# 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] = {
    "assign_shelf_sku": ClientOperationHttpBinding(
        variants_by_type_name={
            "ShelfSkuOutput": ResponseVariantBinding(
                status_code=201,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "ServiceUnavailable": ResponseVariantBinding(
                status_code=503,
                media_type="application/json",
                header_bindings=(),
                static_headers=(("Content-Type", "application/problem+json"),),
            ),
        },
        variants_by_status={
            201: "ShelfSkuOutput",
            503: "ServiceUnavailable",
        },
    ),
    "AssignShelfSku": ClientOperationHttpBinding(
        variants_by_type_name={
            "ShelfSkuOutput": ResponseVariantBinding(
                status_code=201,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "ServiceUnavailable": ResponseVariantBinding(
                status_code=503,
                media_type="application/json",
                header_bindings=(),
                static_headers=(("Content-Type", "application/problem+json"),),
            ),
        },
        variants_by_status={
            201: "ShelfSkuOutput",
            503: "ServiceUnavailable",
        },
    ),
    "create_shelf_item": ClientOperationHttpBinding(
        variants_by_type_name={
            "ShelfItemOutput": ResponseVariantBinding(
                status_code=201,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "Conflict": ResponseVariantBinding(
                status_code=409,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "ServiceUnavailable": ResponseVariantBinding(
                status_code=503,
                media_type="application/json",
                header_bindings=(),
                static_headers=(("Content-Type", "application/problem+json"),),
            ),
        },
        variants_by_status={
            201: "ShelfItemOutput",
            409: "Conflict",
            503: "ServiceUnavailable",
        },
    ),
    "CreateShelfItem": ClientOperationHttpBinding(
        variants_by_type_name={
            "ShelfItemOutput": ResponseVariantBinding(
                status_code=201,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "Conflict": ResponseVariantBinding(
                status_code=409,
                media_type="application/json",
                header_bindings=(),
                static_headers=(),
            ),
            "ServiceUnavailable": ResponseVariantBinding(
                status_code=503,
                media_type="application/json",
                header_bindings=(),
                static_headers=(("Content-Type", "application/problem+json"),),
            ),
        },
        variants_by_status={
            201: "ShelfItemOutput",
            409: "Conflict",
            503: "ServiceUnavailable",
        },
    ),
}
