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


/**
 * Service that provides access to the PayerTheme
 * endpoints of the API
 */
class PayerThemesService extends BaseService
{

    protected $envelope_key   = 'payer_themes';
    protected $resource_class = '\GoCardlessPro\Resources\PayerTheme';


    /**
     * Create a payer theme associated with a creditor
     *
     * Example URL: /branding/payer_themes
     *
     * @param  array<string, mixed> $params An associative array for any params
     * @return PayerTheme
     **/
    public function createForCreditor($params = array())
    {
        $path = "/branding/payer_themes";
        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);
    }

}
