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

"""
pqapiv2

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from pqapiv2.models.key_value_pair_language_type_string import KeyValuePairLanguageTypeString


class BankAccountRequirementFormatLegend(object):

    """Implementation of the '_bankAccountRequirementFormatLegend' model.

    Classifies the legend format of the required information for a bank
    account

    Attributes:
        key (string): TODO: type description here.
        descriptions (list of KeyValuePairLanguageTypeString): Localized
            requirement description for display purposes

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "key": 'key',
        "descriptions": 'descriptions'
    }

    def __init__(self,
                 key=None,
                 descriptions=None):
        """Constructor for the BankAccountRequirementFormatLegend class"""

        # Initialize members of the class
        self.key = key
        self.descriptions = descriptions

    @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
        key = dictionary.get('key')
        descriptions = None
        if dictionary.get('descriptions') is not None:
            descriptions = [KeyValuePairLanguageTypeString.from_dictionary(x) for x in dictionary.get('descriptions')]

        # Return an object of this model
        return cls(key,
                   descriptions)
