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

"""
swaggerpetstore

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from swaggerpetstore.api_helper import APIHelper


class User(object):

    """Implementation of the 'User' model.

    TODO: type model description here.

    Attributes:
        id (long|int): TODO: type description here.
        username (string): TODO: type description here.
        first_name (string): TODO: type description here.
        last_name (string): TODO: type description here.
        email (string): TODO: type description here.
        password (string): TODO: type description here.
        phone (string): TODO: type description here.
        user_status (int): User Status

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": 'id',
        "username": 'username',
        "first_name": 'firstName',
        "last_name": 'lastName',
        "email": 'email',
        "password": 'password',
        "phone": 'phone',
        "user_status": 'userStatus'
    }

    _optionals = [
        'id',
        'username',
        'first_name',
        'last_name',
        'email',
        'password',
        'phone',
        'user_status',
    ]

    def __init__(self,
                 id=APIHelper.SKIP,
                 username=APIHelper.SKIP,
                 first_name=APIHelper.SKIP,
                 last_name=APIHelper.SKIP,
                 email=APIHelper.SKIP,
                 password=APIHelper.SKIP,
                 phone=APIHelper.SKIP,
                 user_status=APIHelper.SKIP):
        """Constructor for the User class"""

        # Initialize members of the class
        if id is not APIHelper.SKIP:
            self.id = id 
        if username is not APIHelper.SKIP:
            self.username = username 
        if first_name is not APIHelper.SKIP:
            self.first_name = first_name 
        if last_name is not APIHelper.SKIP:
            self.last_name = last_name 
        if email is not APIHelper.SKIP:
            self.email = email 
        if password is not APIHelper.SKIP:
            self.password = password 
        if phone is not APIHelper.SKIP:
            self.phone = phone 
        if user_status is not APIHelper.SKIP:
            self.user_status = user_status 

    @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") if dictionary.get("id") else APIHelper.SKIP
        username = dictionary.get("username") if dictionary.get("username") else APIHelper.SKIP
        first_name = dictionary.get("firstName") if dictionary.get("firstName") else APIHelper.SKIP
        last_name = dictionary.get("lastName") if dictionary.get("lastName") else APIHelper.SKIP
        email = dictionary.get("email") if dictionary.get("email") else APIHelper.SKIP
        password = dictionary.get("password") if dictionary.get("password") else APIHelper.SKIP
        phone = dictionary.get("phone") if dictionary.get("phone") else APIHelper.SKIP
        user_status = dictionary.get("userStatus") if dictionary.get("userStatus") else APIHelper.SKIP
        # Return an object of this model
        return cls(id,
                   username,
                   first_name,
                   last_name,
                   email,
                   password,
                   phone,
                   user_status)
