"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from __future__ import annotations
import dataclasses
import requests as requests_http
from ...models.shared import pricingcalculatorservices as shared_pricingcalculatorservices
from dataclasses_json import Undefined, dataclass_json
from leonardoaisdk import utils
from typing import Optional


@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class PricingCalculatorObject:
    r"""Parameters for FANTASY_AVATAR_GENERATION service"""
    image_height: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('imageHeight'), 'exclude': lambda f: f is None }})
    r"""The input height of the images. Must be between 32 and 1024 and be a multiple of 8. Note: Input resolution is not always the same as output resolution due to upscaling from other features"""
    image_width: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('imageWidth'), 'exclude': lambda f: f is None }})
    r"""The input height of the images. Must be between 32 and 1024 and be a multiple of 8. Note: Input resolution is not always the same as output resolution due to upscaling from other features"""
    num_images: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('numImages'), 'exclude': lambda f: f is None }})
    r"""The number of images to generate. Must be between 1 and 8. If either width or height is over 768, must be between 1 and 4."""
    



@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class PricingCalculatorPricingCalculatorObject:
    r"""Parameters for IMAGE_GENERATION service"""
    UNSET='__SPEAKEASY_UNSET__'
    alchemy_mode: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('alchemyMode'), 'exclude': lambda f: f is None }})
    r"""Enable to use Alchemy."""
    controlnets_cost: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('controlnetsCost'), 'exclude': lambda f: f is PricingCalculatorPricingCalculatorObject.UNSET }})
    r"""The total cost of controlnets input."""
    high_resolution: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('highResolution'), 'exclude': lambda f: f is None }})
    r"""Enable to use high resolution."""
    image_height: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('imageHeight'), 'exclude': lambda f: f is None }})
    r"""The input height of the images. Must be between 32 and 1024 and be a multiple of 8. Note: Input resolution is not always the same as output resolution due to upscaling from other features"""
    image_width: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('imageWidth'), 'exclude': lambda f: f is None }})
    r"""The input height of the images. Must be between 32 and 1024 and be a multiple of 8. Note: Input resolution is not always the same as output resolution due to upscaling from other features"""
    inference_steps: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('inferenceSteps'), 'exclude': lambda f: f is None }})
    r"""The Step Count to use for the generation. Must be between 10 and 60."""
    is_model_custom: Optional[bool] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isModelCustom'), 'exclude': lambda f: f is PricingCalculatorPricingCalculatorObject.UNSET }})
    r"""Enable to use custom model."""
    is_sdxl: Optional[bool] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isSDXL'), 'exclude': lambda f: f is PricingCalculatorPricingCalculatorObject.UNSET }})
    r"""Enable to use SDXL model."""
    is_sdxl_lightning: Optional[bool] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isSDXLLightning'), 'exclude': lambda f: f is PricingCalculatorPricingCalculatorObject.UNSET }})
    r"""Enable to use SDXL Lightning model."""
    lora_count: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('loraCount'), 'exclude': lambda f: f is PricingCalculatorPricingCalculatorObject.UNSET }})
    r"""The number of elements used for the generation."""
    num_images: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('numImages'), 'exclude': lambda f: f is None }})
    r"""The number of images to generate. Must be between 1 and 8. If either width or height is over 768, must be between 1 and 4."""
    prompt_magic: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('promptMagic'), 'exclude': lambda f: f is None }})
    r"""Enable to use prompt magic."""
    prompt_magic_strength: Optional[float] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('promptMagicStrength'), 'exclude': lambda f: f is PricingCalculatorPricingCalculatorObject.UNSET }})
    r"""Strength of prompt magic. Must be a float between 0.1 and 1.0"""
    prompt_magic_strength_arg: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('promptMagicStrengthArg'), 'exclude': lambda f: f is PricingCalculatorPricingCalculatorObject.UNSET }})
    r"""Strength of prompt magic."""
    



@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class PricingCalculatorPricingCalculatorRequestObject:
    r"""Parameters for LCM_GENERATION service"""
    UNSET='__SPEAKEASY_UNSET__'
    height: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('height'), 'exclude': lambda f: f is PricingCalculatorPricingCalculatorRequestObject.UNSET }})
    r"""The output height of the image. Must be 512, 640 or 1024."""
    instant_refine: Optional[bool] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('instantRefine'), 'exclude': lambda f: f is PricingCalculatorPricingCalculatorRequestObject.UNSET }})
    r"""Enable for instant upscale"""
    refine: Optional[bool] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('refine'), 'exclude': lambda f: f is PricingCalculatorPricingCalculatorRequestObject.UNSET }})
    r"""Enable for normal alchemy upscale"""
    width: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('width'), 'exclude': lambda f: f is PricingCalculatorPricingCalculatorRequestObject.UNSET }})
    r"""The output width of the image. Must be 512, 640 or 1024."""
    



@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class PricingCalculatorPricingCalculatorRequestRequestBodyObject:
    r"""Parameters for MODEL_TRAINING service"""
    resolution: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('resolution'), 'exclude': lambda f: f is None }})
    r"""The resolution for training. Must be 512 or 768."""
    



@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class PricingCalculatorPricingCalculatorRequestRequestBodyServiceParamsObject:
    r"""Parameters for MOTION_GENERATION service"""
    duration_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('durationSeconds'), 'exclude': lambda f: f is None }})
    r"""The total duration of the motion generation in seconds."""
    



@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class PricingCalculatorPricingCalculatorRequestRequestBodyServiceParamsTEXTUREGENERATIONObject:
    r"""Parameters for TEXTURE_GENERATION service"""
    preview: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('preview'), 'exclude': lambda f: f is None }})
    



@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class PricingCalculatorPricingCalculatorRequestRequestBodyServiceParamsUNIVERSALUPSCALERObject:
    r"""Parameters for UNIVERSAL_UPSCALER service"""
    megapixel: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('megapixel'), 'exclude': lambda f: f is None }})
    r"""The maximum upscaled image size is 20 megapixels."""
    



@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class Object:
    r"""Parameters for the service"""
    UNSET='__SPEAKEASY_UNSET__'
    fantasy_avatar_generation: Optional[PricingCalculatorObject] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('FANTASY_AVATAR_GENERATION'), 'exclude': lambda f: f is Object.UNSET }})
    r"""Parameters for FANTASY_AVATAR_GENERATION service"""
    image_generation: Optional[PricingCalculatorPricingCalculatorObject] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('IMAGE_GENERATION'), 'exclude': lambda f: f is Object.UNSET }})
    r"""Parameters for IMAGE_GENERATION service"""
    lcm_generation: Optional[PricingCalculatorPricingCalculatorRequestObject] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('LCM_GENERATION'), 'exclude': lambda f: f is Object.UNSET }})
    r"""Parameters for LCM_GENERATION service"""
    model_training: Optional[PricingCalculatorPricingCalculatorRequestRequestBodyObject] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('MODEL_TRAINING'), 'exclude': lambda f: f is Object.UNSET }})
    r"""Parameters for MODEL_TRAINING service"""
    motion_generation: Optional[PricingCalculatorPricingCalculatorRequestRequestBodyServiceParamsObject] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('MOTION_GENERATION'), 'exclude': lambda f: f is Object.UNSET }})
    r"""Parameters for MOTION_GENERATION service"""
    texture_generation: Optional[PricingCalculatorPricingCalculatorRequestRequestBodyServiceParamsTEXTUREGENERATIONObject] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('TEXTURE_GENERATION'), 'exclude': lambda f: f is Object.UNSET }})
    r"""Parameters for TEXTURE_GENERATION service"""
    universal_upscaler: Optional[PricingCalculatorPricingCalculatorRequestRequestBodyServiceParamsUNIVERSALUPSCALERObject] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('UNIVERSAL_UPSCALER'), 'exclude': lambda f: f is Object.UNSET }})
    r"""Parameters for UNIVERSAL_UPSCALER service"""
    



@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class PricingCalculatorRequestBody:
    service: Optional[shared_pricingcalculatorservices.PricingCalculatorServices] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('service'), 'exclude': lambda f: f is None }})
    r"""The services to be chosen for calculating the API credit cost."""
    service_params: Optional[Object] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('serviceParams'), 'exclude': lambda f: f is None }})
    r"""Parameters for the service"""
    



@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class CalculateProductionAPIServiceCost:
    cost: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cost'), 'exclude': lambda f: f is None }})
    r"""API service cost to generate the image."""
    



@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclasses.dataclass
class PricingCalculatorResponseBody:
    r"""Responses for POST /pricing-calculator"""
    UNSET='__SPEAKEASY_UNSET__'
    calculate_production_api_service_cost: Optional[CalculateProductionAPIServiceCost] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('calculateProductionApiServiceCost'), 'exclude': lambda f: f is PricingCalculatorResponseBody.UNSET }})
    



@dataclasses.dataclass
class PricingCalculatorResponse:
    content_type: str = dataclasses.field()
    r"""HTTP response content type for this operation"""
    status_code: int = dataclasses.field()
    r"""HTTP response status code for this operation"""
    raw_response: requests_http.Response = dataclasses.field()
    r"""Raw HTTP response; suitable for custom response parsing"""
    object: Optional[PricingCalculatorResponseBody] = dataclasses.field(default=None)
    r"""Responses for POST /pricing-calculator"""
    

