from datetime import date, datetime  # noqa: F401
from typing import Dict, List  # noqa: F401

from timestep.api.openai.v1 import util
from timestep.api.openai.v1.models.base_model import Model
from timestep.api.openai.v1.models.create_image_request_model import \
    CreateImageRequestModel  # noqa: E501


class CreateImageRequest(Model):
    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

    Do not edit the class manually.
    """

    def __init__(self, prompt=None, model=None, n=1, quality='standard', response_format='url', size='1024x1024', style='vivid', user=None):  # noqa: E501
        """CreateImageRequest - a model defined in OpenAPI

        :param prompt: The prompt of this CreateImageRequest.  # noqa: E501
        :type prompt: str
        :param model: The model of this CreateImageRequest.  # noqa: E501
        :type model: CreateImageRequestModel
        :param n: The n of this CreateImageRequest.  # noqa: E501
        :type n: int
        :param quality: The quality of this CreateImageRequest.  # noqa: E501
        :type quality: str
        :param response_format: The response_format of this CreateImageRequest.  # noqa: E501
        :type response_format: str
        :param size: The size of this CreateImageRequest.  # noqa: E501
        :type size: str
        :param style: The style of this CreateImageRequest.  # noqa: E501
        :type style: str
        :param user: The user of this CreateImageRequest.  # noqa: E501
        :type user: str
        """
        self.openapi_types = {
            'prompt': str,
            'model': CreateImageRequestModel,
            'n': int,
            'quality': str,
            'response_format': str,
            'size': str,
            'style': str,
            'user': str
        }

        self.attribute_map = {
            'prompt': 'prompt',
            'model': 'model',
            'n': 'n',
            'quality': 'quality',
            'response_format': 'response_format',
            'size': 'size',
            'style': 'style',
            'user': 'user'
        }

        self._prompt = prompt
        self._model = model
        self._n = n
        self._quality = quality
        self._response_format = response_format
        self._size = size
        self._style = style
        self._user = user

    @classmethod
    def from_dict(cls, dikt) -> 'CreateImageRequest':
        """Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The CreateImageRequest of this CreateImageRequest.  # noqa: E501
        :rtype: CreateImageRequest
        """
        return util.deserialize_model(dikt, cls)

    @property
    def prompt(self) -> str:
        """Gets the prompt of this CreateImageRequest.

        A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.  # noqa: E501

        :return: The prompt of this CreateImageRequest.
        :rtype: str
        """
        return self._prompt

    @prompt.setter
    def prompt(self, prompt: str):
        """Sets the prompt of this CreateImageRequest.

        A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`.  # noqa: E501

        :param prompt: The prompt of this CreateImageRequest.
        :type prompt: str
        """
        if prompt is None:
            raise ValueError("Invalid value for `prompt`, must not be `None`")  # noqa: E501

        self._prompt = prompt

    @property
    def model(self) -> CreateImageRequestModel:
        """Gets the model of this CreateImageRequest.


        :return: The model of this CreateImageRequest.
        :rtype: CreateImageRequestModel
        """
        return self._model

    @model.setter
    def model(self, model: CreateImageRequestModel):
        """Sets the model of this CreateImageRequest.


        :param model: The model of this CreateImageRequest.
        :type model: CreateImageRequestModel
        """

        self._model = model

    @property
    def n(self) -> int:
        """Gets the n of this CreateImageRequest.

        The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.  # noqa: E501

        :return: The n of this CreateImageRequest.
        :rtype: int
        """
        return self._n

    @n.setter
    def n(self, n: int):
        """Sets the n of this CreateImageRequest.

        The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.  # noqa: E501

        :param n: The n of this CreateImageRequest.
        :type n: int
        """
        if n is not None and n > 10:  # noqa: E501
            raise ValueError("Invalid value for `n`, must be a value less than or equal to `10`")  # noqa: E501
        if n is not None and n < 1:  # noqa: E501
            raise ValueError("Invalid value for `n`, must be a value greater than or equal to `1`")  # noqa: E501

        self._n = n

    @property
    def quality(self) -> str:
        """Gets the quality of this CreateImageRequest.

        The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`.  # noqa: E501

        :return: The quality of this CreateImageRequest.
        :rtype: str
        """
        return self._quality

    @quality.setter
    def quality(self, quality: str):
        """Sets the quality of this CreateImageRequest.

        The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image. This param is only supported for `dall-e-3`.  # noqa: E501

        :param quality: The quality of this CreateImageRequest.
        :type quality: str
        """
        allowed_values = ["standard", "hd"]  # noqa: E501
        if quality not in allowed_values:
            raise ValueError(
                "Invalid value for `quality` ({0}), must be one of {1}"
                .format(quality, allowed_values)
            )

        self._quality = quality

    @property
    def response_format(self) -> str:
        """Gets the response_format of this CreateImageRequest.

        The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.  # noqa: E501

        :return: The response_format of this CreateImageRequest.
        :rtype: str
        """
        return self._response_format

    @response_format.setter
    def response_format(self, response_format: str):
        """Sets the response_format of this CreateImageRequest.

        The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.  # noqa: E501

        :param response_format: The response_format of this CreateImageRequest.
        :type response_format: str
        """
        allowed_values = [None,"url", "b64_json"]  # noqa: E501
        if response_format not in allowed_values:
            raise ValueError(
                "Invalid value for `response_format` ({0}), must be one of {1}"
                .format(response_format, allowed_values)
            )

        self._response_format = response_format

    @property
    def size(self) -> str:
        """Gets the size of this CreateImageRequest.

        The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models.  # noqa: E501

        :return: The size of this CreateImageRequest.
        :rtype: str
        """
        return self._size

    @size.setter
    def size(self, size: str):
        """Sets the size of this CreateImageRequest.

        The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models.  # noqa: E501

        :param size: The size of this CreateImageRequest.
        :type size: str
        """
        allowed_values = [None,"256x256", "512x512", "1024x1024", "1792x1024", "1024x1792"]  # noqa: E501
        if size not in allowed_values:
            raise ValueError(
                "Invalid value for `size` ({0}), must be one of {1}"
                .format(size, allowed_values)
            )

        self._size = size

    @property
    def style(self) -> str:
        """Gets the style of this CreateImageRequest.

        The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`.  # noqa: E501

        :return: The style of this CreateImageRequest.
        :rtype: str
        """
        return self._style

    @style.setter
    def style(self, style: str):
        """Sets the style of this CreateImageRequest.

        The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for `dall-e-3`.  # noqa: E501

        :param style: The style of this CreateImageRequest.
        :type style: str
        """
        allowed_values = [None,"vivid", "natural"]  # noqa: E501
        if style not in allowed_values:
            raise ValueError(
                "Invalid value for `style` ({0}), must be one of {1}"
                .format(style, allowed_values)
            )

        self._style = style

    @property
    def user(self) -> str:
        """Gets the user of this CreateImageRequest.

        A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).   # noqa: E501

        :return: The user of this CreateImageRequest.
        :rtype: str
        """
        return self._user

    @user.setter
    def user(self, user: str):
        """Sets the user of this CreateImageRequest.

        A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).   # noqa: E501

        :param user: The user of this CreateImageRequest.
        :type user: str
        """

        self._user = user
