Skip to content

remove_thing_from_thing_group

remove_thing_from_thing_group(
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    thing_group_name: Optional[ThingGroupName] = None,
    thing_group_arn: Optional[ThingGroupArn] = None,
    thing_name: Optional[ThingName] = None,
    thing_arn: Optional[ThingArn] = None,
) -> RemoveThingFromThingGroupResponse

Remove the specified thing from the specified group.

You must specify either a thingGroupArn or a thingGroupName to identify the thing group and either a thingArn or a thingName to identify the thing to remove from the thing group.

Requires permission to access the RemoveThingFromThingGroup action.

Parameters:

Raises:

Source code in docs_src/capo_iot/_services/io_t.py
def remove_thing_from_thing_group(
    self,
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    thing_group_name: Optional[
        "capo_iot.types.thing_group_name.ThingGroupName"
    ] = None,
    thing_group_arn: Optional[
        "capo_iot.types.thing_group_arn.ThingGroupArn"
    ] = None,
    thing_name: Optional["capo_iot.types.thing_name.ThingName"] = None,
    thing_arn: Optional["capo_iot.types.thing_arn.ThingArn"] = None,
) -> "capo_iot.types.remove_thing_from_thing_group_response.RemoveThingFromThingGroupResponse":
    """<p>Remove the specified thing from the specified group.</p> <p>You must specify either a <code>thingGroupArn</code> or a <code>thingGroupName</code> to identify the thing group and either a <code>thingArn</code> or a <code>thingName</code> to identify the thing to remove from the thing group. </p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">RemoveThingFromThingGroup</a> action.</p>

    Args:
        thing_group_name: <p>The group name.</p>
        thing_group_arn: <p>The group ARN.</p>
        thing_name: <p>The name of the thing to remove from the group.</p>
        thing_arn: <p>The ARN of the thing to remove from the group.</p>

    Raises:
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</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.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot.types.remove_thing_from_thing_group_request.RemoveThingFromThingGroupRequest]",
    ) -> OperationResponse[
        "capo_iot.types.remove_thing_from_thing_group_response.RemoveThingFromThingGroupResponse"
    ]:
        import capo_iot._operations.aws_iot_service.remove_thing_from_thing_group

        output, http_response = (
            capo_iot._operations.aws_iot_service.remove_thing_from_thing_group.remove_thing_from_thing_group(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RemoveThingFromThingGroup")
    )
    input_: capo_iot.types.remove_thing_from_thing_group_request.RemoveThingFromThingGroupRequest = {}
    if thing_group_name is not None:
        input_["thing_group_name"] = thing_group_name
    if thing_group_arn is not None:
        input_["thing_group_arn"] = thing_group_arn
    if thing_name is not None:
        input_["thing_name"] = thing_name
    if thing_arn is not None:
        input_["thing_arn"] = thing_arn

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output