Skip to content

create_segment_snapshot

create_segment_snapshot(
    domain_name: name,
    segment_definition_name: name,
    data_format: DataFormat,
    *,
    config_overrides: Optional[CustomerProfilesClientConfig] = None,
    encryption_key: Optional[encryptionKey] = None,
    role_arn: Optional[RoleArn] = None,
    destination_uri: Optional[string1To255] = None,
) -> CreateSegmentSnapshotResponse

Triggers a job to export a segment to a specified destination.

Parameters:

  • domain_name (name) –

    The unique name of the domain.

  • segment_definition_name (name) –

    The name of the segment definition used in this snapshot request.

  • data_format (DataFormat) –

    The format in which the segment will be exported.

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

    The Amazon Resource Name (ARN) of the KMS key used to encrypt the exported segment.

  • role_arn (Optional[RoleArn], default: None ) –

    The Amazon Resource Name (ARN) of the IAM role that allows Customer Profiles service principal to assume the role for conducting KMS and S3 operations.

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

    The destination to which the segment will be exported. This field must be provided if the request is not submitted from the Connect Customer Admin Website.

Raises:

Source code in docs_src/capo_customer_profiles/_services/customer_profiles.py
def create_segment_snapshot(
    self,
    domain_name: "capo_customer_profiles.types.name.name",
    segment_definition_name: "capo_customer_profiles.types.name.name",
    data_format: "capo_customer_profiles.types.data_format.DataFormat",
    *,
    config_overrides: Optional[CustomerProfilesClientConfig] = None,
    encryption_key: Optional[
        "capo_customer_profiles.types.encryption_key.encryptionKey"
    ] = None,
    role_arn: Optional["capo_customer_profiles.types.role_arn.RoleArn"] = None,
    destination_uri: Optional[
        "capo_customer_profiles.types.string1_to255.string1To255"
    ] = None,
) -> "capo_customer_profiles.types.create_segment_snapshot_response.CreateSegmentSnapshotResponse":
    """<p>Triggers a job to export a segment to a specified destination.</p>

    Args:
        domain_name: <p>The unique name of the domain.</p>
        segment_definition_name: <p>The name of the segment definition used in this snapshot request.</p>
        data_format: <p>The format in which the segment will be exported.</p>
        encryption_key: <p>The Amazon Resource Name (ARN) of the KMS key used to encrypt the exported segment.</p>
        role_arn: <p>The Amazon Resource Name (ARN) of the IAM role that allows Customer Profiles service principal to assume the role for conducting KMS and S3 operations.</p>
        destination_uri: <p>The destination to which the segment will be exported. This field must be provided if the request is not submitted from the Connect Customer Admin Website.</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.
    """

    def _handler(
        req: "OperationRequest[capo_customer_profiles.types.create_segment_snapshot_request.CreateSegmentSnapshotRequest]",
    ) -> OperationResponse[
        "capo_customer_profiles.types.create_segment_snapshot_response.CreateSegmentSnapshotResponse"
    ]:
        import capo_customer_profiles._operations.customer_profiles_20200815.create_segment_snapshot

        output, http_response = (
            capo_customer_profiles._operations.customer_profiles_20200815.create_segment_snapshot.create_segment_snapshot(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateSegmentSnapshot")
    )
    input_: capo_customer_profiles.types.create_segment_snapshot_request.CreateSegmentSnapshotRequest = {
        "domain_name": domain_name,
        "segment_definition_name": segment_definition_name,
        "data_format": data_format,
    }
    if encryption_key is not None:
        input_["encryption_key"] = encryption_key
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if destination_uri is not None:
        input_["destination_uri"] = destination_uri

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output