Skip to content

get_place async

get_place(
    place_id: SensitiveString,
    *,
    config_overrides: Optional[AsyncGeoPlacesClientConfig] = None,
    additional_features: Optional[GetPlaceAdditionalFeatureList] = None,
    language: Optional[LanguageTag] = None,
    political_view: Optional[CountryCode] = None,
    intended_use: Optional[GetPlaceIntendedUse] = None,
    key: Optional[ApiKey] = None,
    address_names_mode: Optional[GetPlaceAddressNamesMode] = None,
) -> GetPlaceResponse

GetPlace finds a place by its unique ID. A PlaceId is returned by other place operations.

For more information, see GetPlace in the Amazon Location Service Developer Guide.

Parameters:

  • place_id (SensitiveString) –

    The PlaceId of the place you wish to receive the information for.

  • additional_features (Optional[GetPlaceAdditionalFeatureList], default: None ) –

    A list of optional additional parameters such as time zone that can be requested for each result. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only the TimeZone value.

  • language (Optional[LanguageTag], default: None ) –

    A list of BCP 47 compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry. For GrabMaps customers, ap-southeast-1 and ap-southeast-5 regions support only the following codes: en, id, km, lo, ms, my, pt, th, tl, vi, zh

  • political_view (Optional[CountryCode], default: None ) –

    The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country. Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

  • intended_use (Optional[GetPlaceIntendedUse], default: None ) –

    Indicates if the query results will be persisted in customer infrastructure. Defaults to SingleUse (not stored). Not supported in ap-southeast-1 and ap-southeast-5 regions for GrabMaps customers.

    When storing GetPlace responses, you must set this field to Storage to comply with the terms of service. These requests will be charged at a higher rate. Please review the user agreement and service pricing structure to determine the correct setting for your use case.

  • key (Optional[ApiKey], default: None ) –

    Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.

  • address_names_mode (Optional[GetPlaceAddressNamesMode], default: None ) –

    Specifies how address names are returned. When set to Administrative, the service returns the official administrative names for address components. Administrative currently applies only to addresses in the United States.

Raises:

Source code in docs_src/capo_geo_places/_services/async_geo_places.py
async def get_place(
    self,
    place_id: "capo_geo_places.types.sensitive_string.SensitiveString",
    *,
    config_overrides: Optional[AsyncGeoPlacesClientConfig] = None,
    additional_features: Optional[
        "capo_geo_places.types.get_place_additional_feature_list.GetPlaceAdditionalFeatureList"
    ] = None,
    language: Optional["capo_geo_places.types.language_tag.LanguageTag"] = None,
    political_view: Optional[
        "capo_geo_places.types.country_code.CountryCode"
    ] = None,
    intended_use: Optional[
        "capo_geo_places.types.get_place_intended_use.GetPlaceIntendedUse"
    ] = None,
    key: Optional["capo_geo_places.types.api_key.ApiKey"] = None,
    address_names_mode: Optional[
        "capo_geo_places.types.get_place_address_names_mode.GetPlaceAddressNamesMode"
    ] = None,
) -> "capo_geo_places.types.get_place_response.GetPlaceResponse":
    """<p> <code>GetPlace</code> finds a place by its unique ID. A <code>PlaceId</code> is returned by other place operations.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/location/latest/developerguide/get-place.html">GetPlace</a> in the <i>Amazon Location Service Developer Guide</i>.</p>

    Args:
        place_id: <p>The <code>PlaceId</code> of the place you wish to receive the information for.</p>
        additional_features: <p> A list of optional additional parameters such as time zone that can be requested for each result. For <a href="https://docs.aws.amazon.com/location/latest/developerguide/GrabMaps.html">GrabMaps</a> customers, <code>ap-southeast-1</code> and <code>ap-southeast-5</code> regions support only the <code>TimeZone</code> value. </p>
        language: <p> A list of <a href="https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry">BCP 47</a> compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry. For <a href="https://docs.aws.amazon.com/location/latest/developerguide/GrabMaps.html">GrabMaps</a> customers, <code>ap-southeast-1</code> and <code>ap-southeast-5</code> regions support only the following codes: <code>en, id, km, lo, ms, my, pt, th, tl, vi, zh</code> </p>
        political_view: <p> The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country. Not supported in <code>ap-southeast-1</code> and <code>ap-southeast-5</code> regions for <a href="https://docs.aws.amazon.com/location/latest/developerguide/GrabMaps.html">GrabMaps</a> customers. </p>
        intended_use: <p> Indicates if the query results will be persisted in customer infrastructure. Defaults to <code>SingleUse</code> (not stored). Not supported in <code>ap-southeast-1</code> and <code>ap-southeast-5</code> regions for <a href="https://docs.aws.amazon.com/location/latest/developerguide/GrabMaps.html">GrabMaps</a> customers. </p> <note> <p>When storing <code>GetPlace</code> responses, you <i>must</i> set this field to <code>Storage</code> to comply with the terms of service. These requests will be charged at a higher rate. Please review the <a href="https://aws.amazon.com/location/sla/">user agreement</a> and <a href="https://aws.amazon.com/location/pricing/">service pricing structure</a> to determine the correct setting for your use case.</p> </note>
        key: <p>Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.</p>
        address_names_mode: <p>Specifies how address names are returned. When set to <code>Administrative</code>, the service returns the official administrative names for address components. <code>Administrative</code> currently applies only to addresses in the United States.</p>

    Raises:
        capo_geo_places.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action.</p>
        capo_geo_places.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_geo_places.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_geo_places.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_geo_places.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_geo_places.types.get_place_request.GetPlaceRequest]",
    ) -> AsyncOperationResponse[
        "capo_geo_places.types.get_place_response.GetPlaceResponse"
    ]:
        import capo_geo_places._operations.places_service.get_place

        (
            output,
            http_response,
        ) = await capo_geo_places._operations.places_service.get_place.async_get_place(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_geo_places.types.get_place_request.GetPlaceRequest",
    ) -> dict[str, Any]:
        import capo_geo_places.types.get_place_request

        return capo_geo_places.types.get_place_request.redact_sensitive(input_)

    def _redact_output(
        output: "capo_geo_places.types.get_place_response.GetPlaceResponse",
    ) -> dict[str, Any]:
        import capo_geo_places.types.get_place_response

        return capo_geo_places.types.get_place_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GetPlace", redact_input=_redact_input, redact_output=_redact_output
        ),
    )
    input_: capo_geo_places.types.get_place_request.GetPlaceRequest = {
        "place_id": place_id
    }
    if additional_features is not None:
        input_["additional_features"] = additional_features
    if language is not None:
        input_["language"] = language
    if political_view is not None:
        input_["political_view"] = political_view
    if intended_use is not None:
        input_["intended_use"] = intended_use
    if key is not None:
        input_["key"] = key
    if address_names_mode is not None:
        input_["address_names_mode"] = address_names_mode

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