modelsPatchByAssetmodelidAndTenantidWithHttpInfo method

Future<Response> modelsPatchByAssetmodelidAndTenantidWithHttpInfo(
  1. int assetModelId,
  2. String tenantId,
  3. String region,
  4. ModelEdit model,
)

Edit an existing model

Summary:Edit an existing model.
Return Type: Model

Note: This method returns the HTTP Response.

Parameters:

  • int assetModelId (required):

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

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

  • ModelEdit model (required): The entity to patch

Implementation

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

  // ignore: prefer_const_declarations
  final path = r'/{region}/aim/2.0/{tenantId}/Models({AssetModelId})'
    .replaceAll('{AssetModelId}', assetModelId.toString())
    .replaceAll('{tenantId}', tenantId)
    .replaceAll('{region}', region);

  // ignore: prefer_final_locals
  Object postBody = model;

  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,
  );
}