Skip to content

create_upload_job

create_upload_job(
    domain_name: name,
    display_name: string1To255,
    fields: FieldMap,
    unique_key: text,
    *,
    config_overrides: Optional[CustomerProfilesClientConfig] = None,
    data_expiry: Optional[expirationDaysInteger] = None,
) -> CreateUploadJobResponse

Creates an Upload job to ingest data for segment imports. The metadata is created for the job with the provided field mapping and unique key.

Parameters:

  • domain_name (name) –

    The unique name of the domain. Domain should be exists for the upload job to be created.

  • display_name (string1To255) –

    The unique name of the upload job. Could be a file name to identify the upload job.

  • fields (FieldMap) –

    The mapping between CSV Columns and Profile Object attributes. A map of the name and ObjectType field.

  • unique_key (text) –

    The unique key columns for de-duping the profiles used to map data to the profile.

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

    The expiry duration for the profiles ingested with the job. If not provided, the system default of 2 weeks is used.

Raises:

Source code in docs_src/capo_customer_profiles/_services/customer_profiles.py
def create_upload_job(
    self,
    domain_name: "capo_customer_profiles.types.name.name",
    display_name: "capo_customer_profiles.types.string1_to255.string1To255",
    fields: "capo_customer_profiles.types.field_map.FieldMap",
    unique_key: "capo_customer_profiles.types.text.text",
    *,
    config_overrides: Optional[CustomerProfilesClientConfig] = None,
    data_expiry: Optional[
        "capo_customer_profiles.types.expiration_days_integer.expirationDaysInteger"
    ] = None,
) -> "capo_customer_profiles.types.create_upload_job_response.CreateUploadJobResponse":
    """<p>Creates an Upload job to ingest data for segment imports. The metadata is created for the job with the provided field mapping and unique key. </p>

    Args:
        domain_name: <p>The unique name of the domain. Domain should be exists for the upload job to be created. </p>
        display_name: <p>The unique name of the upload job. Could be a file name to identify the upload job.</p>
        fields: <p>The mapping between CSV Columns and Profile Object attributes. A map of the name and ObjectType field.</p>
        unique_key: <p>The unique key columns for de-duping the profiles used to map data to the profile. </p>
        data_expiry: <p>The expiry duration for the profiles ingested with the job. If not provided, the system default of 2 weeks is used. </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_upload_job_request.CreateUploadJobRequest]",
    ) -> OperationResponse[
        "capo_customer_profiles.types.create_upload_job_response.CreateUploadJobResponse"
    ]:
        import capo_customer_profiles._operations.customer_profiles_20200815.create_upload_job

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

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

        return (
            capo_customer_profiles.types.create_upload_job_request.redact_sensitive(
                input_
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateUploadJob", redact_input=_redact_input),
    )
    input_: capo_customer_profiles.types.create_upload_job_request.CreateUploadJobRequest = {
        "domain_name": domain_name,
        "display_name": display_name,
        "fields": fields,
        "unique_key": unique_key,
    }
    if data_expiry is not None:
        input_["data_expiry"] = data_expiry

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