@@ -53,6 +53,13 @@ var KeyLifecycleRule = /*#__PURE__*/(0, _createClass2.default)(function KeyLifec
5353 ( 0 , _defineProperty2 . default ) ( this , "setInactivityDays" , function ( value ) {
5454 _this . attributes . inactivity_days = value ;
5555 } ) ;
56+ // int64 # Number of days after creation before an SSH key expires. Applies only to SSH keys.
57+ ( 0 , _defineProperty2 . default ) ( this , "getExpirationDays" , function ( ) {
58+ return _this . attributes . expiration_days ;
59+ } ) ;
60+ ( 0 , _defineProperty2 . default ) ( this , "setExpirationDays" , function ( value ) {
61+ _this . attributes . expiration_days = value ;
62+ } ) ;
5663 // boolean # If true, a default-workspace rule also applies to keys in all workspaces.
5764 ( 0 , _defineProperty2 . default ) ( this , "getApplyToAllWorkspaces" , function ( ) {
5865 return _this . attributes . apply_to_all_workspaces ;
@@ -76,6 +83,7 @@ var KeyLifecycleRule = /*#__PURE__*/(0, _createClass2.default)(function KeyLifec
7683 } ) ;
7784 // Parameters:
7885 // apply_to_all_workspaces - boolean - If true, a default-workspace rule also applies to keys in all workspaces.
86+ // expiration_days - int64 - Number of days after creation before an SSH key expires. Applies only to SSH keys.
7987 // key_type - string - Key type for which the rule will apply (gpg or ssh).
8088 // inactivity_days - int64 - Number of days of inactivity before the rule applies.
8189 // name - string - Key Lifecycle Rule name
@@ -107,50 +115,56 @@ var KeyLifecycleRule = /*#__PURE__*/(0, _createClass2.default)(function KeyLifec
107115 }
108116 throw new errors . InvalidParameterError ( "Bad parameter: id must be of type Int, received " . concat ( ( 0 , _utils . getType ) ( params . id ) ) ) ;
109117 case 3 :
110- if ( ! ( params . key_type && ! ( 0 , _utils . isString ) ( params . key_type ) ) ) {
118+ if ( ! ( params . expiration_days && ! ( 0 , _utils . isInt ) ( params . expiration_days ) ) ) {
111119 _context . next = 4 ;
112120 break ;
113121 }
114- throw new errors . InvalidParameterError ( "Bad parameter: key_type must be of type String , received " . concat ( ( 0 , _utils . getType ) ( params . key_type ) ) ) ;
122+ throw new errors . InvalidParameterError ( "Bad parameter: expiration_days must be of type Int , received " . concat ( ( 0 , _utils . getType ) ( params . expiration_days ) ) ) ;
115123 case 4 :
116- if ( ! ( params . inactivity_days && ! ( 0 , _utils . isInt ) ( params . inactivity_days ) ) ) {
124+ if ( ! ( params . key_type && ! ( 0 , _utils . isString ) ( params . key_type ) ) ) {
117125 _context . next = 5 ;
118126 break ;
119127 }
120- throw new errors . InvalidParameterError ( "Bad parameter: inactivity_days must be of type Int , received " . concat ( ( 0 , _utils . getType ) ( params . inactivity_days ) ) ) ;
128+ throw new errors . InvalidParameterError ( "Bad parameter: key_type must be of type String , received " . concat ( ( 0 , _utils . getType ) ( params . key_type ) ) ) ;
121129 case 5 :
122- if ( ! ( params . name && ! ( 0 , _utils . isString ) ( params . name ) ) ) {
130+ if ( ! ( params . inactivity_days && ! ( 0 , _utils . isInt ) ( params . inactivity_days ) ) ) {
123131 _context . next = 6 ;
124132 break ;
125133 }
126- throw new errors . InvalidParameterError ( "Bad parameter: name must be of type String , received " . concat ( ( 0 , _utils . getType ) ( params . name ) ) ) ;
134+ throw new errors . InvalidParameterError ( "Bad parameter: inactivity_days must be of type Int , received " . concat ( ( 0 , _utils . getType ) ( params . inactivity_days ) ) ) ;
127135 case 6 :
128- if ( ! ( params . workspace_id && ! ( 0 , _utils . isInt ) ( params . workspace_id ) ) ) {
136+ if ( ! ( params . name && ! ( 0 , _utils . isString ) ( params . name ) ) ) {
129137 _context . next = 7 ;
130138 break ;
131139 }
132- throw new errors . InvalidParameterError ( "Bad parameter: workspace_id must be of type Int , received " . concat ( ( 0 , _utils . getType ) ( params . workspace_id ) ) ) ;
140+ throw new errors . InvalidParameterError ( "Bad parameter: name must be of type String , received " . concat ( ( 0 , _utils . getType ) ( params . name ) ) ) ;
133141 case 7 :
142+ if ( ! ( params . workspace_id && ! ( 0 , _utils . isInt ) ( params . workspace_id ) ) ) {
143+ _context . next = 8 ;
144+ break ;
145+ }
146+ throw new errors . InvalidParameterError ( "Bad parameter: workspace_id must be of type Int, received " . concat ( ( 0 , _utils . getType ) ( params . workspace_id ) ) ) ;
147+ case 8 :
134148 if ( params . id ) {
135- _context . next = 9 ;
149+ _context . next = 10 ;
136150 break ;
137151 }
138152 if ( ! _this . attributes . id ) {
139- _context . next = 8 ;
153+ _context . next = 9 ;
140154 break ;
141155 }
142156 params . id = _this . id ;
143- _context . next = 9 ;
157+ _context . next = 10 ;
144158 break ;
145- case 8 :
146- throw new errors . MissingParameterError ( 'Parameter missing: id' ) ;
147159 case 9 :
148- _context . next = 10 ;
149- return _Api . default . sendRequest ( "/key_lifecycle_rules/" . concat ( encodeURIComponent ( params . id ) ) , 'PATCH' , params , _this . options ) ;
160+ throw new errors . MissingParameterError ( 'Parameter missing: id' ) ;
150161 case 10 :
162+ _context . next = 11 ;
163+ return _Api . default . sendRequest ( "/key_lifecycle_rules/" . concat ( encodeURIComponent ( params . id ) ) , 'PATCH' , params , _this . options ) ;
164+ case 11 :
151165 response = _context . sent ;
152166 return _context . abrupt ( "return" , new KeyLifecycleRule ( response === null || response === void 0 ? void 0 : response . data , _this . options ) ) ;
153- case 11 :
167+ case 12 :
154168 case "end" :
155169 return _context . stop ( ) ;
156170 }
@@ -350,6 +364,7 @@ _KeyLifecycleRule = KeyLifecycleRule;
350364} ) ;
351365// Parameters:
352366// apply_to_all_workspaces - boolean - If true, a default-workspace rule also applies to keys in all workspaces.
367+ // expiration_days - int64 - Number of days after creation before an SSH key expires. Applies only to SSH keys.
353368// key_type - string - Key type for which the rule will apply (gpg or ssh).
354369// inactivity_days - int64 - Number of days of inactivity before the rule applies.
355370// name - string - Key Lifecycle Rule name
@@ -364,36 +379,42 @@ _KeyLifecycleRule = KeyLifecycleRule;
364379 case 0 :
365380 params = _args6 . length > 0 && _args6 [ 0 ] !== undefined ? _args6 [ 0 ] : { } ;
366381 options = _args6 . length > 1 && _args6 [ 1 ] !== undefined ? _args6 [ 1 ] : { } ;
367- if ( ! ( params . key_type && ! ( 0 , _utils . isString ) ( params . key_type ) ) ) {
382+ if ( ! ( params . expiration_days && ! ( 0 , _utils . isInt ) ( params . expiration_days ) ) ) {
368383 _context6 . next = 1 ;
369384 break ;
370385 }
371- throw new errors . InvalidParameterError ( "Bad parameter: key_type must be of type String , received " . concat ( ( 0 , _utils . getType ) ( params . key_type ) ) ) ;
386+ throw new errors . InvalidParameterError ( "Bad parameter: expiration_days must be of type Int , received " . concat ( ( 0 , _utils . getType ) ( params . expiration_days ) ) ) ;
372387 case 1 :
373- if ( ! ( params . inactivity_days && ! ( 0 , _utils . isInt ) ( params . inactivity_days ) ) ) {
388+ if ( ! ( params . key_type && ! ( 0 , _utils . isString ) ( params . key_type ) ) ) {
374389 _context6 . next = 2 ;
375390 break ;
376391 }
377- throw new errors . InvalidParameterError ( "Bad parameter: inactivity_days must be of type Int , received " . concat ( ( 0 , _utils . getType ) ( params . inactivity_days ) ) ) ;
392+ throw new errors . InvalidParameterError ( "Bad parameter: key_type must be of type String , received " . concat ( ( 0 , _utils . getType ) ( params . key_type ) ) ) ;
378393 case 2 :
379- if ( ! ( params . name && ! ( 0 , _utils . isString ) ( params . name ) ) ) {
394+ if ( ! ( params . inactivity_days && ! ( 0 , _utils . isInt ) ( params . inactivity_days ) ) ) {
380395 _context6 . next = 3 ;
381396 break ;
382397 }
383- throw new errors . InvalidParameterError ( "Bad parameter: name must be of type String , received " . concat ( ( 0 , _utils . getType ) ( params . name ) ) ) ;
398+ throw new errors . InvalidParameterError ( "Bad parameter: inactivity_days must be of type Int , received " . concat ( ( 0 , _utils . getType ) ( params . inactivity_days ) ) ) ;
384399 case 3 :
385- if ( ! ( params . workspace_id && ! ( 0 , _utils . isInt ) ( params . workspace_id ) ) ) {
400+ if ( ! ( params . name && ! ( 0 , _utils . isString ) ( params . name ) ) ) {
386401 _context6 . next = 4 ;
387402 break ;
388403 }
389- throw new errors . InvalidParameterError ( "Bad parameter: workspace_id must be of type Int , received " . concat ( ( 0 , _utils . getType ) ( params . workspace_id ) ) ) ;
404+ throw new errors . InvalidParameterError ( "Bad parameter: name must be of type String , received " . concat ( ( 0 , _utils . getType ) ( params . name ) ) ) ;
390405 case 4 :
391- _context6 . next = 5 ;
392- return _Api . default . sendRequest ( '/key_lifecycle_rules' , 'POST' , params , options ) ;
406+ if ( ! ( params . workspace_id && ! ( 0 , _utils . isInt ) ( params . workspace_id ) ) ) {
407+ _context6 . next = 5 ;
408+ break ;
409+ }
410+ throw new errors . InvalidParameterError ( "Bad parameter: workspace_id must be of type Int, received " . concat ( ( 0 , _utils . getType ) ( params . workspace_id ) ) ) ;
393411 case 5 :
412+ _context6 . next = 6 ;
413+ return _Api . default . sendRequest ( '/key_lifecycle_rules' , 'POST' , params , options ) ;
414+ case 6 :
394415 response = _context6 . sent ;
395416 return _context6 . abrupt ( "return" , new _KeyLifecycleRule ( response === null || response === void 0 ? void 0 : response . data , options ) ) ;
396- case 6 :
417+ case 7 :
397418 case "end" :
398419 return _context6 . stop ( ) ;
399420 }
0 commit comments