# Generated by smithplates HTTP codegen. Do not edit.

from __future__ import annotations

from dataclasses import dataclass


@dataclass(frozen=True)
class ResponseVariantBinding:
    status_code: int
    media_type: str | None
    header_bindings: tuple[tuple[str, str], ...]
    static_headers: tuple[tuple[str, str], ...]


@dataclass(frozen=True)
class ClientOperationHttpBinding:
    variants_by_type_name: dict[str, ResponseVariantBinding]
    variants_by_status: dict[int, str]

    def variant_for_status(self, status_code: int) -> ResponseVariantBinding:
        type_name = self.variants_by_status.get(status_code)
        if type_name is None:
            msg = f"No HTTP binding registered for response status {status_code}"
            raise KeyError(msg)
        binding = self.variants_by_type_name.get(type_name)
        if binding is None:
            msg = f"No HTTP binding registered for response type {type_name!r}"
            raise KeyError(msg)
        return binding

    def type_name_for_status(self, status_code: int) -> str:
        type_name = self.variants_by_status.get(status_code)
        if type_name is None:
            msg = f"No HTTP binding registered for response status {status_code}"
            raise KeyError(msg)
        return type_name


OPERATION_HTTP_BINDINGS: dict[str, ClientOperationHttpBinding] = {
    "get_category": ClientOperationHttpBinding(
        variants_by_type_name={
            "GetCategoryOutput": ResponseVariantBinding(
                status_code=200,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "CategoryNotFound": ResponseVariantBinding(
                status_code=404,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            200: "GetCategoryOutput",
            404: "CategoryNotFound",
        },
    ),
    "GetCategory": ClientOperationHttpBinding(
        variants_by_type_name={
            "GetCategoryOutput": ResponseVariantBinding(
                status_code=200,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "CategoryNotFound": ResponseVariantBinding(
                status_code=404,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            200: "GetCategoryOutput",
            404: "CategoryNotFound",
        },
    ),
    "health_check": ClientOperationHttpBinding(
        variants_by_type_name={
            "HealthCheckOutput": ResponseVariantBinding(
                status_code=200,
                media_type="application/json",
                header_bindings=(),
                static_headers=(("Cache-Control", "no-store"),),
            ),
        },
        variants_by_status={
            200: "HealthCheckOutput",
        },
    ),
    "HealthCheck": ClientOperationHttpBinding(
        variants_by_type_name={
            "HealthCheckOutput": ResponseVariantBinding(
                status_code=200,
                media_type="application/json",
                header_bindings=(),
                static_headers=(("Cache-Control", "no-store"),),
            ),
        },
        variants_by_status={
            200: "HealthCheckOutput",
        },
    ),
    "get_order": ClientOperationHttpBinding(
        variants_by_type_name={
            "GetOrderOutput": ResponseVariantBinding(
                status_code=200,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "OrderNotFound": ResponseVariantBinding(
                status_code=404,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            200: "GetOrderOutput",
            404: "OrderNotFound",
        },
    ),
    "GetOrder": ClientOperationHttpBinding(
        variants_by_type_name={
            "GetOrderOutput": ResponseVariantBinding(
                status_code=200,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "OrderNotFound": ResponseVariantBinding(
                status_code=404,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            200: "GetOrderOutput",
            404: "OrderNotFound",
        },
    ),
    "place_order": ClientOperationHttpBinding(
        variants_by_type_name={
            "PlaceOrderOutput": ResponseVariantBinding(
                status_code=201,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "ValidationError": ResponseVariantBinding(
                status_code=400,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            201: "PlaceOrderOutput",
            400: "ValidationError",
        },
    ),
    "PlaceOrder": ClientOperationHttpBinding(
        variants_by_type_name={
            "PlaceOrderOutput": ResponseVariantBinding(
                status_code=201,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "ValidationError": ResponseVariantBinding(
                status_code=400,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            201: "PlaceOrderOutput",
            400: "ValidationError",
        },
    ),
    "create_pet": ClientOperationHttpBinding(
        variants_by_type_name={
            "CreatePetOutput": ResponseVariantBinding(
                status_code=201,
                media_type="application/json",
                header_bindings=(("etag", "ETag"),),
                static_headers=(),
            ),
            "ValidationError": ResponseVariantBinding(
                status_code=400,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            201: "CreatePetOutput",
            400: "ValidationError",
        },
    ),
    "CreatePet": ClientOperationHttpBinding(
        variants_by_type_name={
            "CreatePetOutput": ResponseVariantBinding(
                status_code=201,
                media_type="application/json",
                header_bindings=(("etag", "ETag"),),
                static_headers=(),
            ),
            "ValidationError": ResponseVariantBinding(
                status_code=400,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            201: "CreatePetOutput",
            400: "ValidationError",
        },
    ),
    "delete_pet": ClientOperationHttpBinding(
        variants_by_type_name={
            "__empty__": ResponseVariantBinding(
                status_code=204,
                media_type=None,
                header_bindings=(),
                static_headers=(),
            ),
            "PetNotFound": ResponseVariantBinding(
                status_code=404,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            204: "__empty__",
            404: "PetNotFound",
        },
    ),
    "DeletePet": ClientOperationHttpBinding(
        variants_by_type_name={
            "__empty__": ResponseVariantBinding(
                status_code=204,
                media_type=None,
                header_bindings=(),
                static_headers=(),
            ),
            "PetNotFound": ResponseVariantBinding(
                status_code=404,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            204: "__empty__",
            404: "PetNotFound",
        },
    ),
    "get_pet": ClientOperationHttpBinding(
        variants_by_type_name={
            "GetPetOutput": ResponseVariantBinding(
                status_code=200,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "PetNotFound": ResponseVariantBinding(
                status_code=404,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            200: "GetPetOutput",
            404: "PetNotFound",
        },
    ),
    "GetPet": ClientOperationHttpBinding(
        variants_by_type_name={
            "GetPetOutput": ResponseVariantBinding(
                status_code=200,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "PetNotFound": ResponseVariantBinding(
                status_code=404,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            200: "GetPetOutput",
            404: "PetNotFound",
        },
    ),
    "pet_events": ClientOperationHttpBinding(
        variants_by_type_name={
            "PetEventsOutput": ResponseVariantBinding(
                status_code=200,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            200: "PetEventsOutput",
        },
    ),
    "PetEvents": ClientOperationHttpBinding(
        variants_by_type_name={
            "PetEventsOutput": ResponseVariantBinding(
                status_code=200,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            200: "PetEventsOutput",
        },
    ),
    "resolve_pet_location": ClientOperationHttpBinding(
        variants_by_type_name={
            "PetLocationRedirect": ResponseVariantBinding(
                status_code=302,
                media_type=None,
                header_bindings=(("url", "Location"),),
                static_headers=(),
            ),
            "PetNotFound": ResponseVariantBinding(
                status_code=404,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            302: "PetLocationRedirect",
            404: "PetNotFound",
        },
    ),
    "ResolvePetLocation": ClientOperationHttpBinding(
        variants_by_type_name={
            "PetLocationRedirect": ResponseVariantBinding(
                status_code=302,
                media_type=None,
                header_bindings=(("url", "Location"),),
                static_headers=(),
            ),
            "PetNotFound": ResponseVariantBinding(
                status_code=404,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            302: "PetLocationRedirect",
            404: "PetNotFound",
        },
    ),
    "update_pet": ClientOperationHttpBinding(
        variants_by_type_name={
            "UpdatePetOutput": ResponseVariantBinding(
                status_code=200,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "PetNotFound": ResponseVariantBinding(
                status_code=404,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "ValidationError": ResponseVariantBinding(
                status_code=400,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            200: "UpdatePetOutput",
            404: "PetNotFound",
            400: "ValidationError",
        },
    ),
    "UpdatePet": ClientOperationHttpBinding(
        variants_by_type_name={
            "UpdatePetOutput": ResponseVariantBinding(
                status_code=200,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "PetNotFound": ResponseVariantBinding(
                status_code=404,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "ValidationError": ResponseVariantBinding(
                status_code=400,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
        },
        variants_by_status={
            200: "UpdatePetOutput",
            404: "PetNotFound",
            400: "ValidationError",
        },
    ),
}
