@@ -74,6 +74,13 @@ var Snapshot = /*#__PURE__*/(0, _createClass2.default)(function Snapshot() {
7474 ( 0 , _defineProperty2 . default ) ( this , "setBundleId" , function ( value ) {
7575 _this . attributes . bundle_id = value ;
7676 } ) ;
77+ // int64 # Workspace ID. `0` means the default workspace.
78+ ( 0 , _defineProperty2 . default ) ( this , "getWorkspaceId" , function ( ) {
79+ return _this . attributes . workspace_id ;
80+ } ) ;
81+ ( 0 , _defineProperty2 . default ) ( this , "setWorkspaceId" , function ( value ) {
82+ _this . attributes . workspace_id = value ;
83+ } ) ;
7784 // array(string) # An array of paths to add to the snapshot.
7885 ( 0 , _defineProperty2 . default ) ( this , "getPaths" , function ( ) {
7986 return _this . attributes . paths ;
@@ -398,6 +405,7 @@ _Snapshot = Snapshot;
398405// expires_at - string - When the snapshot expires.
399406// name - string - A name for the snapshot.
400407// paths - array(string) - An array of paths to add to the snapshot.
408+ // workspace_id - int64 - Workspace ID. `0` means the default workspace.
401409( 0 , _defineProperty2 . default ) ( Snapshot , "create" , /*#__PURE__*/ ( 0 , _asyncToGenerator2 . default ) ( /*#__PURE__*/ _regenerator . default . mark ( function _callee7 ( ) {
402410 var params ,
403411 options ,
@@ -426,12 +434,18 @@ _Snapshot = Snapshot;
426434 }
427435 throw new errors . InvalidParameterError ( "Bad parameter: paths must be of type Array, received " . concat ( ( 0 , _utils . getType ) ( params . paths ) ) ) ;
428436 case 3 :
429- _context7 . next = 4 ;
430- return _Api . default . sendRequest ( '/snapshots' , 'POST' , params , options ) ;
437+ if ( ! ( params . workspace_id && ! ( 0 , _utils . isInt ) ( params . workspace_id ) ) ) {
438+ _context7 . next = 4 ;
439+ break ;
440+ }
441+ throw new errors . InvalidParameterError ( "Bad parameter: workspace_id must be of type Int, received " . concat ( ( 0 , _utils . getType ) ( params . workspace_id ) ) ) ;
431442 case 4 :
443+ _context7 . next = 5 ;
444+ return _Api . default . sendRequest ( '/snapshots' , 'POST' , params , options ) ;
445+ case 5 :
432446 response = _context7 . sent ;
433447 return _context7 . abrupt ( "return" , new _Snapshot ( response === null || response === void 0 ? void 0 : response . data , options ) ) ;
434- case 5 :
448+ case 6 :
435449 case "end" :
436450 return _context7 . stop ( ) ;
437451 }
0 commit comments