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

"""
pqapiv2

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


class SourceMonetaryRequired(object):

    """Implementation of the '_sourceMonetaryRequired' model.

    Required details of the monetary source.

    Attributes:
        source_amount (float): Amount of the transfer in the specified
            currency.
        source_currency (CurrencyTypesEnum): Currency code type for the
            object

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "source_amount": 'sourceAmount',
        "source_currency": 'sourceCurrency'
    }

    def __init__(self,
                 source_amount=None,
                 source_currency=None):
        """Constructor for the SourceMonetaryRequired class"""

        # Initialize members of the class
        self.source_amount = source_amount
        self.source_currency = source_currency

    @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
        source_amount = dictionary.get('sourceAmount')
        source_currency = dictionary.get('sourceCurrency')

        # Return an object of this model
        return cls(source_amount,
                   source_currency)
