import { toQueryString } from "../../utils" ; import { SdkClient } from "../common/sdk-client" ; import { AssetManagementModels } from "./asset-models" ; export class extends SdkClient export class AssetManagementClient extends SdkClient { private _baseUrl : string = "/api/assetmanagement/v3" ; param { { page ? : number ; size ? : number ; sort ? : string ; filter ? : string ; ifNoneMatch ? : number ; includeShared ? : boolean ; * } } params param params . page param params . size param params . sort param params . filter param params . ifnonematch param params . includeShared example example returns { Promise < AssetManagementModels . AspectTypeListResource > } memberOf public async GetAspectTypes ( params ? ) { const parameters = params || { } ; const { page , size , sort , filter , ifNoneMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/aspecttypes?${ toQueryString ( { page , size , sort , filter , includeShared } ) }` , additionalHeaders : { "If-None-Match" : ifNoneMatch } , } ) ; return result as AssetManagementModels . AspectTypeListResource ; } param { string } id param { AssetManagementModels . AspectType } aspectType param { { ifMatch ? : string ; ifNoneMatch ? : string , includeShared ? : boolean } } params param { { number } } params . ifMatch param { { number } } params . ifNoneMatch param params . includeShared returns { Promise < AssetManagementModels . AspectTypeResource > } example memberOf public async PutAspectType ( id , aspectType , params ? ) { const parameters = params || { } ; const { ifMatch , ifNoneMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "PUT" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/aspecttypes/${ id }?${ toQueryString ( { includeShared } ) }` , body : aspectType , additionalHeaders : { "If-Match" : ifMatch , "If-None-Match" : ifNoneMatch } , } ) ; return result as AssetManagementModels . AspectTypeResource ; } param { string } id param { AssetManagementModels . AspectType } aspectType param { { ifMatch : string , includeShared ? : boolean } } params param params . includeShared param { { number } } params . ifMatch returns { Promise < AssetManagementModels . AspectTypeResource > } example memberOf public async PatchAspectType ( id , aspectType , params ) { const parameters = params || { } ; const { ifMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "PATCH" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/aspecttypes/${ id }?${ toQueryString ( { includeShared } ) }` , body : aspectType , additionalHeaders : { "If-Match" : ifMatch , "Content-Type" : "application/merge-patch+json" } , } ) ; return result as AssetManagementModels . AspectTypeResource ; } param { string } id param { { ifMatch : string , includeShared ? : boolean } } params param { { ifMatch : string } } params . ifMatch param params . includeShared returns { Promise < Object > } example memberOf public async DeleteAspectType ( id , params ) { const parameters = params || { } ; const { ifMatch , includeShared } = parameters ; await this . HttpAction ( { verb : "DELETE" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/aspecttypes/${ id }?${ toQueryString ( { includeShared } ) }` , additionalHeaders : { "If-Match" : ifMatch } , noResponse : true , } ) ; } param { string } id param { { ifNoneMatch ? : number , includeShared ? : boolean } } params param params . includeShared returns { Promise < AssetManagementModels . AspectTypeResource > } example memberOf public async GetAspectType ( id , params ? ) { const parameters = params || { } ; const { ifNoneMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/aspecttypes/${ id }?${ toQueryString ( { includeShared } ) }` , additionalHeaders : { "If-None-Match" : ifNoneMatch } , } ) ; return result as AssetManagementModels . AspectTypeResource ; } param { { page ? : number ; size ? : number ; sort ? : string ; filter ? : string ; ifNoneMatch ? : number ; exploded ? : boolean ; includeShared ? boolean ; * } } params param params . page param params . size param params . sort param params . filter param params . ifnonematch param params . exploded param params . includeShared example example returns { Promise < AssetManagementModels . AssetTypeListResource > } memberOf public async GetAssetTypes ( params ? ) { const parameters = params || { } ; const { page , size , sort , filter , ifNoneMatch , exploded , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assettypes?${ toQueryString ( { page , size , sort , filter , exploded , includeShared , } ) }` , additionalHeaders : { "If-None-Match" : ifNoneMatch } , } ) ; return result as AssetManagementModels . AssetTypeListResource ; } param { string } id param { AssetManagementModels . AssetType } assetType param { { ifMatch ? : string ; ifNoneMatch ? : string ; exploded ? : boolean } } params param { { number } } params . ifMatch param { { string } } params . ifNoneMatch param { { boolean } } params . exploded param { { boolean } } params . includeShared returns { Promise < AssetManagementModels . AssetTypeResource > } example memberOf public async PutAssetType ( id , assetType , params ? ) { const parameters = params || { } ; const { ifMatch , ifNoneMatch , exploded , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "PUT" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assettypes/${ id }?${ toQueryString ( { exploded , includeShared } ) }` , body : assetType , additionalHeaders : { "If-Match" : ifMatch , "If-None-Match" : ifNoneMatch } , } ) ; return result as AssetManagementModels . AssetTypeResource ; } param { string } id param { AssetManagementModels . AssetType } assetType param { { ifMatch : string ; exploded ? : boolean ; includeShared ? : boolean } } params param { { number } } params . ifMatch param { { boolean } } params . exploded param { { boolean } } params . includeShared returns { Promise < AssetManagementModels . AssetTypeResource > } example memberOf public async PatchAssetType ( id , assetType , params ) { const parameters = params || { } ; const { ifMatch , exploded , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "PATCH" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assettypes/${ id }?${ toQueryString ( { exploded , includeShared } ) }` , body : assetType , additionalHeaders : { "If-Match" : ifMatch , "Content-Type" : "application/merge-patch+json" } , } ) ; return result as AssetManagementModels . AssetTypeResource ; } param { string } id param { { ifMatch : string ; includeShared ? : boolean ; } } params param { { number } } params . ifMatch param { { boolean } } params . includeShared example memberOf public async DeleteAssetType ( id , params ) { const parameters = params || { } ; const { ifMatch , includeShared } = parameters ; await this . HttpAction ( { verb : "DELETE" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assettypes/${ id }?${ toQueryString ( { includeShared } ) }` , additionalHeaders : { "If-Match" : ifMatch } , noResponse : true , } ) ; } param { string } id param { { ifNoneMatch ? : string ; exploded ? : boolean ; includeShared ? : boolean } } params returns { Promise < AssetManagementModels . AssetTypeResource > } example memberOf public async GetAssetType ( id , params ? ) { const parameters = params || { } ; const { ifNoneMatch , exploded , includeShared } = parameters ; const ex = exploded === undefined ? false : exploded ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assettypes/${ id }?${ toQueryString ( { exploded : ex , includeShared } ) }` , additionalHeaders : { "If-None-Match" : ifNoneMatch } , } ) ; return result as AssetManagementModels . AssetTypeResource ; } param { string } id param { string } key param { AssetManagementModels . KeyedFileAssignment } assignment param { { ifMatch : string ; includeShared ? : boolean } } params param { { number } } params . ifMatch param { { boolean } } params . includeShared returns { Promise < AssetManagementModels . AssetTypeResource > } memberOf public async PutAssetTypeFileAssignment ( id , key , assignment , params ) { const parameters = params || { } ; const { ifMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "PUT" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assettypes/${ id }/fileAssignments/${ key }?${ toQueryString ( { includeShared } ) }` , body : assignment , additionalHeaders : { "If-Match" : ifMatch } , } ) ; return result as AssetManagementModels . AssetTypeResource ; } param { string } id param { string } key param { AssetManagementModels . KeyedFileAssignment } assignment param { { ifMatch : string ; includeShared ? : boolean } } params param { { number } } params . ifMatch param { { boolean } } params . includeShared memberOf public async DeleteAssetTypeFileAssignment ( id , key , params ) { const parameters = params || { } ; const { ifMatch , includeShared } = parameters ; await this . HttpAction ( { verb : "DELETE" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assettypes/${ id }/fileAssignments/${ key }?${ toQueryString ( { includeShared } ) }` , additionalHeaders : { "If-Match" : ifMatch } , noResponse : true , } ) ; } param { string } id param { { ifMatch : string ; includeShared ? : boolean } } params param { { number } } params . ifMatch param { { boolean } } params . includeShared param { AssetManagementModels . VariableUpdateMap } variableMap returns { Promise < Headers > } memberOf public async PatchAssetTypeVariable ( id , variableMap , params ) { const parameters = params || { } ; const { ifMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "PATCH" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assettypes/${ id }/variables?${ toQueryString ( { includeShared } ) }` , body : variableMap , returnHeaders : true , additionalHeaders : { "If-Match" : ifMatch , "Content-Type" : "application/merge-patch+json" } , } ) ; return result as Headers ; } param { { page ? : number ; size ? : number ; sort ? : string ; filter ? : string ; ifNoneMatch ? : string ; includeShared ? boolean ; * } } params param params . page param params . size param params . sort param params . filter param params . ifnonematch param params . includeShared returns { Promise < AssetManagementModels . AssetListResource > } example example memberOf public async GetAssets ( params ? ) { const parameters = params || { } ; const { page , size , sort , filter , ifNoneMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assets?${ toQueryString ( { page , size , sort , filter , includeShared } ) }` , additionalHeaders : { "If-None-Match" : ifNoneMatch } , } ) ; return result as AssetManagementModels . AssetListResource ; } param { { includeShared ? boolean ; * } } params param params . includeShared param { AssetManagementModels . Asset } asset returns { Promise < AssetManagementModels . AssetResourceWithHierarchyPath > } example memberOf public async PostAsset ( asset , params ? ) { const parameters = params || { } ; const { includeShared } = parameters ; const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assets?${ toQueryString ( { includeShared } ) }
            ` , body : asset , } ) ; return result as AssetManagementModels . AssetResourceWithHierarchyPath ; } param { string } assetId param { { ifNoneMatch ? : string ; includeShared ? : boolean } } params param { { string } } params . ifNoneMatch param params . includeShared returns { Promise < AssetManagementModels . AssetResourceWithHierarchyPath > } memberOf public async GetAsset ( assetId , params ? ) { const parameters = params || { } ; const { ifNoneMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assets/${ assetId }?${ toQueryString ( { includeShared } ) }` , additionalHeaders : { "If-None-Match" : ifNoneMatch } , } ) ; return result as AssetManagementModels . AssetResourceWithHierarchyPath ; } param { string } assetId param { AssetManagementModels . AssetUpdate } asset param { { ifMatch : string ; includeShared ? : boolean } } params param { { number } } params . ifMatch param { { boolean } } params . includeShared returns { Promise < AssetManagementModels . AssetResourceWithHierarchyPath > } example memberOf public async PutAsset ( assetId , asset , params ) { const parameters = params || { } ; const { ifMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "PUT" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assets/${ assetId }?${ toQueryString ( { includeShared } ) }` , body : asset , additionalHeaders : { "If-Match" : ifMatch } , } ) ; return result as AssetManagementModels . AssetResourceWithHierarchyPath ; } param { string } assetId param { AssetManagementModels . AssetUpdate } asset param { { ifMatch : string ; includeShared ? : boolean ; } } params param { { number } } params . ifMatch param { { boolean } } params . includeShared returns { Promise < AssetManagementModels . AssetResourceWithHierarchyPath > } example memberOf public async PatchAsset ( assetId , asset , params ) { const parameters = params || { } ; const { ifMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "PATCH" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assets/${ assetId }?${ toQueryString ( { includeShared } ) }` , body : asset , additionalHeaders : { "If-Match" : ifMatch , "Content-Type" : "application/merge-patch+json" } , } ) ; return result as AssetManagementModels . AssetResourceWithHierarchyPath ; } param { string } id param { { ifMatch : string ; includeShared ? : booleanl } } params param { { number } } params . ifMatch param { { boolean } } params . includeShared example memberOf public async DeleteAsset ( id , params ) { const parameters = params || { } ; const { ifMatch , includeShared } = parameters ; await this . HttpAction ( { verb : "DELETE" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assets/${ id }?${ toQueryString ( { includeShared } ) }` , additionalHeaders : { "If-Match" : ifMatch } , noResponse : true , } ) ; } param { string } assetId param { AssetManagementModels . AssetMove } moveParameters param { { ifMatch : string ; includeShared ? : boolean } } params param { { number } } params . ifMatch param { { boolean } } params . includeShared returns { Promise < AssetManagementModels . AssetResourceWithHierarchyPath > } example memberOf public async MoveAsset ( assetId , moveParameters , params ) { const parameters = params || { } ; const { ifMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assets/${ assetId }?${ toQueryString ( { includeShared } ) }` , body : moveParameters , additionalHeaders : { "If-Match" : ifMatch } , } ) ; return result as AssetManagementModels . AssetResourceWithHierarchyPath ; } param { string } id param { string } key param { AssetManagementModels . KeyedFileAssignment } assignment param { { ifMatch : string ; includeShared ? : boolean ; } } params param { { boolean } } params . includeShared param { { number } } params . ifMatch returns { Promise < AssetManagementModels . AssetTypeResource > } memberOf public async PutAssetFileAssignment ( id , key , assignment , params ) { const parameters = params || { } ; const { ifMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "PUT" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assets/${ id }/fileAssignments/${ key }?${ toQueryString ( { includeShared } ) }` , body : assignment , additionalHeaders : { "If-Match" : ifMatch } , } ) ; return result as AssetManagementModels . AssetTypeResource ; } param { string } id param { string } key param { AssetManagementModels . KeyedFileAssignment } assignment param { { ifMatch : string ; includeShared ? : boolean } } params param { { number } } params . ifMatch memberOf public async DeleteAssetFileAssignment ( id , key , params ) { const parameters = params || { } ; const { ifMatch , includeShared } = parameters ; await this . HttpAction ( { verb : "DELETE" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assets/${ id }/fileAssignments/${ key }?${ toQueryString ( { includeShared } ) }` , additionalHeaders : { "If-Match" : ifMatch } , noResponse : true , } ) ; } returns { Promise < AssetManagementModels . RootAssetResource > } memberOf public async GetRootAsset ( ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assets/root` , } ) ; return result as AssetManagementModels . RootAssetResource ; } param { string } assetId param { { page ? : number ; size ? : number ; sort ? : string ; filter ? : string ; ifNoneMatch ? : number ; includeShared ? : number ; * } } params param params . page param params . size param params . sort param params . filter param params . ifnonematch param params . includeShared returns { Promise < AssetManagementModels . AspectListResource > } memberOf public async GetAspects ( assetId , params ? ) { const parameters = params || { } ; const { page , size , sort , filter , ifNoneMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assets/${ assetId }/aspects?${ toQueryString ( { page , size , sort , filter , includeShared , } ) }` , additionalHeaders : { "If-None-Match" : ifNoneMatch } , } ) ; return result as AssetManagementModels . AspectListResource ; } param { string } assetId param { { page ? : number ; size ? : number ; sort ? : string ; filter ? : string ; ifNoneMatch ? : number ; includeShared ? : boolean ; * } } params param params . page param params . size param params . sort param params . filter param params . ifnonematch param params . includeShared returns { Promise < AssetManagementModels . AspectListResource > } memberOf public async GetVariables ( assetId , params ? ) { const parameters = params || { } ; const { page , size , sort , filter , ifNoneMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assets/${ assetId }/variables?${ toQueryString ( { page , size , sort , filter , includeShared , } ) }` , additionalHeaders : { "If-None-Match" : ifNoneMatch } , } ) ; return result as AssetManagementModels . VariableListResource ; } param { string } id param { AssetManagementModels . Location } location param { { ifMatch : string ; includeShared ? : boolean } } params param { { number } } params . ifMatch param { { boolean } } params . includeShared returns { Promise < AssetManagementModels . Location > } memberOf public async PutAssetLocation ( id , location , params ) { const parameters = params || { } ; const { ifMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "PUT" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assets/${ id }/location?${ toQueryString ( { includeShared } ) }` , body : location , additionalHeaders : { "If-Match" : ifMatch } , } ) ; return result as AssetManagementModels . AssetResourceWithHierarchyPath ; } param { string } id param { AssetManagementModels . Location } location param { { ifMatch : string ; includeShared ? : boolean } } params param { { number } } params . ifMatch param { { boolean } } params . includeShared returns { Promise < AssetManagementModels . AssetResourceWithHierarchyPath > } memberOf public async DeleteAssetLocation ( id , params ) { const parameters = params || { } ; const { ifMatch , includeShared } = parameters ; const result = await this . HttpAction ( { verb : "DELETE" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/assets/${ id }/location?${ toQueryString ( { includeShared } ) }` , additionalHeaders : { "If-Match" : ifMatch } , } ) ; return result as AssetManagementModels . AssetResourceWithHierarchyPath ; } param { Buffer } file param { string } name param { { scope ? : AssetManagementModels . FileMetadataResource . ScopeEnum ; description ? : string ; mimeType ? : string ; * } } params returns { Promise < AssetManagementModels . FileMetadataResource > } memberOf public async PostFile ( file , name , params ? ) { const parameters = params || { } ; const { scope , description , mimeType } = parameters ; const template = `----mindsphere\r\nContent-Disposition: form-data; name="file"; filename="${ name }"\r\nContent-Type: ${ mimeType || "application/octet-stream" }\r\n\r\n${ file . toString ( "ascii" ) }\r\n----mindsphere\r\nContent-Disposition: form-data; name="name"\r\n\r\n${ name }\r\n----mindsphere\r\nContent-Disposition: form-data; name="description"\r\n\r\n${ description || "uploaded file" }\r\n\----mindsphere\r\nContent-Disposition: form-data; name="scope"\r\n\r\n${ scope || "PRIVATE" }\r\n----mindsphere--` ; const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/files` , body : template , multiPartFormData : true , } ) ; return result as AssetManagementModels . FileMetadataResource ; } param { { page ? : number ; size ? : number ; sort ? : string ; filter ? : string ; ifNoneMatch ? : number ; * } } params param { { page ? : number ; size ? : number ; sort ? : string ; filter ? : string ; ifNoneMatch ? : number ; * } } params param params . page param params . size param params . sort param params . filter param params . ifnonematch returns { Promise < AssetManagementModels . FileMetadataListResource > } memberOf public async GetFiles ( params ? ) { const parameters = params || { } ; const { page , size , sort , filter , ifNoneMatch } = parameters ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/files?${ toQueryString ( { page , size , sort , filter } ) }` , additionalHeaders : { "If-None-Match" : ifNoneMatch } , } ) ; return result as AssetManagementModels . FileMetadataListResource ; } param { string } fileId param { { ifNoneMatch ? : number ; * } } params returns { Promise < AssetManagementModels . FileMetadataResource > } memberOf public async GetFile ( fileId , params ? ) { const parameters = params || { } ; const { ifNoneMatch } = parameters ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/files/${ fileId }` , additionalHeaders : { "If-None-Match" : ifNoneMatch } , } ) ; return result as AssetManagementModels . FileMetadataResource ; } param { string } fileId param { { ifNoneMatch ? : number ; * } } params returns { Promise < Response > } memberOf public async DownloadFile ( fileId , params ? ) { const parameters = params || { } ; const { ifNoneMatch } = parameters ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/files/${ fileId }/file` , additionalHeaders : { "If-None-Match" : ifNoneMatch } , rawResponse : true , } ) ; return result as Response ; } param { string } fileid param { Buffer } file param { string } name param { { scope : AssetManagementModels . FileMetadataResource . ScopeEnum ; description ? : string ; mimeType ? : string ; ifMatch : string ; * } } params returns { Promise < AssetManagementModels . FileMetadataResource > } memberOf public async PutFile ( fileid , file , name , params ) { const parameters = params || { } ; const { scope , description , mimeType , ifMatch } = parameters ; const template = `----mindsphere\r\nContent-Disposition: form-data; name="file"; filename="${ name }"\r\nContent-Type: ${ mimeType || "application/octet-stream" }\r\n\r\n${ file }\r\n----mindsphere\r\nContent-Disposition: form-data; name="name"\r\n\r\n${ name }\r\n----mindsphere\r\nContent-Disposition: form-data; name="description"\r\n\r\n${ description || "uploaded file" }\r\n\----mindsphere\r\nContent-Disposition: form-data; name="scope"\r\n\r\n${ scope || "PRIVATE" }\r\n----mindsphere--` ; const result = await this . HttpAction ( { verb : "PUT" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/files/${ fileid }` , body : template , multiPartFormData : true , additionalHeaders : { "If-Match" : ifMatch } , } ) ; return result as AssetManagementModels . FileMetadataResource ; } param { string } fileId param { { ifMatch : string } } params memberOf public async DeleteFile ( fileId , params ) { const parameters = params || { } ; const { ifMatch } = parameters ; await this . HttpAction ( { verb : "DELETE" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/files/${ fileId }` , additionalHeaders : { "If-Match" : ifMatch } , noResponse : true , } ) ; } returns { Promise < AssetManagementModels . AssetModelLock > } memberOf public async GetModelLock ( ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/model/lock` , } ) ; return result as AssetManagementModels . AssetModelLock ; } param { { enabled : boolean } } params returns { Promise < AssetManagementModels . AssetModelLock > } memberOf public async PutModelLock ( params ) { const parameters = params || { } ; const result = await this . HttpAction ( { verb : "PUT" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/model/lock?${ toQueryString ( parameters ) }` , } ) ; return result as AssetManagementModels . AssetModelLock ; } returns { Promise < AssetManagementModels . BillboardResource > } memberOf public async GetBillboard ( ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/` , } ) ; return result as AssetManagementModels . BillboardResource ; } }