putProfileObjectType method

Future<PutProfileObjectTypeResponse> putProfileObjectType({
  1. required String description,
  2. required String domainName,
  3. required String objectTypeName,
  4. bool? allowProfileCreation,
  5. String? encryptionKey,
  6. int? expirationDays,
  7. Map<String, ObjectTypeField>? fields,
  8. Map<String, List<ObjectTypeKey>>? keys,
  9. int? maxProfileObjectCount,
  10. String? sourceLastUpdatedTimestampFormat,
  11. int? sourcePriority,
  12. Map<String, String>? tags,
  13. String? templateId,
})

Defines a ProfileObjectType.

To add or remove tags on an existing ObjectType, see TagResource/UntagResource.

May throw AccessDeniedException. May throw BadRequestException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter description : Description of the profile object type.

Parameter domainName : The unique name of the domain.

Parameter objectTypeName : The name of the profile object type.

Parameter allowProfileCreation : Indicates whether a profile should be created when data is received if one doesn’t exist for an object of this type. The default is FALSE. If the AllowProfileCreation flag is set to FALSE, then the service tries to fetch a standard profile and associate this object with the profile. If it is set to TRUE, and if no match is found, then the service creates a new standard profile.

Parameter encryptionKey : The customer-provided key to encrypt the profile object that will be created in this profile object type.

Parameter expirationDays : The number of days until the data in the object expires.

Parameter fields : A map of the name and ObjectType field.

Parameter keys : A list of unique keys that can be used to map data to the profile.

Parameter maxProfileObjectCount : The amount of profile object max count assigned to the object type

Parameter sourceLastUpdatedTimestampFormat : The format of your sourceLastUpdatedTimestamp that was previously set up.

Parameter sourcePriority : An integer that determines the priority of this object type when data from multiple sources is ingested. Lower values take priority. Object types without a specified source priority default to the lowest priority.

Parameter tags : The tags used to organize, track, or control access for this resource.

Parameter templateId : A unique identifier for the object template. For some attributes in the request, the service will use the default value from the object template when TemplateId is present. If these attributes are present in the request, the service may return a BadRequestException. These attributes include: AllowProfileCreation, SourceLastUpdatedTimestampFormat, Fields, and Keys. For example, if AllowProfileCreation is set to true when TemplateId is set, the service may return a BadRequestException.

Implementation

Future<PutProfileObjectTypeResponse> putProfileObjectType({
  required String description,
  required String domainName,
  required String objectTypeName,
  bool? allowProfileCreation,
  String? encryptionKey,
  int? expirationDays,
  Map<String, ObjectTypeField>? fields,
  Map<String, List<ObjectTypeKey>>? keys,
  int? maxProfileObjectCount,
  String? sourceLastUpdatedTimestampFormat,
  int? sourcePriority,
  Map<String, String>? tags,
  String? templateId,
}) async {
  _s.validateNumRange(
    'expirationDays',
    expirationDays,
    1,
    1098,
  );
  _s.validateNumRange(
    'maxProfileObjectCount',
    maxProfileObjectCount,
    1,
    1152921504606846976,
  );
  _s.validateNumRange(
    'sourcePriority',
    sourcePriority,
    1,
    1152921504606846976,
  );
  final $payload = <String, dynamic>{
    'Description': description,
    if (allowProfileCreation != null)
      'AllowProfileCreation': allowProfileCreation,
    if (encryptionKey != null) 'EncryptionKey': encryptionKey,
    if (expirationDays != null) 'ExpirationDays': expirationDays,
    if (fields != null) 'Fields': fields,
    if (keys != null) 'Keys': keys,
    if (maxProfileObjectCount != null)
      'MaxProfileObjectCount': maxProfileObjectCount,
    if (sourceLastUpdatedTimestampFormat != null)
      'SourceLastUpdatedTimestampFormat': sourceLastUpdatedTimestampFormat,
    if (sourcePriority != null) 'SourcePriority': sourcePriority,
    if (tags != null) 'Tags': tags,
    if (templateId != null) 'TemplateId': templateId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/domains/${Uri.encodeComponent(domainName)}/object-types/${Uri.encodeComponent(objectTypeName)}',
    exceptionFnMap: _exceptionFns,
  );
  return PutProfileObjectTypeResponse.fromJson(response);
}