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

from __future__ import annotations
from ascend_sdk.models.components import (
    httpmetadata as components_httpmetadata,
    pushsubscription as components_pushsubscription,
    pushsubscriptionupdate as components_pushsubscriptionupdate,
    status as components_status,
)
from ascend_sdk.types import BaseModel
from ascend_sdk.utils import (
    FieldMetadata,
    PathParamMetadata,
    QueryParamMetadata,
    RequestMetadata,
)
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class SubscriberUpdatePushSubscriptionRequestTypedDict(TypedDict):
    subscription_id: str
    r"""The subscription id."""
    push_subscription_update: (
        components_pushsubscriptionupdate.PushSubscriptionUpdateTypedDict
    )
    update_mask: NotRequired[str]
    r"""The fields to update in subscription"""


class SubscriberUpdatePushSubscriptionRequest(BaseModel):
    subscription_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""The subscription id."""

    push_subscription_update: Annotated[
        components_pushsubscriptionupdate.PushSubscriptionUpdate,
        FieldMetadata(request=RequestMetadata(media_type="application/json")),
    ]

    update_mask: Annotated[
        Optional[str],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""The fields to update in subscription"""


class SubscriberUpdatePushSubscriptionResponseTypedDict(TypedDict):
    http_meta: components_httpmetadata.HTTPMetadataTypedDict
    push_subscription: NotRequired[
        components_pushsubscription.PushSubscriptionTypedDict
    ]
    r"""OK"""
    status: NotRequired[components_status.StatusTypedDict]
    r"""INVALID_ARGUMENT: The request was not well formed.
    FAILED_PRECONDITION: The subscription cannot be updated in its current state.
    """


class SubscriberUpdatePushSubscriptionResponse(BaseModel):
    http_meta: Annotated[
        Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True)
    ] = None

    push_subscription: Optional[components_pushsubscription.PushSubscription] = None
    r"""OK"""

    status: Optional[components_status.Status] = None
    r"""INVALID_ARGUMENT: The request was not well formed.
    FAILED_PRECONDITION: The subscription cannot be updated in its current state.
    """
