createHub method

Future<CreateHubResponse> createHub({
  1. required String hubDescription,
  2. required String hubName,
  3. String? hubDisplayName,
  4. List<String>? hubSearchKeywords,
  5. HubS3StorageConfig? s3StorageConfig,
  6. List<Tag>? tags,
})

Create a hub.

May throw ResourceInUse. May throw ResourceLimitExceeded.

Parameter hubDescription : A description of the hub.

Parameter hubName : The name of the hub to create.

Parameter hubDisplayName : The display name of the hub.

Parameter hubSearchKeywords : The searchable keywords for the hub.

Parameter s3StorageConfig : The Amazon S3 storage configuration for the hub.

Parameter tags : Any tags to associate with the hub.

Implementation

Future<CreateHubResponse> createHub({
  required String hubDescription,
  required String hubName,
  String? hubDisplayName,
  List<String>? hubSearchKeywords,
  HubS3StorageConfig? s3StorageConfig,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreateHub'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'HubDescription': hubDescription,
      'HubName': hubName,
      if (hubDisplayName != null) 'HubDisplayName': hubDisplayName,
      if (hubSearchKeywords != null) 'HubSearchKeywords': hubSearchKeywords,
      if (s3StorageConfig != null) 'S3StorageConfig': s3StorageConfig,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateHubResponse.fromJson(jsonResponse.body);
}