Skip to content

create_revenue_attribution async

create_revenue_attribution(
    catalog: CatalogName,
    name: str,
    tenancy_model: TenancyModel,
    *,
    config_overrides: Optional[
        AsyncPartnerCentralRevenueMeasurementClientConfig
    ] = None,
    client_token: Optional[ClientToken] = None,
    description: Optional[str] = None,
    product_identifier: Optional[str] = None,
    tags: Optional[TagList] = None,
) -> CreateRevenueAttributionOutput

Creates a new revenue attribution record in the specified catalog.

Parameters:

  • catalog (CatalogName) –

    The catalog in which to create the revenue attribution.

  • client_token (Optional[ClientToken], default: None ) –

    A unique token to ensure idempotency of the create request.

  • name (str) –

    The name of the revenue attribution. Must be unique within the catalog and the partner's account.

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

    A description of the revenue attribution.

  • tenancy_model (TenancyModel) –

    The tenancy model for this revenue attribution.

  • product_identifier (Optional[str], default: None ) –

    The unique product identifier in AWS Marketplace. Accepts a product entity ID (e.g., prod-abc123def4567) or a product ARN.

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

    Tags to associate with the revenue attribution upon creation.

Raises:

Examples:

Example for CreateRevenueAttribution

>>> await client.create_revenue_attribution(catalog='AWS', name='My Revenue Attribution', tenancy_model='MULTI_TENANT')
Source code in docs_src/capo_partnercentral_revenue_measurement/_services/async_partner_central_revenue_measurement.py
async def create_revenue_attribution(
    self,
    catalog: "capo_partnercentral_revenue_measurement.types.catalog_name.CatalogName",
    name: str,
    tenancy_model: "capo_partnercentral_revenue_measurement.types.tenancy_model.TenancyModel",
    *,
    config_overrides: Optional[
        AsyncPartnerCentralRevenueMeasurementClientConfig
    ] = None,
    client_token: Optional[
        "capo_partnercentral_revenue_measurement.types.client_token.ClientToken"
    ] = None,
    description: Optional[str] = None,
    product_identifier: Optional[str] = None,
    tags: Optional[
        "capo_partnercentral_revenue_measurement.types.tag_list.TagList"
    ] = None,
) -> "capo_partnercentral_revenue_measurement.types.create_revenue_attribution_output.CreateRevenueAttributionOutput":
    """<p>Creates a new revenue attribution record in the specified catalog.</p>

    Args:
        catalog: <p>The catalog in which to create the revenue attribution.</p>
        client_token: <p>A unique token to ensure idempotency of the create request.</p>
        name: <p>The name of the revenue attribution. Must be unique within the catalog and the partner's account.</p>
        description: <p>A description of the revenue attribution.</p>
        tenancy_model: <p>The tenancy model for this revenue attribution.</p>
        product_identifier: <p>The unique product identifier in AWS Marketplace. Accepts a product entity ID (e.g., prod-abc123def4567) or a product ARN.</p>
        tags: <p>Tags to associate with the revenue attribution upon creation.</p>

    Raises:
        capo_partnercentral_revenue_measurement.errors.access_denied_exception.AccessDeniedException: <p>The request was denied due to insufficient permissions.</p>
        capo_partnercentral_revenue_measurement.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
        capo_partnercentral_revenue_measurement.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_partnercentral_revenue_measurement.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_partnercentral_revenue_measurement.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed a service quota limit.</p>
        capo_partnercentral_revenue_measurement.errors.throttling_exception.ThrottlingException: <p>The request was throttled due to too many requests. Retry your request.</p>
        capo_partnercentral_revenue_measurement.errors.validation_exception.ValidationException: <p>The request failed validation due to invalid input parameters.</p>
        capo_partnercentral_revenue_measurement.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Example for CreateRevenueAttribution

        >>> await client.create_revenue_attribution(catalog='AWS', name='My Revenue Attribution', tenancy_model='MULTI_TENANT')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_partnercentral_revenue_measurement.types.create_revenue_attribution_input.CreateRevenueAttributionInput]",
    ) -> AsyncOperationResponse[
        "capo_partnercentral_revenue_measurement.types.create_revenue_attribution_output.CreateRevenueAttributionOutput"
    ]:
        import capo_partnercentral_revenue_measurement._operations.partner_central_revenue_measurement.create_revenue_attribution

        (
            output,
            http_response,
        ) = await capo_partnercentral_revenue_measurement._operations.partner_central_revenue_measurement.create_revenue_attribution.async_create_revenue_attribution(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateRevenueAttribution")
    )
    input_: capo_partnercentral_revenue_measurement.types.create_revenue_attribution_input.CreateRevenueAttributionInput = {
        "catalog": catalog,
        "name": name,
        "tenancy_model": tenancy_model,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if description is not None:
        input_["description"] = description
    if product_identifier is not None:
        input_["product_identifier"] = product_identifier
    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