Skip to content

create_label_group async

create_label_group(
    label_group_name: LabelGroupName,
    client_token: IdempotenceToken,
    *,
    config_overrides: Optional[AsyncLookoutEquipmentClientConfig] = None,
    fault_codes: Optional[FaultCodes] = None,
    tags: Optional[TagList] = None,
) -> CreateLabelGroupResponse

Creates a group of labels.

Parameters:

  • label_group_name (LabelGroupName) –

    Names a group of labels.

    Data in this field will be retained for service usage. Follow best practices for the security of your data.

  • fault_codes (Optional[FaultCodes], default: None ) –

    The acceptable fault codes (indicating the type of anomaly associated with the label) that can be used with this label group.

    Data in this field will be retained for service usage. Follow best practices for the security of your data.

  • client_token (IdempotenceToken) –

    A unique identifier for the request to create a label group. If you do not set the client request token, Lookout for Equipment generates one.

  • tags (Optional[TagList], default: None ) –

    Tags that provide metadata about the label group you are creating.

    Data in this field will be retained for service usage. Follow best practices for the security of your data.

Raises:

  • AccessDeniedException –

    The request could not be completed because you do not have access to the resource.

  • ConflictException –

    The request could not be completed due to a conflict with the current state of the target resource.

  • InternalServerException –

    Processing of the request has failed because of an unknown error, exception or failure.

  • ServiceQuotaExceededException –

    Resource limitations have been exceeded.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy constraints specified by Amazon Lookout for Equipment or a related Amazon Web Services service that's being utilized.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_lookoutequipment/_services/async_lookout_equipment.py
async def create_label_group(
    self,
    label_group_name: "capo_lookoutequipment.types.label_group_name.LabelGroupName",
    client_token: "capo_lookoutequipment.types.idempotence_token.IdempotenceToken",
    *,
    config_overrides: Optional[AsyncLookoutEquipmentClientConfig] = None,
    fault_codes: Optional[
        "capo_lookoutequipment.types.fault_codes.FaultCodes"
    ] = None,
    tags: Optional["capo_lookoutequipment.types.tag_list.TagList"] = None,
) -> "capo_lookoutequipment.types.create_label_group_response.CreateLabelGroupResponse":
    """<p> Creates a group of labels. </p>

    Args:
        label_group_name: <p> Names a group of labels.</p> <p>Data in this field will be retained for service usage. Follow best practices for the security of your data. </p>
        fault_codes: <p> The acceptable fault codes (indicating the type of anomaly associated with the label) that can be used with this label group.</p> <p>Data in this field will be retained for service usage. Follow best practices for the security of your data.</p>
        client_token: <p> A unique identifier for the request to create a label group. If you do not set the client request token, Lookout for Equipment generates one. </p>
        tags: <p> Tags that provide metadata about the label group you are creating. </p> <p>Data in this field will be retained for service usage. Follow best practices for the security of your data.</p>

    Raises:
        capo_lookoutequipment.errors.access_denied_exception.AccessDeniedException: <p>The request could not be completed because you do not have access to the resource. </p>
        capo_lookoutequipment.errors.conflict_exception.ConflictException: <p> The request could not be completed due to a conflict with the current state of the target resource. </p>
        capo_lookoutequipment.errors.internal_server_exception.InternalServerException: <p> Processing of the request has failed because of an unknown error, exception or failure. </p>
        capo_lookoutequipment.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p> Resource limitations have been exceeded. </p>
        capo_lookoutequipment.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_lookoutequipment.errors.validation_exception.ValidationException: <p> The input fails to satisfy constraints specified by Amazon Lookout for Equipment or a related Amazon Web Services service that's being utilized. </p>
        capo_lookoutequipment.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lookoutequipment.types.create_label_group_request.CreateLabelGroupRequest]",
    ) -> AsyncOperationResponse[
        "capo_lookoutequipment.types.create_label_group_response.CreateLabelGroupResponse"
    ]:
        import capo_lookoutequipment._operations.aws_lookout_equipment_frontend_service.create_label_group

        (
            output,
            http_response,
        ) = await capo_lookoutequipment._operations.aws_lookout_equipment_frontend_service.create_label_group.async_create_label_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateLabelGroup")
    )
    input_: capo_lookoutequipment.types.create_label_group_request.CreateLabelGroupRequest = {
        "label_group_name": label_group_name,
        "client_token": client_token,
    }
    if fault_codes is not None:
        input_["fault_codes"] = fault_codes
    if tags is not None:
        input_["tags"] = tags

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