Skip to content

create_analysis_template async

create_analysis_template(
    membership_identifier: MembershipIdentifier,
    name: TableAlias,
    format: AnalysisFormat,
    source: AnalysisSource,
    *,
    config_overrides: Optional[AsyncCleanRoomsClientConfig] = None,
    description: Optional[ResourceDescription] = None,
    tags: Optional[TagMap] = None,
    analysis_parameters: Optional[AnalysisParameterList] = None,
    schema: Optional[AnalysisSchema] = None,
    error_message_configuration: Optional[ErrorMessageConfiguration] = None,
    synthetic_data_parameters: Optional[SyntheticDataParameters] = None,
) -> CreateAnalysisTemplateOutput

Creates a new analysis template.

Parameters:

  • description (Optional[ResourceDescription], default: None ) –

    The description of the analysis template.

  • membership_identifier (MembershipIdentifier) –

    The identifier for a membership resource.

  • name (TableAlias) –

    The name of the analysis template.

  • format (AnalysisFormat) –

    The format of the analysis template.

  • source (AnalysisSource) –

    The information in the analysis template.

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

    An optional label that you can assign to a resource when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to this resource.

  • analysis_parameters (Optional[AnalysisParameterList], default: None ) –

    The parameters of the analysis template.

  • error_message_configuration (Optional[ErrorMessageConfiguration], default: None ) –

    The configuration that specifies the level of detail in error messages returned by analyses using this template. When set to DETAILED, error messages include more information to help troubleshoot issues with PySpark jobs. Detailed error messages may expose underlying data, including sensitive information. Recommended for faster troubleshooting in development and testing environments.

  • synthetic_data_parameters (Optional[SyntheticDataParameters], default: None ) –

    The parameters for generating synthetic data when running the analysis template.

Raises:

Source code in docs_src/capo_cleanrooms/_services/async_clean_rooms.py
async def create_analysis_template(
    self,
    membership_identifier: "capo_cleanrooms.types.membership_identifier.MembershipIdentifier",
    name: "capo_cleanrooms.types.table_alias.TableAlias",
    format: "capo_cleanrooms.types.analysis_format.AnalysisFormat",
    source: "capo_cleanrooms.types.analysis_source.AnalysisSource",
    *,
    config_overrides: Optional[AsyncCleanRoomsClientConfig] = None,
    description: Optional[
        "capo_cleanrooms.types.resource_description.ResourceDescription"
    ] = None,
    tags: Optional["capo_cleanrooms.types.tag_map.TagMap"] = None,
    analysis_parameters: Optional[
        "capo_cleanrooms.types.analysis_parameter_list.AnalysisParameterList"
    ] = None,
    schema: Optional["capo_cleanrooms.types.analysis_schema.AnalysisSchema"] = None,
    error_message_configuration: Optional[
        "capo_cleanrooms.types.error_message_configuration.ErrorMessageConfiguration"
    ] = None,
    synthetic_data_parameters: Optional[
        "capo_cleanrooms.types.synthetic_data_parameters.SyntheticDataParameters"
    ] = None,
) -> "capo_cleanrooms.types.create_analysis_template_output.CreateAnalysisTemplateOutput":
    """<p>Creates a new analysis template.</p>

    Args:
        description: <p>The description of the analysis template.</p>
        membership_identifier: <p>The identifier for a membership resource.</p>
        name: <p>The name of the analysis template.</p>
        format: <p>The format of the analysis template.</p>
        source: <p>The information in the analysis template.</p>
        tags: <p>An optional label that you can assign to a resource when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to this resource.</p>
        analysis_parameters: <p>The parameters of the analysis template.</p>
        error_message_configuration: <p>The configuration that specifies the level of detail in error messages returned by analyses using this template. When set to <code>DETAILED</code>, error messages include more information to help troubleshoot issues with PySpark jobs. Detailed error messages may expose underlying data, including sensitive information. Recommended for faster troubleshooting in development and testing environments.</p>
        synthetic_data_parameters: <p>The parameters for generating synthetic data when running the analysis template.</p>

    Raises:
        capo_cleanrooms.errors.access_denied_exception.AccessDeniedException: <p>Caller does not have sufficient access to perform this action.</p>
        capo_cleanrooms.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_cleanrooms.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_cleanrooms.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_cleanrooms.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request denied because service quota has been exceeded.</p>
        capo_cleanrooms.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_cleanrooms.errors.validation_exception.ValidationException: <p>The input fails to satisfy the specified constraints.</p>
        capo_cleanrooms.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cleanrooms.types.create_analysis_template_input.CreateAnalysisTemplateInput]",
    ) -> AsyncOperationResponse[
        "capo_cleanrooms.types.create_analysis_template_output.CreateAnalysisTemplateOutput"
    ]:
        import capo_cleanrooms._operations.aws_bastion_control_plane_service_lambda.create_analysis_template

        (
            output,
            http_response,
        ) = await capo_cleanrooms._operations.aws_bastion_control_plane_service_lambda.create_analysis_template.async_create_analysis_template(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_cleanrooms.types.create_analysis_template_input.CreateAnalysisTemplateInput",
    ) -> dict[str, Any]:
        import capo_cleanrooms.types.create_analysis_template_input

        return (
            capo_cleanrooms.types.create_analysis_template_input.redact_sensitive(
                input_
            )
        )

    def _redact_output(
        output: "capo_cleanrooms.types.create_analysis_template_output.CreateAnalysisTemplateOutput",
    ) -> dict[str, Any]:
        import capo_cleanrooms.types.create_analysis_template_output

        return (
            capo_cleanrooms.types.create_analysis_template_output.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateAnalysisTemplate",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_cleanrooms.types.create_analysis_template_input.CreateAnalysisTemplateInput = {
        "membership_identifier": membership_identifier,
        "name": name,
        "format": format,
        "source": source,
    }
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags
    if analysis_parameters is not None:
        input_["analysis_parameters"] = analysis_parameters
    if schema is not None:
        input_["schema"] = schema
    if error_message_configuration is not None:
        input_["error_message_configuration"] = error_message_configuration
    if synthetic_data_parameters is not None:
        input_["synthetic_data_parameters"] = synthetic_data_parameters

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