Skip to content

update_component_type async

update_component_type(
    workspace_id: Id,
    component_type_id: ComponentTypeId,
    *,
    config_overrides: Optional[AsyncIoTTwinMakerClientConfig] = None,
    is_singleton: Optional[Boolean] = None,
    description: Optional[Description] = None,
    property_definitions: Optional[PropertyDefinitionsRequest] = None,
    extends_from: Optional[ExtendsFrom] = None,
    functions: Optional[FunctionsRequest] = None,
    property_groups: Optional[PropertyGroupsRequest] = None,
    component_type_name: Optional[ComponentTypeName] = None,
    composite_component_types: Optional[CompositeComponentTypesRequest] = None,
) -> UpdateComponentTypeResponse

Updates information in a component type.

Parameters:

  • workspace_id (Id) –

    The ID of the workspace.

  • is_singleton (Optional[Boolean], default: None ) –

    A Boolean value that specifies whether an entity can have more than one component of this type.

  • component_type_id (ComponentTypeId) –

    The ID of the component type.

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

    The description of the component type.

  • property_definitions (Optional[PropertyDefinitionsRequest], default: None ) –

    An object that maps strings to the property definitions in the component type. Each string in the mapping must be unique to this object.

  • extends_from (Optional[ExtendsFrom], default: None ) –

    Specifies the component type that this component type extends.

  • functions (Optional[FunctionsRequest], default: None ) –

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

  • property_groups (Optional[PropertyGroupsRequest], default: None ) –

    The property groups.

  • component_type_name (Optional[ComponentTypeName], default: None ) –

    The component type name.

  • composite_component_types (Optional[CompositeComponentTypesRequest], default: None ) –

    This is an object that maps strings to compositeComponentTypes of the componentType. CompositeComponentType is referenced by componentTypeId.

Raises:

Source code in docs_src/capo_iottwinmaker/_services/async_io_t_twin_maker.py
async def update_component_type(
    self,
    workspace_id: "capo_iottwinmaker.types.id.Id",
    component_type_id: "capo_iottwinmaker.types.component_type_id.ComponentTypeId",
    *,
    config_overrides: Optional[AsyncIoTTwinMakerClientConfig] = None,
    is_singleton: Optional["capo_iottwinmaker.types.boolean.Boolean"] = None,
    description: Optional["capo_iottwinmaker.types.description.Description"] = None,
    property_definitions: Optional[
        "capo_iottwinmaker.types.property_definitions_request.PropertyDefinitionsRequest"
    ] = None,
    extends_from: Optional[
        "capo_iottwinmaker.types.extends_from.ExtendsFrom"
    ] = None,
    functions: Optional[
        "capo_iottwinmaker.types.functions_request.FunctionsRequest"
    ] = None,
    property_groups: Optional[
        "capo_iottwinmaker.types.property_groups_request.PropertyGroupsRequest"
    ] = None,
    component_type_name: Optional[
        "capo_iottwinmaker.types.component_type_name.ComponentTypeName"
    ] = None,
    composite_component_types: Optional[
        "capo_iottwinmaker.types.composite_component_types_request.CompositeComponentTypesRequest"
    ] = None,
) -> "capo_iottwinmaker.types.update_component_type_response.UpdateComponentTypeResponse":
    """<p>Updates information in a component type.</p>

    Args:
        workspace_id: <p>The ID of the workspace.</p>
        is_singleton: <p>A Boolean value that specifies whether an entity can have more than one component of this type.</p>
        component_type_id: <p>The ID of the component type.</p>
        description: <p>The description of the component type.</p>
        property_definitions: <p>An object that maps strings to the property definitions in the component type. Each string in the mapping must be unique to this object.</p>
        extends_from: <p>Specifies the component type that this component type extends.</p>
        functions: <p>An object that maps strings to the functions in the component type. Each string in the mapping must be unique to this object.</p>
        property_groups: <p>The property groups.</p>
        component_type_name: <p>The component type name.</p>
        composite_component_types: <p>This is an object that maps strings to <code>compositeComponentTypes</code> of the <code>componentType</code>. <code>CompositeComponentType</code> is referenced by <code>componentTypeId</code>.</p>

    Raises:
        capo_iottwinmaker.errors.access_denied_exception.AccessDeniedException: <p>Access is denied.</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_component_type_request.UpdateComponentTypeRequest]",
    ) -> AsyncOperationResponse[
        "capo_iottwinmaker.types.update_component_type_response.UpdateComponentTypeResponse"
    ]:
        import capo_iottwinmaker._operations.aws_io_t_twin_maker.update_component_type

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateComponentType")
    )
    input_: capo_iottwinmaker.types.update_component_type_request.UpdateComponentTypeRequest = {
        "workspace_id": workspace_id,
        "component_type_id": component_type_id,
    }
    if is_singleton is not None:
        input_["is_singleton"] = is_singleton
    if description is not None:
        input_["description"] = description
    if property_definitions is not None:
        input_["property_definitions"] = property_definitions
    if extends_from is not None:
        input_["extends_from"] = extends_from
    if functions is not None:
        input_["functions"] = functions
    if property_groups is not None:
        input_["property_groups"] = property_groups
    if component_type_name is not None:
        input_["component_type_name"] = component_type_name
    if composite_component_types is not None:
        input_["composite_component_types"] = composite_component_types

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