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

"""
    pagarmecoreapi

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


class CreateCancelChargeSplitRulesRequest(object):

    """Implementation of the 'CreateCancelChargeSplitRulesRequest' model.

    Creates a refund with split rules

    Attributes:
        id (string): The split rule gateway id
        amount (int): The split rule amount
        mtype (string): The amount type (flat ou percentage)

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id":'id',
        "amount":'Amount',
        "mtype":'type'
    }

    def __init__(self,
                 id=None,
                 amount=None,
                 mtype=None):
        """Constructor for the CreateCancelChargeSplitRulesRequest class"""

        # Initialize members of the class
        self.id = id
        self.amount = amount
        self.mtype = mtype


    @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')
        amount = dictionary.get('Amount')
        mtype = dictionary.get('type')

        # Return an object of this model
        return cls(id,
                   amount,
                   mtype)


