createHubContentReference method

Future<CreateHubContentReferenceResponse> createHubContentReference({
  1. required String hubName,
  2. required String sageMakerPublicHubContentArn,
  3. String? hubContentName,
  4. String? minVersion,
  5. List<Tag>? tags,
})

Create a hub content reference in order to add a model in the JumpStart public hub to a private hub.

May throw ResourceInUse. May throw ResourceLimitExceeded. May throw ResourceNotFound.

Parameter hubName : The name of the hub to add the hub content reference to.

Parameter sageMakerPublicHubContentArn : The ARN of the public hub content to reference.

Parameter hubContentName : The name of the hub content to reference.

Parameter minVersion : The minimum version of the hub content to reference.

Parameter tags : Any tags associated with the hub content to reference.

Implementation

Future<CreateHubContentReferenceResponse> createHubContentReference({
  required String hubName,
  required String sageMakerPublicHubContentArn,
  String? hubContentName,
  String? minVersion,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreateHubContentReference'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'HubName': hubName,
      'SageMakerPublicHubContentArn': sageMakerPublicHubContentArn,
      if (hubContentName != null) 'HubContentName': hubContentName,
      if (minVersion != null) 'MinVersion': minVersion,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateHubContentReferenceResponse.fromJson(jsonResponse.body);
}