@@ -74,6 +74,20 @@ var Permission = /*#__PURE__*/(0, _createClass2.default)(function Permission() {
7474 ( 0 , _defineProperty2 . default ) ( this , "setGroupName" , function ( value ) {
7575 _this . attributes . group_name = value ;
7676 } ) ;
77+ // array(int64) # Group IDs when this permission requires multiple groups
78+ ( 0 , _defineProperty2 . default ) ( this , "getGroupIds" , function ( ) {
79+ return _this . attributes . group_ids ;
80+ } ) ;
81+ ( 0 , _defineProperty2 . default ) ( this , "setGroupIds" , function ( value ) {
82+ _this . attributes . group_ids = value ;
83+ } ) ;
84+ // array(string) # Group names when this permission requires multiple groups
85+ ( 0 , _defineProperty2 . default ) ( this , "getGroupNames" , function ( ) {
86+ return _this . attributes . group_names ;
87+ } ) ;
88+ ( 0 , _defineProperty2 . default ) ( this , "setGroupNames" , function ( value ) {
89+ _this . attributes . group_names = value ;
90+ } ) ;
7791 // int64 # Partner ID (if applicable)
7892 ( 0 , _defineProperty2 . default ) ( this , "getPartnerId" , function ( ) {
7993 return _this . attributes . partner_id ;
@@ -277,6 +291,7 @@ _Permission = Permission;
277291// Parameters:
278292// path (required) - string - Folder path
279293// group_id - int64 - Group ID. Provide `group_name` or `group_id`
294+ // group_ids - string - Group IDs when the permission requires multiple groups. If sent as a string, it should be comma-delimited.
280295// permission - string - Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history`
281296// recursive - boolean - Apply to subfolders recursively?
282297// partner_id - int64 - Partner ID if this Permission belongs to a partner.
@@ -312,48 +327,54 @@ _Permission = Permission;
312327 }
313328 throw new errors . InvalidParameterError ( "Bad parameter: group_id must be of type Int, received " . concat ( ( 0 , _utils . getType ) ( params . group_id ) ) ) ;
314329 case 3 :
315- if ( ! ( params . permission && ! ( 0 , _utils . isString ) ( params . permission ) ) ) {
330+ if ( ! ( params . group_ids && ! ( 0 , _utils . isString ) ( params . group_ids ) ) ) {
316331 _context4 . next = 4 ;
317332 break ;
318333 }
319- throw new errors . InvalidParameterError ( "Bad parameter: permission must be of type String, received " . concat ( ( 0 , _utils . getType ) ( params . permission ) ) ) ;
334+ throw new errors . InvalidParameterError ( "Bad parameter: group_ids must be of type String, received " . concat ( ( 0 , _utils . getType ) ( params . group_ids ) ) ) ;
320335 case 4 :
321- if ( ! ( params . partner_id && ! ( 0 , _utils . isInt ) ( params . partner_id ) ) ) {
336+ if ( ! ( params . permission && ! ( 0 , _utils . isString ) ( params . permission ) ) ) {
322337 _context4 . next = 5 ;
323338 break ;
324339 }
325- throw new errors . InvalidParameterError ( "Bad parameter: partner_id must be of type Int , received " . concat ( ( 0 , _utils . getType ) ( params . partner_id ) ) ) ;
340+ throw new errors . InvalidParameterError ( "Bad parameter: permission must be of type String , received " . concat ( ( 0 , _utils . getType ) ( params . permission ) ) ) ;
326341 case 5 :
327- if ( ! ( params . user_id && ! ( 0 , _utils . isInt ) ( params . user_id ) ) ) {
342+ if ( ! ( params . partner_id && ! ( 0 , _utils . isInt ) ( params . partner_id ) ) ) {
328343 _context4 . next = 6 ;
329344 break ;
330345 }
331- throw new errors . InvalidParameterError ( "Bad parameter: user_id must be of type Int, received " . concat ( ( 0 , _utils . getType ) ( params . user_id ) ) ) ;
346+ throw new errors . InvalidParameterError ( "Bad parameter: partner_id must be of type Int, received " . concat ( ( 0 , _utils . getType ) ( params . partner_id ) ) ) ;
332347 case 6 :
333- if ( ! ( params . username && ! ( 0 , _utils . isString ) ( params . username ) ) ) {
348+ if ( ! ( params . user_id && ! ( 0 , _utils . isInt ) ( params . user_id ) ) ) {
334349 _context4 . next = 7 ;
335350 break ;
336351 }
337- throw new errors . InvalidParameterError ( "Bad parameter: username must be of type String , received " . concat ( ( 0 , _utils . getType ) ( params . username ) ) ) ;
352+ throw new errors . InvalidParameterError ( "Bad parameter: user_id must be of type Int , received " . concat ( ( 0 , _utils . getType ) ( params . user_id ) ) ) ;
338353 case 7 :
339- if ( ! ( params . group_name && ! ( 0 , _utils . isString ) ( params . group_name ) ) ) {
354+ if ( ! ( params . username && ! ( 0 , _utils . isString ) ( params . username ) ) ) {
340355 _context4 . next = 8 ;
341356 break ;
342357 }
343- throw new errors . InvalidParameterError ( "Bad parameter: group_name must be of type String, received " . concat ( ( 0 , _utils . getType ) ( params . group_name ) ) ) ;
358+ throw new errors . InvalidParameterError ( "Bad parameter: username must be of type String, received " . concat ( ( 0 , _utils . getType ) ( params . username ) ) ) ;
344359 case 8 :
345- if ( ! ( params . site_id && ! ( 0 , _utils . isInt ) ( params . site_id ) ) ) {
360+ if ( ! ( params . group_name && ! ( 0 , _utils . isString ) ( params . group_name ) ) ) {
346361 _context4 . next = 9 ;
347362 break ;
348363 }
349- throw new errors . InvalidParameterError ( "Bad parameter: site_id must be of type Int , received " . concat ( ( 0 , _utils . getType ) ( params . site_id ) ) ) ;
364+ throw new errors . InvalidParameterError ( "Bad parameter: group_name must be of type String , received " . concat ( ( 0 , _utils . getType ) ( params . group_name ) ) ) ;
350365 case 9 :
351- _context4 . next = 10 ;
352- return _Api . default . sendRequest ( '/permissions' , 'POST' , params , options ) ;
366+ if ( ! ( params . site_id && ! ( 0 , _utils . isInt ) ( params . site_id ) ) ) {
367+ _context4 . next = 10 ;
368+ break ;
369+ }
370+ throw new errors . InvalidParameterError ( "Bad parameter: site_id must be of type Int, received " . concat ( ( 0 , _utils . getType ) ( params . site_id ) ) ) ;
353371 case 10 :
372+ _context4 . next = 11 ;
373+ return _Api . default . sendRequest ( '/permissions' , 'POST' , params , options ) ;
374+ case 11 :
354375 response = _context4 . sent ;
355376 return _context4 . abrupt ( "return" , new _Permission ( response === null || response === void 0 ? void 0 : response . data , options ) ) ;
356- case 11 :
377+ case 12 :
357378 case "end" :
358379 return _context4 . stop ( ) ;
359380 }
0 commit comments