updateImage method

Future<UpdateImageResponse> updateImage({
  1. required String imageName,
  2. List<String>? deleteProperties,
  3. String? description,
  4. String? displayName,
  5. String? roleArn,
})

Updates the properties of a SageMaker image. To change the image's tags, use the AddTags and DeleteTags APIs.

May throw ResourceInUse. May throw ResourceNotFound.

Parameter imageName : The name of the image to update.

Parameter deleteProperties : A list of properties to delete. Only the Description and DisplayName properties can be deleted.

Parameter description : The new description for the image.

Parameter displayName : The new display name for the image.

Parameter roleArn : The new Amazon Resource Name (ARN) for the IAM role that enables Amazon SageMaker to perform tasks on your behalf.

Implementation

Future<UpdateImageResponse> updateImage({
  required String imageName,
  List<String>? deleteProperties,
  String? description,
  String? displayName,
  String? roleArn,
}) async {
  ArgumentError.checkNotNull(imageName, 'imageName');
  _s.validateStringLength(
    'imageName',
    imageName,
    1,
    63,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    1,
    512,
  );
  _s.validateStringLength(
    'displayName',
    displayName,
    1,
    128,
  );
  _s.validateStringLength(
    'roleArn',
    roleArn,
    20,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.UpdateImage'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ImageName': imageName,
      if (deleteProperties != null) 'DeleteProperties': deleteProperties,
      if (description != null) 'Description': description,
      if (displayName != null) 'DisplayName': displayName,
      if (roleArn != null) 'RoleArn': roleArn,
    },
  );

  return UpdateImageResponse.fromJson(jsonResponse.body);
}