<commit_before><?php

namespace HiddeCo\TransIP;

/**
 * The better TransIP SOAP client.
 *
 * @method Api\Colocation colocation()
 * @method Api\Colocation colocation_service()
 * @method Api\Colocation colocationService()
 * @method Api\Domain     domain()
 * @method Api\Domain     domain_service()
 * @method Api\Domain     domainService()
 * @method Api\Forward    forward()
 * @method Api\Forward    forward_service()
 * @method Api\Forward    forwardService()
 * @method Api\Vps        vps()
 * @method Api\Vps        vps_service()
 * @method Api\Vps        vpsService()
 * @method Api\WebHosting hosting()
 * @method Api\WebHosting web_hosting()
 * @method Api\WebHosting webHosting()
 * @method Api\WebHosting web_hosting_service()
 * @method Api\WebHosting webHostingService()
 *
 * @author <NAME> <<EMAIL>>
 */
class Client
{
    /**
     * @var string TransIP username
     */
    protected $username;

    /**
     * @var string TransIP private key
     */
    protected $privateKey;

    /**
     * @var string Accepted permission modes
     */
    protected $acceptedModes = [
        'readwrite',
        'readonly',
    ];

    /**
     * @var string Permission mode
     */
    protected $mode;

    /**
     * @var string TransIP endpoint
     */
    protected $endpoint;

    /**
     * Construct the TransIP client.
     *
     * @param string $username   TransIP username
     * @param string $privateKey TransIP private key
     * @param string $mode       Permission mode
     * @param string $endpoint   TransIP endpoint
     */
    public function __construct($username, $privateKey, $mode = 'readwrite', $endpoint = 'api.transip.nl')
    {
        $this->username = $username;
        $this->privateKey = $privateKey;
        $this->endpoint = $endpoint;

        $this->setMode($mode);
    }

    /**
     * Get the API.
     *
     * @param string $name Name/alias of the API
     *
     * @throws \InvalidArgumentException
     *
     * @return \HiddeCo\TransIP\Api\ApiInterface
     */
    public function api($name)
    {
        switch ($name) {
            case 'domain':
            case 'domain_service':
            case 'domainService':
                return new Api\Domain($this);
                break;

            case 'colocation':
            case 'colocation_service':
            case 'colocationService':
                return new Api\Colocation($this);
                break;

            case 'forward':
            case 'forward_service':
            case 'forwardService':
                return new Api\Forward($this);
                break;

            case 'vps':
            case 'vps_service':
            case 'vpsService':
                return new Api\Vps($this);
                break;

            case 'hosting':
            case 'web_hosting':
            case 'webHosting':
            case 'web_hosting_service':
            case 'webHostingService':
                return new Api\WebHosting($this);
                break;

            default:
                throw new \InvalidArgumentException(sprintf('Undefined api instance called: [%s]', $name));
        }
    }

    /**
     * Build the SOAP client for the given service.<commit_msg>Remove unnecessary breaks in switch<commit_after><?php

namespace HiddeCo\TransIP;

/**
 * The better TransIP SOAP client.
 *
 * @method Api\Colocation colocation()
 * @method Api\Colocation colocation_service()
 * @method Api\Colocation colocationService()
 * @method Api\Domain     domain()
 * @method Api\Domain     domain_service()
 * @method Api\Domain     domainService()
 * @method Api\Forward    forward()
 * @method Api\Forward    forward_service()
 * @method Api\Forward    forwardService()
 * @method Api\Vps        vps()
 * @method Api\Vps        vps_service()
 * @method Api\Vps        vpsService()
 * @method Api\WebHosting hosting()
 * @method Api\WebHosting web_hosting()
 * @method Api\WebHosting webHosting()
 * @method Api\WebHosting web_hosting_service()
 * @method Api\WebHosting webHostingService()
 *
 * @author <NAME> <<EMAIL>>
 */
class Client
{
    /**
     * @var string TransIP username
     */
    protected $username;

    /**
     * @var string TransIP private key
     */
    protected $privateKey;

    /**
     * @var string Accepted permission modes
     */
    protected $acceptedModes = [
        'readwrite',
        'readonly',
    ];

    /**
     * @var string Permission mode
     */
    protected $mode;

    /**
     * @var string TransIP endpoint
     */
    protected $endpoint;

    /**
     * Construct the TransIP client.
     *
     * @param string $username   TransIP username
     * @param string $privateKey TransIP private key
     * @param string $mode       Permission mode
     * @param string $endpoint   TransIP endpoint
     */
    public function __construct($username, $privateKey, $mode = 'readwrite', $endpoint = 'api.transip.nl')
    {
        $this->username = $username;
        $this->privateKey = $privateKey;
        $this->endpoint = $endpoint;

        $this->setMode($mode);
    }

    /**
     * Get the API.
     *
     * @param string $name Name/alias of the API
     *
     * @throws \InvalidArgumentException
     *
     * @return \HiddeCo\TransIP\Api\ApiInterface
     */
    public function api($name)
    {
        switch ($name) {
            case 'domain':
            case 'domain_service':
            case 'domainService':
                return new Api\Domain($this);

            case 'colocation':
            case 'colocation_service':
            case 'colocationService':
                return new Api\Colocation($this);

            case 'forward':
            case 'forward_service':
            case 'forwardService':
                return new Api\Forward($this);

            case 'vps':
            case 'vps_service':
            case 'vpsService':
                return new Api\Vps($this);

            case 'hosting':
            case 'web_hosting':
            case 'webHosting':
            case 'web_hosting_service':
            case 'webHostingService':
                return new Api\WebHosting($this);

            default:
                throw new \InvalidArgumentException(sprintf('Undefined api instance called: [%s]', $name));
        }
    }

    /**
     * Build the SOAP client for the given service.
{'fraction_non_alphanumeric': 0.11360404487280772, 'fraction_numerical': 0.0, 'mean_word_length': 1.9551820728291316, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5061702', 'n_tokens_mistral': 1781, 'n_tokens_neox': 1777, 'n_words': 454}