<?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\MandatePdf;
use \GoCardlessPro\Core\Exception\InvalidStateException;


/**
 * Service that provides access to the MandatePdf
 * endpoints of the API
 */
class MandatePdfsService extends BaseService
{

    protected $envelope_key   = 'mandate_pdfs';
    protected $resource_class = '\GoCardlessPro\Resources\MandatePdf';


    /**
    * Create a mandate PDF
    *
    * Example URL: /mandate_pdfs
    *
    * @param  string[mixed] $params An associative array for any params
    * @return MandatePdf
    **/
    public function create($params = array())
    {
        $path = "/mandate_pdfs";
        if(isset($params['params'])) { 
            $params['body'] = json_encode(array($this->envelope_key => (object)$params['params']));
        
            unset($params['params']);
        }

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

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

}
