Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
finicityapi / finicityapi / models / request_constraints.py
Size: Mime:
# -*- coding: utf-8 -*-

import finicityapi.models.report_custom_field

class RequestConstraints(object):

    """Implementation of the 'Request Constraints' model.

    TODO: type model description here.

    Attributes:
        account_ids (string): Specific accountIds to be included in the new
            report.
        report_custom_fields (list of ReportCustomField): Designate up to 5
            custom fields that you would like associated with the report upon
            generation by providing a label for the field and a value for the
            field. Set the shown variable to true if you want the custom field
            to display in the PDF reports. Set the shown variable to false to
            limit seeing the variable to JSON, XML report but not in the PDF
            report. All custom fields will display in the Reseller Billing
            endpoint.  This is optional.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "account_ids":'accountIds',
        "report_custom_fields":'reportCustomFields'
    }

    def __init__(self,
                 account_ids=None,
                 report_custom_fields=None,
                 additional_properties = {}):
        """Constructor for the RequestConstraints class"""

        # Initialize members of the class
        self.account_ids = account_ids
        self.report_custom_fields = report_custom_fields

        # Add additional model properties to the instance
        self.additional_properties = additional_properties


    @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
        account_ids = dictionary.get('accountIds')
        report_custom_fields = None
        if dictionary.get('reportCustomFields') != None:
            report_custom_fields = list()
            for structure in dictionary.get('reportCustomFields'):
                report_custom_fields.append(finicityapi.models.report_custom_field.ReportCustomField.from_dictionary(structure))

        # Clean out expected properties from dictionary
        for key in cls._names.values():
            if key in dictionary:
                del dictionary[key]

        # Return an object of this model
        return cls(account_ids,
                   report_custom_fields,
                   dictionary)