updateArtifact method

Future<UpdateArtifactResponse> updateArtifact({
  1. required String artifactArn,
  2. String? artifactName,
  3. Map<String, String>? properties,
  4. List<String>? propertiesToRemove,
})

Updates an artifact.

May throw ConflictException. May throw ResourceNotFound.

Parameter artifactArn : The Amazon Resource Name (ARN) of the artifact to update.

Parameter artifactName : The new name for the artifact.

Parameter properties : The new list of properties. Overwrites the current property list.

Parameter propertiesToRemove : A list of properties to remove.

Implementation

Future<UpdateArtifactResponse> updateArtifact({
  required String artifactArn,
  String? artifactName,
  Map<String, String>? properties,
  List<String>? propertiesToRemove,
}) async {
  ArgumentError.checkNotNull(artifactArn, 'artifactArn');
  _s.validateStringLength(
    'artifactArn',
    artifactArn,
    0,
    256,
    isRequired: true,
  );
  _s.validateStringLength(
    'artifactName',
    artifactName,
    1,
    120,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.UpdateArtifact'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ArtifactArn': artifactArn,
      if (artifactName != null) 'ArtifactName': artifactName,
      if (properties != null) 'Properties': properties,
      if (propertiesToRemove != null)
        'PropertiesToRemove': propertiesToRemove,
    },
  );

  return UpdateArtifactResponse.fromJson(jsonResponse.body);
}