Skip to content

update_dynamic_thing_group async

update_dynamic_thing_group(
    thing_group_name: ThingGroupName,
    thing_group_properties: ThingGroupProperties,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    expected_version: Optional[OptionalVersion] = None,
    index_name: Optional[IndexName] = None,
    query_string: Optional[QueryString] = None,
    query_version: Optional[QueryVersion] = None,
) -> UpdateDynamicThingGroupResponse

Updates a dynamic thing group.

Requires permission to access the UpdateDynamicThingGroup action.

Parameters:

  • thing_group_name (ThingGroupName) –

    The name of the dynamic thing group to update.

  • thing_group_properties (ThingGroupProperties) –

    The dynamic thing group properties to update.

  • expected_version (Optional[OptionalVersion], default: None ) –

    The expected version of the dynamic thing group to update.

  • index_name (Optional[IndexName], default: None ) –

    The dynamic thing group index to update.

    Currently one index is supported: AWS_Things.

  • query_string (Optional[QueryString], default: None ) –

    The dynamic thing group search query string to update.

  • query_version (Optional[QueryVersion], default: None ) –

    The dynamic thing group query version to update.

    Currently one query version is supported: "2017-09-30". If not specified, the query version defaults to this value.

Raises:

Source code in docs_src/capo_iot/_services/async_io_t.py
async def update_dynamic_thing_group(
    self,
    thing_group_name: "capo_iot.types.thing_group_name.ThingGroupName",
    thing_group_properties: "capo_iot.types.thing_group_properties.ThingGroupProperties",
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    expected_version: Optional[
        "capo_iot.types.optional_version.OptionalVersion"
    ] = None,
    index_name: Optional["capo_iot.types.index_name.IndexName"] = None,
    query_string: Optional["capo_iot.types.query_string.QueryString"] = None,
    query_version: Optional["capo_iot.types.query_version.QueryVersion"] = None,
) -> "capo_iot.types.update_dynamic_thing_group_response.UpdateDynamicThingGroupResponse":
    """<p>Updates a dynamic 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">UpdateDynamicThingGroup</a> action.</p>

    Args:
        thing_group_name: <p>The name of the dynamic thing group to update.</p>
        thing_group_properties: <p>The dynamic thing group properties to update.</p>
        expected_version: <p>The expected version of the dynamic thing group to update.</p>
        index_name: <p>The dynamic thing group index to update.</p> <note> <p>Currently one index is supported: <code>AWS_Things</code>.</p> </note>
        query_string: <p>The dynamic thing group search query string to update.</p>
        query_version: <p>The dynamic thing group query version to update.</p> <note> <p>Currently one query version is supported: "2017-09-30". If not specified, the query version defaults to this value.</p> </note>

    Raises:
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_query_exception.InvalidQueryException: <p>The query is invalid.</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.version_conflict_exception.VersionConflictException: <p>An exception thrown when the version of an entity specified with the <code>expectedVersion</code> parameter does not match the latest version in the system.</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_dynamic_thing_group_request.UpdateDynamicThingGroupRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot.types.update_dynamic_thing_group_response.UpdateDynamicThingGroupResponse"
    ]:
        import capo_iot._operations.aws_iot_service.update_dynamic_thing_group

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDynamicThingGroup")
    )
    input_: capo_iot.types.update_dynamic_thing_group_request.UpdateDynamicThingGroupRequest = {
        "thing_group_name": thing_group_name,
        "thing_group_properties": thing_group_properties,
    }
    if expected_version is not None:
        input_["expected_version"] = expected_version
    if index_name is not None:
        input_["index_name"] = index_name
    if query_string is not None:
        input_["query_string"] = query_string
    if query_version is not None:
        input_["query_version"] = query_version

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