"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .versionheader import VersionHeader
from enum import Enum
from gusto_embedded.types import BaseModel
from gusto_embedded.utils import (
    FieldMetadata,
    HeaderMetadata,
    RequestMetadata,
    SecurityMetadata,
)
import pydantic
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class PostV1WebhookSubscriptionSecurityTypedDict(TypedDict):
    system_access_auth: str


class PostV1WebhookSubscriptionSecurity(BaseModel):
    system_access_auth: Annotated[
        str,
        FieldMetadata(
            security=SecurityMetadata(
                scheme=True,
                scheme_type="http",
                sub_type="bearer",
                field_name="Authorization",
            )
        ),
    ]


class PostV1WebhookSubscriptionSubscriptionTypes(str, Enum):
    BANK_ACCOUNT = "BankAccount"
    COMPANY = "Company"
    COMPANY_BENEFIT = "CompanyBenefit"
    CONTRACTOR = "Contractor"
    CONTRACTOR_PAYMENT = "ContractorPayment"
    EMPLOYEE = "Employee"
    EMPLOYEE_BENEFIT = "EmployeeBenefit"
    EMPLOYEE_JOB_COMPENSATION = "EmployeeJobCompensation"
    EXTERNAL_PAYROLL = "ExternalPayroll"
    FORM = "Form"
    LOCATION = "Location"
    NOTIFICATION = "Notification"
    PAYROLL = "Payroll"
    PAY_SCHEDULE = "PaySchedule"
    SIGNATORY = "Signatory"


class PostV1WebhookSubscriptionRequestBodyTypedDict(TypedDict):
    url: str
    subscription_types: List[PostV1WebhookSubscriptionSubscriptionTypes]


class PostV1WebhookSubscriptionRequestBody(BaseModel):
    url: str

    subscription_types: List[PostV1WebhookSubscriptionSubscriptionTypes]


class PostV1WebhookSubscriptionRequestTypedDict(TypedDict):
    request_body: PostV1WebhookSubscriptionRequestBodyTypedDict
    x_gusto_api_version: NotRequired[VersionHeader]
    r"""Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used."""


class PostV1WebhookSubscriptionRequest(BaseModel):
    request_body: Annotated[
        PostV1WebhookSubscriptionRequestBody,
        FieldMetadata(request=RequestMetadata(media_type="application/json")),
    ]

    x_gusto_api_version: Annotated[
        Optional[VersionHeader],
        pydantic.Field(alias="X-Gusto-API-Version"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = VersionHeader.TWO_THOUSAND_AND_TWENTY_FOUR_04_01
    r"""Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used."""
