# -*- coding: utf-8 -*-

"""
cookiesapi

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from cookiesapi.models.brand_spec import BrandSpec
from cookiesapi.models.media_item import MediaItem
from cookiesapi.models.name import Name


class Breeder(object):

    """Implementation of the 'Breeder' model.

    Information about a Cookies in-house breeder or partner breeder.

    Attributes:
        id (string): Unique ID assigned to a breeder. Do not key against this:
            it is guaranteed to change.
        slug (string): Unique slug assigned to a breeder. Typically assigned
            if there is no linked brand. If a linked brand is present, this
            field takes precedence, should any value be present.
        name (Name): Naming info for a breeder. Typically assigned if there is
            no linked brand. If a linked brand is present, this field takes
            precedence, should any value be present.
        brand (BrandSpec): Brand associated with a breeder, if applicable.
        logo (MediaItem): Logo for a breeder, if available.
        in_house (bool): Whether this breeder is considered "in-house".

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": 'id',
        "slug": 'slug',
        "name": 'name',
        "brand": 'brand',
        "logo": 'logo',
        "in_house": 'inHouse'
    }

    def __init__(self,
                 id=None,
                 slug=None,
                 name=None,
                 brand=None,
                 logo=None,
                 in_house=None):
        """Constructor for the Breeder class"""

        # Initialize members of the class
        self.id = id
        self.slug = slug
        self.name = name
        self.brand = brand
        self.logo = logo
        self.in_house = in_house

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Creates an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object
            as obtained from the deserialization of the server's response. The
            keys MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if dictionary is None:
            return None

        # Extract variables from the dictionary
        id = dictionary.get('id')
        slug = dictionary.get('slug')
        name = Name.from_dictionary(dictionary.get('name')) if dictionary.get('name') else None
        brand = BrandSpec.from_dictionary(dictionary.get('brand')) if dictionary.get('brand') else None
        logo = MediaItem.from_dictionary(dictionary.get('logo')) if dictionary.get('logo') else None
        in_house = dictionary.get('inHouse')

        # Return an object of this model
        return cls(id,
                   slug,
                   name,
                   brand,
                   logo,
                   in_house)
