<?php
/**
 * WARNING: Do not edit by hand, this file was generated by Crank:
 *
 * https://github.com/gocardless/crank
 */

namespace GoCardlessPro\Services;

use \GoCardlessPro\Core\Paginator;
use \GoCardlessPro\Core\Util;
use \GoCardlessPro\Core\ListResponse;
use \GoCardlessPro\Resources\TransferredMandate;
use \GoCardlessPro\Core\Exception\InvalidStateException;


/**
 * Service that provides access to the TransferredMandate
 * endpoints of the API
 */
class TransferredMandatesService extends BaseService
{

    protected $envelope_key   = 'transferred_mandates';
    protected $resource_class = '\GoCardlessPro\Resources\TransferredMandate';


    /**
     * Get updated customer bank details
     *
     * Example URL: /transferred_mandates/:identity
     *
     * @param  string               $identity Unique identifier, beginning with "MD". Note that this
     *                                        prefix may not apply to mandates created before 2016.
     * @param  array<string, mixed> $params   An associative array for any params
     * @return TransferredMandate
     **/
    public function transferredMandates($identity, $params = array())
    {
        $path = Util::subUrl(
            '/transferred_mandates/:identity',
            array(
                
                'identity' => $identity
            )
        );
        if(isset($params['params'])) { $params['query'] = $params['params'];
            unset($params['params']);
        }

        
        $response = $this->api_client->get($path, $params);
        

        return $this->getResourceForResponse($response);
    }

}
