assetsPatchByAssetidAndTenantidWithHttpInfo method

Future<Response> assetsPatchByAssetidAndTenantidWithHttpInfo(
  1. int assetId,
  2. String tenantId,
  3. String region,
  4. AssetEdit asset,
)

Edit an existing asset

Summary:Edit an existing asset.
Return Type: Asset

Note: This method returns the HTTP Response.

Parameters:

  • int assetId (required):

  • String tenantId (required): The unique Tenant ID (UUID or Identifier string)

  • String region (required): The data center region the data resides in

  • AssetEdit asset (required): The entity to patch

Implementation

Future<Response> assetsPatchByAssetidAndTenantidWithHttpInfo(int assetId, String tenantId, String region, AssetEdit asset,) async {
  // Verify required params are set.
  if (assetId == null) {
   throw ApiException(HttpStatus.badRequest, 'Missing required param: assetId');
  }
  if (tenantId == null) {
   throw ApiException(HttpStatus.badRequest, 'Missing required param: tenantId');
  }
  if (region == null) {
   throw ApiException(HttpStatus.badRequest, 'Missing required param: region');
  }
  if (asset == null) {
   throw ApiException(HttpStatus.badRequest, 'Missing required param: asset');
  }

  // ignore: prefer_const_declarations
  final path = r'/{region}/aim/2.0/{tenantId}/Assets({AssetId})'
    .replaceAll('{AssetId}', assetId.toString())
    .replaceAll('{tenantId}', tenantId)
    .replaceAll('{region}', region);

  // ignore: prefer_final_locals
  Object postBody = asset;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const authNames = <String>['oauth2'];
  const contentTypes = <String>['application/json'];


  return apiClient.invokeAPI(
    path,
    'PATCH',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes[0],
    authNames,
  );
}