# This file was auto-generated by Fern from our API Definition.

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .publish_scheduled_shift_response import PublishScheduledShiftResponse
import pydantic
from .error import Error
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class BulkPublishScheduledShiftsResponse(UncheckedBaseModel):
    """
    Represents a [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) response.
    Either `scheduled_shifts` or `errors` is present in the response.
    """

    responses: typing.Optional[typing.Dict[str, PublishScheduledShiftResponse]] = pydantic.Field(default=None)
    """
    A map of key-value pairs that represent responses for individual publish requests.
    The order of responses might differ from the order in which the requests were provided.
    
    - Each key is the scheduled shift ID that was specified for a publish request.
    - Each value is the corresponding response. If the request succeeds, the value is the
    published scheduled shift. If the request fails, the value is an `errors` array containing
    any errors that occurred while processing the request.
    """

    errors: typing.Optional[typing.List[Error]] = pydantic.Field(default=None)
    """
    Any top-level errors that prevented the bulk operation from succeeding.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
