importHubContent method

Future<ImportHubContentResponse> importHubContent({
  1. required String documentSchemaVersion,
  2. required String hubContentDocument,
  3. required String hubContentName,
  4. required HubContentType hubContentType,
  5. required String hubName,
  6. String? hubContentDescription,
  7. String? hubContentDisplayName,
  8. String? hubContentMarkdown,
  9. List<String>? hubContentSearchKeywords,
  10. String? hubContentVersion,
  11. HubContentSupportStatus? supportStatus,
  12. List<Tag>? tags,
})

Import hub content.

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

Parameter documentSchemaVersion : The version of the hub content schema to import.

Parameter hubContentDocument : The hub content document that describes information about the hub content such as type, associated containers, scripts, and more.

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

Parameter hubContentType : The type of hub content to import.

Parameter hubName : The name of the hub to import content into.

Parameter hubContentDescription : A description of the hub content to import.

Parameter hubContentDisplayName : The display name of the hub content to import.

Parameter hubContentMarkdown : A string that provides a description of the hub content. This string can include links, tables, and standard markdown formating.

Parameter hubContentSearchKeywords : The searchable keywords of the hub content.

Parameter hubContentVersion : The version of the hub content to import.

Parameter supportStatus : The status of the hub content resource.

Parameter tags : Any tags associated with the hub content.

Implementation

Future<ImportHubContentResponse> importHubContent({
  required String documentSchemaVersion,
  required String hubContentDocument,
  required String hubContentName,
  required HubContentType hubContentType,
  required String hubName,
  String? hubContentDescription,
  String? hubContentDisplayName,
  String? hubContentMarkdown,
  List<String>? hubContentSearchKeywords,
  String? hubContentVersion,
  HubContentSupportStatus? supportStatus,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ImportHubContent'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DocumentSchemaVersion': documentSchemaVersion,
      'HubContentDocument': hubContentDocument,
      'HubContentName': hubContentName,
      'HubContentType': hubContentType.value,
      'HubName': hubName,
      if (hubContentDescription != null)
        'HubContentDescription': hubContentDescription,
      if (hubContentDisplayName != null)
        'HubContentDisplayName': hubContentDisplayName,
      if (hubContentMarkdown != null)
        'HubContentMarkdown': hubContentMarkdown,
      if (hubContentSearchKeywords != null)
        'HubContentSearchKeywords': hubContentSearchKeywords,
      if (hubContentVersion != null) 'HubContentVersion': hubContentVersion,
      if (supportStatus != null) 'SupportStatus': supportStatus.value,
      if (tags != null) 'Tags': tags,
    },
  );

  return ImportHubContentResponse.fromJson(jsonResponse.body);
}