Skip to content

update_entity async

update_entity(
    workspace_id: Id,
    entity_id: EntityId,
    *,
    config_overrides: Optional[AsyncIoTTwinMakerClientConfig] = None,
    entity_name: Optional[EntityName] = None,
    description: Optional[Description] = None,
    component_updates: Optional[ComponentUpdatesMapRequest] = None,
    composite_component_updates: Optional[CompositeComponentUpdatesMapRequest] = None,
    parent_entity_update: Optional[ParentEntityUpdateRequest] = None,
) -> UpdateEntityResponse

Updates an entity.

Parameters:

  • workspace_id (Id) –

    The ID of the workspace that contains the entity.

  • entity_id (EntityId) –

    The ID of the entity.

  • entity_name (Optional[EntityName], default: None ) –

    The name of the entity.

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

    The description of the entity.

  • component_updates (Optional[ComponentUpdatesMapRequest], default: None ) –

    An object that maps strings to the component updates in the request. Each string in the mapping must be unique to this object.

  • composite_component_updates (Optional[CompositeComponentUpdatesMapRequest], default: None ) –

    This is an object that maps strings to compositeComponent updates in the request. Each key of the map represents the componentPath of the compositeComponent.

  • parent_entity_update (Optional[ParentEntityUpdateRequest], default: None ) –

    An object that describes the update request for a parent entity.

Raises:

Source code in docs_src/capo_iottwinmaker/_services/async_io_t_twin_maker.py
async def update_entity(
    self,
    workspace_id: "capo_iottwinmaker.types.id.Id",
    entity_id: "capo_iottwinmaker.types.entity_id.EntityId",
    *,
    config_overrides: Optional[AsyncIoTTwinMakerClientConfig] = None,
    entity_name: Optional["capo_iottwinmaker.types.entity_name.EntityName"] = None,
    description: Optional["capo_iottwinmaker.types.description.Description"] = None,
    component_updates: Optional[
        "capo_iottwinmaker.types.component_updates_map_request.ComponentUpdatesMapRequest"
    ] = None,
    composite_component_updates: Optional[
        "capo_iottwinmaker.types.composite_component_updates_map_request.CompositeComponentUpdatesMapRequest"
    ] = None,
    parent_entity_update: Optional[
        "capo_iottwinmaker.types.parent_entity_update_request.ParentEntityUpdateRequest"
    ] = None,
) -> "capo_iottwinmaker.types.update_entity_response.UpdateEntityResponse":
    """<p>Updates an entity.</p>

    Args:
        workspace_id: <p>The ID of the workspace that contains the entity.</p>
        entity_id: <p>The ID of the entity.</p>
        entity_name: <p>The name of the entity.</p>
        description: <p>The description of the entity.</p>
        component_updates: <p>An object that maps strings to the component updates in the request. Each string in the mapping must be unique to this object.</p>
        composite_component_updates: <p>This is an object that maps strings to <code>compositeComponent</code> updates in the request. Each key of the map represents the <code>componentPath</code> of the <code>compositeComponent</code>.</p>
        parent_entity_update: <p>An object that describes the update request for a parent entity.</p>

    Raises:
        capo_iottwinmaker.errors.access_denied_exception.AccessDeniedException: <p>Access is denied.</p>
        capo_iottwinmaker.errors.conflict_exception.ConflictException: <p>A conflict occurred.</p>
        capo_iottwinmaker.errors.internal_server_exception.InternalServerException: <p>An unexpected error has occurred.</p>
        capo_iottwinmaker.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource wasn't found.</p>
        capo_iottwinmaker.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota was exceeded.</p>
        capo_iottwinmaker.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iottwinmaker.errors.validation_exception.ValidationException: <p>Failed</p>
        capo_iottwinmaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iottwinmaker.types.update_entity_request.UpdateEntityRequest]",
    ) -> AsyncOperationResponse[
        "capo_iottwinmaker.types.update_entity_response.UpdateEntityResponse"
    ]:
        import capo_iottwinmaker._operations.aws_io_t_twin_maker.update_entity

        (
            output,
            http_response,
        ) = await capo_iottwinmaker._operations.aws_io_t_twin_maker.update_entity.async_update_entity(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateEntity")
    )
    input_: capo_iottwinmaker.types.update_entity_request.UpdateEntityRequest = {
        "workspace_id": workspace_id,
        "entity_id": entity_id,
    }
    if entity_name is not None:
        input_["entity_name"] = entity_name
    if description is not None:
        input_["description"] = description
    if component_updates is not None:
        input_["component_updates"] = component_updates
    if composite_component_updates is not None:
        input_["composite_component_updates"] = composite_component_updates
    if parent_entity_update is not None:
        input_["parent_entity_update"] = parent_entity_update

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