<?php
/**
 * SMSCampaignsApi
 * PHP version 5
 *
 * @category Class
 * @package  SendinBlue\Client
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * SendinBlue API
 *
 * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to :   - Manage your campaigns and get the statistics   - Manage your contacts   - Send transactional Emails and SMS   - and much more...  You can download our wrappers at https://github.com/orgs/sendinblue  **Possible responses**   | Code | Message |   | :-------------: | ------------- |   | 200  | OK. Successful Request  |   | 201  | OK. Successful Creation |   | 202  | OK. Request accepted |   | 204  | OK. Successful Update/Deletion  |   | 400  | Error. Bad Request  |   | 401  | Error. Authentication Needed  |   | 402  | Error. Not enough credit, plan upgrade needed  |   | 403  | Error. Permission denied  |   | 404  | Error. Object does not exist |   | 405  | Error. Method not allowed  |
 *
 * OpenAPI spec version: 3.0.0
 * Contact: contact@sendinblue.com
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 *
 */

/**
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */

namespace SendinBlue\Client\Api;

use \SendinBlue\Client\ApiClient;
use \SendinBlue\Client\ApiException;
use \SendinBlue\Client\Configuration;
use \SendinBlue\Client\ObjectSerializer;

/**
 * SMSCampaignsApi Class Doc Comment
 *
 * @category Class
 * @package  SendinBlue\Client
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class SMSCampaignsApi
{
    /**
     * API Client
     *
     * @var \SendinBlue\Client\ApiClient instance of the ApiClient
     */
    protected $apiClient;

    /**
     * Constructor
     *
     * @param \SendinBlue\Client\ApiClient|null $apiClient The api client to use
     */
    public function __construct(\SendinBlue\Client\ApiClient $apiClient = null)
    {
        if ($apiClient === null) {
            $apiClient = new ApiClient();
        }

        $this->apiClient = $apiClient;
    }

    /**
     * Get API client
     *
     * @return \SendinBlue\Client\ApiClient get the API client
     */
    public function getApiClient()
    {
        return $this->apiClient;
    }

    /**
     * Set the API client
     *
     * @param \SendinBlue\Client\ApiClient $apiClient set the API client
     *
     * @return SMSCampaignsApi
     */
    public function setApiClient(\SendinBlue\Client\ApiClient $apiClient)
    {
        $this->apiClient = $apiClient;
        return $this;
    }

    /**
     * Operation createSMSCampaign
     *
     * Creates a SMS campaign
     *
     * @param \SendinBlue\Client\Model\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return \SendinBlue\Client\Model\CreateModel
     */
    public function createSMSCampaign($createSmsCampaign)
    {
        list($response) = $this->createSMSCampaignWithHttpInfo($createSmsCampaign);
        return $response;
    }

    /**
     * Operation createSMSCampaignWithHttpInfo
     *
     * Creates a SMS campaign
     *
     * @param \SendinBlue\Client\Model\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return array of \SendinBlue\Client\Model\CreateModel, HTTP status code, HTTP response headers (array of strings)
     */
    public function createSMSCampaignWithHttpInfo($createSmsCampaign)
    {
        // verify the required parameter 'createSmsCampaign' is set
        if ($createSmsCampaign === null) {
            throw new \InvalidArgumentException('Missing the required parameter $createSmsCampaign when calling createSMSCampaign');
        }
        // parse inputs
        $resourcePath = "/smsCampaigns";
        $httpBody = '';
        $queryParams = [];
        $headerParams = [];
        $formParams = [];
        $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);

        // body params
        $_tempBody = null;
        if (isset($createSmsCampaign)) {
            $_tempBody = $createSmsCampaign;
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key');
        if (strlen($apiKey) !== 0) {
            $headerParams['api-key'] = $apiKey;
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'POST',
                $queryParams,
                $httpBody,
                $headerParams,
                '\SendinBlue\Client\Model\CreateModel',
                '/smsCampaigns'
            );

            return [$this->apiClient->getSerializer()->deserialize($response, '\SendinBlue\Client\Model\CreateModel', $httpHeader), $statusCode, $httpHeader];
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 201:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\CreateModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 400:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation deleteSMSCampaigns
     *
     * Delete the SMS campaign
     *
     * @param int $campaignId id of the SMS campaign (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return void
     */
    public function deleteSMSCampaigns($campaignId)
    {
        list($response) = $this->deleteSMSCampaignsWithHttpInfo($campaignId);
        return $response;
    }

    /**
     * Operation deleteSMSCampaignsWithHttpInfo
     *
     * Delete the SMS campaign
     *
     * @param int $campaignId id of the SMS campaign (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return array of null, HTTP status code, HTTP response headers (array of strings)
     */
    public function deleteSMSCampaignsWithHttpInfo($campaignId)
    {
        // verify the required parameter 'campaignId' is set
        if ($campaignId === null) {
            throw new \InvalidArgumentException('Missing the required parameter $campaignId when calling deleteSMSCampaigns');
        }
        // parse inputs
        $resourcePath = "/smsCampaigns/{campaignId}";
        $httpBody = '';
        $queryParams = [];
        $headerParams = [];
        $formParams = [];
        $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);

        // path params
        if ($campaignId !== null) {
            $resourcePath = str_replace(
                "{" . "campaignId" . "}",
                $this->apiClient->getSerializer()->toPathValue($campaignId),
                $resourcePath
            );
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key');
        if (strlen($apiKey) !== 0) {
            $headerParams['api-key'] = $apiKey;
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'DELETE',
                $queryParams,
                $httpBody,
                $headerParams,
                null,
                '/smsCampaigns/{campaignId}'
            );

            return [null, $statusCode, $httpHeader];
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 400:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 404:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation getSMSCampaigns
     *
     * Returns the informations for all your created SMS campaigns
     *
     * @param string $status Status of campaign. (optional)
     * @param int $limit Number limitation for the result returned (optional, default to 500)
     * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return \SendinBlue\Client\Model\GetSmsCampaigns
     */
    public function getSMSCampaigns($status = null, $limit = '500', $offset = '0')
    {
        list($response) = $this->getSMSCampaignsWithHttpInfo($status, $limit, $offset);
        return $response;
    }

    /**
     * Operation getSMSCampaignsWithHttpInfo
     *
     * Returns the informations for all your created SMS campaigns
     *
     * @param string $status Status of campaign. (optional)
     * @param int $limit Number limitation for the result returned (optional, default to 500)
     * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return array of \SendinBlue\Client\Model\GetSmsCampaigns, HTTP status code, HTTP response headers (array of strings)
     */
    public function getSMSCampaignsWithHttpInfo($status = null, $limit = '500', $offset = '0')
    {
        if (!is_null($limit) && ($limit > 1000)) {
            throw new \InvalidArgumentException('invalid value for "$limit" when calling SMSCampaignsApi.getSMSCampaigns, must be smaller than or equal to 1000.');
        }

        // parse inputs
        $resourcePath = "/smsCampaigns";
        $httpBody = '';
        $queryParams = [];
        $headerParams = [];
        $formParams = [];
        $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);

        // query params
        if ($status !== null) {
            $queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status);
        }
        // query params
        if ($limit !== null) {
            $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($limit);
        }
        // query params
        if ($offset !== null) {
            $queryParams['offset'] = $this->apiClient->getSerializer()->toQueryValue($offset);
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key');
        if (strlen($apiKey) !== 0) {
            $headerParams['api-key'] = $apiKey;
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'GET',
                $queryParams,
                $httpBody,
                $headerParams,
                '\SendinBlue\Client\Model\GetSmsCampaigns',
                '/smsCampaigns'
            );

            return [$this->apiClient->getSerializer()->deserialize($response, '\SendinBlue\Client\Model\GetSmsCampaigns', $httpHeader), $statusCode, $httpHeader];
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\GetSmsCampaigns', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 400:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation getSmsCampaign
     *
     * Get a SMS campaign
     *
     * @param int $campaignId id of the SMS campaign (required)
     * @param \SendinBlue\Client\Model\GetSmsCampaign $getSmsCampaign Values to update an SMS Campaign (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return \SendinBlue\Client\Model\GetSmsCampaign
     */
    public function getSmsCampaign($campaignId, $getSmsCampaign)
    {
        list($response) = $this->getSmsCampaignWithHttpInfo($campaignId, $getSmsCampaign);
        return $response;
    }

    /**
     * Operation getSmsCampaignWithHttpInfo
     *
     * Get a SMS campaign
     *
     * @param int $campaignId id of the SMS campaign (required)
     * @param \SendinBlue\Client\Model\GetSmsCampaign $getSmsCampaign Values to update an SMS Campaign (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return array of \SendinBlue\Client\Model\GetSmsCampaign, HTTP status code, HTTP response headers (array of strings)
     */
    public function getSmsCampaignWithHttpInfo($campaignId, $getSmsCampaign)
    {
        // verify the required parameter 'campaignId' is set
        if ($campaignId === null) {
            throw new \InvalidArgumentException('Missing the required parameter $campaignId when calling getSmsCampaign');
        }
        // verify the required parameter 'getSmsCampaign' is set
        if ($getSmsCampaign === null) {
            throw new \InvalidArgumentException('Missing the required parameter $getSmsCampaign when calling getSmsCampaign');
        }
        // parse inputs
        $resourcePath = "/smsCampaigns/{campaignId}";
        $httpBody = '';
        $queryParams = [];
        $headerParams = [];
        $formParams = [];
        $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);

        // path params
        if ($campaignId !== null) {
            $resourcePath = str_replace(
                "{" . "campaignId" . "}",
                $this->apiClient->getSerializer()->toPathValue($campaignId),
                $resourcePath
            );
        }
        // body params
        $_tempBody = null;
        if (isset($getSmsCampaign)) {
            $_tempBody = $getSmsCampaign;
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key');
        if (strlen($apiKey) !== 0) {
            $headerParams['api-key'] = $apiKey;
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'GET',
                $queryParams,
                $httpBody,
                $headerParams,
                '\SendinBlue\Client\Model\GetSmsCampaign',
                '/smsCampaigns/{campaignId}'
            );

            return [$this->apiClient->getSerializer()->deserialize($response, '\SendinBlue\Client\Model\GetSmsCampaign', $httpHeader), $statusCode, $httpHeader];
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\GetSmsCampaign', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 400:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 404:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation requestSMSRecipientExport
     *
     * Exports the recipients of the specified campaign.
     *
     * @param int $campaignId id of the campaign (required)
     * @param \SendinBlue\Client\Model\RequestSMSRecipientExport $recipientExport Values to send for a recipient export request (optional)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return \SendinBlue\Client\Model\CreatedProcessId
     */
    public function requestSMSRecipientExport($campaignId, $recipientExport = null)
    {
        list($response) = $this->requestSMSRecipientExportWithHttpInfo($campaignId, $recipientExport);
        return $response;
    }

    /**
     * Operation requestSMSRecipientExportWithHttpInfo
     *
     * Exports the recipients of the specified campaign.
     *
     * @param int $campaignId id of the campaign (required)
     * @param \SendinBlue\Client\Model\RequestSMSRecipientExport $recipientExport Values to send for a recipient export request (optional)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return array of \SendinBlue\Client\Model\CreatedProcessId, HTTP status code, HTTP response headers (array of strings)
     */
    public function requestSMSRecipientExportWithHttpInfo($campaignId, $recipientExport = null)
    {
        // verify the required parameter 'campaignId' is set
        if ($campaignId === null) {
            throw new \InvalidArgumentException('Missing the required parameter $campaignId when calling requestSMSRecipientExport');
        }
        // parse inputs
        $resourcePath = "/smsCampaigns/{campaignId}/exportRecipients";
        $httpBody = '';
        $queryParams = [];
        $headerParams = [];
        $formParams = [];
        $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);

        // path params
        if ($campaignId !== null) {
            $resourcePath = str_replace(
                "{" . "campaignId" . "}",
                $this->apiClient->getSerializer()->toPathValue($campaignId),
                $resourcePath
            );
        }
        // body params
        $_tempBody = null;
        if (isset($recipientExport)) {
            $_tempBody = $recipientExport;
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key');
        if (strlen($apiKey) !== 0) {
            $headerParams['api-key'] = $apiKey;
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'POST',
                $queryParams,
                $httpBody,
                $headerParams,
                '\SendinBlue\Client\Model\CreatedProcessId',
                '/smsCampaigns/{campaignId}/exportRecipients'
            );

            return [$this->apiClient->getSerializer()->deserialize($response, '\SendinBlue\Client\Model\CreatedProcessId', $httpHeader), $statusCode, $httpHeader];
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 202:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\CreatedProcessId', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 400:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 404:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation sendSMSCampaignNow
     *
     * Send your SMS campaign immediately
     *
     * @param int $campaignId id of the campaign (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return void
     */
    public function sendSMSCampaignNow($campaignId)
    {
        list($response) = $this->sendSMSCampaignNowWithHttpInfo($campaignId);
        return $response;
    }

    /**
     * Operation sendSMSCampaignNowWithHttpInfo
     *
     * Send your SMS campaign immediately
     *
     * @param int $campaignId id of the campaign (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return array of null, HTTP status code, HTTP response headers (array of strings)
     */
    public function sendSMSCampaignNowWithHttpInfo($campaignId)
    {
        // verify the required parameter 'campaignId' is set
        if ($campaignId === null) {
            throw new \InvalidArgumentException('Missing the required parameter $campaignId when calling sendSMSCampaignNow');
        }
        // parse inputs
        $resourcePath = "/smsCampaigns/{campaignId}/sendNow";
        $httpBody = '';
        $queryParams = [];
        $headerParams = [];
        $formParams = [];
        $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);

        // path params
        if ($campaignId !== null) {
            $resourcePath = str_replace(
                "{" . "campaignId" . "}",
                $this->apiClient->getSerializer()->toPathValue($campaignId),
                $resourcePath
            );
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key');
        if (strlen($apiKey) !== 0) {
            $headerParams['api-key'] = $apiKey;
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'POST',
                $queryParams,
                $httpBody,
                $headerParams,
                null,
                '/smsCampaigns/{campaignId}/sendNow'
            );

            return [null, $statusCode, $httpHeader];
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 400:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 402:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 404:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation sendSMSReport
     *
     * Send report of SMS campaigns
     *
     * @param int $campaignId id of the campaign (required)
     * @param \SendinBlue\Client\Model\SendReport $sendReport Values for send a report (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return void
     */
    public function sendSMSReport($campaignId, $sendReport)
    {
        list($response) = $this->sendSMSReportWithHttpInfo($campaignId, $sendReport);
        return $response;
    }

    /**
     * Operation sendSMSReportWithHttpInfo
     *
     * Send report of SMS campaigns
     *
     * @param int $campaignId id of the campaign (required)
     * @param \SendinBlue\Client\Model\SendReport $sendReport Values for send a report (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return array of null, HTTP status code, HTTP response headers (array of strings)
     */
    public function sendSMSReportWithHttpInfo($campaignId, $sendReport)
    {
        // verify the required parameter 'campaignId' is set
        if ($campaignId === null) {
            throw new \InvalidArgumentException('Missing the required parameter $campaignId when calling sendSMSReport');
        }
        // verify the required parameter 'sendReport' is set
        if ($sendReport === null) {
            throw new \InvalidArgumentException('Missing the required parameter $sendReport when calling sendSMSReport');
        }
        // parse inputs
        $resourcePath = "/smsCampaigns/{campaignId}/sendReport";
        $httpBody = '';
        $queryParams = [];
        $headerParams = [];
        $formParams = [];
        $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);

        // path params
        if ($campaignId !== null) {
            $resourcePath = str_replace(
                "{" . "campaignId" . "}",
                $this->apiClient->getSerializer()->toPathValue($campaignId),
                $resourcePath
            );
        }
        // body params
        $_tempBody = null;
        if (isset($sendReport)) {
            $_tempBody = $sendReport;
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key');
        if (strlen($apiKey) !== 0) {
            $headerParams['api-key'] = $apiKey;
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'POST',
                $queryParams,
                $httpBody,
                $headerParams,
                null,
                '/smsCampaigns/{campaignId}/sendReport'
            );

            return [null, $statusCode, $httpHeader];
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 400:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 404:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation sendTestSms
     *
     * Send an SMS
     *
     * @param int $campaignId Id of the SMS campaign (required)
     * @param \SendinBlue\Client\Model\SendTestSms $sendTestSms Mobile number to which send the test (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return void
     */
    public function sendTestSms($campaignId, $sendTestSms)
    {
        list($response) = $this->sendTestSmsWithHttpInfo($campaignId, $sendTestSms);
        return $response;
    }

    /**
     * Operation sendTestSmsWithHttpInfo
     *
     * Send an SMS
     *
     * @param int $campaignId Id of the SMS campaign (required)
     * @param \SendinBlue\Client\Model\SendTestSms $sendTestSms Mobile number to which send the test (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return array of null, HTTP status code, HTTP response headers (array of strings)
     */
    public function sendTestSmsWithHttpInfo($campaignId, $sendTestSms)
    {
        // verify the required parameter 'campaignId' is set
        if ($campaignId === null) {
            throw new \InvalidArgumentException('Missing the required parameter $campaignId when calling sendTestSms');
        }
        // verify the required parameter 'sendTestSms' is set
        if ($sendTestSms === null) {
            throw new \InvalidArgumentException('Missing the required parameter $sendTestSms when calling sendTestSms');
        }
        // parse inputs
        $resourcePath = "/smsCampaigns/{campaignId}/sendTest";
        $httpBody = '';
        $queryParams = [];
        $headerParams = [];
        $formParams = [];
        $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);

        // path params
        if ($campaignId !== null) {
            $resourcePath = str_replace(
                "{" . "campaignId" . "}",
                $this->apiClient->getSerializer()->toPathValue($campaignId),
                $resourcePath
            );
        }
        // body params
        $_tempBody = null;
        if (isset($sendTestSms)) {
            $_tempBody = $sendTestSms;
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key');
        if (strlen($apiKey) !== 0) {
            $headerParams['api-key'] = $apiKey;
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'POST',
                $queryParams,
                $httpBody,
                $headerParams,
                null,
                '/smsCampaigns/{campaignId}/sendTest'
            );

            return [null, $statusCode, $httpHeader];
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 400:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\PostSendSmsTestFailed', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 404:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation updateSMSCampaignStatus
     *
     * Update the campaign status
     *
     * @param int $campaignId id of the campaign (required)
     * @param \SendinBlue\Client\Model\UpdateCampaignStatus $status Status of the campaign. (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return void
     */
    public function updateSMSCampaignStatus($campaignId, $status)
    {
        list($response) = $this->updateSMSCampaignStatusWithHttpInfo($campaignId, $status);
        return $response;
    }

    /**
     * Operation updateSMSCampaignStatusWithHttpInfo
     *
     * Update the campaign status
     *
     * @param int $campaignId id of the campaign (required)
     * @param \SendinBlue\Client\Model\UpdateCampaignStatus $status Status of the campaign. (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return array of null, HTTP status code, HTTP response headers (array of strings)
     */
    public function updateSMSCampaignStatusWithHttpInfo($campaignId, $status)
    {
        // verify the required parameter 'campaignId' is set
        if ($campaignId === null) {
            throw new \InvalidArgumentException('Missing the required parameter $campaignId when calling updateSMSCampaignStatus');
        }
        // verify the required parameter 'status' is set
        if ($status === null) {
            throw new \InvalidArgumentException('Missing the required parameter $status when calling updateSMSCampaignStatus');
        }
        // parse inputs
        $resourcePath = "/smsCampaigns/{campaignId}/status";
        $httpBody = '';
        $queryParams = [];
        $headerParams = [];
        $formParams = [];
        $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);

        // path params
        if ($campaignId !== null) {
            $resourcePath = str_replace(
                "{" . "campaignId" . "}",
                $this->apiClient->getSerializer()->toPathValue($campaignId),
                $resourcePath
            );
        }
        // body params
        $_tempBody = null;
        if (isset($status)) {
            $_tempBody = $status;
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key');
        if (strlen($apiKey) !== 0) {
            $headerParams['api-key'] = $apiKey;
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'PUT',
                $queryParams,
                $httpBody,
                $headerParams,
                null,
                '/smsCampaigns/{campaignId}/status'
            );

            return [null, $statusCode, $httpHeader];
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 400:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 404:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation updateSmsCampaign
     *
     * Updates a SMS campaign
     *
     * @param int $campaignId id of the SMS campaign (required)
     * @param \SendinBlue\Client\Model\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return void
     */
    public function updateSmsCampaign($campaignId, $updateSmsCampaign)
    {
        list($response) = $this->updateSmsCampaignWithHttpInfo($campaignId, $updateSmsCampaign);
        return $response;
    }

    /**
     * Operation updateSmsCampaignWithHttpInfo
     *
     * Updates a SMS campaign
     *
     * @param int $campaignId id of the SMS campaign (required)
     * @param \SendinBlue\Client\Model\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required)
     * @throws \SendinBlue\Client\ApiException on non-2xx response
     * @return array of null, HTTP status code, HTTP response headers (array of strings)
     */
    public function updateSmsCampaignWithHttpInfo($campaignId, $updateSmsCampaign)
    {
        // verify the required parameter 'campaignId' is set
        if ($campaignId === null) {
            throw new \InvalidArgumentException('Missing the required parameter $campaignId when calling updateSmsCampaign');
        }
        // verify the required parameter 'updateSmsCampaign' is set
        if ($updateSmsCampaign === null) {
            throw new \InvalidArgumentException('Missing the required parameter $updateSmsCampaign when calling updateSmsCampaign');
        }
        // parse inputs
        $resourcePath = "/smsCampaigns/{campaignId}";
        $httpBody = '';
        $queryParams = [];
        $headerParams = [];
        $formParams = [];
        $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);

        // path params
        if ($campaignId !== null) {
            $resourcePath = str_replace(
                "{" . "campaignId" . "}",
                $this->apiClient->getSerializer()->toPathValue($campaignId),
                $resourcePath
            );
        }
        // body params
        $_tempBody = null;
        if (isset($updateSmsCampaign)) {
            $_tempBody = $updateSmsCampaign;
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('api-key');
        if (strlen($apiKey) !== 0) {
            $headerParams['api-key'] = $apiKey;
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'PUT',
                $queryParams,
                $httpBody,
                $headerParams,
                null,
                '/smsCampaigns/{campaignId}'
            );

            return [null, $statusCode, $httpHeader];
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 400:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                case 404:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }
}
