Skip to content

create_hours_of_operation_override

create_hours_of_operation_override(
    instance_id: InstanceId,
    hours_of_operation_id: HoursOfOperationId,
    name: CommonHumanReadableName,
    config: HoursOfOperationOverrideConfigList,
    effective_from: HoursOfOperationOverrideYearMonthDayDateFormat,
    effective_till: HoursOfOperationOverrideYearMonthDayDateFormat,
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    description: Optional[CommonHumanReadableDescription] = None,
    recurrence_config: Optional[RecurrenceConfig] = None,
    override_type: Optional[OverrideType] = None,
) -> CreateHoursOfOperationOverrideResponse

Creates an hours of operation override in an Connect Customer hours of operation resource.

Parameters:

Raises:

Source code in docs_src/capo_connect/_services/connect.py
def create_hours_of_operation_override(
    self,
    instance_id: "capo_connect.types.instance_id.InstanceId",
    hours_of_operation_id: "capo_connect.types.hours_of_operation_id.HoursOfOperationId",
    name: "capo_connect.types.common_human_readable_name.CommonHumanReadableName",
    config: "capo_connect.types.hours_of_operation_override_config_list.HoursOfOperationOverrideConfigList",
    effective_from: "capo_connect.types.hours_of_operation_override_year_month_day_date_format.HoursOfOperationOverrideYearMonthDayDateFormat",
    effective_till: "capo_connect.types.hours_of_operation_override_year_month_day_date_format.HoursOfOperationOverrideYearMonthDayDateFormat",
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    description: Optional[
        "capo_connect.types.common_human_readable_description.CommonHumanReadableDescription"
    ] = None,
    recurrence_config: Optional[
        "capo_connect.types.recurrence_config.RecurrenceConfig"
    ] = None,
    override_type: Optional["capo_connect.types.override_type.OverrideType"] = None,
) -> "capo_connect.types.create_hours_of_operation_override_response.CreateHoursOfOperationOverrideResponse":
    """<p>Creates an hours of operation override in an Connect Customer hours of operation resource.</p>

    Args:
        instance_id: <p>The identifier of the Connect Customer instance.</p>
        hours_of_operation_id: <p>The identifier for the hours of operation</p>
        name: <p>The name of the hours of operation override.</p>
        description: <p>The description of the hours of operation override.</p>
        config: <p>Configuration information for the hours of operation override: day, start time, and end time.</p>
        effective_from: <p>The date from when the hours of operation override is effective.</p>
        effective_till: <p>The date until when the hours of operation override is effective.</p>
        recurrence_config: <p>Configuration for a recurring event.</p>
        override_type: <p>Whether the override will be defined as a <i>standard</i> or as a <i>recurring event</i>.</p> <p>For more information about how override types are applied, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/hours-of-operation-overrides.html">Build your list of overrides</a> in the <i> Administrator Guide</i>.</p>

    Raises:
        capo_connect.errors.duplicate_resource_exception.DuplicateResourceException: <p>A resource with the specified name already exists.</p>
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the specified parameters are not valid.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.limit_exceeded_exception.LimitExceededException: <p>The allowed limit for the resource has been exceeded.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_connect.types.create_hours_of_operation_override_request.CreateHoursOfOperationOverrideRequest]",
    ) -> OperationResponse[
        "capo_connect.types.create_hours_of_operation_override_response.CreateHoursOfOperationOverrideResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.create_hours_of_operation_override

        output, http_response = (
            capo_connect._operations.amazon_connect_service.create_hours_of_operation_override.create_hours_of_operation_override(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateHoursOfOperationOverride")
    )
    input_: capo_connect.types.create_hours_of_operation_override_request.CreateHoursOfOperationOverrideRequest = {
        "instance_id": instance_id,
        "hours_of_operation_id": hours_of_operation_id,
        "name": name,
        "config": config,
        "effective_from": effective_from,
        "effective_till": effective_till,
    }
    if description is not None:
        input_["description"] = description
    if recurrence_config is not None:
        input_["recurrence_config"] = recurrence_config
    if override_type is not None:
        input_["override_type"] = override_type

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