Skip to content

put_profile_object_type async

put_profile_object_type(
    domain_name: name,
    object_type_name: typeName,
    description: sensitiveText,
    *,
    config_overrides: Optional[AsyncCustomerProfilesClientConfig] = None,
    template_id: Optional[name] = None,
    expiration_days: Optional[expirationDaysInteger] = None,
    encryption_key: Optional[encryptionKey] = None,
    allow_profile_creation: Optional[boolean] = None,
    source_last_updated_timestamp_format: Optional[string1To255] = None,
    max_profile_object_count: Optional[minSize1] = None,
    source_priority: Optional[minSize1] = None,
    fields: Optional[FieldMap] = None,
    keys: Optional[KeyMap] = None,
    tags: Optional[TagMap] = None,
) -> PutProfileObjectTypeResponse

Defines a ProfileObjectType.

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

Parameters:

  • domain_name (name) –

    The unique name of the domain.

  • object_type_name (typeName) –

    The name of the profile object type.

  • description (sensitiveText) –

    Description of the profile object type.

  • template_id (Optional[name], default: None ) –

    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.

  • expiration_days (Optional[expirationDaysInteger], default: None ) –

    The number of days until the data in the object expires.

  • encryption_key (Optional[encryptionKey], default: None ) –

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

  • allow_profile_creation (Optional[boolean], default: None ) –

    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.

  • source_last_updated_timestamp_format (Optional[string1To255], default: None ) –

    The format of your sourceLastUpdatedTimestamp that was previously set up.

  • max_profile_object_count (Optional[minSize1], default: None ) –

    The amount of profile object max count assigned to the object type

  • source_priority (Optional[minSize1], default: None ) –

    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.

  • fields (Optional[FieldMap], default: None ) –

    A map of the name and ObjectType field.

  • keys (Optional[KeyMap], default: None ) –

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

  • tags (Optional[TagMap], default: None ) –

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

Raises:

Source code in docs_src/capo_customer_profiles/_services/async_customer_profiles.py
async def put_profile_object_type(
    self,
    domain_name: "capo_customer_profiles.types.name.name",
    object_type_name: "capo_customer_profiles.types.type_name.typeName",
    description: "capo_customer_profiles.types.sensitive_text.sensitiveText",
    *,
    config_overrides: Optional[AsyncCustomerProfilesClientConfig] = None,
    template_id: Optional["capo_customer_profiles.types.name.name"] = None,
    expiration_days: Optional[
        "capo_customer_profiles.types.expiration_days_integer.expirationDaysInteger"
    ] = None,
    encryption_key: Optional[
        "capo_customer_profiles.types.encryption_key.encryptionKey"
    ] = None,
    allow_profile_creation: Optional[
        "capo_customer_profiles.types.boolean.boolean"
    ] = None,
    source_last_updated_timestamp_format: Optional[
        "capo_customer_profiles.types.string1_to255.string1To255"
    ] = None,
    max_profile_object_count: Optional[
        "capo_customer_profiles.types.min_size1.minSize1"
    ] = None,
    source_priority: Optional[
        "capo_customer_profiles.types.min_size1.minSize1"
    ] = None,
    fields: Optional["capo_customer_profiles.types.field_map.FieldMap"] = None,
    keys: Optional["capo_customer_profiles.types.key_map.KeyMap"] = None,
    tags: Optional["capo_customer_profiles.types.tag_map.TagMap"] = None,
) -> "capo_customer_profiles.types.put_profile_object_type_response.PutProfileObjectTypeResponse":
    """<p>Defines a ProfileObjectType.</p> <p>To add or remove tags on an existing ObjectType, see <a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_TagResource.html"> TagResource</a>/<a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_UntagResource.html">UntagResource</a>.</p>

    Args:
        domain_name: <p>The unique name of the domain.</p>
        object_type_name: <p>The name of the profile object type.</p>
        description: <p>Description of the profile object type.</p>
        template_id: <p>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 <code>BadRequestException</code>. 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 <code>BadRequestException</code>.</p>
        expiration_days: <p>The number of days until the data in the object expires.</p>
        encryption_key: <p>The customer-provided key to encrypt the profile object that will be created in this profile object type.</p>
        allow_profile_creation: <p>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 <code>FALSE</code>. If the AllowProfileCreation flag is set to <code>FALSE</code>, then the service tries to fetch a standard profile and associate this object with the profile. If it is set to <code>TRUE</code>, and if no match is found, then the service creates a new standard profile.</p>
        source_last_updated_timestamp_format: <p>The format of your <code>sourceLastUpdatedTimestamp</code> that was previously set up. </p>
        max_profile_object_count: <p>The amount of profile object max count assigned to the object type</p>
        source_priority: <p>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.</p>
        fields: <p>A map of the name and ObjectType field.</p>
        keys: <p>A list of unique keys that can be used to map data to the profile.</p>
        tags: <p>The tags used to organize, track, or control access for this resource.</p>

    Raises:
        capo_customer_profiles.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_customer_profiles.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
        capo_customer_profiles.errors.internal_server_exception.InternalServerException: <p>An internal service error occurred.</p>
        capo_customer_profiles.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource does not exist, or access was denied.</p>
        capo_customer_profiles.errors.throttling_exception.ThrottlingException: <p>You exceeded the maximum number of requests.</p>
        capo_customer_profiles.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_customer_profiles.types.put_profile_object_type_request.PutProfileObjectTypeRequest]",
    ) -> AsyncOperationResponse[
        "capo_customer_profiles.types.put_profile_object_type_response.PutProfileObjectTypeResponse"
    ]:
        import capo_customer_profiles._operations.customer_profiles_20200815.put_profile_object_type

        (
            output,
            http_response,
        ) = await capo_customer_profiles._operations.customer_profiles_20200815.put_profile_object_type.async_put_profile_object_type(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_customer_profiles.types.put_profile_object_type_request.PutProfileObjectTypeRequest",
    ) -> dict[str, Any]:
        import capo_customer_profiles.types.put_profile_object_type_request

        return capo_customer_profiles.types.put_profile_object_type_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_customer_profiles.types.put_profile_object_type_response.PutProfileObjectTypeResponse",
    ) -> dict[str, Any]:
        import capo_customer_profiles.types.put_profile_object_type_response

        return capo_customer_profiles.types.put_profile_object_type_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "PutProfileObjectType",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_customer_profiles.types.put_profile_object_type_request.PutProfileObjectTypeRequest = {
        "domain_name": domain_name,
        "object_type_name": object_type_name,
        "description": description,
    }
    if template_id is not None:
        input_["template_id"] = template_id
    if expiration_days is not None:
        input_["expiration_days"] = expiration_days
    if encryption_key is not None:
        input_["encryption_key"] = encryption_key
    if allow_profile_creation is not None:
        input_["allow_profile_creation"] = allow_profile_creation
    if source_last_updated_timestamp_format is not None:
        input_["source_last_updated_timestamp_format"] = (
            source_last_updated_timestamp_format
        )
    if max_profile_object_count is not None:
        input_["max_profile_object_count"] = max_profile_object_count
    if source_priority is not None:
        input_["source_priority"] = source_priority
    if fields is not None:
        input_["fields"] = fields
    if keys is not None:
        input_["keys"] = keys
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output