Skip to content

update_device_definition async

update_device_definition(
    device_definition_id: __string,
    *,
    config_overrides: Optional[AsyncGreengrassClientConfig] = None,
    name: Optional[__string] = None,
) -> UpdateDeviceDefinitionResponse

Updates a device definition.

Parameters:

  • device_definition_id (__string) –

    The ID of the device definition.

  • name (Optional[__string], default: None ) –

    The name of the definition.

Raises:

Source code in docs_src/capo_greengrass/_services/async_greengrass.py
async def update_device_definition(
    self,
    device_definition_id: "capo_greengrass.types.__string.__string",
    *,
    config_overrides: Optional[AsyncGreengrassClientConfig] = None,
    name: Optional["capo_greengrass.types.__string.__string"] = None,
) -> "capo_greengrass.types.update_device_definition_response.UpdateDeviceDefinitionResponse":
    """Updates a device definition.

    Args:
        device_definition_id: The ID of the device definition.
        name: The name of the definition.

    Raises:
        capo_greengrass.errors.bad_request_exception.BadRequestException: General error information.
        capo_greengrass.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_greengrass.types.update_device_definition_request.UpdateDeviceDefinitionRequest]",
    ) -> AsyncOperationResponse[
        "capo_greengrass.types.update_device_definition_response.UpdateDeviceDefinitionResponse"
    ]:
        import capo_greengrass._operations.greengrass.update_device_definition

        (
            output,
            http_response,
        ) = await capo_greengrass._operations.greengrass.update_device_definition.async_update_device_definition(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDeviceDefinition")
    )
    input_: capo_greengrass.types.update_device_definition_request.UpdateDeviceDefinitionRequest = {
        "device_definition_id": device_definition_id
    }
    if name is not None:
        input_["name"] = name

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