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

"""
    pagarmecoreapi

    This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""

import pagarmecoreapi.models.get_pix_bank_account_response

class GetPixPayerResponse(object):

    """Implementation of the 'GetPixPayerResponse' model.

    Pix payer data.

    Attributes:
        name (string): TODO: type description here.
        document (string): TODO: type description here.
        document_type (string): TODO: type description here.
        bank_account (GetPixBankAccountResponse): TODO: type description
            here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "name":'name',
        "document":'document',
        "document_type":'document_type',
        "bank_account":'bank_account'
    }

    def __init__(self,
                 name=None,
                 document=None,
                 document_type=None,
                 bank_account=None):
        """Constructor for the GetPixPayerResponse class"""

        # Initialize members of the class
        self.name = name
        self.document = document
        self.document_type = document_type
        self.bank_account = bank_account


    @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
        name = dictionary.get('name')
        document = dictionary.get('document')
        document_type = dictionary.get('document_type')
        bank_account = pagarmecoreapi.models.get_pix_bank_account_response.GetPixBankAccountResponse.from_dictionary(dictionary.get('bank_account')) if dictionary.get('bank_account') else None

        # Return an object of this model
        return cls(name,
                   document,
                   document_type,
                   bank_account)


