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

"""
    mundiapi.models.create_capture_charge_request

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


class CreateCaptureChargeRequest(object):

    """Implementation of the 'CreateCaptureChargeRequest' model.

    Request for capturing a charge

    Attributes:
        code (string): Code for the charge. Sending this field will update the
            code send on the charge and order creation.
        amount (int): The amount that will be captured

    """

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

    def __init__(self,
                 code=None,
                 amount=None):
        """Constructor for the CreateCaptureChargeRequest class"""

        # Initialize members of the class
        self.code = code
        self.amount = amount


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

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


