Skip to content

get_listing async

get_listing(
    listing_id: ListingId,
    *,
    config_overrides: Optional[AsyncMarketplaceDiscoveryClientConfig] = None,
    locale: Optional[Locale] = None,
) -> GetListingOutput

Provides details about a listing, such as descriptions, badges, categories, pricing model summaries, reviews, and associated products and offers.

Parameters:

  • locale (Optional[Locale], default: None ) –

    The preferred locale for response content, as a Best Current Practice 47 (BCP 47) language tag or a comma-separated priority list of language tags. See Locale for supported values, constraints, fallback behavior, and the default locale. If you omit this field, the service returns content in the default locale.

  • listing_id (ListingId) –

    The unique identifier of the listing to retrieve.

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this action. Verify that you have the required permissions.

  • InternalServerException –

    Unexpected error during processing of the request.

  • ThrottlingException –

    The request was denied due to request throttling. Reduce the frequency of your requests and retry.

  • ValidationException –

    The input fails to satisfy the constraints specified by the service. Check the reason field for the constraint that failed.

  • ResourceNotFoundException –

    The specified resource doesn't exist. Verify that the identifier is correct.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

GetListing for SaaS listing

>>> await client.get_listing(locale='en-US', listing_id='prodview-sampleSaasId')
GetListing for AMI listing with video
>>> await client.get_listing(locale='en-US', listing_id='prodview-sampleAmiId')
GetListing for multi-product listing
>>> await client.get_listing(locale='en-US', listing_id='prodview-sampleMultiProductId')
GetListing for listing available without a subscription
>>> await client.get_listing(locale='en-US', listing_id='prodview-sampleNoSubscriptionId')
GetListing for listing not available for new subscriptions
>>> await client.get_listing(locale='en-US', listing_id='prodview-sampleUnavailableId')
Source code in docs_src/capo_marketplace_discovery/_services/async_marketplace_discovery.py
async def get_listing(
    self,
    listing_id: "capo_marketplace_discovery.types.listing_id.ListingId",
    *,
    config_overrides: Optional[AsyncMarketplaceDiscoveryClientConfig] = None,
    locale: Optional["capo_marketplace_discovery.types.locale.Locale"] = None,
) -> "capo_marketplace_discovery.types.get_listing_output.GetListingOutput":
    """<p>Provides details about a listing, such as descriptions, badges, categories, pricing model summaries, reviews, and associated products and offers.</p>

    Args:
        locale: <p>The preferred locale for response content, as a Best Current Practice 47 (BCP 47) language tag or a comma-separated priority list of language tags. See <code>Locale</code> for supported values, constraints, fallback behavior, and the default locale. If you omit this field, the service returns content in the default locale.</p>
        listing_id: <p>The unique identifier of the listing to retrieve.</p>

    Raises:
        capo_marketplace_discovery.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action. Verify that you have the required permissions.</p>
        capo_marketplace_discovery.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of the request.</p>
        capo_marketplace_discovery.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Reduce the frequency of your requests and retry.</p>
        capo_marketplace_discovery.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service. Check the <code>reason</code> field for the constraint that failed.</p>
        capo_marketplace_discovery.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource doesn't exist. Verify that the identifier is correct.</p>
        capo_marketplace_discovery.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        GetListing for SaaS listing

        >>> await client.get_listing(locale='en-US', listing_id='prodview-sampleSaasId')
        GetListing for AMI listing with video

        >>> await client.get_listing(locale='en-US', listing_id='prodview-sampleAmiId')
        GetListing for multi-product listing

        >>> await client.get_listing(locale='en-US', listing_id='prodview-sampleMultiProductId')
        GetListing for listing available without a subscription

        >>> await client.get_listing(locale='en-US', listing_id='prodview-sampleNoSubscriptionId')
        GetListing for listing not available for new subscriptions

        >>> await client.get_listing(locale='en-US', listing_id='prodview-sampleUnavailableId')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_marketplace_discovery.types.get_listing_input.GetListingInput]",
    ) -> AsyncOperationResponse[
        "capo_marketplace_discovery.types.get_listing_output.GetListingOutput"
    ]:
        import capo_marketplace_discovery._operations.aws_marketplace_discovery.get_listing

        (
            output,
            http_response,
        ) = await capo_marketplace_discovery._operations.aws_marketplace_discovery.get_listing.async_get_listing(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetListing")
    )
    input_: capo_marketplace_discovery.types.get_listing_input.GetListingInput = {
        "listing_id": listing_id
    }
    if locale is not None:
        input_["locale"] = locale

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