Skip to content

create_field

create_field(
    domain_id: DomainId,
    name: FieldName,
    type: FieldType,
    *,
    config_overrides: Optional[ConnectCasesClientConfig] = None,
    description: Optional[FieldDescription] = None,
    attributes: Optional[FieldAttributes] = None,
) -> CreateFieldResponse

Creates a field in the Cases domain. This field is used to define the case object model (that is, defines what data can be captured on cases) in a Cases domain.

Parameters:

  • domain_id (DomainId) –

    The unique identifier of the Cases domain.

  • name (FieldName) –

    The name of the field.

  • type (FieldType) –

    Defines the data type, some system constraints, and default display of the field.

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

    The description of the field.

  • attributes (Optional[FieldAttributes], default: None ) –

    Union of field attributes.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.

  • InternalServerException –

    We couldn't process your request because of an issue with the server. Try again later.

  • ResourceNotFoundException –

    We couldn't find the requested resource. Check that your resources exists and were created in the same Amazon Web Services Region as your request, and try your request again.

  • ServiceQuotaExceededException –

    The service quota has been exceeded. For a list of service quotas, see Amazon Connect Service Quotas in the Amazon Connect Administrator Guide.

  • ThrottlingException –

    The rate has been exceeded for this API. Please try again after a few minutes.

  • ValidationException –

    The request isn't valid. Check the syntax and try again.

  • UnknownServiceError –

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

Source code in docs_src/capo_connectcases/_services/connect_cases.py
def create_field(
    self,
    domain_id: "capo_connectcases.types.domain_id.DomainId",
    name: "capo_connectcases.types.field_name.FieldName",
    type: "capo_connectcases.types.field_type.FieldType",
    *,
    config_overrides: Optional[ConnectCasesClientConfig] = None,
    description: Optional[
        "capo_connectcases.types.field_description.FieldDescription"
    ] = None,
    attributes: Optional[
        "capo_connectcases.types.field_attributes.FieldAttributes"
    ] = None,
) -> "capo_connectcases.types.create_field_response.CreateFieldResponse":
    """<p>Creates a field in the Cases domain. This field is used to define the case object model (that is, defines what data can be captured on cases) in a Cases domain. </p>

    Args:
        domain_id: <p>The unique identifier of the Cases domain. </p>
        name: <p>The name of the field.</p>
        type: <p>Defines the data type, some system constraints, and default display of the field.</p>
        description: <p>The description of the field.</p>
        attributes: <p>Union of field attributes.</p>

    Raises:
        capo_connectcases.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_connectcases.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.</p>
        capo_connectcases.errors.internal_server_exception.InternalServerException: <p>We couldn't process your request because of an issue with the server. Try again later.</p>
        capo_connectcases.errors.resource_not_found_exception.ResourceNotFoundException: <p>We couldn't find the requested resource. Check that your resources exists and were created in the same Amazon Web Services Region as your request, and try your request again.</p>
        capo_connectcases.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded. For a list of service quotas, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html">Amazon Connect Service Quotas</a> in the <i>Amazon Connect Administrator Guide</i>.</p>
        capo_connectcases.errors.throttling_exception.ThrottlingException: <p>The rate has been exceeded for this API. Please try again after a few minutes.</p>
        capo_connectcases.errors.validation_exception.ValidationException: <p>The request isn't valid. Check the syntax and try again.</p>
        capo_connectcases.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_connectcases.types.create_field_request.CreateFieldRequest]",
    ) -> OperationResponse[
        "capo_connectcases.types.create_field_response.CreateFieldResponse"
    ]:
        import capo_connectcases._operations.amazon_connect_cases.create_field

        output, http_response = (
            capo_connectcases._operations.amazon_connect_cases.create_field.create_field(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateField")
    )
    input_: capo_connectcases.types.create_field_request.CreateFieldRequest = {
        "domain_id": domain_id,
        "name": name,
        "type": type,
    }
    if description is not None:
        input_["description"] = description
    if attributes is not None:
        input_["attributes"] = attributes

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