import { SdkClient } from "../common/sdk-client" ; import { TenantManagementModels } from "./tenant-management-models" ; export class extends SdkClient export class TenantManagementClient extends SdkClient { private _baseUrl = "/api/tenantmanagement/v4" ; returns { Promise < TenantManagementModels . LegalConfiguration > } memberOf public async GetLegalConfigRegions ( ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/legalConfigRegions` , } ) ; return result as TenantManagementModels . LegalConfiguration ; } param { TenantManagementModels . LegalConfiguration } legalConfig returns { Promise < TenantManagementModels . LegalConfigurationResource > } memberOf public async PostLegalConfigRegions ( legalConfig ) { const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/legalConfigRegions` , body : legalConfig , } ) ; return result as TenantManagementModels . LegalConfigurationResource ; } param { string } regionId param { TenantManagementModels . Region } region param { { ifMatch : string } } params returns { Promise < TenantManagementModels . RegionResource > } memberOf public async PutLegalConfigRegions ( regionId , region , params ) { const parameters = params || { } ; const { ifMatch } = parameters ; const result = await this . HttpAction ( { verb : "PUT" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/legalConfigRegions/${ regionId }` , body : region , additionalHeaders : { "If-Match" : ifMatch } , } ) ; return result as TenantManagementModels . RegionResource ; } memberOf public async DeleteLegalConfigRegions ( ) { await this . HttpAction ( { verb : "DELETE" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/legalConfigRegions` , noResponse : true , } ) ; } returns { Promise < TenantManagementModels . LegalInfo > } memberOf public async GetLegalInfo ( ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/legalInfo` , } ) ; return result as TenantManagementModels . LegalInfo ; } param { string } tenantId returns { Promise < TenantManagementModels . LegalInfo > } memberOf public async GetLegalInfoForTenant ( tenantId ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/legalInfo/${ tenantId }` , } ) ; return result as TenantManagementModels . LegalInfo ; } param { string } tenantId returns { Promise < TenantManagementModels . LegalInfo > } memberOf public async GetLegalInfoForSpecificTenant ( tenantId ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/legalInfoForSpecificTenant/${ tenantId }` , } ) ; return result as TenantManagementModels . LegalInfo ; } returns { Promise < TenantManagementModels . TenantInfo > } memberOf public async GetTenantInfo ( ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/tenantInfo` , } ) ; return result as TenantManagementModels . TenantInfo ; } param { TenantManagementModels . TenantInfoUpdateProperties } tenantInfoUpdateProperties param { { ifMatch : string } } params memberOf public async PatchTenantInfo ( tenantInfoUpdateProperties , params ) { const parameters = params || { } ; const { ifMatch } = parameters ; await this . HttpAction ( { verb : "PATCH" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/tenantInfo` , body : tenantInfoUpdateProperties , additionalHeaders : { "If-Match" : ifMatch } , } ) ; } returns { Promise < Response > } memberOf public async GetTenantInfoLogo ( ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/tenantInfo/logo` , rawResponse : true , } ) ; return result as Response ; } param { Buffer } file param { string } name param { string } mimeType returns { Promise < Response > } memberOf public async PostTenantInfoLogo ( file , name ? , mimeType ? ) { const template = `----mindsphere\r\nContent-Disposition: form-data; name="file"; filename="${ name }"\r\nContent-Type: ${ mimeType || "application/octet-stream" }\r\n\r\n` ; const body = Buffer . concat ( [ Buffer . from ( template ) , file , Buffer . from ( "\r\n----mindsphere--" ) ] ) ; const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/tenantInfo/logo` , body : body , multiPartFormData : true , rawResponse : true , additionalHeaders : { enctype : "multipart/form-data" } , } ) ; return result as Response ; } returns { Promise < TenantManagementModels . UploadedFileResource > } memberOf public async GetTenantInfoLogoMetaData ( ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/tenantInfo/logoMetaData` , } ) ; return result as TenantManagementModels . UploadedFileResource ; } returns { Promise < TenantManagementModels . PageSubtenantResource > } memberOf public async GetSubtenants ( ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/subtenants` , } ) ; return result as TenantManagementModels . PageSubtenantResource ; } param { TenantManagementModels . Subtenant } subtenant returns { Promise < TenantManagementModels . SubtenantResource > } memberOf public async PostSubtenant ( subtenant ) { const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/subtenants` , body : subtenant , } ) ; return result as TenantManagementModels . SubtenantResource ; } param { string } id returns { Promise < TenantManagementModels . SubtenantResource > } memberOf public async GetSubtenant ( id ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/subtenants/${ id }` , } ) ; return result as TenantManagementModels . SubtenantResource ; } param { string } id param { TenantManagementModels . SubtenantUpdateProperties } subtenantUpdateProperties param { { ifMatch : string } } params returns { Promise < TenantManagementModels . SubtenantResource > } memberOf public async PutSubtenant ( id , subtenantUpdateProperties , params ) { const parameters = params || { } ; const { ifMatch } = parameters ; const result = await this . HttpAction ( { verb : "PUT" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/subtenants/${ id }` , body : subtenantUpdateProperties , additionalHeaders : { "If-Match" : ifMatch } , } ) ; return result as TenantManagementModels . SubtenantResource ; } param { string } id memberOf public async DeleteSubtenant ( id ) { await this . HttpAction ( { verb : "DELETE" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/subtenants/${ id }` , noResponse : true , } ) ; } }