createSpace method
Creates a private space or a space used for real time collaboration in a domain.
May throw ResourceInUse.
May throw ResourceLimitExceeded.
Parameter domainId :
The ID of the associated domain.
Parameter spaceName :
The name of the space.
Parameter ownershipSettings :
A collection of ownership settings.
Parameter spaceDisplayName :
The name of the space that appears in the SageMaker Studio UI.
Parameter spaceSettings :
A collection of space settings.
Parameter spaceSharingSettings :
A collection of space sharing settings.
Parameter tags :
Tags to associated with the space. Each tag consists of a key and an
optional value. Tag keys must be unique for each resource. Tags are
searchable using the Search API.
Implementation
Future<CreateSpaceResponse> createSpace({
required String domainId,
required String spaceName,
OwnershipSettings? ownershipSettings,
String? spaceDisplayName,
SpaceSettings? spaceSettings,
SpaceSharingSettings? spaceSharingSettings,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SageMaker.CreateSpace'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DomainId': domainId,
'SpaceName': spaceName,
if (ownershipSettings != null) 'OwnershipSettings': ownershipSettings,
if (spaceDisplayName != null) 'SpaceDisplayName': spaceDisplayName,
if (spaceSettings != null) 'SpaceSettings': spaceSettings,
if (spaceSharingSettings != null)
'SpaceSharingSettings': spaceSharingSettings,
if (tags != null) 'Tags': tags,
},
);
return CreateSpaceResponse.fromJson(jsonResponse.body);
}