Skip to content

update_command async

update_command(
    command_id: CommandId,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    display_name: Optional[DisplayName] = None,
    description: Optional[CommandDescription] = None,
    deprecated: Optional[DeprecationFlag] = None,
) -> UpdateCommandResponse

Update information about a command or mark a command for deprecation.

Parameters:

  • command_id (CommandId) –

    The unique identifier of the command to be updated.

  • display_name (Optional[DisplayName], default: None ) –

    The new user-friendly name to use in the console for the command.

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

    A short text description of the command.

  • deprecated (Optional[DeprecationFlag], default: None ) –

    A boolean that you can use to specify whether to deprecate a command.

Raises:

Source code in docs_src/capo_iot/_services/async_io_t.py
async def update_command(
    self,
    command_id: "capo_iot.types.command_id.CommandId",
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    display_name: Optional["capo_iot.types.display_name.DisplayName"] = None,
    description: Optional[
        "capo_iot.types.command_description.CommandDescription"
    ] = None,
    deprecated: Optional["capo_iot.types.deprecation_flag.DeprecationFlag"] = None,
) -> "capo_iot.types.update_command_response.UpdateCommandResponse":
    """<p>Update information about a command or mark a command for deprecation.</p>

    Args:
        command_id: <p>The unique identifier of the command to be updated.</p>
        display_name: <p>The new user-friendly name to use in the console for the command.</p>
        description: <p>A short text description of the command.</p>
        deprecated: <p>A boolean that you can use to specify whether to deprecate a command.</p>

    Raises:
        capo_iot.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
        capo_iot.errors.internal_server_exception.InternalServerException: <p>Internal error from the service that indicates an unexpected error or that the service is unavailable.</p>
        capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.validation_exception.ValidationException: <p>The request is not valid.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot.types.update_command_request.UpdateCommandRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot.types.update_command_response.UpdateCommandResponse"
    ]:
        import capo_iot._operations.aws_iot_service.update_command

        (
            output,
            http_response,
        ) = await capo_iot._operations.aws_iot_service.update_command.async_update_command(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateCommand")
    )
    input_: capo_iot.types.update_command_request.UpdateCommandRequest = {
        "command_id": command_id
    }
    if display_name is not None:
        input_["display_name"] = display_name
    if description is not None:
        input_["description"] = description
    if deprecated is not None:
        input_["deprecated"] = deprecated

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