describeImageVersion method

Future<DescribeImageVersionResponse> describeImageVersion({
  1. required String imageName,
  2. int? version,
})

Describes a version of a SageMaker image.

May throw ResourceNotFound.

Parameter imageName : The name of the image.

Parameter version : The version of the image. If not specified, the latest version is described.

Implementation

Future<DescribeImageVersionResponse> describeImageVersion({
  required String imageName,
  int? version,
}) async {
  ArgumentError.checkNotNull(imageName, 'imageName');
  _s.validateStringLength(
    'imageName',
    imageName,
    1,
    63,
    isRequired: true,
  );
  _s.validateNumRange(
    'version',
    version,
    0,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.DescribeImageVersion'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ImageName': imageName,
      if (version != null) 'Version': version,
    },
  );

  return DescribeImageVersionResponse.fromJson(jsonResponse.body);
}