public async Task <ActionResult <AssetType> > UpdateAssetType() { var assetClient = _mindSphereSdkService.GetAssetManagementClient(); var aspects = new List <AspectPut>(); aspects.Add(new AspectPut() { Name = "acceleration", AspectTypeId = "iiotdgli.acceleration" }); var newAssetType = new AssetTypeUpdate() { Name = "My_new_asset_type", Description = "Updated asset type", ParentTypeId = "core.basicasset", Instantiable = true, Scope = "private", Aspects = aspects }; var request = new PutAssetTypeRequest() { Id = "iiotdgli.My_new_asset_type", IfMatch = "0", Body = newAssetType }; var assetType = await assetClient.PutAssetTypeAsync(request); return(StatusCode(200, assetType)); }
public async Task <ActionResult <AssetType> > PatchAssetType() { var assetClient = _mindSphereSdkService.GetAssetManagementClient(); var updatedAssetType = new AssetTypeUpdate() { Description = "Patched asset type" }; var request = new PatchAssetTypeRequest() { Id = "iiotdgli.My_new_asset_type", IfMatch = "1", Body = updatedAssetType }; var assetType = await assetClient.PatchAssetTypeAsync(request); return(StatusCode(200, assetType)); }