putDomainObjectType method
Create/Update a DomainObjectType in a Customer Profiles domain. To create a new DomainObjectType, Data Store needs to be enabled on the Domain.
May throw AccessDeniedException.
May throw BadRequestException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter domainName :
The unique name of the domain.
Parameter fields :
A map of field names to their corresponding domain object type field
definitions.
Parameter objectTypeName :
The unique name of the domain object type.
Parameter description :
The description of the domain object type.
Parameter encryptionKey :
The customer provided KMS key used to encrypt this type of domain object.
Parameter tags :
The tags used to organize, track, or control access for this resource.
Implementation
Future<PutDomainObjectTypeResponse> putDomainObjectType({
required String domainName,
required Map<String, DomainObjectTypeField> fields,
required String objectTypeName,
String? description,
String? encryptionKey,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'Fields': fields,
if (description != null) 'Description': description,
if (encryptionKey != null) 'EncryptionKey': encryptionKey,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/domains/${Uri.encodeComponent(domainName)}/domain-object-types/${Uri.encodeComponent(objectTypeName)}',
exceptionFnMap: _exceptionFns,
);
return PutDomainObjectTypeResponse.fromJson(response);
}