<?php
/*
 * PagarmeCoreApiLib
 *
 * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
 */

namespace PagarmeCoreApiLib\Models;

use JsonSerializable;

/**
 *Creates a refund with split rules
 */
class CreateCancelChargeSplitRulesRequest implements JsonSerializable
{
    /**
     * The split rule gateway id
     * @required
     * @var string $id public property
     */
    public $id;

    /**
     * The split rule amount
     * @required
     * @maps Amount
     * @var integer $amount public property
     */
    public $amount;

    /**
     * The amount type (flat ou percentage)
     * @required
     * @var string $type public property
     */
    public $type;

    /**
     * Constructor to set initial or default values of member properties
     * @param string  $id     Initialization value for $this->id
     * @param integer $amount Initialization value for $this->amount
     * @param string  $type   Initialization value for $this->type
     */
    public function __construct()
    {
        if (3 == func_num_args()) {
            $this->id     = func_get_arg(0);
            $this->amount = func_get_arg(1);
            $this->type   = func_get_arg(2);
        }
    }


    /**
     * Encode this object to JSON
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
        $json = array();
        $json['id']     = $this->id;
        $json['Amount'] = $this->amount;
        $json['type']   = $this->type;

        return $json;
    }
}
