<?php
/**
 * DefaultApi
 * PHP version 7.4
 *
 * @category Class
 * @package  EdgeBox\SyncCore\V2\Raw
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * Sync Core
 *
 * The Sync Core that sends and receives content from all connected sites and services for Content Sync.
 *
 * The version of the OpenAPI document: 1.0
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 6.4.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace EdgeBox\SyncCore\V2\Raw\Api;

use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\MultipartStream;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\RequestOptions;
use EdgeBox\SyncCore\V2\Raw\ApiException;
use EdgeBox\SyncCore\V2\Raw\Configuration;
use EdgeBox\SyncCore\V2\Raw\HeaderSelector;
use EdgeBox\SyncCore\V2\Raw\ObjectSerializer;

/**
 * DefaultApi Class Doc Comment
 *
 * @category Class
 * @package  EdgeBox\SyncCore\V2\Raw
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */
class DefaultApi
{
    /**
     * @var ClientInterface
     */
    protected $client;

    /**
     * @var Configuration
     */
    protected $config;

    /**
     * @var HeaderSelector
     */
    protected $headerSelector;

    /**
     * @var int Host index
     */
    protected $hostIndex;

    /** @var string[] $contentTypes **/
    public const contentTypes = [
        'aiModelControllerCreate' => [
            'application/json',
        ],
        'aiModelControllerItem' => [
            'application/json',
        ],
        'aiModelControllerList' => [
            'application/json',
        ],
        'aiModelControllerUpdate' => [
            'application/json',
        ],
        'aiPromptExecutionControllerItem' => [
            'application/json',
        ],
        'aiPromptExecutionControllerList' => [
            'application/json',
        ],
        'aiPromptTemplateControllerActiveByKey' => [
            'application/json',
        ],
        'aiPromptTemplateControllerCreate' => [
            'application/json',
        ],
        'aiPromptTemplateControllerItem' => [
            'application/json',
        ],
        'aiPromptTemplateControllerList' => [
            'application/json',
        ],
        'aiPromptTemplateControllerRevisionsByPreviousStatus' => [
            'application/json',
        ],
        'aiPromptTemplateControllerUpdate' => [
            'application/json',
        ],
        'aiProviderControllerCreate' => [
            'application/json',
        ],
        'aiProviderControllerItem' => [
            'application/json',
        ],
        'aiProviderControllerList' => [
            'application/json',
        ],
        'aiProviderControllerModels' => [
            'application/json',
        ],
        'aiProviderControllerUpdate' => [
            'application/json',
        ],
        'authenticationControllerCreate' => [
            'application/json',
        ],
        'authenticationControllerGetBasicAuth' => [
            'application/json',
        ],
        'authenticationControllerSetBasicAuth' => [
            'application/json',
        ],
        'backendControllerExchangeToken' => [
            'application/json',
        ],
        'backendControllerImportSite' => [
            'application/json',
        ],
        'backendControllerRefreshContract' => [
            'application/json',
        ],
        'configurationControllerContract' => [
            'application/json',
        ],
        'configurationControllerInfo' => [
            'application/json',
        ],
        'configurationControllerPullDashboard' => [
            'application/json',
        ],
        'contentGroupControllerItem' => [
            'application/json',
        ],
        'contentGroupControllerList' => [
            'application/json',
        ],
        'contentItemControllerAutocomplete' => [
            'application/json',
        ],
        'contentItemControllerContentAreaHtml' => [
            'application/json',
        ],
        'contentItemControllerItem' => [
            'application/json',
        ],
        'contentItemControllerItemByKey' => [
            'application/json',
        ],
        'contentItemControllerList' => [
            'application/json',
        ],
        'contentItemControllerRevisionsByPreviousStatus' => [
            'application/json',
        ],
        'contentOptimizationControllerCreate' => [
            'application/json',
        ],
        'contentOptimizationControllerCreateMany' => [
            'application/json',
        ],
        'contentOptimizationControllerItem' => [
            'application/json',
        ],
        'contentOptimizationControllerList' => [
            'application/json',
        ],
        'contentOptimizationTypeControllerItem' => [
            'application/json',
        ],
        'contentOptimizationTypeControllerItemByKey' => [
            'application/json',
        ],
        'contentOptimizationTypeControllerList' => [
            'application/json',
        ],
        'contentOptimizationTypeControllerRevisionsByPreviousStatus' => [
            'application/json',
        ],
        'contractControllerItem' => [
            'application/json',
        ],
        'contractControllerItemByUuid' => [
            'application/json',
        ],
        'contractRevisionControllerItem' => [
            'application/json',
        ],
        'contractRevisionControllerMostRecentForContract' => [
            'application/json',
        ],
        'customerControllerItem' => [
            'application/json',
        ],
        'customerControllerItemByUuid' => [
            'application/json',
        ],
        'featuresControllerSummary' => [
            'application/json',
        ],
        'featuresControllerSummaryAll' => [
            'application/json',
        ],
        'featuresControllerUpdate' => [
            'application/json',
        ],
        'fileControllerCreate' => [
            'application/json',
        ],
        'fileControllerDownload' => [
            'application/json',
        ],
        'fileControllerFileUploaded' => [
            'application/json',
        ],
        'fileControllerItem' => [
            'application/json',
        ],
        'fileControllerPreview' => [
            'application/json',
        ],
        'flowControllerCreate' => [
            'application/json',
        ],
        'flowControllerDelete' => [
            'application/json',
        ],
        'flowControllerItem' => [
            'application/json',
        ],
        'flowControllerList' => [
            'application/json',
        ],
        'formulaControllerConfig' => [
            'application/json',
        ],
        'formulaControllerEvaluate' => [
            'application/json',
        ],
        'formulaControllerGenerate' => [
            'application/json',
        ],
        'formulaControllerParse' => [
            'application/json',
        ],
        'formulaControllerValidate' => [
            'application/json',
        ],
        'governanceContentItemStatsControllerChecks' => [
            'application/json',
        ],
        'governanceContentItemStatsControllerMatrix' => [
            'application/json',
        ],
        'governanceContentItemStatsControllerMonthlyHistory' => [
            'application/json',
        ],
        'governanceContentItemStatsControllerTotal' => [
            'application/json',
        ],
        'governanceContentItemStatsControllerWeeklyHistory' => [
            'application/json',
        ],
        'governancePromptMonitoringStatsControllerDailyHistory' => [
            'application/json',
        ],
        'governancePromptMonitoringStatsControllerMatrix' => [
            'application/json',
        ],
        'governancePromptMonitoringStatsControllerMonthlyHistory' => [
            'application/json',
        ],
        'governancePromptMonitoringStatsControllerTotal' => [
            'application/json',
        ],
        'governancePromptMonitoringStatsControllerWeeklyHistory' => [
            'application/json',
        ],
        'healthCheckControllerCreate' => [
            'application/json',
        ],
        'healthCheckControllerItem' => [
            'application/json',
        ],
        'healthCheckControllerItemByKey' => [
            'application/json',
        ],
        'healthCheckControllerItemByKeyActive' => [
            'application/json',
        ],
        'healthCheckControllerList' => [
            'application/json',
        ],
        'healthCheckControllerRevisionsByPreviousStatus' => [
            'application/json',
        ],
        'healthCheckControllerUpdate' => [
            'application/json',
        ],
        'healthControllerLive' => [
            'application/json',
        ],
        'healthControllerReady' => [
            'application/json',
        ],
        'issueControllerItem' => [
            'application/json',
        ],
        'issueControllerList' => [
            'application/json',
        ],
        'localFileControllerDownload' => [
            'application/json',
        ],
        'localFileControllerUpload' => [
            'multipart/form-data',
        ],
        'localeControllerByCode' => [
            'application/json',
        ],
        'localeControllerByIsoCode' => [
            'application/json',
        ],
        'localeControllerCreate' => [
            'application/json',
        ],
        'localeControllerItem' => [
            'application/json',
        ],
        'localeControllerList' => [
            'application/json',
        ],
        'localeControllerUpdate' => [
            'application/json',
        ],
        'loggingControllerList' => [
            'application/json',
        ],
        'migrationControllerCreate' => [
            'application/json',
        ],
        'migrationControllerDelete' => [
            'application/json',
        ],
        'migrationControllerItem' => [
            'application/json',
        ],
        'migrationControllerList' => [
            'application/json',
        ],
        'migrationControllerSummary' => [
            'application/json',
        ],
        'monitoringPromptControllerCreate' => [
            'application/json',
        ],
        'monitoringPromptControllerItem' => [
            'application/json',
        ],
        'monitoringPromptControllerItemByKey' => [
            'application/json',
        ],
        'monitoringPromptControllerList' => [
            'application/json',
        ],
        'monitoringPromptControllerRevisionsByPreviousStatus' => [
            'application/json',
        ],
        'monitoringPromptControllerUpdate' => [
            'application/json',
        ],
        'monitoringPromptRunControllerItem' => [
            'application/json',
        ],
        'monitoringPromptRunControllerList' => [
            'application/json',
        ],
        'onboardingUtilityControllerGetContentItemTerms' => [
            'application/json',
        ],
        'onboardingUtilityControllerGetMainPageDataExtraction' => [
            'application/json',
        ],
        'onboardingUtilityControllerGetMainPageHtmlDom' => [
            'application/json',
        ],
        'onboardingUtilityControllerGetMainPageMarkdown' => [
            'application/json',
        ],
        'onboardingUtilityControllerGetMainPageRetrieve' => [
            'application/json',
        ],
        'onboardingUtilityControllerGetMainPageSystemPage' => [
            'application/json',
        ],
        'onboardingUtilityControllerGetReducedTerms' => [
            'application/json',
        ],
        'onboardingUtilityControllerSubmitSelectedPages' => [
            'application/json',
        ],
        'poolControllerCreate' => [
            'application/json',
        ],
        'poolControllerItem' => [
            'application/json',
        ],
        'poolControllerList' => [
            'application/json',
        ],
        'previewsControllerList' => [
            'application/json',
        ],
        'previewsControllerListForFlow' => [
            'application/json',
        ],
        'projectControllerGetLanguages' => [
            'application/json',
        ],
        'projectControllerItem' => [
            'application/json',
        ],
        'projectControllerItemByUuid' => [
            'application/json',
        ],
        'projectControllerUpdateCrawlingSettings' => [
            'application/json',
        ],
        'projectLinkControllerImport' => [
            'application/json',
        ],
        'projectLinkControllerItem' => [
            'application/json',
        ],
        'projectLinkControllerItemByUuid' => [
            'application/json',
        ],
        'remoteEntityCloneControllerItem' => [
            'application/json',
        ],
        'remoteEntityCloneControllerItemByTargetUuid' => [
            'application/json',
        ],
        'remoteEntityCloneControllerList' => [
            'application/json',
        ],
        'remoteEntityCloneControllerListBySourceUuid' => [
            'application/json',
        ],
        'remoteEntityRevisionControllerCreate' => [
            'application/json',
        ],
        'remoteEntityRevisionControllerDelete' => [
            'application/json',
        ],
        'remoteEntityRevisionControllerGetTranslationLanguages' => [
            'application/json',
        ],
        'remoteEntityRevisionControllerItem' => [
            'application/json',
        ],
        'remoteEntityRevisionControllerList' => [
            'application/json',
        ],
        'remoteEntityRevisionControllerSerialize' => [
            'application/json',
        ],
        'remoteEntityTypeControllerByMachineName' => [
            'application/json',
        ],
        'remoteEntityTypeControllerItem' => [
            'application/json',
        ],
        'remoteEntityTypeControllerList' => [
            'application/json',
        ],
        'remoteEntityTypeVersionControllerCreate' => [
            'application/json',
        ],
        'remoteEntityTypeVersionControllerGetVersionUsage' => [
            'application/json',
        ],
        'remoteEntityTypeVersionControllerItem' => [
            'application/json',
        ],
        'remoteEntityTypeVersionControllerItemByMachineName' => [
            'application/json',
        ],
        'remoteEntityUsageControllerItem' => [
            'application/json',
        ],
        'remoteEntityUsageControllerList' => [
            'application/json',
        ],
        'serviceSecretsControllerActiveByTarget' => [
            'application/json',
        ],
        'serviceSecretsControllerArchiveAiProviderSecrets' => [
            'application/json',
        ],
        'serviceSecretsControllerItem' => [
            'application/json',
        ],
        'serviceSecretsControllerList' => [
            'application/json',
        ],
        'serviceSecretsControllerRevisionsByPreviousStatus' => [
            'application/json',
        ],
        'serviceSecretsControllerSetAiProviderAccessKey' => [
            'application/json',
        ],
        'siteControllerGetRequests' => [
            'application/json',
        ],
        'siteControllerGetThrottling' => [
            'application/json',
        ],
        'siteControllerItem' => [
            'application/json',
        ],
        'siteControllerItemByUuid' => [
            'application/json',
        ],
        'siteControllerRegister' => [
            'application/json',
        ],
        'siteControllerRegisterNew' => [
            'application/json',
        ],
        'siteControllerRespondToRequest' => [
            'application/json',
        ],
        'siteControllerSearch' => [
            'application/json',
        ],
        'siteControllerSelf' => [
            'application/json',
        ],
        'siteControllerSetThrottling' => [
            'application/json',
        ],
        'siteControllerUpdate' => [
            'application/json',
        ],
        'siteControllerUpdateConfig' => [
            'application/json',
        ],
        'syndicationControllerCreate' => [
            'application/json',
        ],
        'syndicationControllerDelete' => [
            'application/json',
        ],
        'syndicationControllerGetErrors' => [
            'application/json',
        ],
        'syndicationControllerItem' => [
            'application/json',
        ],
        'syndicationControllerList' => [
            'application/json',
        ],
        'syndicationControllerRestart' => [
            'application/json',
        ],
        'syndicationControllerRestartOperation' => [
            'application/json',
        ],
        'syndicationControllerTrace' => [
            'application/json',
        ],
        'syndicationControllerUsageSummary' => [
            'application/json',
        ],
        'syndicationControllerUsageSummaryForSite' => [
            'application/json',
        ],
        'taskControllerCreate' => [
            'application/json',
        ],
        'taskControllerDelete' => [
            'application/json',
        ],
        'taskControllerGetErrors' => [
            'application/json',
        ],
        'taskControllerItem' => [
            'application/json',
        ],
        'taskControllerList' => [
            'application/json',
        ],
        'taskControllerRestart' => [
            'application/json',
        ],
        'taskControllerRestartOperation' => [
            'application/json',
        ],
        'taskControllerTrace' => [
            'application/json',
        ],
        'taskControllerUsageSummary' => [
            'application/json',
        ],
        'taskControllerUsageSummaryForSite' => [
            'application/json',
        ],
        'taskGroupControllerCreate' => [
            'application/json',
        ],
        'taskGroupControllerDelete' => [
            'application/json',
        ],
        'taskGroupControllerItem' => [
            'application/json',
        ],
        'taskGroupControllerList' => [
            'application/json',
        ],
        'taskGroupControllerSummary' => [
            'application/json',
        ],
        'taxonomyControllerCreate' => [
            'application/json',
        ],
        'taxonomyControllerItem' => [
            'application/json',
        ],
        'taxonomyControllerItemByFacet' => [
            'application/json',
        ],
        'taxonomyControllerItemByKey' => [
            'application/json',
        ],
        'taxonomyControllerList' => [
            'application/json',
        ],
        'taxonomyControllerUpdate' => [
            'application/json',
        ],
        'taxonomyTermControllerCreate' => [
            'application/json',
        ],
        'taxonomyTermControllerItem' => [
            'application/json',
        ],
        'taxonomyTermControllerItemByKey' => [
            'application/json',
        ],
        'taxonomyTermControllerList' => [
            'application/json',
        ],
        'taxonomyTermControllerRevisionsByPreviousStatus' => [
            'application/json',
        ],
        'taxonomyTermControllerUpdate' => [
            'application/json',
        ],
        'textProfileControllerItem' => [
            'application/json',
        ],
        'textProfileControllerList' => [
            'application/json',
        ],
        'usageStatsControllerGetForPeriod' => [
            'application/json',
        ],
        'usageStatsControllerGetForType' => [
            'application/json',
        ],
        'usageStatsControllerSummary' => [
            'application/json',
        ],
        'webhookControllerCreate' => [
            'application/json',
        ],
        'webhookControllerDelete' => [
            'application/json',
        ],
        'webhookControllerItem' => [
            'application/json',
        ],
        'webhookControllerList' => [
            'application/json',
        ],
        'webhookControllerSendVerificationEmail' => [
            'application/json',
        ],
        'webhookControllerUpdate' => [
            'application/json',
        ],
        'webhookControllerVerifyEmail' => [
            'application/json',
        ],
    ];

/**
     * @param ClientInterface $client
     * @param Configuration   $config
     * @param HeaderSelector  $selector
     * @param int             $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
     */
    public function __construct(
        ClientInterface $client = null,
        Configuration $config = null,
        HeaderSelector $selector = null,
        $hostIndex = 0
    ) {
        $this->client = $client ?: new Client();
        $this->config = $config ?: new Configuration();
        $this->headerSelector = $selector ?: new HeaderSelector();
        $this->hostIndex = $hostIndex;
    }

    /**
     * Set the host index
     *
     * @param int $hostIndex Host index (required)
     */
    public function setHostIndex($hostIndex): void
    {
        $this->hostIndex = $hostIndex;
    }

    /**
     * Get the host index
     *
     * @return int Host index
     */
    public function getHostIndex()
    {
        return $this->hostIndex;
    }

    /**
     * @return Configuration
     */
    public function getConfig()
    {
        return $this->config;
    }

    /**
     * Operation aiModelControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiModelDto $createAiModelDto createAiModelDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity
     */
    public function aiModelControllerCreate($createAiModelDto, string $contentType = self::contentTypes['aiModelControllerCreate'][0])
    {
        list($response) = $this->aiModelControllerCreateWithHttpInfo($createAiModelDto, $contentType);
        return $response;
    }

    /**
     * Operation aiModelControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiModelDto $createAiModelDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiModelControllerCreateWithHttpInfo($createAiModelDto, string $contentType = self::contentTypes['aiModelControllerCreate'][0])
    {
        $request = $this->aiModelControllerCreateRequest($createAiModelDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiModelControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiModelDto $createAiModelDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiModelControllerCreateAsync($createAiModelDto, string $contentType = self::contentTypes['aiModelControllerCreate'][0])
    {
        return $this->aiModelControllerCreateAsyncWithHttpInfo($createAiModelDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiModelControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiModelDto $createAiModelDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiModelControllerCreateAsyncWithHttpInfo($createAiModelDto, string $contentType = self::contentTypes['aiModelControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity';
        $request = $this->aiModelControllerCreateRequest($createAiModelDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiModelControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiModelDto $createAiModelDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiModelControllerCreateRequest($createAiModelDto, string $contentType = self::contentTypes['aiModelControllerCreate'][0])
    {

        // verify the required parameter 'createAiModelDto' is set
        if ($createAiModelDto === null || (is_array($createAiModelDto) && count($createAiModelDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createAiModelDto when calling aiModelControllerCreate'
            );
        }


        $resourcePath = '/sync-core/ai-model';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createAiModelDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createAiModelDto));
            } else {
                $httpBody = $createAiModelDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiModelControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity
     */
    public function aiModelControllerItem($id, string $contentType = self::contentTypes['aiModelControllerItem'][0])
    {
        list($response) = $this->aiModelControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation aiModelControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiModelControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['aiModelControllerItem'][0])
    {
        $request = $this->aiModelControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiModelControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiModelControllerItemAsync($id, string $contentType = self::contentTypes['aiModelControllerItem'][0])
    {
        return $this->aiModelControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiModelControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiModelControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['aiModelControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity';
        $request = $this->aiModelControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiModelControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiModelControllerItemRequest($id, string $contentType = self::contentTypes['aiModelControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling aiModelControllerItem'
            );
        }


        $resourcePath = '/sync-core/ai-model/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiModelControllerList
     *
     * @param  mixed $projectId projectId (optional)
     * @param  mixed $customerId customerId (optional)
     * @param  mixed $providerId providerId (optional)
     * @param  mixed $accessScope accessScope (optional)
     * @param  mixed $status status (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedAiModelListResponse
     */
    public function aiModelControllerList($projectId = null, $customerId = null, $providerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiModelControllerList'][0])
    {
        list($response) = $this->aiModelControllerListWithHttpInfo($projectId, $customerId, $providerId, $accessScope, $status, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation aiModelControllerListWithHttpInfo
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $providerId (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedAiModelListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiModelControllerListWithHttpInfo($projectId = null, $customerId = null, $providerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiModelControllerList'][0])
    {
        $request = $this->aiModelControllerListRequest($projectId, $customerId, $providerId, $accessScope, $status, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedAiModelListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedAiModelListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiModelListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiModelListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiModelListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiModelControllerListAsync
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $providerId (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiModelControllerListAsync($projectId = null, $customerId = null, $providerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiModelControllerList'][0])
    {
        return $this->aiModelControllerListAsyncWithHttpInfo($projectId, $customerId, $providerId, $accessScope, $status, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiModelControllerListAsyncWithHttpInfo
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $providerId (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiModelControllerListAsyncWithHttpInfo($projectId = null, $customerId = null, $providerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiModelControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiModelListResponse';
        $request = $this->aiModelControllerListRequest($projectId, $customerId, $providerId, $accessScope, $status, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiModelControllerList'
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $providerId (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiModelControllerListRequest($projectId = null, $customerId = null, $providerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiModelControllerList'][0])
    {









        $resourcePath = '/sync-core/ai-model';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $projectId,
            'projectId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $customerId,
            'customerId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $providerId,
            'providerId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $accessScope,
            'accessScope', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiModelControllerUpdate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity $aiModelEntity aiModelEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity
     */
    public function aiModelControllerUpdate($aiModelEntity, string $contentType = self::contentTypes['aiModelControllerUpdate'][0])
    {
        list($response) = $this->aiModelControllerUpdateWithHttpInfo($aiModelEntity, $contentType);
        return $response;
    }

    /**
     * Operation aiModelControllerUpdateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity $aiModelEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiModelControllerUpdateWithHttpInfo($aiModelEntity, string $contentType = self::contentTypes['aiModelControllerUpdate'][0])
    {
        $request = $this->aiModelControllerUpdateRequest($aiModelEntity, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiModelControllerUpdateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity $aiModelEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiModelControllerUpdateAsync($aiModelEntity, string $contentType = self::contentTypes['aiModelControllerUpdate'][0])
    {
        return $this->aiModelControllerUpdateAsyncWithHttpInfo($aiModelEntity, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiModelControllerUpdateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity $aiModelEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiModelControllerUpdateAsyncWithHttpInfo($aiModelEntity, string $contentType = self::contentTypes['aiModelControllerUpdate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity';
        $request = $this->aiModelControllerUpdateRequest($aiModelEntity, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiModelControllerUpdate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiModelEntity $aiModelEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiModelControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiModelControllerUpdateRequest($aiModelEntity, string $contentType = self::contentTypes['aiModelControllerUpdate'][0])
    {

        // verify the required parameter 'aiModelEntity' is set
        if ($aiModelEntity === null || (is_array($aiModelEntity) && count($aiModelEntity) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $aiModelEntity when calling aiModelControllerUpdate'
            );
        }


        $resourcePath = '/sync-core/ai-model';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($aiModelEntity)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($aiModelEntity));
            } else {
                $httpBody = $aiModelEntity;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'PATCH',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiPromptExecutionControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptExecutionControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\AiPromptExecutionEntity
     */
    public function aiPromptExecutionControllerItem($id, string $contentType = self::contentTypes['aiPromptExecutionControllerItem'][0])
    {
        list($response) = $this->aiPromptExecutionControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation aiPromptExecutionControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptExecutionControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\AiPromptExecutionEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiPromptExecutionControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['aiPromptExecutionControllerItem'][0])
    {
        $request = $this->aiPromptExecutionControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\AiPromptExecutionEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\AiPromptExecutionEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptExecutionEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptExecutionEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptExecutionEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiPromptExecutionControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptExecutionControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptExecutionControllerItemAsync($id, string $contentType = self::contentTypes['aiPromptExecutionControllerItem'][0])
    {
        return $this->aiPromptExecutionControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiPromptExecutionControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptExecutionControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptExecutionControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['aiPromptExecutionControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptExecutionEntity';
        $request = $this->aiPromptExecutionControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiPromptExecutionControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptExecutionControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiPromptExecutionControllerItemRequest($id, string $contentType = self::contentTypes['aiPromptExecutionControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling aiPromptExecutionControllerItem'
            );
        }


        $resourcePath = '/sync-core/ai-prompt-execution/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiPromptExecutionControllerList
     *
     * @param  mixed $templateKey templateKey (optional)
     * @param  mixed $templateId templateId (optional)
     * @param  mixed $projectId projectId (optional)
     * @param  mixed $customerId customerId (optional)
     * @param  mixed $modelId modelId (optional)
     * @param  mixed $providerId providerId (optional)
     * @param  mixed $status status (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptExecutionControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptExecutionListResponse
     */
    public function aiPromptExecutionControllerList($templateKey = null, $templateId = null, $projectId = null, $customerId = null, $modelId = null, $providerId = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiPromptExecutionControllerList'][0])
    {
        list($response) = $this->aiPromptExecutionControllerListWithHttpInfo($templateKey, $templateId, $projectId, $customerId, $modelId, $providerId, $status, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation aiPromptExecutionControllerListWithHttpInfo
     *
     * @param  mixed $templateKey (optional)
     * @param  mixed $templateId (optional)
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $modelId (optional)
     * @param  mixed $providerId (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptExecutionControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptExecutionListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiPromptExecutionControllerListWithHttpInfo($templateKey = null, $templateId = null, $projectId = null, $customerId = null, $modelId = null, $providerId = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiPromptExecutionControllerList'][0])
    {
        $request = $this->aiPromptExecutionControllerListRequest($templateKey, $templateId, $projectId, $customerId, $modelId, $providerId, $status, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptExecutionListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptExecutionListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptExecutionListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptExecutionListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptExecutionListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiPromptExecutionControllerListAsync
     *
     * @param  mixed $templateKey (optional)
     * @param  mixed $templateId (optional)
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $modelId (optional)
     * @param  mixed $providerId (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptExecutionControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptExecutionControllerListAsync($templateKey = null, $templateId = null, $projectId = null, $customerId = null, $modelId = null, $providerId = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiPromptExecutionControllerList'][0])
    {
        return $this->aiPromptExecutionControllerListAsyncWithHttpInfo($templateKey, $templateId, $projectId, $customerId, $modelId, $providerId, $status, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiPromptExecutionControllerListAsyncWithHttpInfo
     *
     * @param  mixed $templateKey (optional)
     * @param  mixed $templateId (optional)
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $modelId (optional)
     * @param  mixed $providerId (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptExecutionControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptExecutionControllerListAsyncWithHttpInfo($templateKey = null, $templateId = null, $projectId = null, $customerId = null, $modelId = null, $providerId = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiPromptExecutionControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptExecutionListResponse';
        $request = $this->aiPromptExecutionControllerListRequest($templateKey, $templateId, $projectId, $customerId, $modelId, $providerId, $status, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiPromptExecutionControllerList'
     *
     * @param  mixed $templateKey (optional)
     * @param  mixed $templateId (optional)
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $modelId (optional)
     * @param  mixed $providerId (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptExecutionControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiPromptExecutionControllerListRequest($templateKey = null, $templateId = null, $projectId = null, $customerId = null, $modelId = null, $providerId = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiPromptExecutionControllerList'][0])
    {











        $resourcePath = '/sync-core/ai-prompt-execution';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $templateKey,
            'templateKey', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $templateId,
            'templateId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $projectId,
            'projectId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $customerId,
            'customerId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $modelId,
            'modelId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $providerId,
            'providerId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiPromptTemplateControllerActiveByKey
     *
     * @param  string $status status (required)
     * @param  string $key key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerActiveByKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity
     */
    public function aiPromptTemplateControllerActiveByKey($status, $key, string $contentType = self::contentTypes['aiPromptTemplateControllerActiveByKey'][0])
    {
        list($response) = $this->aiPromptTemplateControllerActiveByKeyWithHttpInfo($status, $key, $contentType);
        return $response;
    }

    /**
     * Operation aiPromptTemplateControllerActiveByKeyWithHttpInfo
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerActiveByKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiPromptTemplateControllerActiveByKeyWithHttpInfo($status, $key, string $contentType = self::contentTypes['aiPromptTemplateControllerActiveByKey'][0])
    {
        $request = $this->aiPromptTemplateControllerActiveByKeyRequest($status, $key, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiPromptTemplateControllerActiveByKeyAsync
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerActiveByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptTemplateControllerActiveByKeyAsync($status, $key, string $contentType = self::contentTypes['aiPromptTemplateControllerActiveByKey'][0])
    {
        return $this->aiPromptTemplateControllerActiveByKeyAsyncWithHttpInfo($status, $key, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiPromptTemplateControllerActiveByKeyAsyncWithHttpInfo
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerActiveByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptTemplateControllerActiveByKeyAsyncWithHttpInfo($status, $key, string $contentType = self::contentTypes['aiPromptTemplateControllerActiveByKey'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity';
        $request = $this->aiPromptTemplateControllerActiveByKeyRequest($status, $key, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiPromptTemplateControllerActiveByKey'
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerActiveByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiPromptTemplateControllerActiveByKeyRequest($status, $key, string $contentType = self::contentTypes['aiPromptTemplateControllerActiveByKey'][0])
    {

        // verify the required parameter 'status' is set
        if ($status === null || (is_array($status) && count($status) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $status when calling aiPromptTemplateControllerActiveByKey'
            );
        }

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling aiPromptTemplateControllerActiveByKey'
            );
        }


        $resourcePath = '/sync-core/ai-prompt-template/by-key/{key}/{status}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($status !== null) {
            $resourcePath = str_replace(
                '{' . 'status' . '}',
                ObjectSerializer::toPathValue($status),
                $resourcePath
            );
        }
        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiPromptTemplateControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiPromptTemplateDto $createAiPromptTemplateDto createAiPromptTemplateDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity
     */
    public function aiPromptTemplateControllerCreate($createAiPromptTemplateDto, string $contentType = self::contentTypes['aiPromptTemplateControllerCreate'][0])
    {
        list($response) = $this->aiPromptTemplateControllerCreateWithHttpInfo($createAiPromptTemplateDto, $contentType);
        return $response;
    }

    /**
     * Operation aiPromptTemplateControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiPromptTemplateDto $createAiPromptTemplateDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiPromptTemplateControllerCreateWithHttpInfo($createAiPromptTemplateDto, string $contentType = self::contentTypes['aiPromptTemplateControllerCreate'][0])
    {
        $request = $this->aiPromptTemplateControllerCreateRequest($createAiPromptTemplateDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiPromptTemplateControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiPromptTemplateDto $createAiPromptTemplateDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptTemplateControllerCreateAsync($createAiPromptTemplateDto, string $contentType = self::contentTypes['aiPromptTemplateControllerCreate'][0])
    {
        return $this->aiPromptTemplateControllerCreateAsyncWithHttpInfo($createAiPromptTemplateDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiPromptTemplateControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiPromptTemplateDto $createAiPromptTemplateDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptTemplateControllerCreateAsyncWithHttpInfo($createAiPromptTemplateDto, string $contentType = self::contentTypes['aiPromptTemplateControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity';
        $request = $this->aiPromptTemplateControllerCreateRequest($createAiPromptTemplateDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiPromptTemplateControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiPromptTemplateDto $createAiPromptTemplateDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiPromptTemplateControllerCreateRequest($createAiPromptTemplateDto, string $contentType = self::contentTypes['aiPromptTemplateControllerCreate'][0])
    {

        // verify the required parameter 'createAiPromptTemplateDto' is set
        if ($createAiPromptTemplateDto === null || (is_array($createAiPromptTemplateDto) && count($createAiPromptTemplateDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createAiPromptTemplateDto when calling aiPromptTemplateControllerCreate'
            );
        }


        $resourcePath = '/sync-core/ai-prompt-template';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createAiPromptTemplateDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createAiPromptTemplateDto));
            } else {
                $httpBody = $createAiPromptTemplateDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiPromptTemplateControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity
     */
    public function aiPromptTemplateControllerItem($id, string $contentType = self::contentTypes['aiPromptTemplateControllerItem'][0])
    {
        list($response) = $this->aiPromptTemplateControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation aiPromptTemplateControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiPromptTemplateControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['aiPromptTemplateControllerItem'][0])
    {
        $request = $this->aiPromptTemplateControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiPromptTemplateControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptTemplateControllerItemAsync($id, string $contentType = self::contentTypes['aiPromptTemplateControllerItem'][0])
    {
        return $this->aiPromptTemplateControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiPromptTemplateControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptTemplateControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['aiPromptTemplateControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity';
        $request = $this->aiPromptTemplateControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiPromptTemplateControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiPromptTemplateControllerItemRequest($id, string $contentType = self::contentTypes['aiPromptTemplateControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling aiPromptTemplateControllerItem'
            );
        }


        $resourcePath = '/sync-core/ai-prompt-template/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiPromptTemplateControllerList
     *
     * @param  mixed $key key (optional)
     * @param  mixed $projectId projectId (optional)
     * @param  mixed $customerId customerId (optional)
     * @param  mixed $modelId modelId (optional)
     * @param  mixed $providerId providerId (optional)
     * @param  mixed $accessScope accessScope (optional)
     * @param  mixed $status status (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $search search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse
     */
    public function aiPromptTemplateControllerList($key = null, $projectId = null, $customerId = null, $modelId = null, $providerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, $search = null, string $contentType = self::contentTypes['aiPromptTemplateControllerList'][0])
    {
        list($response) = $this->aiPromptTemplateControllerListWithHttpInfo($key, $projectId, $customerId, $modelId, $providerId, $accessScope, $status, $page, $itemsPerPage, $search, $contentType);
        return $response;
    }

    /**
     * Operation aiPromptTemplateControllerListWithHttpInfo
     *
     * @param  mixed $key (optional)
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $modelId (optional)
     * @param  mixed $providerId (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiPromptTemplateControllerListWithHttpInfo($key = null, $projectId = null, $customerId = null, $modelId = null, $providerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, $search = null, string $contentType = self::contentTypes['aiPromptTemplateControllerList'][0])
    {
        $request = $this->aiPromptTemplateControllerListRequest($key, $projectId, $customerId, $modelId, $providerId, $accessScope, $status, $page, $itemsPerPage, $search, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiPromptTemplateControllerListAsync
     *
     * @param  mixed $key (optional)
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $modelId (optional)
     * @param  mixed $providerId (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptTemplateControllerListAsync($key = null, $projectId = null, $customerId = null, $modelId = null, $providerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, $search = null, string $contentType = self::contentTypes['aiPromptTemplateControllerList'][0])
    {
        return $this->aiPromptTemplateControllerListAsyncWithHttpInfo($key, $projectId, $customerId, $modelId, $providerId, $accessScope, $status, $page, $itemsPerPage, $search, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiPromptTemplateControllerListAsyncWithHttpInfo
     *
     * @param  mixed $key (optional)
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $modelId (optional)
     * @param  mixed $providerId (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptTemplateControllerListAsyncWithHttpInfo($key = null, $projectId = null, $customerId = null, $modelId = null, $providerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, $search = null, string $contentType = self::contentTypes['aiPromptTemplateControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse';
        $request = $this->aiPromptTemplateControllerListRequest($key, $projectId, $customerId, $modelId, $providerId, $accessScope, $status, $page, $itemsPerPage, $search, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiPromptTemplateControllerList'
     *
     * @param  mixed $key (optional)
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $modelId (optional)
     * @param  mixed $providerId (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiPromptTemplateControllerListRequest($key = null, $projectId = null, $customerId = null, $modelId = null, $providerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, $search = null, string $contentType = self::contentTypes['aiPromptTemplateControllerList'][0])
    {












        $resourcePath = '/sync-core/ai-prompt-template';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $key,
            'key', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $projectId,
            'projectId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $customerId,
            'customerId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $modelId,
            'modelId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $providerId,
            'providerId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $accessScope,
            'accessScope', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $search,
            'search', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiPromptTemplateControllerRevisionsByPreviousStatus
     *
     * @param  string $status status (required)
     * @param  string $key key (required)
     * @param  mixed $itemsPerPage itemsPerPage (optional)
     * @param  mixed $page page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse
     */
    public function aiPromptTemplateControllerRevisionsByPreviousStatus($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['aiPromptTemplateControllerRevisionsByPreviousStatus'][0])
    {
        list($response) = $this->aiPromptTemplateControllerRevisionsByPreviousStatusWithHttpInfo($status, $key, $itemsPerPage, $page, $contentType);
        return $response;
    }

    /**
     * Operation aiPromptTemplateControllerRevisionsByPreviousStatusWithHttpInfo
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiPromptTemplateControllerRevisionsByPreviousStatusWithHttpInfo($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['aiPromptTemplateControllerRevisionsByPreviousStatus'][0])
    {
        $request = $this->aiPromptTemplateControllerRevisionsByPreviousStatusRequest($status, $key, $itemsPerPage, $page, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiPromptTemplateControllerRevisionsByPreviousStatusAsync
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptTemplateControllerRevisionsByPreviousStatusAsync($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['aiPromptTemplateControllerRevisionsByPreviousStatus'][0])
    {
        return $this->aiPromptTemplateControllerRevisionsByPreviousStatusAsyncWithHttpInfo($status, $key, $itemsPerPage, $page, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiPromptTemplateControllerRevisionsByPreviousStatusAsyncWithHttpInfo
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptTemplateControllerRevisionsByPreviousStatusAsyncWithHttpInfo($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['aiPromptTemplateControllerRevisionsByPreviousStatus'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiPromptTemplateListResponse';
        $request = $this->aiPromptTemplateControllerRevisionsByPreviousStatusRequest($status, $key, $itemsPerPage, $page, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiPromptTemplateControllerRevisionsByPreviousStatus'
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiPromptTemplateControllerRevisionsByPreviousStatusRequest($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['aiPromptTemplateControllerRevisionsByPreviousStatus'][0])
    {

        // verify the required parameter 'status' is set
        if ($status === null || (is_array($status) && count($status) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $status when calling aiPromptTemplateControllerRevisionsByPreviousStatus'
            );
        }

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling aiPromptTemplateControllerRevisionsByPreviousStatus'
            );
        }




        $resourcePath = '/sync-core/ai-prompt-template/by-key/{key}/{status}/revisions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($status !== null) {
            $resourcePath = str_replace(
                '{' . 'status' . '}',
                ObjectSerializer::toPathValue($status),
                $resourcePath
            );
        }
        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiPromptTemplateControllerUpdate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity $aiPromptTemplateEntity aiPromptTemplateEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity
     */
    public function aiPromptTemplateControllerUpdate($aiPromptTemplateEntity, string $contentType = self::contentTypes['aiPromptTemplateControllerUpdate'][0])
    {
        list($response) = $this->aiPromptTemplateControllerUpdateWithHttpInfo($aiPromptTemplateEntity, $contentType);
        return $response;
    }

    /**
     * Operation aiPromptTemplateControllerUpdateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity $aiPromptTemplateEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiPromptTemplateControllerUpdateWithHttpInfo($aiPromptTemplateEntity, string $contentType = self::contentTypes['aiPromptTemplateControllerUpdate'][0])
    {
        $request = $this->aiPromptTemplateControllerUpdateRequest($aiPromptTemplateEntity, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiPromptTemplateControllerUpdateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity $aiPromptTemplateEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptTemplateControllerUpdateAsync($aiPromptTemplateEntity, string $contentType = self::contentTypes['aiPromptTemplateControllerUpdate'][0])
    {
        return $this->aiPromptTemplateControllerUpdateAsyncWithHttpInfo($aiPromptTemplateEntity, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiPromptTemplateControllerUpdateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity $aiPromptTemplateEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiPromptTemplateControllerUpdateAsyncWithHttpInfo($aiPromptTemplateEntity, string $contentType = self::contentTypes['aiPromptTemplateControllerUpdate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity';
        $request = $this->aiPromptTemplateControllerUpdateRequest($aiPromptTemplateEntity, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiPromptTemplateControllerUpdate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiPromptTemplateEntity $aiPromptTemplateEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiPromptTemplateControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiPromptTemplateControllerUpdateRequest($aiPromptTemplateEntity, string $contentType = self::contentTypes['aiPromptTemplateControllerUpdate'][0])
    {

        // verify the required parameter 'aiPromptTemplateEntity' is set
        if ($aiPromptTemplateEntity === null || (is_array($aiPromptTemplateEntity) && count($aiPromptTemplateEntity) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $aiPromptTemplateEntity when calling aiPromptTemplateControllerUpdate'
            );
        }


        $resourcePath = '/sync-core/ai-prompt-template';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($aiPromptTemplateEntity)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($aiPromptTemplateEntity));
            } else {
                $httpBody = $aiPromptTemplateEntity;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'PATCH',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiProviderControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiProviderDto $createAiProviderDto createAiProviderDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity
     */
    public function aiProviderControllerCreate($createAiProviderDto, string $contentType = self::contentTypes['aiProviderControllerCreate'][0])
    {
        list($response) = $this->aiProviderControllerCreateWithHttpInfo($createAiProviderDto, $contentType);
        return $response;
    }

    /**
     * Operation aiProviderControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiProviderDto $createAiProviderDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiProviderControllerCreateWithHttpInfo($createAiProviderDto, string $contentType = self::contentTypes['aiProviderControllerCreate'][0])
    {
        $request = $this->aiProviderControllerCreateRequest($createAiProviderDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiProviderControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiProviderDto $createAiProviderDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiProviderControllerCreateAsync($createAiProviderDto, string $contentType = self::contentTypes['aiProviderControllerCreate'][0])
    {
        return $this->aiProviderControllerCreateAsyncWithHttpInfo($createAiProviderDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiProviderControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiProviderDto $createAiProviderDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiProviderControllerCreateAsyncWithHttpInfo($createAiProviderDto, string $contentType = self::contentTypes['aiProviderControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity';
        $request = $this->aiProviderControllerCreateRequest($createAiProviderDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiProviderControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAiProviderDto $createAiProviderDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiProviderControllerCreateRequest($createAiProviderDto, string $contentType = self::contentTypes['aiProviderControllerCreate'][0])
    {

        // verify the required parameter 'createAiProviderDto' is set
        if ($createAiProviderDto === null || (is_array($createAiProviderDto) && count($createAiProviderDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createAiProviderDto when calling aiProviderControllerCreate'
            );
        }


        $resourcePath = '/sync-core/ai-provider';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createAiProviderDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createAiProviderDto));
            } else {
                $httpBody = $createAiProviderDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiProviderControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity
     */
    public function aiProviderControllerItem($id, string $contentType = self::contentTypes['aiProviderControllerItem'][0])
    {
        list($response) = $this->aiProviderControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation aiProviderControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiProviderControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['aiProviderControllerItem'][0])
    {
        $request = $this->aiProviderControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiProviderControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiProviderControllerItemAsync($id, string $contentType = self::contentTypes['aiProviderControllerItem'][0])
    {
        return $this->aiProviderControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiProviderControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiProviderControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['aiProviderControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity';
        $request = $this->aiProviderControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiProviderControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiProviderControllerItemRequest($id, string $contentType = self::contentTypes['aiProviderControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling aiProviderControllerItem'
            );
        }


        $resourcePath = '/sync-core/ai-provider/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiProviderControllerList
     *
     * @param  mixed $projectId projectId (optional)
     * @param  mixed $customerId customerId (optional)
     * @param  mixed $accessScope accessScope (optional)
     * @param  mixed $status status (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedAiProviderListResponse
     */
    public function aiProviderControllerList($projectId = null, $customerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiProviderControllerList'][0])
    {
        list($response) = $this->aiProviderControllerListWithHttpInfo($projectId, $customerId, $accessScope, $status, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation aiProviderControllerListWithHttpInfo
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedAiProviderListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiProviderControllerListWithHttpInfo($projectId = null, $customerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiProviderControllerList'][0])
    {
        $request = $this->aiProviderControllerListRequest($projectId, $customerId, $accessScope, $status, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedAiProviderListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedAiProviderListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiProviderListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiProviderListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiProviderListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiProviderControllerListAsync
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiProviderControllerListAsync($projectId = null, $customerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiProviderControllerList'][0])
    {
        return $this->aiProviderControllerListAsyncWithHttpInfo($projectId, $customerId, $accessScope, $status, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiProviderControllerListAsyncWithHttpInfo
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiProviderControllerListAsyncWithHttpInfo($projectId = null, $customerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiProviderControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedAiProviderListResponse';
        $request = $this->aiProviderControllerListRequest($projectId, $customerId, $accessScope, $status, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiProviderControllerList'
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiProviderControllerListRequest($projectId = null, $customerId = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['aiProviderControllerList'][0])
    {








        $resourcePath = '/sync-core/ai-provider';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $projectId,
            'projectId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $customerId,
            'customerId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $accessScope,
            'accessScope', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiProviderControllerModels
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerModels'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\AiProviderModelListResponse
     */
    public function aiProviderControllerModels($id, string $contentType = self::contentTypes['aiProviderControllerModels'][0])
    {
        list($response) = $this->aiProviderControllerModelsWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation aiProviderControllerModelsWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerModels'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\AiProviderModelListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiProviderControllerModelsWithHttpInfo($id, string $contentType = self::contentTypes['aiProviderControllerModels'][0])
    {
        $request = $this->aiProviderControllerModelsRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\AiProviderModelListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\AiProviderModelListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderModelListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderModelListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderModelListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiProviderControllerModelsAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerModels'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiProviderControllerModelsAsync($id, string $contentType = self::contentTypes['aiProviderControllerModels'][0])
    {
        return $this->aiProviderControllerModelsAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiProviderControllerModelsAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerModels'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiProviderControllerModelsAsyncWithHttpInfo($id, string $contentType = self::contentTypes['aiProviderControllerModels'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderModelListResponse';
        $request = $this->aiProviderControllerModelsRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiProviderControllerModels'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerModels'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiProviderControllerModelsRequest($id, string $contentType = self::contentTypes['aiProviderControllerModels'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling aiProviderControllerModels'
            );
        }


        $resourcePath = '/sync-core/ai-provider/{id}/models';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation aiProviderControllerUpdate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity $aiProviderEntity aiProviderEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity
     */
    public function aiProviderControllerUpdate($aiProviderEntity, string $contentType = self::contentTypes['aiProviderControllerUpdate'][0])
    {
        list($response) = $this->aiProviderControllerUpdateWithHttpInfo($aiProviderEntity, $contentType);
        return $response;
    }

    /**
     * Operation aiProviderControllerUpdateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity $aiProviderEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function aiProviderControllerUpdateWithHttpInfo($aiProviderEntity, string $contentType = self::contentTypes['aiProviderControllerUpdate'][0])
    {
        $request = $this->aiProviderControllerUpdateRequest($aiProviderEntity, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation aiProviderControllerUpdateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity $aiProviderEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiProviderControllerUpdateAsync($aiProviderEntity, string $contentType = self::contentTypes['aiProviderControllerUpdate'][0])
    {
        return $this->aiProviderControllerUpdateAsyncWithHttpInfo($aiProviderEntity, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation aiProviderControllerUpdateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity $aiProviderEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function aiProviderControllerUpdateAsyncWithHttpInfo($aiProviderEntity, string $contentType = self::contentTypes['aiProviderControllerUpdate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity';
        $request = $this->aiProviderControllerUpdateRequest($aiProviderEntity, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'aiProviderControllerUpdate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\AiProviderEntity $aiProviderEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['aiProviderControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function aiProviderControllerUpdateRequest($aiProviderEntity, string $contentType = self::contentTypes['aiProviderControllerUpdate'][0])
    {

        // verify the required parameter 'aiProviderEntity' is set
        if ($aiProviderEntity === null || (is_array($aiProviderEntity) && count($aiProviderEntity) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $aiProviderEntity when calling aiProviderControllerUpdate'
            );
        }


        $resourcePath = '/sync-core/ai-provider';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($aiProviderEntity)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($aiProviderEntity));
            } else {
                $httpBody = $aiProviderEntity;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'PATCH',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation authenticationControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAuthenticationDto $createAuthenticationDto createAuthenticationDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function authenticationControllerCreate($createAuthenticationDto, string $contentType = self::contentTypes['authenticationControllerCreate'][0])
    {
        list($response) = $this->authenticationControllerCreateWithHttpInfo($createAuthenticationDto, $contentType);
        return $response;
    }

    /**
     * Operation authenticationControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAuthenticationDto $createAuthenticationDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function authenticationControllerCreateWithHttpInfo($createAuthenticationDto, string $contentType = self::contentTypes['authenticationControllerCreate'][0])
    {
        $request = $this->authenticationControllerCreateRequest($createAuthenticationDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation authenticationControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAuthenticationDto $createAuthenticationDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function authenticationControllerCreateAsync($createAuthenticationDto, string $contentType = self::contentTypes['authenticationControllerCreate'][0])
    {
        return $this->authenticationControllerCreateAsyncWithHttpInfo($createAuthenticationDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation authenticationControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAuthenticationDto $createAuthenticationDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function authenticationControllerCreateAsyncWithHttpInfo($createAuthenticationDto, string $contentType = self::contentTypes['authenticationControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->authenticationControllerCreateRequest($createAuthenticationDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'authenticationControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateAuthenticationDto $createAuthenticationDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function authenticationControllerCreateRequest($createAuthenticationDto, string $contentType = self::contentTypes['authenticationControllerCreate'][0])
    {

        // verify the required parameter 'createAuthenticationDto' is set
        if ($createAuthenticationDto === null || (is_array($createAuthenticationDto) && count($createAuthenticationDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createAuthenticationDto when calling authenticationControllerCreate'
            );
        }


        $resourcePath = '/sync-core/authentication';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createAuthenticationDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createAuthenticationDto));
            } else {
                $httpBody = $createAuthenticationDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation authenticationControllerGetBasicAuth
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerGetBasicAuth'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\GetBasicAuthDto
     */
    public function authenticationControllerGetBasicAuth(string $contentType = self::contentTypes['authenticationControllerGetBasicAuth'][0])
    {
        list($response) = $this->authenticationControllerGetBasicAuthWithHttpInfo($contentType);
        return $response;
    }

    /**
     * Operation authenticationControllerGetBasicAuthWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerGetBasicAuth'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\GetBasicAuthDto, HTTP status code, HTTP response headers (array of strings)
     */
    public function authenticationControllerGetBasicAuthWithHttpInfo(string $contentType = self::contentTypes['authenticationControllerGetBasicAuth'][0])
    {
        $request = $this->authenticationControllerGetBasicAuthRequest($contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\GetBasicAuthDto' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\GetBasicAuthDto' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\GetBasicAuthDto', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GetBasicAuthDto';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\GetBasicAuthDto',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation authenticationControllerGetBasicAuthAsync
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerGetBasicAuth'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function authenticationControllerGetBasicAuthAsync(string $contentType = self::contentTypes['authenticationControllerGetBasicAuth'][0])
    {
        return $this->authenticationControllerGetBasicAuthAsyncWithHttpInfo($contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation authenticationControllerGetBasicAuthAsyncWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerGetBasicAuth'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function authenticationControllerGetBasicAuthAsyncWithHttpInfo(string $contentType = self::contentTypes['authenticationControllerGetBasicAuth'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GetBasicAuthDto';
        $request = $this->authenticationControllerGetBasicAuthRequest($contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'authenticationControllerGetBasicAuth'
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerGetBasicAuth'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function authenticationControllerGetBasicAuthRequest(string $contentType = self::contentTypes['authenticationControllerGetBasicAuth'][0])
    {


        $resourcePath = '/sync-core/authentication/basic-auth';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation authenticationControllerSetBasicAuth
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetBasicAuthDto $setBasicAuthDto setBasicAuthDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerSetBasicAuth'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function authenticationControllerSetBasicAuth($setBasicAuthDto, string $contentType = self::contentTypes['authenticationControllerSetBasicAuth'][0])
    {
        list($response) = $this->authenticationControllerSetBasicAuthWithHttpInfo($setBasicAuthDto, $contentType);
        return $response;
    }

    /**
     * Operation authenticationControllerSetBasicAuthWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetBasicAuthDto $setBasicAuthDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerSetBasicAuth'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function authenticationControllerSetBasicAuthWithHttpInfo($setBasicAuthDto, string $contentType = self::contentTypes['authenticationControllerSetBasicAuth'][0])
    {
        $request = $this->authenticationControllerSetBasicAuthRequest($setBasicAuthDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation authenticationControllerSetBasicAuthAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetBasicAuthDto $setBasicAuthDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerSetBasicAuth'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function authenticationControllerSetBasicAuthAsync($setBasicAuthDto, string $contentType = self::contentTypes['authenticationControllerSetBasicAuth'][0])
    {
        return $this->authenticationControllerSetBasicAuthAsyncWithHttpInfo($setBasicAuthDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation authenticationControllerSetBasicAuthAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetBasicAuthDto $setBasicAuthDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerSetBasicAuth'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function authenticationControllerSetBasicAuthAsyncWithHttpInfo($setBasicAuthDto, string $contentType = self::contentTypes['authenticationControllerSetBasicAuth'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->authenticationControllerSetBasicAuthRequest($setBasicAuthDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'authenticationControllerSetBasicAuth'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetBasicAuthDto $setBasicAuthDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['authenticationControllerSetBasicAuth'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function authenticationControllerSetBasicAuthRequest($setBasicAuthDto, string $contentType = self::contentTypes['authenticationControllerSetBasicAuth'][0])
    {

        // verify the required parameter 'setBasicAuthDto' is set
        if ($setBasicAuthDto === null || (is_array($setBasicAuthDto) && count($setBasicAuthDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $setBasicAuthDto when calling authenticationControllerSetBasicAuth'
            );
        }


        $resourcePath = '/sync-core/authentication/basic-auth';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($setBasicAuthDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($setBasicAuthDto));
            } else {
                $httpBody = $setBasicAuthDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation backendControllerExchangeToken
     *
     * @param  string $uuid uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerExchangeToken'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\JwtResponse
     */
    public function backendControllerExchangeToken($uuid, string $contentType = self::contentTypes['backendControllerExchangeToken'][0])
    {
        list($response) = $this->backendControllerExchangeTokenWithHttpInfo($uuid, $contentType);
        return $response;
    }

    /**
     * Operation backendControllerExchangeTokenWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerExchangeToken'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\JwtResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function backendControllerExchangeTokenWithHttpInfo($uuid, string $contentType = self::contentTypes['backendControllerExchangeToken'][0])
    {
        $request = $this->backendControllerExchangeTokenRequest($uuid, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\JwtResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\JwtResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\JwtResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\JwtResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\JwtResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation backendControllerExchangeTokenAsync
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerExchangeToken'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function backendControllerExchangeTokenAsync($uuid, string $contentType = self::contentTypes['backendControllerExchangeToken'][0])
    {
        return $this->backendControllerExchangeTokenAsyncWithHttpInfo($uuid, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation backendControllerExchangeTokenAsyncWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerExchangeToken'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function backendControllerExchangeTokenAsyncWithHttpInfo($uuid, string $contentType = self::contentTypes['backendControllerExchangeToken'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\JwtResponse';
        $request = $this->backendControllerExchangeTokenRequest($uuid, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'backendControllerExchangeToken'
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerExchangeToken'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function backendControllerExchangeTokenRequest($uuid, string $contentType = self::contentTypes['backendControllerExchangeToken'][0])
    {

        // verify the required parameter 'uuid' is set
        if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $uuid when calling backendControllerExchangeToken'
            );
        }


        $resourcePath = '/sync-core/backend/exchange-token/{uuid}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($uuid !== null) {
            $resourcePath = str_replace(
                '{' . 'uuid' . '}',
                ObjectSerializer::toPathValue($uuid),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation backendControllerImportSite
     *
     * @param  string $uuid uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerImportSite'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails
     */
    public function backendControllerImportSite($uuid, string $contentType = self::contentTypes['backendControllerImportSite'][0])
    {
        list($response) = $this->backendControllerImportSiteWithHttpInfo($uuid, $contentType);
        return $response;
    }

    /**
     * Operation backendControllerImportSiteWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerImportSite'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails, HTTP status code, HTTP response headers (array of strings)
     */
    public function backendControllerImportSiteWithHttpInfo($uuid, string $contentType = self::contentTypes['backendControllerImportSite'][0])
    {
        $request = $this->backendControllerImportSiteRequest($uuid, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation backendControllerImportSiteAsync
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerImportSite'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function backendControllerImportSiteAsync($uuid, string $contentType = self::contentTypes['backendControllerImportSite'][0])
    {
        return $this->backendControllerImportSiteAsyncWithHttpInfo($uuid, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation backendControllerImportSiteAsyncWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerImportSite'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function backendControllerImportSiteAsyncWithHttpInfo($uuid, string $contentType = self::contentTypes['backendControllerImportSite'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails';
        $request = $this->backendControllerImportSiteRequest($uuid, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'backendControllerImportSite'
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerImportSite'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function backendControllerImportSiteRequest($uuid, string $contentType = self::contentTypes['backendControllerImportSite'][0])
    {

        // verify the required parameter 'uuid' is set
        if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $uuid when calling backendControllerImportSite'
            );
        }


        $resourcePath = '/sync-core/backend/site/{uuid}/import';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($uuid !== null) {
            $resourcePath = str_replace(
                '{' . 'uuid' . '}',
                ObjectSerializer::toPathValue($uuid),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation backendControllerRefreshContract
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerRefreshContract'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function backendControllerRefreshContract($id, string $contentType = self::contentTypes['backendControllerRefreshContract'][0])
    {
        list($response) = $this->backendControllerRefreshContractWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation backendControllerRefreshContractWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerRefreshContract'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function backendControllerRefreshContractWithHttpInfo($id, string $contentType = self::contentTypes['backendControllerRefreshContract'][0])
    {
        $request = $this->backendControllerRefreshContractRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation backendControllerRefreshContractAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerRefreshContract'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function backendControllerRefreshContractAsync($id, string $contentType = self::contentTypes['backendControllerRefreshContract'][0])
    {
        return $this->backendControllerRefreshContractAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation backendControllerRefreshContractAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerRefreshContract'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function backendControllerRefreshContractAsyncWithHttpInfo($id, string $contentType = self::contentTypes['backendControllerRefreshContract'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->backendControllerRefreshContractRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'backendControllerRefreshContract'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['backendControllerRefreshContract'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function backendControllerRefreshContractRequest($id, string $contentType = self::contentTypes['backendControllerRefreshContract'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling backendControllerRefreshContract'
            );
        }


        $resourcePath = '/sync-core/backend/contract/{id}/refresh';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation configurationControllerContract
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerContract'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ContractConfiguration
     */
    public function configurationControllerContract(string $contentType = self::contentTypes['configurationControllerContract'][0])
    {
        list($response) = $this->configurationControllerContractWithHttpInfo($contentType);
        return $response;
    }

    /**
     * Operation configurationControllerContractWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerContract'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ContractConfiguration, HTTP status code, HTTP response headers (array of strings)
     */
    public function configurationControllerContractWithHttpInfo(string $contentType = self::contentTypes['configurationControllerContract'][0])
    {
        $request = $this->configurationControllerContractRequest($contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ContractConfiguration' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ContractConfiguration' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ContractConfiguration', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContractConfiguration';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ContractConfiguration',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation configurationControllerContractAsync
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerContract'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function configurationControllerContractAsync(string $contentType = self::contentTypes['configurationControllerContract'][0])
    {
        return $this->configurationControllerContractAsyncWithHttpInfo($contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation configurationControllerContractAsyncWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerContract'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function configurationControllerContractAsyncWithHttpInfo(string $contentType = self::contentTypes['configurationControllerContract'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContractConfiguration';
        $request = $this->configurationControllerContractRequest($contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'configurationControllerContract'
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerContract'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function configurationControllerContractRequest(string $contentType = self::contentTypes['configurationControllerContract'][0])
    {


        $resourcePath = '/sync-core/configuration/contract';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation configurationControllerInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerInfo'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SyncCoreInfo
     */
    public function configurationControllerInfo(string $contentType = self::contentTypes['configurationControllerInfo'][0])
    {
        list($response) = $this->configurationControllerInfoWithHttpInfo($contentType);
        return $response;
    }

    /**
     * Operation configurationControllerInfoWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerInfo'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SyncCoreInfo, HTTP status code, HTTP response headers (array of strings)
     */
    public function configurationControllerInfoWithHttpInfo(string $contentType = self::contentTypes['configurationControllerInfo'][0])
    {
        $request = $this->configurationControllerInfoRequest($contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SyncCoreInfo' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SyncCoreInfo' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SyncCoreInfo', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyncCoreInfo';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SyncCoreInfo',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation configurationControllerInfoAsync
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerInfo'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function configurationControllerInfoAsync(string $contentType = self::contentTypes['configurationControllerInfo'][0])
    {
        return $this->configurationControllerInfoAsyncWithHttpInfo($contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation configurationControllerInfoAsyncWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerInfo'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function configurationControllerInfoAsyncWithHttpInfo(string $contentType = self::contentTypes['configurationControllerInfo'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyncCoreInfo';
        $request = $this->configurationControllerInfoRequest($contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'configurationControllerInfo'
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerInfo'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function configurationControllerInfoRequest(string $contentType = self::contentTypes['configurationControllerInfo'][0])
    {


        $resourcePath = '/sync-core/configuration/info';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation configurationControllerPullDashboard
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerPullDashboard'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PullDashboardConfiguration
     */
    public function configurationControllerPullDashboard(string $contentType = self::contentTypes['configurationControllerPullDashboard'][0])
    {
        list($response) = $this->configurationControllerPullDashboardWithHttpInfo($contentType);
        return $response;
    }

    /**
     * Operation configurationControllerPullDashboardWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerPullDashboard'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PullDashboardConfiguration, HTTP status code, HTTP response headers (array of strings)
     */
    public function configurationControllerPullDashboardWithHttpInfo(string $contentType = self::contentTypes['configurationControllerPullDashboard'][0])
    {
        $request = $this->configurationControllerPullDashboardRequest($contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PullDashboardConfiguration' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PullDashboardConfiguration' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PullDashboardConfiguration', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PullDashboardConfiguration';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PullDashboardConfiguration',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation configurationControllerPullDashboardAsync
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerPullDashboard'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function configurationControllerPullDashboardAsync(string $contentType = self::contentTypes['configurationControllerPullDashboard'][0])
    {
        return $this->configurationControllerPullDashboardAsyncWithHttpInfo($contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation configurationControllerPullDashboardAsyncWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerPullDashboard'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function configurationControllerPullDashboardAsyncWithHttpInfo(string $contentType = self::contentTypes['configurationControllerPullDashboard'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PullDashboardConfiguration';
        $request = $this->configurationControllerPullDashboardRequest($contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'configurationControllerPullDashboard'
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['configurationControllerPullDashboard'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function configurationControllerPullDashboardRequest(string $contentType = self::contentTypes['configurationControllerPullDashboard'][0])
    {


        $resourcePath = '/sync-core/configuration/pull-dashboard';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentGroupControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentGroupControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ContentGroupEntity
     */
    public function contentGroupControllerItem($id, string $contentType = self::contentTypes['contentGroupControllerItem'][0])
    {
        list($response) = $this->contentGroupControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation contentGroupControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentGroupControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ContentGroupEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentGroupControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['contentGroupControllerItem'][0])
    {
        $request = $this->contentGroupControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentGroupEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentGroupEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ContentGroupEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentGroupEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ContentGroupEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentGroupControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentGroupControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentGroupControllerItemAsync($id, string $contentType = self::contentTypes['contentGroupControllerItem'][0])
    {
        return $this->contentGroupControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentGroupControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentGroupControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentGroupControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['contentGroupControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentGroupEntity';
        $request = $this->contentGroupControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentGroupControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentGroupControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentGroupControllerItemRequest($id, string $contentType = self::contentTypes['contentGroupControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling contentGroupControllerItem'
            );
        }


        $resourcePath = '/sync-core/content-group/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentGroupControllerList
     *
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentGroupControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedContentGroupListResponse
     */
    public function contentGroupControllerList($page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentGroupControllerList'][0])
    {
        list($response) = $this->contentGroupControllerListWithHttpInfo($page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation contentGroupControllerListWithHttpInfo
     *
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentGroupControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedContentGroupListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentGroupControllerListWithHttpInfo($page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentGroupControllerList'][0])
    {
        $request = $this->contentGroupControllerListRequest($page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedContentGroupListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedContentGroupListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentGroupListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentGroupListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentGroupListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentGroupControllerListAsync
     *
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentGroupControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentGroupControllerListAsync($page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentGroupControllerList'][0])
    {
        return $this->contentGroupControllerListAsyncWithHttpInfo($page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentGroupControllerListAsyncWithHttpInfo
     *
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentGroupControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentGroupControllerListAsyncWithHttpInfo($page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentGroupControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentGroupListResponse';
        $request = $this->contentGroupControllerListRequest($page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentGroupControllerList'
     *
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentGroupControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentGroupControllerListRequest($page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentGroupControllerList'][0])
    {




        $resourcePath = '/sync-core/content-group';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentItemControllerAutocomplete
     *
     * @param  string $search search (required)
     * @param  string $limit limit (optional)
     * @param  string $localeIds localeIds (optional)
     * @param  string $priority priority (optional)
     * @param  string $status status (optional)
     * @param  string $type type (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerAutocomplete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ContentItemAutocompleteResponse
     */
    public function contentItemControllerAutocomplete($search, $limit = null, $localeIds = null, $priority = null, $status = null, $type = null, string $contentType = self::contentTypes['contentItemControllerAutocomplete'][0])
    {
        list($response) = $this->contentItemControllerAutocompleteWithHttpInfo($search, $limit, $localeIds, $priority, $status, $type, $contentType);
        return $response;
    }

    /**
     * Operation contentItemControllerAutocompleteWithHttpInfo
     *
     * @param  string $search (required)
     * @param  string $limit (optional)
     * @param  string $localeIds (optional)
     * @param  string $priority (optional)
     * @param  string $status (optional)
     * @param  string $type (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerAutocomplete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ContentItemAutocompleteResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentItemControllerAutocompleteWithHttpInfo($search, $limit = null, $localeIds = null, $priority = null, $status = null, $type = null, string $contentType = self::contentTypes['contentItemControllerAutocomplete'][0])
    {
        $request = $this->contentItemControllerAutocompleteRequest($search, $limit, $localeIds, $priority, $status, $type, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentItemAutocompleteResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentItemAutocompleteResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemAutocompleteResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemAutocompleteResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemAutocompleteResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentItemControllerAutocompleteAsync
     *
     * @param  string $search (required)
     * @param  string $limit (optional)
     * @param  string $localeIds (optional)
     * @param  string $priority (optional)
     * @param  string $status (optional)
     * @param  string $type (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerAutocomplete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentItemControllerAutocompleteAsync($search, $limit = null, $localeIds = null, $priority = null, $status = null, $type = null, string $contentType = self::contentTypes['contentItemControllerAutocomplete'][0])
    {
        return $this->contentItemControllerAutocompleteAsyncWithHttpInfo($search, $limit, $localeIds, $priority, $status, $type, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentItemControllerAutocompleteAsyncWithHttpInfo
     *
     * @param  string $search (required)
     * @param  string $limit (optional)
     * @param  string $localeIds (optional)
     * @param  string $priority (optional)
     * @param  string $status (optional)
     * @param  string $type (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerAutocomplete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentItemControllerAutocompleteAsyncWithHttpInfo($search, $limit = null, $localeIds = null, $priority = null, $status = null, $type = null, string $contentType = self::contentTypes['contentItemControllerAutocomplete'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemAutocompleteResponse';
        $request = $this->contentItemControllerAutocompleteRequest($search, $limit, $localeIds, $priority, $status, $type, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentItemControllerAutocomplete'
     *
     * @param  string $search (required)
     * @param  string $limit (optional)
     * @param  string $localeIds (optional)
     * @param  string $priority (optional)
     * @param  string $status (optional)
     * @param  string $type (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerAutocomplete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentItemControllerAutocompleteRequest($search, $limit = null, $localeIds = null, $priority = null, $status = null, $type = null, string $contentType = self::contentTypes['contentItemControllerAutocomplete'][0])
    {

        // verify the required parameter 'search' is set
        if ($search === null || (is_array($search) && count($search) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $search when calling contentItemControllerAutocomplete'
            );
        }







        $resourcePath = '/sync-core/content-item/autocomplete';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $limit,
            'limit', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localeIds,
            'localeIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $priority,
            'priority', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $type,
            'type', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $search,
            'search', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            true // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentItemControllerContentAreaHtml
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerContentAreaHtml'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ContentItemContentAreaHtmlResponse
     */
    public function contentItemControllerContentAreaHtml($id, string $contentType = self::contentTypes['contentItemControllerContentAreaHtml'][0])
    {
        list($response) = $this->contentItemControllerContentAreaHtmlWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation contentItemControllerContentAreaHtmlWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerContentAreaHtml'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ContentItemContentAreaHtmlResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentItemControllerContentAreaHtmlWithHttpInfo($id, string $contentType = self::contentTypes['contentItemControllerContentAreaHtml'][0])
    {
        $request = $this->contentItemControllerContentAreaHtmlRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentItemContentAreaHtmlResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentItemContentAreaHtmlResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemContentAreaHtmlResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemContentAreaHtmlResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemContentAreaHtmlResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentItemControllerContentAreaHtmlAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerContentAreaHtml'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentItemControllerContentAreaHtmlAsync($id, string $contentType = self::contentTypes['contentItemControllerContentAreaHtml'][0])
    {
        return $this->contentItemControllerContentAreaHtmlAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentItemControllerContentAreaHtmlAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerContentAreaHtml'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentItemControllerContentAreaHtmlAsyncWithHttpInfo($id, string $contentType = self::contentTypes['contentItemControllerContentAreaHtml'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemContentAreaHtmlResponse';
        $request = $this->contentItemControllerContentAreaHtmlRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentItemControllerContentAreaHtml'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerContentAreaHtml'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentItemControllerContentAreaHtmlRequest($id, string $contentType = self::contentTypes['contentItemControllerContentAreaHtml'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling contentItemControllerContentAreaHtml'
            );
        }


        $resourcePath = '/sync-core/content-item/{id}/content-area-html';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentItemControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity
     */
    public function contentItemControllerItem($id, string $contentType = self::contentTypes['contentItemControllerItem'][0])
    {
        list($response) = $this->contentItemControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation contentItemControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentItemControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['contentItemControllerItem'][0])
    {
        $request = $this->contentItemControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentItemControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentItemControllerItemAsync($id, string $contentType = self::contentTypes['contentItemControllerItem'][0])
    {
        return $this->contentItemControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentItemControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentItemControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['contentItemControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity';
        $request = $this->contentItemControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentItemControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentItemControllerItemRequest($id, string $contentType = self::contentTypes['contentItemControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling contentItemControllerItem'
            );
        }


        $resourcePath = '/sync-core/content-item/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentItemControllerItemByKey
     *
     * @param  string $key key (required)
     * @param  string $status status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity
     */
    public function contentItemControllerItemByKey($key, $status, string $contentType = self::contentTypes['contentItemControllerItemByKey'][0])
    {
        list($response) = $this->contentItemControllerItemByKeyWithHttpInfo($key, $status, $contentType);
        return $response;
    }

    /**
     * Operation contentItemControllerItemByKeyWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentItemControllerItemByKeyWithHttpInfo($key, $status, string $contentType = self::contentTypes['contentItemControllerItemByKey'][0])
    {
        $request = $this->contentItemControllerItemByKeyRequest($key, $status, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentItemControllerItemByKeyAsync
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentItemControllerItemByKeyAsync($key, $status, string $contentType = self::contentTypes['contentItemControllerItemByKey'][0])
    {
        return $this->contentItemControllerItemByKeyAsyncWithHttpInfo($key, $status, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentItemControllerItemByKeyAsyncWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentItemControllerItemByKeyAsyncWithHttpInfo($key, $status, string $contentType = self::contentTypes['contentItemControllerItemByKey'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentItemEntity';
        $request = $this->contentItemControllerItemByKeyRequest($key, $status, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentItemControllerItemByKey'
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentItemControllerItemByKeyRequest($key, $status, string $contentType = self::contentTypes['contentItemControllerItemByKey'][0])
    {

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling contentItemControllerItemByKey'
            );
        }

        // verify the required parameter 'status' is set
        if ($status === null || (is_array($status) && count($status) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $status when calling contentItemControllerItemByKey'
            );
        }


        $resourcePath = '/sync-core/content-item/by-key/{key}/{status}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }
        // path params
        if ($status !== null) {
            $resourcePath = str_replace(
                '{' . 'status' . '}',
                ObjectSerializer::toPathValue($status),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentItemControllerList
     *
     * @param  string $search search (optional)
     * @param  string $order Allowed: name, priority, lastCrawledAt, healthScore. Prefix with - or + for direction. (optional)
     * @param  string $lastCrawledAtGt lastCrawledAtGt (optional)
     * @param  string $lastCrawledAtLt lastCrawledAtLt (optional)
     * @param  string $taxonomyTerms taxonomyTerms (optional)
     * @param  string $localeCodes localeCodes (optional)
     * @param  string $localeKeys localeKeys (optional)
     * @param  string $localeIds localeIds (optional)
     * @param  string $sourceWorkflowStage sourceWorkflowStage (optional)
     * @param  string $workflowStage workflowStage (optional)
     * @param  string $priority priority (optional)
     * @param  string $status status (optional)
     * @param  string $type type (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse
     */
    public function contentItemControllerList($search = null, $order = null, $lastCrawledAtGt = null, $lastCrawledAtLt = null, $taxonomyTerms = null, $localeCodes = null, $localeKeys = null, $localeIds = null, $sourceWorkflowStage = null, $workflowStage = null, $priority = null, $status = null, $type = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentItemControllerList'][0])
    {
        list($response) = $this->contentItemControllerListWithHttpInfo($search, $order, $lastCrawledAtGt, $lastCrawledAtLt, $taxonomyTerms, $localeCodes, $localeKeys, $localeIds, $sourceWorkflowStage, $workflowStage, $priority, $status, $type, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation contentItemControllerListWithHttpInfo
     *
     * @param  string $search (optional)
     * @param  string $order Allowed: name, priority, lastCrawledAt, healthScore. Prefix with - or + for direction. (optional)
     * @param  string $lastCrawledAtGt (optional)
     * @param  string $lastCrawledAtLt (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $localeCodes (optional)
     * @param  string $localeKeys (optional)
     * @param  string $localeIds (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $workflowStage (optional)
     * @param  string $priority (optional)
     * @param  string $status (optional)
     * @param  string $type (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentItemControllerListWithHttpInfo($search = null, $order = null, $lastCrawledAtGt = null, $lastCrawledAtLt = null, $taxonomyTerms = null, $localeCodes = null, $localeKeys = null, $localeIds = null, $sourceWorkflowStage = null, $workflowStage = null, $priority = null, $status = null, $type = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentItemControllerList'][0])
    {
        $request = $this->contentItemControllerListRequest($search, $order, $lastCrawledAtGt, $lastCrawledAtLt, $taxonomyTerms, $localeCodes, $localeKeys, $localeIds, $sourceWorkflowStage, $workflowStage, $priority, $status, $type, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentItemControllerListAsync
     *
     * @param  string $search (optional)
     * @param  string $order Allowed: name, priority, lastCrawledAt, healthScore. Prefix with - or + for direction. (optional)
     * @param  string $lastCrawledAtGt (optional)
     * @param  string $lastCrawledAtLt (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $localeCodes (optional)
     * @param  string $localeKeys (optional)
     * @param  string $localeIds (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $workflowStage (optional)
     * @param  string $priority (optional)
     * @param  string $status (optional)
     * @param  string $type (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentItemControllerListAsync($search = null, $order = null, $lastCrawledAtGt = null, $lastCrawledAtLt = null, $taxonomyTerms = null, $localeCodes = null, $localeKeys = null, $localeIds = null, $sourceWorkflowStage = null, $workflowStage = null, $priority = null, $status = null, $type = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentItemControllerList'][0])
    {
        return $this->contentItemControllerListAsyncWithHttpInfo($search, $order, $lastCrawledAtGt, $lastCrawledAtLt, $taxonomyTerms, $localeCodes, $localeKeys, $localeIds, $sourceWorkflowStage, $workflowStage, $priority, $status, $type, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentItemControllerListAsyncWithHttpInfo
     *
     * @param  string $search (optional)
     * @param  string $order Allowed: name, priority, lastCrawledAt, healthScore. Prefix with - or + for direction. (optional)
     * @param  string $lastCrawledAtGt (optional)
     * @param  string $lastCrawledAtLt (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $localeCodes (optional)
     * @param  string $localeKeys (optional)
     * @param  string $localeIds (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $workflowStage (optional)
     * @param  string $priority (optional)
     * @param  string $status (optional)
     * @param  string $type (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentItemControllerListAsyncWithHttpInfo($search = null, $order = null, $lastCrawledAtGt = null, $lastCrawledAtLt = null, $taxonomyTerms = null, $localeCodes = null, $localeKeys = null, $localeIds = null, $sourceWorkflowStage = null, $workflowStage = null, $priority = null, $status = null, $type = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentItemControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse';
        $request = $this->contentItemControllerListRequest($search, $order, $lastCrawledAtGt, $lastCrawledAtLt, $taxonomyTerms, $localeCodes, $localeKeys, $localeIds, $sourceWorkflowStage, $workflowStage, $priority, $status, $type, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentItemControllerList'
     *
     * @param  string $search (optional)
     * @param  string $order Allowed: name, priority, lastCrawledAt, healthScore. Prefix with - or + for direction. (optional)
     * @param  string $lastCrawledAtGt (optional)
     * @param  string $lastCrawledAtLt (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $localeCodes (optional)
     * @param  string $localeKeys (optional)
     * @param  string $localeIds (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $workflowStage (optional)
     * @param  string $priority (optional)
     * @param  string $status (optional)
     * @param  string $type (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentItemControllerListRequest($search = null, $order = null, $lastCrawledAtGt = null, $lastCrawledAtLt = null, $taxonomyTerms = null, $localeCodes = null, $localeKeys = null, $localeIds = null, $sourceWorkflowStage = null, $workflowStage = null, $priority = null, $status = null, $type = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentItemControllerList'][0])
    {

















        $resourcePath = '/sync-core/content-item';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $search,
            'search', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $order,
            'order', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $lastCrawledAtGt,
            'lastCrawledAt[gt]', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $lastCrawledAtLt,
            'lastCrawledAt[lt]', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taxonomyTerms,
            'taxonomyTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localeCodes,
            'localeCodes', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localeKeys,
            'localeKeys', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localeIds,
            'localeIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $sourceWorkflowStage,
            'sourceWorkflowStage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $workflowStage,
            'workflowStage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $priority,
            'priority', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $type,
            'type', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentItemControllerRevisionsByPreviousStatus
     *
     * @param  string $key key (required)
     * @param  string $status status (required)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $page page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse
     */
    public function contentItemControllerRevisionsByPreviousStatus($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['contentItemControllerRevisionsByPreviousStatus'][0])
    {
        list($response) = $this->contentItemControllerRevisionsByPreviousStatusWithHttpInfo($key, $status, $itemsPerPage, $page, $contentType);
        return $response;
    }

    /**
     * Operation contentItemControllerRevisionsByPreviousStatusWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentItemControllerRevisionsByPreviousStatusWithHttpInfo($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['contentItemControllerRevisionsByPreviousStatus'][0])
    {
        $request = $this->contentItemControllerRevisionsByPreviousStatusRequest($key, $status, $itemsPerPage, $page, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentItemControllerRevisionsByPreviousStatusAsync
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentItemControllerRevisionsByPreviousStatusAsync($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['contentItemControllerRevisionsByPreviousStatus'][0])
    {
        return $this->contentItemControllerRevisionsByPreviousStatusAsyncWithHttpInfo($key, $status, $itemsPerPage, $page, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentItemControllerRevisionsByPreviousStatusAsyncWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentItemControllerRevisionsByPreviousStatusAsyncWithHttpInfo($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['contentItemControllerRevisionsByPreviousStatus'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentItemListResponse';
        $request = $this->contentItemControllerRevisionsByPreviousStatusRequest($key, $status, $itemsPerPage, $page, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentItemControllerRevisionsByPreviousStatus'
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentItemControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentItemControllerRevisionsByPreviousStatusRequest($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['contentItemControllerRevisionsByPreviousStatus'][0])
    {

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling contentItemControllerRevisionsByPreviousStatus'
            );
        }

        // verify the required parameter 'status' is set
        if ($status === null || (is_array($status) && count($status) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $status when calling contentItemControllerRevisionsByPreviousStatus'
            );
        }




        $resourcePath = '/sync-core/content-item/by-key/{key}/{status}/revisions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }
        // path params
        if ($status !== null) {
            $resourcePath = str_replace(
                '{' . 'status' . '}',
                ObjectSerializer::toPathValue($status),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentOptimizationControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationDto $createContentOptimizationDto createContentOptimizationDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse
     */
    public function contentOptimizationControllerCreate($createContentOptimizationDto, string $contentType = self::contentTypes['contentOptimizationControllerCreate'][0])
    {
        list($response) = $this->contentOptimizationControllerCreateWithHttpInfo($createContentOptimizationDto, $contentType);
        return $response;
    }

    /**
     * Operation contentOptimizationControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationDto $createContentOptimizationDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentOptimizationControllerCreateWithHttpInfo($createContentOptimizationDto, string $contentType = self::contentTypes['contentOptimizationControllerCreate'][0])
    {
        $request = $this->contentOptimizationControllerCreateRequest($createContentOptimizationDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentOptimizationControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationDto $createContentOptimizationDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationControllerCreateAsync($createContentOptimizationDto, string $contentType = self::contentTypes['contentOptimizationControllerCreate'][0])
    {
        return $this->contentOptimizationControllerCreateAsyncWithHttpInfo($createContentOptimizationDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentOptimizationControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationDto $createContentOptimizationDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationControllerCreateAsyncWithHttpInfo($createContentOptimizationDto, string $contentType = self::contentTypes['contentOptimizationControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse';
        $request = $this->contentOptimizationControllerCreateRequest($createContentOptimizationDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentOptimizationControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationDto $createContentOptimizationDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentOptimizationControllerCreateRequest($createContentOptimizationDto, string $contentType = self::contentTypes['contentOptimizationControllerCreate'][0])
    {

        // verify the required parameter 'createContentOptimizationDto' is set
        if ($createContentOptimizationDto === null || (is_array($createContentOptimizationDto) && count($createContentOptimizationDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createContentOptimizationDto when calling contentOptimizationControllerCreate'
            );
        }


        $resourcePath = '/sync-core/content-optimization';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createContentOptimizationDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createContentOptimizationDto));
            } else {
                $httpBody = $createContentOptimizationDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentOptimizationControllerCreateMany
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsDto $createContentOptimizationsDto createContentOptimizationsDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerCreateMany'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse
     */
    public function contentOptimizationControllerCreateMany($createContentOptimizationsDto, string $contentType = self::contentTypes['contentOptimizationControllerCreateMany'][0])
    {
        list($response) = $this->contentOptimizationControllerCreateManyWithHttpInfo($createContentOptimizationsDto, $contentType);
        return $response;
    }

    /**
     * Operation contentOptimizationControllerCreateManyWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsDto $createContentOptimizationsDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerCreateMany'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentOptimizationControllerCreateManyWithHttpInfo($createContentOptimizationsDto, string $contentType = self::contentTypes['contentOptimizationControllerCreateMany'][0])
    {
        $request = $this->contentOptimizationControllerCreateManyRequest($createContentOptimizationsDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentOptimizationControllerCreateManyAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsDto $createContentOptimizationsDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerCreateMany'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationControllerCreateManyAsync($createContentOptimizationsDto, string $contentType = self::contentTypes['contentOptimizationControllerCreateMany'][0])
    {
        return $this->contentOptimizationControllerCreateManyAsyncWithHttpInfo($createContentOptimizationsDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentOptimizationControllerCreateManyAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsDto $createContentOptimizationsDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerCreateMany'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationControllerCreateManyAsyncWithHttpInfo($createContentOptimizationsDto, string $contentType = self::contentTypes['contentOptimizationControllerCreateMany'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsResponse';
        $request = $this->contentOptimizationControllerCreateManyRequest($createContentOptimizationsDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentOptimizationControllerCreateMany'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateContentOptimizationsDto $createContentOptimizationsDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerCreateMany'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentOptimizationControllerCreateManyRequest($createContentOptimizationsDto, string $contentType = self::contentTypes['contentOptimizationControllerCreateMany'][0])
    {

        // verify the required parameter 'createContentOptimizationsDto' is set
        if ($createContentOptimizationsDto === null || (is_array($createContentOptimizationsDto) && count($createContentOptimizationsDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createContentOptimizationsDto when calling contentOptimizationControllerCreateMany'
            );
        }


        $resourcePath = '/sync-core/content-optimization/bulk';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createContentOptimizationsDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createContentOptimizationsDto));
            } else {
                $httpBody = $createContentOptimizationsDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentOptimizationControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationEntity
     */
    public function contentOptimizationControllerItem($id, string $contentType = self::contentTypes['contentOptimizationControllerItem'][0])
    {
        list($response) = $this->contentOptimizationControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation contentOptimizationControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentOptimizationControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['contentOptimizationControllerItem'][0])
    {
        $request = $this->contentOptimizationControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentOptimizationControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationControllerItemAsync($id, string $contentType = self::contentTypes['contentOptimizationControllerItem'][0])
    {
        return $this->contentOptimizationControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentOptimizationControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['contentOptimizationControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationEntity';
        $request = $this->contentOptimizationControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentOptimizationControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentOptimizationControllerItemRequest($id, string $contentType = self::contentTypes['contentOptimizationControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling contentOptimizationControllerItem'
            );
        }


        $resourcePath = '/sync-core/content-optimization/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentOptimizationControllerList
     *
     * @param  mixed $optimizationTypeKey optimizationTypeKey (optional)
     * @param  mixed $statuses statuses (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationListResponse
     */
    public function contentOptimizationControllerList($optimizationTypeKey = null, $statuses = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentOptimizationControllerList'][0])
    {
        list($response) = $this->contentOptimizationControllerListWithHttpInfo($optimizationTypeKey, $statuses, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation contentOptimizationControllerListWithHttpInfo
     *
     * @param  mixed $optimizationTypeKey (optional)
     * @param  mixed $statuses (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentOptimizationControllerListWithHttpInfo($optimizationTypeKey = null, $statuses = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentOptimizationControllerList'][0])
    {
        $request = $this->contentOptimizationControllerListRequest($optimizationTypeKey, $statuses, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentOptimizationControllerListAsync
     *
     * @param  mixed $optimizationTypeKey (optional)
     * @param  mixed $statuses (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationControllerListAsync($optimizationTypeKey = null, $statuses = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentOptimizationControllerList'][0])
    {
        return $this->contentOptimizationControllerListAsyncWithHttpInfo($optimizationTypeKey, $statuses, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentOptimizationControllerListAsyncWithHttpInfo
     *
     * @param  mixed $optimizationTypeKey (optional)
     * @param  mixed $statuses (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationControllerListAsyncWithHttpInfo($optimizationTypeKey = null, $statuses = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentOptimizationControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationListResponse';
        $request = $this->contentOptimizationControllerListRequest($optimizationTypeKey, $statuses, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentOptimizationControllerList'
     *
     * @param  mixed $optimizationTypeKey (optional)
     * @param  mixed $statuses (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentOptimizationControllerListRequest($optimizationTypeKey = null, $statuses = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentOptimizationControllerList'][0])
    {






        $resourcePath = '/sync-core/content-optimization';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $optimizationTypeKey,
            'optimizationTypeKey', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $statuses,
            'statuses', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentOptimizationTypeControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity
     */
    public function contentOptimizationTypeControllerItem($id, string $contentType = self::contentTypes['contentOptimizationTypeControllerItem'][0])
    {
        list($response) = $this->contentOptimizationTypeControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation contentOptimizationTypeControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentOptimizationTypeControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['contentOptimizationTypeControllerItem'][0])
    {
        $request = $this->contentOptimizationTypeControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentOptimizationTypeControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationTypeControllerItemAsync($id, string $contentType = self::contentTypes['contentOptimizationTypeControllerItem'][0])
    {
        return $this->contentOptimizationTypeControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentOptimizationTypeControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationTypeControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['contentOptimizationTypeControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity';
        $request = $this->contentOptimizationTypeControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentOptimizationTypeControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentOptimizationTypeControllerItemRequest($id, string $contentType = self::contentTypes['contentOptimizationTypeControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling contentOptimizationTypeControllerItem'
            );
        }


        $resourcePath = '/sync-core/content-optimization-type/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentOptimizationTypeControllerItemByKey
     *
     * @param  string $status status (required)
     * @param  string $key key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity
     */
    public function contentOptimizationTypeControllerItemByKey($status, $key, string $contentType = self::contentTypes['contentOptimizationTypeControllerItemByKey'][0])
    {
        list($response) = $this->contentOptimizationTypeControllerItemByKeyWithHttpInfo($status, $key, $contentType);
        return $response;
    }

    /**
     * Operation contentOptimizationTypeControllerItemByKeyWithHttpInfo
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentOptimizationTypeControllerItemByKeyWithHttpInfo($status, $key, string $contentType = self::contentTypes['contentOptimizationTypeControllerItemByKey'][0])
    {
        $request = $this->contentOptimizationTypeControllerItemByKeyRequest($status, $key, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentOptimizationTypeControllerItemByKeyAsync
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationTypeControllerItemByKeyAsync($status, $key, string $contentType = self::contentTypes['contentOptimizationTypeControllerItemByKey'][0])
    {
        return $this->contentOptimizationTypeControllerItemByKeyAsyncWithHttpInfo($status, $key, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentOptimizationTypeControllerItemByKeyAsyncWithHttpInfo
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationTypeControllerItemByKeyAsyncWithHttpInfo($status, $key, string $contentType = self::contentTypes['contentOptimizationTypeControllerItemByKey'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContentOptimizationTypeEntity';
        $request = $this->contentOptimizationTypeControllerItemByKeyRequest($status, $key, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentOptimizationTypeControllerItemByKey'
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentOptimizationTypeControllerItemByKeyRequest($status, $key, string $contentType = self::contentTypes['contentOptimizationTypeControllerItemByKey'][0])
    {

        // verify the required parameter 'status' is set
        if ($status === null || (is_array($status) && count($status) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $status when calling contentOptimizationTypeControllerItemByKey'
            );
        }

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling contentOptimizationTypeControllerItemByKey'
            );
        }


        $resourcePath = '/sync-core/content-optimization-type/by-key/{key}/{status}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($status !== null) {
            $resourcePath = str_replace(
                '{' . 'status' . '}',
                ObjectSerializer::toPathValue($status),
                $resourcePath
            );
        }
        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentOptimizationTypeControllerList
     *
     * @param  mixed $accessScope accessScope (optional)
     * @param  mixed $statuses statuses (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse
     */
    public function contentOptimizationTypeControllerList($accessScope = null, $statuses = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentOptimizationTypeControllerList'][0])
    {
        list($response) = $this->contentOptimizationTypeControllerListWithHttpInfo($accessScope, $statuses, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation contentOptimizationTypeControllerListWithHttpInfo
     *
     * @param  mixed $accessScope (optional)
     * @param  mixed $statuses (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentOptimizationTypeControllerListWithHttpInfo($accessScope = null, $statuses = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentOptimizationTypeControllerList'][0])
    {
        $request = $this->contentOptimizationTypeControllerListRequest($accessScope, $statuses, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentOptimizationTypeControllerListAsync
     *
     * @param  mixed $accessScope (optional)
     * @param  mixed $statuses (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationTypeControllerListAsync($accessScope = null, $statuses = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentOptimizationTypeControllerList'][0])
    {
        return $this->contentOptimizationTypeControllerListAsyncWithHttpInfo($accessScope, $statuses, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentOptimizationTypeControllerListAsyncWithHttpInfo
     *
     * @param  mixed $accessScope (optional)
     * @param  mixed $statuses (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationTypeControllerListAsyncWithHttpInfo($accessScope = null, $statuses = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentOptimizationTypeControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse';
        $request = $this->contentOptimizationTypeControllerListRequest($accessScope, $statuses, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentOptimizationTypeControllerList'
     *
     * @param  mixed $accessScope (optional)
     * @param  mixed $statuses (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentOptimizationTypeControllerListRequest($accessScope = null, $statuses = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['contentOptimizationTypeControllerList'][0])
    {






        $resourcePath = '/sync-core/content-optimization-type';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $accessScope,
            'accessScope', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $statuses,
            'statuses', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contentOptimizationTypeControllerRevisionsByPreviousStatus
     *
     * @param  string $status status (required)
     * @param  string $key key (required)
     * @param  mixed $itemsPerPage itemsPerPage (optional)
     * @param  mixed $page page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse
     */
    public function contentOptimizationTypeControllerRevisionsByPreviousStatus($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['contentOptimizationTypeControllerRevisionsByPreviousStatus'][0])
    {
        list($response) = $this->contentOptimizationTypeControllerRevisionsByPreviousStatusWithHttpInfo($status, $key, $itemsPerPage, $page, $contentType);
        return $response;
    }

    /**
     * Operation contentOptimizationTypeControllerRevisionsByPreviousStatusWithHttpInfo
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function contentOptimizationTypeControllerRevisionsByPreviousStatusWithHttpInfo($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['contentOptimizationTypeControllerRevisionsByPreviousStatus'][0])
    {
        $request = $this->contentOptimizationTypeControllerRevisionsByPreviousStatusRequest($status, $key, $itemsPerPage, $page, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contentOptimizationTypeControllerRevisionsByPreviousStatusAsync
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationTypeControllerRevisionsByPreviousStatusAsync($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['contentOptimizationTypeControllerRevisionsByPreviousStatus'][0])
    {
        return $this->contentOptimizationTypeControllerRevisionsByPreviousStatusAsyncWithHttpInfo($status, $key, $itemsPerPage, $page, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contentOptimizationTypeControllerRevisionsByPreviousStatusAsyncWithHttpInfo
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contentOptimizationTypeControllerRevisionsByPreviousStatusAsyncWithHttpInfo($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['contentOptimizationTypeControllerRevisionsByPreviousStatus'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedContentOptimizationTypeListResponse';
        $request = $this->contentOptimizationTypeControllerRevisionsByPreviousStatusRequest($status, $key, $itemsPerPage, $page, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contentOptimizationTypeControllerRevisionsByPreviousStatus'
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contentOptimizationTypeControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contentOptimizationTypeControllerRevisionsByPreviousStatusRequest($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['contentOptimizationTypeControllerRevisionsByPreviousStatus'][0])
    {

        // verify the required parameter 'status' is set
        if ($status === null || (is_array($status) && count($status) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $status when calling contentOptimizationTypeControllerRevisionsByPreviousStatus'
            );
        }

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling contentOptimizationTypeControllerRevisionsByPreviousStatus'
            );
        }




        $resourcePath = '/sync-core/content-optimization-type/by-key/{key}/{status}/revisions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($status !== null) {
            $resourcePath = str_replace(
                '{' . 'status' . '}',
                ObjectSerializer::toPathValue($status),
                $resourcePath
            );
        }
        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contractControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ContractEntity
     */
    public function contractControllerItem($id, string $contentType = self::contentTypes['contractControllerItem'][0])
    {
        list($response) = $this->contractControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation contractControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ContractEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function contractControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['contractControllerItem'][0])
    {
        $request = $this->contractControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ContractEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ContractEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ContractEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContractEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ContractEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contractControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contractControllerItemAsync($id, string $contentType = self::contentTypes['contractControllerItem'][0])
    {
        return $this->contractControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contractControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contractControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['contractControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContractEntity';
        $request = $this->contractControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contractControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contractControllerItemRequest($id, string $contentType = self::contentTypes['contractControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling contractControllerItem'
            );
        }


        $resourcePath = '/sync-core/contract/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contractControllerItemByUuid
     *
     * @param  string $uuid uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ContractEntity
     */
    public function contractControllerItemByUuid($uuid, string $contentType = self::contentTypes['contractControllerItemByUuid'][0])
    {
        list($response) = $this->contractControllerItemByUuidWithHttpInfo($uuid, $contentType);
        return $response;
    }

    /**
     * Operation contractControllerItemByUuidWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ContractEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function contractControllerItemByUuidWithHttpInfo($uuid, string $contentType = self::contentTypes['contractControllerItemByUuid'][0])
    {
        $request = $this->contractControllerItemByUuidRequest($uuid, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ContractEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ContractEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ContractEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContractEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ContractEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contractControllerItemByUuidAsync
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contractControllerItemByUuidAsync($uuid, string $contentType = self::contentTypes['contractControllerItemByUuid'][0])
    {
        return $this->contractControllerItemByUuidAsyncWithHttpInfo($uuid, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contractControllerItemByUuidAsyncWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contractControllerItemByUuidAsyncWithHttpInfo($uuid, string $contentType = self::contentTypes['contractControllerItemByUuid'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContractEntity';
        $request = $this->contractControllerItemByUuidRequest($uuid, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contractControllerItemByUuid'
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contractControllerItemByUuidRequest($uuid, string $contentType = self::contentTypes['contractControllerItemByUuid'][0])
    {

        // verify the required parameter 'uuid' is set
        if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $uuid when calling contractControllerItemByUuid'
            );
        }


        $resourcePath = '/sync-core/contract/by-uuid/{uuid}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($uuid !== null) {
            $resourcePath = str_replace(
                '{' . 'uuid' . '}',
                ObjectSerializer::toPathValue($uuid),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contractRevisionControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractRevisionControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ContractRevisionEntity
     */
    public function contractRevisionControllerItem($id, string $contentType = self::contentTypes['contractRevisionControllerItem'][0])
    {
        list($response) = $this->contractRevisionControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation contractRevisionControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractRevisionControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ContractRevisionEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function contractRevisionControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['contractRevisionControllerItem'][0])
    {
        $request = $this->contractRevisionControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ContractRevisionEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ContractRevisionEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ContractRevisionEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContractRevisionEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ContractRevisionEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contractRevisionControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractRevisionControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contractRevisionControllerItemAsync($id, string $contentType = self::contentTypes['contractRevisionControllerItem'][0])
    {
        return $this->contractRevisionControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contractRevisionControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractRevisionControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contractRevisionControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['contractRevisionControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ContractRevisionEntity';
        $request = $this->contractRevisionControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contractRevisionControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractRevisionControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contractRevisionControllerItemRequest($id, string $contentType = self::contentTypes['contractRevisionControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling contractRevisionControllerItem'
            );
        }


        $resourcePath = '/sync-core/contract-revision/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation contractRevisionControllerMostRecentForContract
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractRevisionControllerMostRecentForContract'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\MostRecentContractRevisions
     */
    public function contractRevisionControllerMostRecentForContract($id, string $contentType = self::contentTypes['contractRevisionControllerMostRecentForContract'][0])
    {
        list($response) = $this->contractRevisionControllerMostRecentForContractWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation contractRevisionControllerMostRecentForContractWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractRevisionControllerMostRecentForContract'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\MostRecentContractRevisions, HTTP status code, HTTP response headers (array of strings)
     */
    public function contractRevisionControllerMostRecentForContractWithHttpInfo($id, string $contentType = self::contentTypes['contractRevisionControllerMostRecentForContract'][0])
    {
        $request = $this->contractRevisionControllerMostRecentForContractRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\MostRecentContractRevisions' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\MostRecentContractRevisions' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\MostRecentContractRevisions', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MostRecentContractRevisions';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\MostRecentContractRevisions',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation contractRevisionControllerMostRecentForContractAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractRevisionControllerMostRecentForContract'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contractRevisionControllerMostRecentForContractAsync($id, string $contentType = self::contentTypes['contractRevisionControllerMostRecentForContract'][0])
    {
        return $this->contractRevisionControllerMostRecentForContractAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation contractRevisionControllerMostRecentForContractAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractRevisionControllerMostRecentForContract'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function contractRevisionControllerMostRecentForContractAsyncWithHttpInfo($id, string $contentType = self::contentTypes['contractRevisionControllerMostRecentForContract'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MostRecentContractRevisions';
        $request = $this->contractRevisionControllerMostRecentForContractRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'contractRevisionControllerMostRecentForContract'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['contractRevisionControllerMostRecentForContract'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function contractRevisionControllerMostRecentForContractRequest($id, string $contentType = self::contentTypes['contractRevisionControllerMostRecentForContract'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling contractRevisionControllerMostRecentForContract'
            );
        }


        $resourcePath = '/sync-core/contract-revision/most-recent-for-contract/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation customerControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['customerControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity
     */
    public function customerControllerItem($id, string $contentType = self::contentTypes['customerControllerItem'][0])
    {
        list($response) = $this->customerControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation customerControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['customerControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function customerControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['customerControllerItem'][0])
    {
        $request = $this->customerControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation customerControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['customerControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function customerControllerItemAsync($id, string $contentType = self::contentTypes['customerControllerItem'][0])
    {
        return $this->customerControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation customerControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['customerControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function customerControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['customerControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity';
        $request = $this->customerControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'customerControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['customerControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function customerControllerItemRequest($id, string $contentType = self::contentTypes['customerControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling customerControllerItem'
            );
        }


        $resourcePath = '/sync-core/customer/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation customerControllerItemByUuid
     *
     * @param  string $uuid uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['customerControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity
     */
    public function customerControllerItemByUuid($uuid, string $contentType = self::contentTypes['customerControllerItemByUuid'][0])
    {
        list($response) = $this->customerControllerItemByUuidWithHttpInfo($uuid, $contentType);
        return $response;
    }

    /**
     * Operation customerControllerItemByUuidWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['customerControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function customerControllerItemByUuidWithHttpInfo($uuid, string $contentType = self::contentTypes['customerControllerItemByUuid'][0])
    {
        $request = $this->customerControllerItemByUuidRequest($uuid, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation customerControllerItemByUuidAsync
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['customerControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function customerControllerItemByUuidAsync($uuid, string $contentType = self::contentTypes['customerControllerItemByUuid'][0])
    {
        return $this->customerControllerItemByUuidAsyncWithHttpInfo($uuid, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation customerControllerItemByUuidAsyncWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['customerControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function customerControllerItemByUuidAsyncWithHttpInfo($uuid, string $contentType = self::contentTypes['customerControllerItemByUuid'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\CustomerEntity';
        $request = $this->customerControllerItemByUuidRequest($uuid, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'customerControllerItemByUuid'
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['customerControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function customerControllerItemByUuidRequest($uuid, string $contentType = self::contentTypes['customerControllerItemByUuid'][0])
    {

        // verify the required parameter 'uuid' is set
        if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $uuid when calling customerControllerItemByUuid'
            );
        }


        $resourcePath = '/sync-core/customer/by-uuid/{uuid}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($uuid !== null) {
            $resourcePath = str_replace(
                '{' . 'uuid' . '}',
                ObjectSerializer::toPathValue($uuid),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation featuresControllerSummary
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerSummary'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary
     */
    public function featuresControllerSummary(string $contentType = self::contentTypes['featuresControllerSummary'][0])
    {
        list($response) = $this->featuresControllerSummaryWithHttpInfo($contentType);
        return $response;
    }

    /**
     * Operation featuresControllerSummaryWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerSummary'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary, HTTP status code, HTTP response headers (array of strings)
     */
    public function featuresControllerSummaryWithHttpInfo(string $contentType = self::contentTypes['featuresControllerSummary'][0])
    {
        $request = $this->featuresControllerSummaryRequest($contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation featuresControllerSummaryAsync
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function featuresControllerSummaryAsync(string $contentType = self::contentTypes['featuresControllerSummary'][0])
    {
        return $this->featuresControllerSummaryAsyncWithHttpInfo($contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation featuresControllerSummaryAsyncWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function featuresControllerSummaryAsyncWithHttpInfo(string $contentType = self::contentTypes['featuresControllerSummary'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary';
        $request = $this->featuresControllerSummaryRequest($contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'featuresControllerSummary'
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function featuresControllerSummaryRequest(string $contentType = self::contentTypes['featuresControllerSummary'][0])
    {


        $resourcePath = '/sync-core/features/summary';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation featuresControllerSummaryAll
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerSummaryAll'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummaryAll
     */
    public function featuresControllerSummaryAll(string $contentType = self::contentTypes['featuresControllerSummaryAll'][0])
    {
        list($response) = $this->featuresControllerSummaryAllWithHttpInfo($contentType);
        return $response;
    }

    /**
     * Operation featuresControllerSummaryAllWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerSummaryAll'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummaryAll, HTTP status code, HTTP response headers (array of strings)
     */
    public function featuresControllerSummaryAllWithHttpInfo(string $contentType = self::contentTypes['featuresControllerSummaryAll'][0])
    {
        $request = $this->featuresControllerSummaryAllRequest($contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummaryAll' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummaryAll' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummaryAll', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummaryAll';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummaryAll',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation featuresControllerSummaryAllAsync
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerSummaryAll'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function featuresControllerSummaryAllAsync(string $contentType = self::contentTypes['featuresControllerSummaryAll'][0])
    {
        return $this->featuresControllerSummaryAllAsyncWithHttpInfo($contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation featuresControllerSummaryAllAsyncWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerSummaryAll'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function featuresControllerSummaryAllAsyncWithHttpInfo(string $contentType = self::contentTypes['featuresControllerSummaryAll'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummaryAll';
        $request = $this->featuresControllerSummaryAllRequest($contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'featuresControllerSummaryAll'
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerSummaryAll'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function featuresControllerSummaryAllRequest(string $contentType = self::contentTypes['featuresControllerSummaryAll'][0])
    {


        $resourcePath = '/sync-core/features/summary/all';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation featuresControllerUpdate
     *
     * @param  FeatureFlagTargetType $targetType targetType (required)
     * @param  string $featureName featureName (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetFeatureFlagDto $setFeatureFlagDto setFeatureFlagDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary
     */
    public function featuresControllerUpdate($targetType, $featureName, $setFeatureFlagDto, string $contentType = self::contentTypes['featuresControllerUpdate'][0])
    {
        list($response) = $this->featuresControllerUpdateWithHttpInfo($targetType, $featureName, $setFeatureFlagDto, $contentType);
        return $response;
    }

    /**
     * Operation featuresControllerUpdateWithHttpInfo
     *
     * @param  FeatureFlagTargetType $targetType (required)
     * @param  string $featureName (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetFeatureFlagDto $setFeatureFlagDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary, HTTP status code, HTTP response headers (array of strings)
     */
    public function featuresControllerUpdateWithHttpInfo($targetType, $featureName, $setFeatureFlagDto, string $contentType = self::contentTypes['featuresControllerUpdate'][0])
    {
        $request = $this->featuresControllerUpdateRequest($targetType, $featureName, $setFeatureFlagDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation featuresControllerUpdateAsync
     *
     * @param  FeatureFlagTargetType $targetType (required)
     * @param  string $featureName (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetFeatureFlagDto $setFeatureFlagDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function featuresControllerUpdateAsync($targetType, $featureName, $setFeatureFlagDto, string $contentType = self::contentTypes['featuresControllerUpdate'][0])
    {
        return $this->featuresControllerUpdateAsyncWithHttpInfo($targetType, $featureName, $setFeatureFlagDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation featuresControllerUpdateAsyncWithHttpInfo
     *
     * @param  FeatureFlagTargetType $targetType (required)
     * @param  string $featureName (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetFeatureFlagDto $setFeatureFlagDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function featuresControllerUpdateAsyncWithHttpInfo($targetType, $featureName, $setFeatureFlagDto, string $contentType = self::contentTypes['featuresControllerUpdate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FeatureFlagSummary';
        $request = $this->featuresControllerUpdateRequest($targetType, $featureName, $setFeatureFlagDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'featuresControllerUpdate'
     *
     * @param  FeatureFlagTargetType $targetType (required)
     * @param  string $featureName (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetFeatureFlagDto $setFeatureFlagDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['featuresControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function featuresControllerUpdateRequest($targetType, $featureName, $setFeatureFlagDto, string $contentType = self::contentTypes['featuresControllerUpdate'][0])
    {

        // verify the required parameter 'targetType' is set
        if ($targetType === null || (is_array($targetType) && count($targetType) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $targetType when calling featuresControllerUpdate'
            );
        }

        // verify the required parameter 'featureName' is set
        if ($featureName === null || (is_array($featureName) && count($featureName) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $featureName when calling featuresControllerUpdate'
            );
        }

        // verify the required parameter 'setFeatureFlagDto' is set
        if ($setFeatureFlagDto === null || (is_array($setFeatureFlagDto) && count($setFeatureFlagDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $setFeatureFlagDto when calling featuresControllerUpdate'
            );
        }


        $resourcePath = '/sync-core/features/{targetType}/{featureName}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($targetType !== null) {
            $resourcePath = str_replace(
                '{' . 'targetType' . '}',
                ObjectSerializer::toPathValue($targetType),
                $resourcePath
            );
        }
        // path params
        if ($featureName !== null) {
            $resourcePath = str_replace(
                '{' . 'featureName' . '}',
                ObjectSerializer::toPathValue($featureName),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($setFeatureFlagDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($setFeatureFlagDto));
            } else {
                $httpBody = $setFeatureFlagDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation fileControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateFileDto $createFileDto createFileDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\FileEntity
     */
    public function fileControllerCreate($createFileDto, string $contentType = self::contentTypes['fileControllerCreate'][0])
    {
        list($response) = $this->fileControllerCreateWithHttpInfo($createFileDto, $contentType);
        return $response;
    }

    /**
     * Operation fileControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateFileDto $createFileDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\FileEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function fileControllerCreateWithHttpInfo($createFileDto, string $contentType = self::contentTypes['fileControllerCreate'][0])
    {
        $request = $this->fileControllerCreateRequest($createFileDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\FileEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\FileEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\FileEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FileEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\FileEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation fileControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateFileDto $createFileDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function fileControllerCreateAsync($createFileDto, string $contentType = self::contentTypes['fileControllerCreate'][0])
    {
        return $this->fileControllerCreateAsyncWithHttpInfo($createFileDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation fileControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateFileDto $createFileDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function fileControllerCreateAsyncWithHttpInfo($createFileDto, string $contentType = self::contentTypes['fileControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FileEntity';
        $request = $this->fileControllerCreateRequest($createFileDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'fileControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateFileDto $createFileDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function fileControllerCreateRequest($createFileDto, string $contentType = self::contentTypes['fileControllerCreate'][0])
    {

        // verify the required parameter 'createFileDto' is set
        if ($createFileDto === null || (is_array($createFileDto) && count($createFileDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createFileDto when calling fileControllerCreate'
            );
        }


        $resourcePath = '/sync-core/file';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createFileDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createFileDto));
            } else {
                $httpBody = $createFileDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation fileControllerDownload
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerDownload'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function fileControllerDownload($id, string $contentType = self::contentTypes['fileControllerDownload'][0])
    {
        list($response) = $this->fileControllerDownloadWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation fileControllerDownloadWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerDownload'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function fileControllerDownloadWithHttpInfo($id, string $contentType = self::contentTypes['fileControllerDownload'][0])
    {
        $request = $this->fileControllerDownloadRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation fileControllerDownloadAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerDownload'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function fileControllerDownloadAsync($id, string $contentType = self::contentTypes['fileControllerDownload'][0])
    {
        return $this->fileControllerDownloadAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation fileControllerDownloadAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerDownload'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function fileControllerDownloadAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fileControllerDownload'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->fileControllerDownloadRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'fileControllerDownload'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerDownload'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function fileControllerDownloadRequest($id, string $contentType = self::contentTypes['fileControllerDownload'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling fileControllerDownload'
            );
        }


        $resourcePath = '/sync-core/file/{id}/download';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation fileControllerFileUploaded
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerFileUploaded'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\FileEntity
     */
    public function fileControllerFileUploaded($id, string $contentType = self::contentTypes['fileControllerFileUploaded'][0])
    {
        list($response) = $this->fileControllerFileUploadedWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation fileControllerFileUploadedWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerFileUploaded'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\FileEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function fileControllerFileUploadedWithHttpInfo($id, string $contentType = self::contentTypes['fileControllerFileUploaded'][0])
    {
        $request = $this->fileControllerFileUploadedRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\FileEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\FileEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\FileEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FileEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\FileEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation fileControllerFileUploadedAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerFileUploaded'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function fileControllerFileUploadedAsync($id, string $contentType = self::contentTypes['fileControllerFileUploaded'][0])
    {
        return $this->fileControllerFileUploadedAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation fileControllerFileUploadedAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerFileUploaded'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function fileControllerFileUploadedAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fileControllerFileUploaded'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FileEntity';
        $request = $this->fileControllerFileUploadedRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'fileControllerFileUploaded'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerFileUploaded'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function fileControllerFileUploadedRequest($id, string $contentType = self::contentTypes['fileControllerFileUploaded'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling fileControllerFileUploaded'
            );
        }


        $resourcePath = '/sync-core/file/{id}/uploaded';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'PUT',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation fileControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\FileEntity
     */
    public function fileControllerItem($id, string $contentType = self::contentTypes['fileControllerItem'][0])
    {
        list($response) = $this->fileControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation fileControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\FileEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function fileControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['fileControllerItem'][0])
    {
        $request = $this->fileControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\FileEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\FileEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\FileEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FileEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\FileEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation fileControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function fileControllerItemAsync($id, string $contentType = self::contentTypes['fileControllerItem'][0])
    {
        return $this->fileControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation fileControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function fileControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fileControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FileEntity';
        $request = $this->fileControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'fileControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function fileControllerItemRequest($id, string $contentType = self::contentTypes['fileControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling fileControllerItem'
            );
        }


        $resourcePath = '/sync-core/file/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation fileControllerPreview
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerPreview'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function fileControllerPreview($id, string $contentType = self::contentTypes['fileControllerPreview'][0])
    {
        list($response) = $this->fileControllerPreviewWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation fileControllerPreviewWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerPreview'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function fileControllerPreviewWithHttpInfo($id, string $contentType = self::contentTypes['fileControllerPreview'][0])
    {
        $request = $this->fileControllerPreviewRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation fileControllerPreviewAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerPreview'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function fileControllerPreviewAsync($id, string $contentType = self::contentTypes['fileControllerPreview'][0])
    {
        return $this->fileControllerPreviewAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation fileControllerPreviewAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerPreview'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function fileControllerPreviewAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fileControllerPreview'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->fileControllerPreviewRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'fileControllerPreview'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['fileControllerPreview'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function fileControllerPreviewRequest($id, string $contentType = self::contentTypes['fileControllerPreview'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling fileControllerPreview'
            );
        }


        $resourcePath = '/sync-core/file/{id}/preview';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }


        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation flowControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateFlowDto $createFlowDto createFlowDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\FlowEntity
     */
    public function flowControllerCreate($createFlowDto, string $contentType = self::contentTypes['flowControllerCreate'][0])
    {
        list($response) = $this->flowControllerCreateWithHttpInfo($createFlowDto, $contentType);
        return $response;
    }

    /**
     * Operation flowControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateFlowDto $createFlowDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\FlowEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function flowControllerCreateWithHttpInfo($createFlowDto, string $contentType = self::contentTypes['flowControllerCreate'][0])
    {
        $request = $this->flowControllerCreateRequest($createFlowDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\FlowEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\FlowEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\FlowEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FlowEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\FlowEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation flowControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateFlowDto $createFlowDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function flowControllerCreateAsync($createFlowDto, string $contentType = self::contentTypes['flowControllerCreate'][0])
    {
        return $this->flowControllerCreateAsyncWithHttpInfo($createFlowDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation flowControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateFlowDto $createFlowDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function flowControllerCreateAsyncWithHttpInfo($createFlowDto, string $contentType = self::contentTypes['flowControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FlowEntity';
        $request = $this->flowControllerCreateRequest($createFlowDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'flowControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateFlowDto $createFlowDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function flowControllerCreateRequest($createFlowDto, string $contentType = self::contentTypes['flowControllerCreate'][0])
    {

        // verify the required parameter 'createFlowDto' is set
        if ($createFlowDto === null || (is_array($createFlowDto) && count($createFlowDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createFlowDto when calling flowControllerCreate'
            );
        }


        $resourcePath = '/sync-core/flow';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createFlowDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createFlowDto));
            } else {
                $httpBody = $createFlowDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation flowControllerDelete
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\FlowDeleteRequest $flowDeleteRequest flowDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerDelete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function flowControllerDelete($flowDeleteRequest, string $contentType = self::contentTypes['flowControllerDelete'][0])
    {
        list($response) = $this->flowControllerDeleteWithHttpInfo($flowDeleteRequest, $contentType);
        return $response;
    }

    /**
     * Operation flowControllerDeleteWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\FlowDeleteRequest $flowDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerDelete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function flowControllerDeleteWithHttpInfo($flowDeleteRequest, string $contentType = self::contentTypes['flowControllerDelete'][0])
    {
        $request = $this->flowControllerDeleteRequest($flowDeleteRequest, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation flowControllerDeleteAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\FlowDeleteRequest $flowDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function flowControllerDeleteAsync($flowDeleteRequest, string $contentType = self::contentTypes['flowControllerDelete'][0])
    {
        return $this->flowControllerDeleteAsyncWithHttpInfo($flowDeleteRequest, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation flowControllerDeleteAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\FlowDeleteRequest $flowDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function flowControllerDeleteAsyncWithHttpInfo($flowDeleteRequest, string $contentType = self::contentTypes['flowControllerDelete'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->flowControllerDeleteRequest($flowDeleteRequest, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'flowControllerDelete'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\FlowDeleteRequest $flowDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function flowControllerDeleteRequest($flowDeleteRequest, string $contentType = self::contentTypes['flowControllerDelete'][0])
    {

        // verify the required parameter 'flowDeleteRequest' is set
        if ($flowDeleteRequest === null || (is_array($flowDeleteRequest) && count($flowDeleteRequest) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $flowDeleteRequest when calling flowControllerDelete'
            );
        }


        $resourcePath = '/sync-core/flow';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($flowDeleteRequest)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($flowDeleteRequest));
            } else {
                $httpBody = $flowDeleteRequest;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'DELETE',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation flowControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\FlowEntity
     */
    public function flowControllerItem($id, string $contentType = self::contentTypes['flowControllerItem'][0])
    {
        list($response) = $this->flowControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation flowControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\FlowEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function flowControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['flowControllerItem'][0])
    {
        $request = $this->flowControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\FlowEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\FlowEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\FlowEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FlowEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\FlowEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation flowControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function flowControllerItemAsync($id, string $contentType = self::contentTypes['flowControllerItem'][0])
    {
        return $this->flowControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation flowControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function flowControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['flowControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FlowEntity';
        $request = $this->flowControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'flowControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function flowControllerItemRequest($id, string $contentType = self::contentTypes['flowControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling flowControllerItem'
            );
        }


        $resourcePath = '/sync-core/flow/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation flowControllerList
     *
     * @param  string $type type (optional)
     * @param  string $poolMachineNames poolMachineNames (optional)
     * @param  string $siteId siteId (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedFlowList
     */
    public function flowControllerList($type = null, $poolMachineNames = null, $siteId = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['flowControllerList'][0])
    {
        list($response) = $this->flowControllerListWithHttpInfo($type, $poolMachineNames, $siteId, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation flowControllerListWithHttpInfo
     *
     * @param  string $type (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $siteId (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedFlowList, HTTP status code, HTTP response headers (array of strings)
     */
    public function flowControllerListWithHttpInfo($type = null, $poolMachineNames = null, $siteId = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['flowControllerList'][0])
    {
        $request = $this->flowControllerListRequest($type, $poolMachineNames, $siteId, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedFlowList' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedFlowList' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedFlowList', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedFlowList';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedFlowList',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation flowControllerListAsync
     *
     * @param  string $type (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $siteId (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function flowControllerListAsync($type = null, $poolMachineNames = null, $siteId = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['flowControllerList'][0])
    {
        return $this->flowControllerListAsyncWithHttpInfo($type, $poolMachineNames, $siteId, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation flowControllerListAsyncWithHttpInfo
     *
     * @param  string $type (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $siteId (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function flowControllerListAsyncWithHttpInfo($type = null, $poolMachineNames = null, $siteId = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['flowControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedFlowList';
        $request = $this->flowControllerListRequest($type, $poolMachineNames, $siteId, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'flowControllerList'
     *
     * @param  string $type (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $siteId (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['flowControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function flowControllerListRequest($type = null, $poolMachineNames = null, $siteId = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['flowControllerList'][0])
    {







        $resourcePath = '/sync-core/flow';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $type,
            'type', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $poolMachineNames,
            'poolMachineNames', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $siteId,
            'siteId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation formulaControllerConfig
     *
     * @param  string $allowedCategories Optional list of function categories to expose in the editor config. If omitted, all categories are included. (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerConfig'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\FormulaConfigResponse
     */
    public function formulaControllerConfig($allowedCategories = null, string $contentType = self::contentTypes['formulaControllerConfig'][0])
    {
        list($response) = $this->formulaControllerConfigWithHttpInfo($allowedCategories, $contentType);
        return $response;
    }

    /**
     * Operation formulaControllerConfigWithHttpInfo
     *
     * @param  string $allowedCategories Optional list of function categories to expose in the editor config. If omitted, all categories are included. (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerConfig'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\FormulaConfigResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function formulaControllerConfigWithHttpInfo($allowedCategories = null, string $contentType = self::contentTypes['formulaControllerConfig'][0])
    {
        $request = $this->formulaControllerConfigRequest($allowedCategories, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\FormulaConfigResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\FormulaConfigResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\FormulaConfigResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FormulaConfigResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\FormulaConfigResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation formulaControllerConfigAsync
     *
     * @param  string $allowedCategories Optional list of function categories to expose in the editor config. If omitted, all categories are included. (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerConfig'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function formulaControllerConfigAsync($allowedCategories = null, string $contentType = self::contentTypes['formulaControllerConfig'][0])
    {
        return $this->formulaControllerConfigAsyncWithHttpInfo($allowedCategories, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation formulaControllerConfigAsyncWithHttpInfo
     *
     * @param  string $allowedCategories Optional list of function categories to expose in the editor config. If omitted, all categories are included. (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerConfig'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function formulaControllerConfigAsyncWithHttpInfo($allowedCategories = null, string $contentType = self::contentTypes['formulaControllerConfig'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\FormulaConfigResponse';
        $request = $this->formulaControllerConfigRequest($allowedCategories, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'formulaControllerConfig'
     *
     * @param  string $allowedCategories Optional list of function categories to expose in the editor config. If omitted, all categories are included. (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerConfig'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function formulaControllerConfigRequest($allowedCategories = null, string $contentType = self::contentTypes['formulaControllerConfig'][0])
    {



        $resourcePath = '/sync-core/formula/config';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $allowedCategories,
            'allowedCategories', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation formulaControllerEvaluate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\EvaluateFormulaRequest $evaluateFormulaRequest evaluateFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerEvaluate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\EvaluateFormulaResponse
     */
    public function formulaControllerEvaluate($evaluateFormulaRequest, string $contentType = self::contentTypes['formulaControllerEvaluate'][0])
    {
        list($response) = $this->formulaControllerEvaluateWithHttpInfo($evaluateFormulaRequest, $contentType);
        return $response;
    }

    /**
     * Operation formulaControllerEvaluateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\EvaluateFormulaRequest $evaluateFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerEvaluate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\EvaluateFormulaResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function formulaControllerEvaluateWithHttpInfo($evaluateFormulaRequest, string $contentType = self::contentTypes['formulaControllerEvaluate'][0])
    {
        $request = $this->formulaControllerEvaluateRequest($evaluateFormulaRequest, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\EvaluateFormulaResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\EvaluateFormulaResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\EvaluateFormulaResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\EvaluateFormulaResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\EvaluateFormulaResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation formulaControllerEvaluateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\EvaluateFormulaRequest $evaluateFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerEvaluate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function formulaControllerEvaluateAsync($evaluateFormulaRequest, string $contentType = self::contentTypes['formulaControllerEvaluate'][0])
    {
        return $this->formulaControllerEvaluateAsyncWithHttpInfo($evaluateFormulaRequest, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation formulaControllerEvaluateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\EvaluateFormulaRequest $evaluateFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerEvaluate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function formulaControllerEvaluateAsyncWithHttpInfo($evaluateFormulaRequest, string $contentType = self::contentTypes['formulaControllerEvaluate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\EvaluateFormulaResponse';
        $request = $this->formulaControllerEvaluateRequest($evaluateFormulaRequest, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'formulaControllerEvaluate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\EvaluateFormulaRequest $evaluateFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerEvaluate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function formulaControllerEvaluateRequest($evaluateFormulaRequest, string $contentType = self::contentTypes['formulaControllerEvaluate'][0])
    {

        // verify the required parameter 'evaluateFormulaRequest' is set
        if ($evaluateFormulaRequest === null || (is_array($evaluateFormulaRequest) && count($evaluateFormulaRequest) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $evaluateFormulaRequest when calling formulaControllerEvaluate'
            );
        }


        $resourcePath = '/sync-core/formula/evaluate';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($evaluateFormulaRequest)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($evaluateFormulaRequest));
            } else {
                $httpBody = $evaluateFormulaRequest;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation formulaControllerGenerate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\GenerateFormulaWithAiRequest $generateFormulaWithAiRequest generateFormulaWithAiRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerGenerate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\GenerateFormulaWithAiResponse
     */
    public function formulaControllerGenerate($generateFormulaWithAiRequest, string $contentType = self::contentTypes['formulaControllerGenerate'][0])
    {
        list($response) = $this->formulaControllerGenerateWithHttpInfo($generateFormulaWithAiRequest, $contentType);
        return $response;
    }

    /**
     * Operation formulaControllerGenerateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\GenerateFormulaWithAiRequest $generateFormulaWithAiRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerGenerate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\GenerateFormulaWithAiResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function formulaControllerGenerateWithHttpInfo($generateFormulaWithAiRequest, string $contentType = self::contentTypes['formulaControllerGenerate'][0])
    {
        $request = $this->formulaControllerGenerateRequest($generateFormulaWithAiRequest, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\GenerateFormulaWithAiResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\GenerateFormulaWithAiResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\GenerateFormulaWithAiResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GenerateFormulaWithAiResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\GenerateFormulaWithAiResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation formulaControllerGenerateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\GenerateFormulaWithAiRequest $generateFormulaWithAiRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerGenerate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function formulaControllerGenerateAsync($generateFormulaWithAiRequest, string $contentType = self::contentTypes['formulaControllerGenerate'][0])
    {
        return $this->formulaControllerGenerateAsyncWithHttpInfo($generateFormulaWithAiRequest, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation formulaControllerGenerateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\GenerateFormulaWithAiRequest $generateFormulaWithAiRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerGenerate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function formulaControllerGenerateAsyncWithHttpInfo($generateFormulaWithAiRequest, string $contentType = self::contentTypes['formulaControllerGenerate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GenerateFormulaWithAiResponse';
        $request = $this->formulaControllerGenerateRequest($generateFormulaWithAiRequest, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'formulaControllerGenerate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\GenerateFormulaWithAiRequest $generateFormulaWithAiRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerGenerate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function formulaControllerGenerateRequest($generateFormulaWithAiRequest, string $contentType = self::contentTypes['formulaControllerGenerate'][0])
    {

        // verify the required parameter 'generateFormulaWithAiRequest' is set
        if ($generateFormulaWithAiRequest === null || (is_array($generateFormulaWithAiRequest) && count($generateFormulaWithAiRequest) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $generateFormulaWithAiRequest when calling formulaControllerGenerate'
            );
        }


        $resourcePath = '/sync-core/formula/generate';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($generateFormulaWithAiRequest)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($generateFormulaWithAiRequest));
            } else {
                $httpBody = $generateFormulaWithAiRequest;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation formulaControllerParse
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ParseFormulaRequest $parseFormulaRequest parseFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerParse'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ParseFormulaResponse
     */
    public function formulaControllerParse($parseFormulaRequest, string $contentType = self::contentTypes['formulaControllerParse'][0])
    {
        list($response) = $this->formulaControllerParseWithHttpInfo($parseFormulaRequest, $contentType);
        return $response;
    }

    /**
     * Operation formulaControllerParseWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ParseFormulaRequest $parseFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerParse'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ParseFormulaResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function formulaControllerParseWithHttpInfo($parseFormulaRequest, string $contentType = self::contentTypes['formulaControllerParse'][0])
    {
        $request = $this->formulaControllerParseRequest($parseFormulaRequest, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ParseFormulaResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ParseFormulaResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ParseFormulaResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ParseFormulaResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ParseFormulaResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation formulaControllerParseAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ParseFormulaRequest $parseFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerParse'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function formulaControllerParseAsync($parseFormulaRequest, string $contentType = self::contentTypes['formulaControllerParse'][0])
    {
        return $this->formulaControllerParseAsyncWithHttpInfo($parseFormulaRequest, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation formulaControllerParseAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ParseFormulaRequest $parseFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerParse'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function formulaControllerParseAsyncWithHttpInfo($parseFormulaRequest, string $contentType = self::contentTypes['formulaControllerParse'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ParseFormulaResponse';
        $request = $this->formulaControllerParseRequest($parseFormulaRequest, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'formulaControllerParse'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ParseFormulaRequest $parseFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerParse'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function formulaControllerParseRequest($parseFormulaRequest, string $contentType = self::contentTypes['formulaControllerParse'][0])
    {

        // verify the required parameter 'parseFormulaRequest' is set
        if ($parseFormulaRequest === null || (is_array($parseFormulaRequest) && count($parseFormulaRequest) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $parseFormulaRequest when calling formulaControllerParse'
            );
        }


        $resourcePath = '/sync-core/formula/parse';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($parseFormulaRequest)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($parseFormulaRequest));
            } else {
                $httpBody = $parseFormulaRequest;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation formulaControllerValidate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ValidateFormulaRequest $validateFormulaRequest validateFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerValidate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ValidateFormulaResponse
     */
    public function formulaControllerValidate($validateFormulaRequest, string $contentType = self::contentTypes['formulaControllerValidate'][0])
    {
        list($response) = $this->formulaControllerValidateWithHttpInfo($validateFormulaRequest, $contentType);
        return $response;
    }

    /**
     * Operation formulaControllerValidateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ValidateFormulaRequest $validateFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerValidate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ValidateFormulaResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function formulaControllerValidateWithHttpInfo($validateFormulaRequest, string $contentType = self::contentTypes['formulaControllerValidate'][0])
    {
        $request = $this->formulaControllerValidateRequest($validateFormulaRequest, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ValidateFormulaResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ValidateFormulaResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ValidateFormulaResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ValidateFormulaResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ValidateFormulaResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation formulaControllerValidateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ValidateFormulaRequest $validateFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerValidate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function formulaControllerValidateAsync($validateFormulaRequest, string $contentType = self::contentTypes['formulaControllerValidate'][0])
    {
        return $this->formulaControllerValidateAsyncWithHttpInfo($validateFormulaRequest, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation formulaControllerValidateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ValidateFormulaRequest $validateFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerValidate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function formulaControllerValidateAsyncWithHttpInfo($validateFormulaRequest, string $contentType = self::contentTypes['formulaControllerValidate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ValidateFormulaResponse';
        $request = $this->formulaControllerValidateRequest($validateFormulaRequest, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'formulaControllerValidate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ValidateFormulaRequest $validateFormulaRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['formulaControllerValidate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function formulaControllerValidateRequest($validateFormulaRequest, string $contentType = self::contentTypes['formulaControllerValidate'][0])
    {

        // verify the required parameter 'validateFormulaRequest' is set
        if ($validateFormulaRequest === null || (is_array($validateFormulaRequest) && count($validateFormulaRequest) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $validateFormulaRequest when calling formulaControllerValidate'
            );
        }


        $resourcePath = '/sync-core/formula/validate';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($validateFormulaRequest)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($validateFormulaRequest));
            } else {
                $httpBody = $validateFormulaRequest;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation governanceContentItemStatsControllerChecks
     *
     * @param  string $type type (required)
     * @param  string $status status (optional)
     * @param  string $priority priority (optional)
     * @param  string $localeIds localeIds (optional)
     * @param  string $taxonomyTerms taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms xAxisTerms (optional)
     * @param  string $yAxisTerms yAxisTerms (optional)
     * @param  string $timezone timezone (optional)
     * @param  float $buckets buckets (optional)
     * @param  float $from from (optional)
     * @param  float $to to (optional)
     * @param  string $publishedState publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerChecks'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemChecksResponse
     */
    public function governanceContentItemStatsControllerChecks($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerChecks'][0])
    {
        list($response) = $this->governanceContentItemStatsControllerChecksWithHttpInfo($type, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);
        return $response;
    }

    /**
     * Operation governanceContentItemStatsControllerChecksWithHttpInfo
     *
     * @param  string $type (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerChecks'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemChecksResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function governanceContentItemStatsControllerChecksWithHttpInfo($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerChecks'][0])
    {
        $request = $this->governanceContentItemStatsControllerChecksRequest($type, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemChecksResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemChecksResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemChecksResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemChecksResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemChecksResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation governanceContentItemStatsControllerChecksAsync
     *
     * @param  string $type (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerChecks'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governanceContentItemStatsControllerChecksAsync($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerChecks'][0])
    {
        return $this->governanceContentItemStatsControllerChecksAsyncWithHttpInfo($type, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation governanceContentItemStatsControllerChecksAsyncWithHttpInfo
     *
     * @param  string $type (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerChecks'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governanceContentItemStatsControllerChecksAsyncWithHttpInfo($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerChecks'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemChecksResponse';
        $request = $this->governanceContentItemStatsControllerChecksRequest($type, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'governanceContentItemStatsControllerChecks'
     *
     * @param  string $type (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerChecks'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function governanceContentItemStatsControllerChecksRequest($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerChecks'][0])
    {

        // verify the required parameter 'type' is set
        if ($type === null || (is_array($type) && count($type) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $type when calling governanceContentItemStatsControllerChecks'
            );
        }

















        $resourcePath = '/sync-core/governance-stats/content-item/{type}/checks';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $priority,
            'priority', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localeIds,
            'localeIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taxonomyTerms,
            'taxonomyTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $sourceWorkflowStage,
            'sourceWorkflowStage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $facetTaxonomyKey,
            'facetTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTaxonomyKey,
            'xAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTaxonomyKey,
            'yAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTerms,
            'xAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTerms,
            'yAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $timezone,
            'timezone', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $buckets,
            'buckets', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $from,
            'from', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $to,
            'to', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $publishedState,
            'publishedState', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($type !== null) {
            $resourcePath = str_replace(
                '{' . 'type' . '}',
                ObjectSerializer::toPathValue($type),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation governanceContentItemStatsControllerMatrix
     *
     * @param  string $type type (required)
     * @param  string $status status (optional)
     * @param  string $priority priority (optional)
     * @param  string $localeIds localeIds (optional)
     * @param  string $taxonomyTerms taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms xAxisTerms (optional)
     * @param  string $yAxisTerms yAxisTerms (optional)
     * @param  string $timezone timezone (optional)
     * @param  float $buckets buckets (optional)
     * @param  float $from from (optional)
     * @param  float $to to (optional)
     * @param  string $publishedState publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerMatrix'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMatrixResponse
     */
    public function governanceContentItemStatsControllerMatrix($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerMatrix'][0])
    {
        list($response) = $this->governanceContentItemStatsControllerMatrixWithHttpInfo($type, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);
        return $response;
    }

    /**
     * Operation governanceContentItemStatsControllerMatrixWithHttpInfo
     *
     * @param  string $type (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerMatrix'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMatrixResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function governanceContentItemStatsControllerMatrixWithHttpInfo($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerMatrix'][0])
    {
        $request = $this->governanceContentItemStatsControllerMatrixRequest($type, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMatrixResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMatrixResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMatrixResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMatrixResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMatrixResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation governanceContentItemStatsControllerMatrixAsync
     *
     * @param  string $type (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerMatrix'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governanceContentItemStatsControllerMatrixAsync($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerMatrix'][0])
    {
        return $this->governanceContentItemStatsControllerMatrixAsyncWithHttpInfo($type, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation governanceContentItemStatsControllerMatrixAsyncWithHttpInfo
     *
     * @param  string $type (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerMatrix'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governanceContentItemStatsControllerMatrixAsyncWithHttpInfo($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerMatrix'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMatrixResponse';
        $request = $this->governanceContentItemStatsControllerMatrixRequest($type, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'governanceContentItemStatsControllerMatrix'
     *
     * @param  string $type (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerMatrix'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function governanceContentItemStatsControllerMatrixRequest($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerMatrix'][0])
    {

        // verify the required parameter 'type' is set
        if ($type === null || (is_array($type) && count($type) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $type when calling governanceContentItemStatsControllerMatrix'
            );
        }

















        $resourcePath = '/sync-core/governance-stats/content-item/{type}/matrix';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $priority,
            'priority', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localeIds,
            'localeIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taxonomyTerms,
            'taxonomyTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $sourceWorkflowStage,
            'sourceWorkflowStage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $facetTaxonomyKey,
            'facetTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTaxonomyKey,
            'xAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTaxonomyKey,
            'yAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTerms,
            'xAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTerms,
            'yAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $timezone,
            'timezone', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $buckets,
            'buckets', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $from,
            'from', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $to,
            'to', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $publishedState,
            'publishedState', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($type !== null) {
            $resourcePath = str_replace(
                '{' . 'type' . '}',
                ObjectSerializer::toPathValue($type),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation governanceContentItemStatsControllerMonthlyHistory
     *
     * @param  string $type type (required)
     * @param  string $numberOfMonths numberOfMonths (required)
     * @param  string $status status (optional)
     * @param  string $priority priority (optional)
     * @param  string $localeIds localeIds (optional)
     * @param  string $taxonomyTerms taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms xAxisTerms (optional)
     * @param  string $yAxisTerms yAxisTerms (optional)
     * @param  string $timezone timezone (optional)
     * @param  float $buckets buckets (optional)
     * @param  float $from from (optional)
     * @param  float $to to (optional)
     * @param  string $publishedState publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerMonthlyHistory'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMonthlyHistoryBucketResponse[]
     */
    public function governanceContentItemStatsControllerMonthlyHistory($type, $numberOfMonths, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerMonthlyHistory'][0])
    {
        list($response) = $this->governanceContentItemStatsControllerMonthlyHistoryWithHttpInfo($type, $numberOfMonths, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);
        return $response;
    }

    /**
     * Operation governanceContentItemStatsControllerMonthlyHistoryWithHttpInfo
     *
     * @param  string $type (required)
     * @param  string $numberOfMonths (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerMonthlyHistory'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMonthlyHistoryBucketResponse[], HTTP status code, HTTP response headers (array of strings)
     */
    public function governanceContentItemStatsControllerMonthlyHistoryWithHttpInfo($type, $numberOfMonths, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerMonthlyHistory'][0])
    {
        $request = $this->governanceContentItemStatsControllerMonthlyHistoryRequest($type, $numberOfMonths, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMonthlyHistoryBucketResponse[]' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMonthlyHistoryBucketResponse[]' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMonthlyHistoryBucketResponse[]', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMonthlyHistoryBucketResponse[]';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMonthlyHistoryBucketResponse[]',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation governanceContentItemStatsControllerMonthlyHistoryAsync
     *
     * @param  string $type (required)
     * @param  string $numberOfMonths (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerMonthlyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governanceContentItemStatsControllerMonthlyHistoryAsync($type, $numberOfMonths, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerMonthlyHistory'][0])
    {
        return $this->governanceContentItemStatsControllerMonthlyHistoryAsyncWithHttpInfo($type, $numberOfMonths, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation governanceContentItemStatsControllerMonthlyHistoryAsyncWithHttpInfo
     *
     * @param  string $type (required)
     * @param  string $numberOfMonths (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerMonthlyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governanceContentItemStatsControllerMonthlyHistoryAsyncWithHttpInfo($type, $numberOfMonths, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerMonthlyHistory'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemMonthlyHistoryBucketResponse[]';
        $request = $this->governanceContentItemStatsControllerMonthlyHistoryRequest($type, $numberOfMonths, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'governanceContentItemStatsControllerMonthlyHistory'
     *
     * @param  string $type (required)
     * @param  string $numberOfMonths (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerMonthlyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function governanceContentItemStatsControllerMonthlyHistoryRequest($type, $numberOfMonths, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerMonthlyHistory'][0])
    {

        // verify the required parameter 'type' is set
        if ($type === null || (is_array($type) && count($type) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $type when calling governanceContentItemStatsControllerMonthlyHistory'
            );
        }

        // verify the required parameter 'numberOfMonths' is set
        if ($numberOfMonths === null || (is_array($numberOfMonths) && count($numberOfMonths) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $numberOfMonths when calling governanceContentItemStatsControllerMonthlyHistory'
            );
        }

















        $resourcePath = '/sync-core/governance-stats/content-item/{type}/history/monthly/{numberOfMonths}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $priority,
            'priority', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localeIds,
            'localeIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taxonomyTerms,
            'taxonomyTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $sourceWorkflowStage,
            'sourceWorkflowStage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $facetTaxonomyKey,
            'facetTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTaxonomyKey,
            'xAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTaxonomyKey,
            'yAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTerms,
            'xAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTerms,
            'yAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $timezone,
            'timezone', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $buckets,
            'buckets', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $from,
            'from', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $to,
            'to', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $publishedState,
            'publishedState', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($type !== null) {
            $resourcePath = str_replace(
                '{' . 'type' . '}',
                ObjectSerializer::toPathValue($type),
                $resourcePath
            );
        }
        // path params
        if ($numberOfMonths !== null) {
            $resourcePath = str_replace(
                '{' . 'numberOfMonths' . '}',
                ObjectSerializer::toPathValue($numberOfMonths),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation governanceContentItemStatsControllerTotal
     *
     * @param  string $type type (required)
     * @param  string $status status (optional)
     * @param  string $priority priority (optional)
     * @param  string $localeIds localeIds (optional)
     * @param  string $taxonomyTerms taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms xAxisTerms (optional)
     * @param  string $yAxisTerms yAxisTerms (optional)
     * @param  string $timezone timezone (optional)
     * @param  float $buckets buckets (optional)
     * @param  float $from from (optional)
     * @param  float $to to (optional)
     * @param  string $publishedState publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerTotal'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemTotalResponse
     */
    public function governanceContentItemStatsControllerTotal($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerTotal'][0])
    {
        list($response) = $this->governanceContentItemStatsControllerTotalWithHttpInfo($type, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);
        return $response;
    }

    /**
     * Operation governanceContentItemStatsControllerTotalWithHttpInfo
     *
     * @param  string $type (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerTotal'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemTotalResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function governanceContentItemStatsControllerTotalWithHttpInfo($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerTotal'][0])
    {
        $request = $this->governanceContentItemStatsControllerTotalRequest($type, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemTotalResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemTotalResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemTotalResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemTotalResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemTotalResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation governanceContentItemStatsControllerTotalAsync
     *
     * @param  string $type (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerTotal'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governanceContentItemStatsControllerTotalAsync($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerTotal'][0])
    {
        return $this->governanceContentItemStatsControllerTotalAsyncWithHttpInfo($type, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation governanceContentItemStatsControllerTotalAsyncWithHttpInfo
     *
     * @param  string $type (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerTotal'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governanceContentItemStatsControllerTotalAsyncWithHttpInfo($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerTotal'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemTotalResponse';
        $request = $this->governanceContentItemStatsControllerTotalRequest($type, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'governanceContentItemStatsControllerTotal'
     *
     * @param  string $type (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerTotal'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function governanceContentItemStatsControllerTotalRequest($type, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerTotal'][0])
    {

        // verify the required parameter 'type' is set
        if ($type === null || (is_array($type) && count($type) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $type when calling governanceContentItemStatsControllerTotal'
            );
        }

















        $resourcePath = '/sync-core/governance-stats/content-item/{type}/total';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $priority,
            'priority', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localeIds,
            'localeIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taxonomyTerms,
            'taxonomyTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $sourceWorkflowStage,
            'sourceWorkflowStage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $facetTaxonomyKey,
            'facetTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTaxonomyKey,
            'xAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTaxonomyKey,
            'yAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTerms,
            'xAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTerms,
            'yAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $timezone,
            'timezone', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $buckets,
            'buckets', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $from,
            'from', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $to,
            'to', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $publishedState,
            'publishedState', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($type !== null) {
            $resourcePath = str_replace(
                '{' . 'type' . '}',
                ObjectSerializer::toPathValue($type),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation governanceContentItemStatsControllerWeeklyHistory
     *
     * @param  string $type type (required)
     * @param  string $numberOfWeeks numberOfWeeks (required)
     * @param  string $status status (optional)
     * @param  string $priority priority (optional)
     * @param  string $localeIds localeIds (optional)
     * @param  string $taxonomyTerms taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms xAxisTerms (optional)
     * @param  string $yAxisTerms yAxisTerms (optional)
     * @param  string $timezone timezone (optional)
     * @param  float $buckets buckets (optional)
     * @param  float $from from (optional)
     * @param  float $to to (optional)
     * @param  string $publishedState publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerWeeklyHistory'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemWeeklyHistoryBucketResponse[]
     */
    public function governanceContentItemStatsControllerWeeklyHistory($type, $numberOfWeeks, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerWeeklyHistory'][0])
    {
        list($response) = $this->governanceContentItemStatsControllerWeeklyHistoryWithHttpInfo($type, $numberOfWeeks, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);
        return $response;
    }

    /**
     * Operation governanceContentItemStatsControllerWeeklyHistoryWithHttpInfo
     *
     * @param  string $type (required)
     * @param  string $numberOfWeeks (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerWeeklyHistory'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemWeeklyHistoryBucketResponse[], HTTP status code, HTTP response headers (array of strings)
     */
    public function governanceContentItemStatsControllerWeeklyHistoryWithHttpInfo($type, $numberOfWeeks, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerWeeklyHistory'][0])
    {
        $request = $this->governanceContentItemStatsControllerWeeklyHistoryRequest($type, $numberOfWeeks, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemWeeklyHistoryBucketResponse[]' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemWeeklyHistoryBucketResponse[]' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemWeeklyHistoryBucketResponse[]', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemWeeklyHistoryBucketResponse[]';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemWeeklyHistoryBucketResponse[]',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation governanceContentItemStatsControllerWeeklyHistoryAsync
     *
     * @param  string $type (required)
     * @param  string $numberOfWeeks (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerWeeklyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governanceContentItemStatsControllerWeeklyHistoryAsync($type, $numberOfWeeks, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerWeeklyHistory'][0])
    {
        return $this->governanceContentItemStatsControllerWeeklyHistoryAsyncWithHttpInfo($type, $numberOfWeeks, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation governanceContentItemStatsControllerWeeklyHistoryAsyncWithHttpInfo
     *
     * @param  string $type (required)
     * @param  string $numberOfWeeks (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerWeeklyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governanceContentItemStatsControllerWeeklyHistoryAsyncWithHttpInfo($type, $numberOfWeeks, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerWeeklyHistory'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernanceContentItemWeeklyHistoryBucketResponse[]';
        $request = $this->governanceContentItemStatsControllerWeeklyHistoryRequest($type, $numberOfWeeks, $status, $priority, $localeIds, $taxonomyTerms, $sourceWorkflowStage, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $publishedState, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'governanceContentItemStatsControllerWeeklyHistory'
     *
     * @param  string $type (required)
     * @param  string $numberOfWeeks (required)
     * @param  string $status (optional)
     * @param  string $priority (optional)
     * @param  string $localeIds (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $sourceWorkflowStage (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $publishedState (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governanceContentItemStatsControllerWeeklyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function governanceContentItemStatsControllerWeeklyHistoryRequest($type, $numberOfWeeks, $status = null, $priority = null, $localeIds = null, $taxonomyTerms = null, $sourceWorkflowStage = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, $publishedState = null, string $contentType = self::contentTypes['governanceContentItemStatsControllerWeeklyHistory'][0])
    {

        // verify the required parameter 'type' is set
        if ($type === null || (is_array($type) && count($type) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $type when calling governanceContentItemStatsControllerWeeklyHistory'
            );
        }

        // verify the required parameter 'numberOfWeeks' is set
        if ($numberOfWeeks === null || (is_array($numberOfWeeks) && count($numberOfWeeks) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $numberOfWeeks when calling governanceContentItemStatsControllerWeeklyHistory'
            );
        }

















        $resourcePath = '/sync-core/governance-stats/content-item/{type}/history/weekly/{numberOfWeeks}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $priority,
            'priority', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localeIds,
            'localeIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taxonomyTerms,
            'taxonomyTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $sourceWorkflowStage,
            'sourceWorkflowStage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $facetTaxonomyKey,
            'facetTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTaxonomyKey,
            'xAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTaxonomyKey,
            'yAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTerms,
            'xAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTerms,
            'yAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $timezone,
            'timezone', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $buckets,
            'buckets', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $from,
            'from', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $to,
            'to', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $publishedState,
            'publishedState', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($type !== null) {
            $resourcePath = str_replace(
                '{' . 'type' . '}',
                ObjectSerializer::toPathValue($type),
                $resourcePath
            );
        }
        // path params
        if ($numberOfWeeks !== null) {
            $resourcePath = str_replace(
                '{' . 'numberOfWeeks' . '}',
                ObjectSerializer::toPathValue($numberOfWeeks),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation governancePromptMonitoringStatsControllerDailyHistory
     *
     * @param  string $numberOfDays numberOfDays (required)
     * @param  string $promptKey promptKey (optional)
     * @param  string $engineKey engineKey (optional)
     * @param  string $localeKey localeKey (optional)
     * @param  string $country country (optional)
     * @param  string $taxonomyTerms taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms xAxisTerms (optional)
     * @param  string $yAxisTerms yAxisTerms (optional)
     * @param  string $timezone timezone (optional)
     * @param  float $buckets buckets (optional)
     * @param  float $from from (optional)
     * @param  float $to to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerDailyHistory'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsDailyHistoryBucketResponse[]
     */
    public function governancePromptMonitoringStatsControllerDailyHistory($numberOfDays, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerDailyHistory'][0])
    {
        list($response) = $this->governancePromptMonitoringStatsControllerDailyHistoryWithHttpInfo($numberOfDays, $promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);
        return $response;
    }

    /**
     * Operation governancePromptMonitoringStatsControllerDailyHistoryWithHttpInfo
     *
     * @param  string $numberOfDays (required)
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerDailyHistory'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsDailyHistoryBucketResponse[], HTTP status code, HTTP response headers (array of strings)
     */
    public function governancePromptMonitoringStatsControllerDailyHistoryWithHttpInfo($numberOfDays, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerDailyHistory'][0])
    {
        $request = $this->governancePromptMonitoringStatsControllerDailyHistoryRequest($numberOfDays, $promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsDailyHistoryBucketResponse[]' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsDailyHistoryBucketResponse[]' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsDailyHistoryBucketResponse[]', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsDailyHistoryBucketResponse[]';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsDailyHistoryBucketResponse[]',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation governancePromptMonitoringStatsControllerDailyHistoryAsync
     *
     * @param  string $numberOfDays (required)
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerDailyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governancePromptMonitoringStatsControllerDailyHistoryAsync($numberOfDays, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerDailyHistory'][0])
    {
        return $this->governancePromptMonitoringStatsControllerDailyHistoryAsyncWithHttpInfo($numberOfDays, $promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation governancePromptMonitoringStatsControllerDailyHistoryAsyncWithHttpInfo
     *
     * @param  string $numberOfDays (required)
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerDailyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governancePromptMonitoringStatsControllerDailyHistoryAsyncWithHttpInfo($numberOfDays, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerDailyHistory'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsDailyHistoryBucketResponse[]';
        $request = $this->governancePromptMonitoringStatsControllerDailyHistoryRequest($numberOfDays, $promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'governancePromptMonitoringStatsControllerDailyHistory'
     *
     * @param  string $numberOfDays (required)
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerDailyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function governancePromptMonitoringStatsControllerDailyHistoryRequest($numberOfDays, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerDailyHistory'][0])
    {

        // verify the required parameter 'numberOfDays' is set
        if ($numberOfDays === null || (is_array($numberOfDays) && count($numberOfDays) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $numberOfDays when calling governancePromptMonitoringStatsControllerDailyHistory'
            );
        }
















        $resourcePath = '/sync-core/governance-stats/prompt-monitoring/history/daily/{numberOfDays}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $promptKey,
            'promptKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $engineKey,
            'engineKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localeKey,
            'localeKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $country,
            'country', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taxonomyTerms,
            'taxonomyTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $facetTaxonomyKey,
            'facetTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTaxonomyKey,
            'xAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTaxonomyKey,
            'yAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTerms,
            'xAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTerms,
            'yAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $timezone,
            'timezone', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $buckets,
            'buckets', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $from,
            'from', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $to,
            'to', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($numberOfDays !== null) {
            $resourcePath = str_replace(
                '{' . 'numberOfDays' . '}',
                ObjectSerializer::toPathValue($numberOfDays),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation governancePromptMonitoringStatsControllerMatrix
     *
     * @param  string $promptKey promptKey (optional)
     * @param  string $engineKey engineKey (optional)
     * @param  string $localeKey localeKey (optional)
     * @param  string $country country (optional)
     * @param  string $taxonomyTerms taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms xAxisTerms (optional)
     * @param  string $yAxisTerms yAxisTerms (optional)
     * @param  string $timezone timezone (optional)
     * @param  float $buckets buckets (optional)
     * @param  float $from from (optional)
     * @param  float $to to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerMatrix'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMatrixResponse
     */
    public function governancePromptMonitoringStatsControllerMatrix($promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerMatrix'][0])
    {
        list($response) = $this->governancePromptMonitoringStatsControllerMatrixWithHttpInfo($promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);
        return $response;
    }

    /**
     * Operation governancePromptMonitoringStatsControllerMatrixWithHttpInfo
     *
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerMatrix'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMatrixResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function governancePromptMonitoringStatsControllerMatrixWithHttpInfo($promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerMatrix'][0])
    {
        $request = $this->governancePromptMonitoringStatsControllerMatrixRequest($promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMatrixResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMatrixResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMatrixResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMatrixResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMatrixResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation governancePromptMonitoringStatsControllerMatrixAsync
     *
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerMatrix'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governancePromptMonitoringStatsControllerMatrixAsync($promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerMatrix'][0])
    {
        return $this->governancePromptMonitoringStatsControllerMatrixAsyncWithHttpInfo($promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation governancePromptMonitoringStatsControllerMatrixAsyncWithHttpInfo
     *
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerMatrix'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governancePromptMonitoringStatsControllerMatrixAsyncWithHttpInfo($promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerMatrix'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMatrixResponse';
        $request = $this->governancePromptMonitoringStatsControllerMatrixRequest($promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'governancePromptMonitoringStatsControllerMatrix'
     *
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerMatrix'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function governancePromptMonitoringStatsControllerMatrixRequest($promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerMatrix'][0])
    {
















        $resourcePath = '/sync-core/governance-stats/prompt-monitoring/matrix';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $promptKey,
            'promptKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $engineKey,
            'engineKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localeKey,
            'localeKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $country,
            'country', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taxonomyTerms,
            'taxonomyTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $facetTaxonomyKey,
            'facetTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTaxonomyKey,
            'xAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTaxonomyKey,
            'yAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTerms,
            'xAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTerms,
            'yAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $timezone,
            'timezone', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $buckets,
            'buckets', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $from,
            'from', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $to,
            'to', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation governancePromptMonitoringStatsControllerMonthlyHistory
     *
     * @param  string $numberOfMonths numberOfMonths (required)
     * @param  string $promptKey promptKey (optional)
     * @param  string $engineKey engineKey (optional)
     * @param  string $localeKey localeKey (optional)
     * @param  string $country country (optional)
     * @param  string $taxonomyTerms taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms xAxisTerms (optional)
     * @param  string $yAxisTerms yAxisTerms (optional)
     * @param  string $timezone timezone (optional)
     * @param  float $buckets buckets (optional)
     * @param  float $from from (optional)
     * @param  float $to to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerMonthlyHistory'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMonthlyHistoryBucketResponse[]
     */
    public function governancePromptMonitoringStatsControllerMonthlyHistory($numberOfMonths, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerMonthlyHistory'][0])
    {
        list($response) = $this->governancePromptMonitoringStatsControllerMonthlyHistoryWithHttpInfo($numberOfMonths, $promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);
        return $response;
    }

    /**
     * Operation governancePromptMonitoringStatsControllerMonthlyHistoryWithHttpInfo
     *
     * @param  string $numberOfMonths (required)
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerMonthlyHistory'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMonthlyHistoryBucketResponse[], HTTP status code, HTTP response headers (array of strings)
     */
    public function governancePromptMonitoringStatsControllerMonthlyHistoryWithHttpInfo($numberOfMonths, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerMonthlyHistory'][0])
    {
        $request = $this->governancePromptMonitoringStatsControllerMonthlyHistoryRequest($numberOfMonths, $promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMonthlyHistoryBucketResponse[]' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMonthlyHistoryBucketResponse[]' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMonthlyHistoryBucketResponse[]', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMonthlyHistoryBucketResponse[]';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMonthlyHistoryBucketResponse[]',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation governancePromptMonitoringStatsControllerMonthlyHistoryAsync
     *
     * @param  string $numberOfMonths (required)
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerMonthlyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governancePromptMonitoringStatsControllerMonthlyHistoryAsync($numberOfMonths, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerMonthlyHistory'][0])
    {
        return $this->governancePromptMonitoringStatsControllerMonthlyHistoryAsyncWithHttpInfo($numberOfMonths, $promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation governancePromptMonitoringStatsControllerMonthlyHistoryAsyncWithHttpInfo
     *
     * @param  string $numberOfMonths (required)
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerMonthlyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governancePromptMonitoringStatsControllerMonthlyHistoryAsyncWithHttpInfo($numberOfMonths, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerMonthlyHistory'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsMonthlyHistoryBucketResponse[]';
        $request = $this->governancePromptMonitoringStatsControllerMonthlyHistoryRequest($numberOfMonths, $promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'governancePromptMonitoringStatsControllerMonthlyHistory'
     *
     * @param  string $numberOfMonths (required)
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerMonthlyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function governancePromptMonitoringStatsControllerMonthlyHistoryRequest($numberOfMonths, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerMonthlyHistory'][0])
    {

        // verify the required parameter 'numberOfMonths' is set
        if ($numberOfMonths === null || (is_array($numberOfMonths) && count($numberOfMonths) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $numberOfMonths when calling governancePromptMonitoringStatsControllerMonthlyHistory'
            );
        }
















        $resourcePath = '/sync-core/governance-stats/prompt-monitoring/history/monthly/{numberOfMonths}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $promptKey,
            'promptKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $engineKey,
            'engineKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localeKey,
            'localeKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $country,
            'country', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taxonomyTerms,
            'taxonomyTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $facetTaxonomyKey,
            'facetTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTaxonomyKey,
            'xAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTaxonomyKey,
            'yAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTerms,
            'xAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTerms,
            'yAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $timezone,
            'timezone', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $buckets,
            'buckets', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $from,
            'from', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $to,
            'to', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($numberOfMonths !== null) {
            $resourcePath = str_replace(
                '{' . 'numberOfMonths' . '}',
                ObjectSerializer::toPathValue($numberOfMonths),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation governancePromptMonitoringStatsControllerTotal
     *
     * @param  string $promptKey promptKey (optional)
     * @param  string $engineKey engineKey (optional)
     * @param  string $localeKey localeKey (optional)
     * @param  string $country country (optional)
     * @param  string $taxonomyTerms taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms xAxisTerms (optional)
     * @param  string $yAxisTerms yAxisTerms (optional)
     * @param  string $timezone timezone (optional)
     * @param  float $buckets buckets (optional)
     * @param  float $from from (optional)
     * @param  float $to to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerTotal'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsTotalResponse
     */
    public function governancePromptMonitoringStatsControllerTotal($promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerTotal'][0])
    {
        list($response) = $this->governancePromptMonitoringStatsControllerTotalWithHttpInfo($promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);
        return $response;
    }

    /**
     * Operation governancePromptMonitoringStatsControllerTotalWithHttpInfo
     *
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerTotal'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsTotalResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function governancePromptMonitoringStatsControllerTotalWithHttpInfo($promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerTotal'][0])
    {
        $request = $this->governancePromptMonitoringStatsControllerTotalRequest($promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsTotalResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsTotalResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsTotalResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsTotalResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsTotalResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation governancePromptMonitoringStatsControllerTotalAsync
     *
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerTotal'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governancePromptMonitoringStatsControllerTotalAsync($promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerTotal'][0])
    {
        return $this->governancePromptMonitoringStatsControllerTotalAsyncWithHttpInfo($promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation governancePromptMonitoringStatsControllerTotalAsyncWithHttpInfo
     *
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerTotal'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governancePromptMonitoringStatsControllerTotalAsyncWithHttpInfo($promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerTotal'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsTotalResponse';
        $request = $this->governancePromptMonitoringStatsControllerTotalRequest($promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'governancePromptMonitoringStatsControllerTotal'
     *
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerTotal'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function governancePromptMonitoringStatsControllerTotalRequest($promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerTotal'][0])
    {
















        $resourcePath = '/sync-core/governance-stats/prompt-monitoring/total';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $promptKey,
            'promptKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $engineKey,
            'engineKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localeKey,
            'localeKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $country,
            'country', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taxonomyTerms,
            'taxonomyTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $facetTaxonomyKey,
            'facetTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTaxonomyKey,
            'xAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTaxonomyKey,
            'yAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTerms,
            'xAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTerms,
            'yAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $timezone,
            'timezone', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $buckets,
            'buckets', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $from,
            'from', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $to,
            'to', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation governancePromptMonitoringStatsControllerWeeklyHistory
     *
     * @param  string $numberOfWeeks numberOfWeeks (required)
     * @param  string $promptKey promptKey (optional)
     * @param  string $engineKey engineKey (optional)
     * @param  string $localeKey localeKey (optional)
     * @param  string $country country (optional)
     * @param  string $taxonomyTerms taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms xAxisTerms (optional)
     * @param  string $yAxisTerms yAxisTerms (optional)
     * @param  string $timezone timezone (optional)
     * @param  float $buckets buckets (optional)
     * @param  float $from from (optional)
     * @param  float $to to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerWeeklyHistory'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsWeeklyHistoryBucketResponse[]
     */
    public function governancePromptMonitoringStatsControllerWeeklyHistory($numberOfWeeks, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerWeeklyHistory'][0])
    {
        list($response) = $this->governancePromptMonitoringStatsControllerWeeklyHistoryWithHttpInfo($numberOfWeeks, $promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);
        return $response;
    }

    /**
     * Operation governancePromptMonitoringStatsControllerWeeklyHistoryWithHttpInfo
     *
     * @param  string $numberOfWeeks (required)
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerWeeklyHistory'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsWeeklyHistoryBucketResponse[], HTTP status code, HTTP response headers (array of strings)
     */
    public function governancePromptMonitoringStatsControllerWeeklyHistoryWithHttpInfo($numberOfWeeks, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerWeeklyHistory'][0])
    {
        $request = $this->governancePromptMonitoringStatsControllerWeeklyHistoryRequest($numberOfWeeks, $promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsWeeklyHistoryBucketResponse[]' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsWeeklyHistoryBucketResponse[]' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsWeeklyHistoryBucketResponse[]', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsWeeklyHistoryBucketResponse[]';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsWeeklyHistoryBucketResponse[]',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation governancePromptMonitoringStatsControllerWeeklyHistoryAsync
     *
     * @param  string $numberOfWeeks (required)
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerWeeklyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governancePromptMonitoringStatsControllerWeeklyHistoryAsync($numberOfWeeks, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerWeeklyHistory'][0])
    {
        return $this->governancePromptMonitoringStatsControllerWeeklyHistoryAsyncWithHttpInfo($numberOfWeeks, $promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation governancePromptMonitoringStatsControllerWeeklyHistoryAsyncWithHttpInfo
     *
     * @param  string $numberOfWeeks (required)
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerWeeklyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function governancePromptMonitoringStatsControllerWeeklyHistoryAsyncWithHttpInfo($numberOfWeeks, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerWeeklyHistory'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GovernancePromptMonitoringStatsWeeklyHistoryBucketResponse[]';
        $request = $this->governancePromptMonitoringStatsControllerWeeklyHistoryRequest($numberOfWeeks, $promptKey, $engineKey, $localeKey, $country, $taxonomyTerms, $facetTaxonomyKey, $xAxisTaxonomyKey, $yAxisTaxonomyKey, $xAxisTerms, $yAxisTerms, $timezone, $buckets, $from, $to, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'governancePromptMonitoringStatsControllerWeeklyHistory'
     *
     * @param  string $numberOfWeeks (required)
     * @param  string $promptKey (optional)
     * @param  string $engineKey (optional)
     * @param  string $localeKey (optional)
     * @param  string $country (optional)
     * @param  string $taxonomyTerms (optional)
     * @param  string $facetTaxonomyKey (optional)
     * @param  string $xAxisTaxonomyKey (optional)
     * @param  string $yAxisTaxonomyKey (optional)
     * @param  string $xAxisTerms (optional)
     * @param  string $yAxisTerms (optional)
     * @param  string $timezone (optional)
     * @param  float $buckets (optional)
     * @param  float $from (optional)
     * @param  float $to (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['governancePromptMonitoringStatsControllerWeeklyHistory'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function governancePromptMonitoringStatsControllerWeeklyHistoryRequest($numberOfWeeks, $promptKey = null, $engineKey = null, $localeKey = null, $country = null, $taxonomyTerms = null, $facetTaxonomyKey = null, $xAxisTaxonomyKey = null, $yAxisTaxonomyKey = null, $xAxisTerms = null, $yAxisTerms = null, $timezone = null, $buckets = null, $from = null, $to = null, string $contentType = self::contentTypes['governancePromptMonitoringStatsControllerWeeklyHistory'][0])
    {

        // verify the required parameter 'numberOfWeeks' is set
        if ($numberOfWeeks === null || (is_array($numberOfWeeks) && count($numberOfWeeks) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $numberOfWeeks when calling governancePromptMonitoringStatsControllerWeeklyHistory'
            );
        }
















        $resourcePath = '/sync-core/governance-stats/prompt-monitoring/history/weekly/{numberOfWeeks}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $promptKey,
            'promptKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $engineKey,
            'engineKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localeKey,
            'localeKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $country,
            'country', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taxonomyTerms,
            'taxonomyTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $facetTaxonomyKey,
            'facetTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTaxonomyKey,
            'xAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTaxonomyKey,
            'yAxisTaxonomyKey', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $xAxisTerms,
            'xAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $yAxisTerms,
            'yAxisTerms', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $timezone,
            'timezone', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $buckets,
            'buckets', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $from,
            'from', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $to,
            'to', // param base name
            'number', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($numberOfWeeks !== null) {
            $resourcePath = str_replace(
                '{' . 'numberOfWeeks' . '}',
                ObjectSerializer::toPathValue($numberOfWeeks),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation healthCheckControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateHealthCheckDto $createHealthCheckDto createHealthCheckDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity
     */
    public function healthCheckControllerCreate($createHealthCheckDto, string $contentType = self::contentTypes['healthCheckControllerCreate'][0])
    {
        list($response) = $this->healthCheckControllerCreateWithHttpInfo($createHealthCheckDto, $contentType);
        return $response;
    }

    /**
     * Operation healthCheckControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateHealthCheckDto $createHealthCheckDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function healthCheckControllerCreateWithHttpInfo($createHealthCheckDto, string $contentType = self::contentTypes['healthCheckControllerCreate'][0])
    {
        $request = $this->healthCheckControllerCreateRequest($createHealthCheckDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation healthCheckControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateHealthCheckDto $createHealthCheckDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthCheckControllerCreateAsync($createHealthCheckDto, string $contentType = self::contentTypes['healthCheckControllerCreate'][0])
    {
        return $this->healthCheckControllerCreateAsyncWithHttpInfo($createHealthCheckDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation healthCheckControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateHealthCheckDto $createHealthCheckDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthCheckControllerCreateAsyncWithHttpInfo($createHealthCheckDto, string $contentType = self::contentTypes['healthCheckControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity';
        $request = $this->healthCheckControllerCreateRequest($createHealthCheckDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'healthCheckControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateHealthCheckDto $createHealthCheckDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function healthCheckControllerCreateRequest($createHealthCheckDto, string $contentType = self::contentTypes['healthCheckControllerCreate'][0])
    {

        // verify the required parameter 'createHealthCheckDto' is set
        if ($createHealthCheckDto === null || (is_array($createHealthCheckDto) && count($createHealthCheckDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createHealthCheckDto when calling healthCheckControllerCreate'
            );
        }


        $resourcePath = '/sync-core/health-check';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createHealthCheckDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createHealthCheckDto));
            } else {
                $httpBody = $createHealthCheckDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation healthCheckControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity
     */
    public function healthCheckControllerItem($id, string $contentType = self::contentTypes['healthCheckControllerItem'][0])
    {
        list($response) = $this->healthCheckControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation healthCheckControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function healthCheckControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['healthCheckControllerItem'][0])
    {
        $request = $this->healthCheckControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation healthCheckControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthCheckControllerItemAsync($id, string $contentType = self::contentTypes['healthCheckControllerItem'][0])
    {
        return $this->healthCheckControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation healthCheckControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthCheckControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['healthCheckControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity';
        $request = $this->healthCheckControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'healthCheckControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function healthCheckControllerItemRequest($id, string $contentType = self::contentTypes['healthCheckControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling healthCheckControllerItem'
            );
        }


        $resourcePath = '/sync-core/health-check/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation healthCheckControllerItemByKey
     *
     * @param  string $key key (required)
     * @param  string $status status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity
     */
    public function healthCheckControllerItemByKey($key, $status, string $contentType = self::contentTypes['healthCheckControllerItemByKey'][0])
    {
        list($response) = $this->healthCheckControllerItemByKeyWithHttpInfo($key, $status, $contentType);
        return $response;
    }

    /**
     * Operation healthCheckControllerItemByKeyWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function healthCheckControllerItemByKeyWithHttpInfo($key, $status, string $contentType = self::contentTypes['healthCheckControllerItemByKey'][0])
    {
        $request = $this->healthCheckControllerItemByKeyRequest($key, $status, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation healthCheckControllerItemByKeyAsync
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthCheckControllerItemByKeyAsync($key, $status, string $contentType = self::contentTypes['healthCheckControllerItemByKey'][0])
    {
        return $this->healthCheckControllerItemByKeyAsyncWithHttpInfo($key, $status, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation healthCheckControllerItemByKeyAsyncWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthCheckControllerItemByKeyAsyncWithHttpInfo($key, $status, string $contentType = self::contentTypes['healthCheckControllerItemByKey'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity';
        $request = $this->healthCheckControllerItemByKeyRequest($key, $status, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'healthCheckControllerItemByKey'
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function healthCheckControllerItemByKeyRequest($key, $status, string $contentType = self::contentTypes['healthCheckControllerItemByKey'][0])
    {

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling healthCheckControllerItemByKey'
            );
        }

        // verify the required parameter 'status' is set
        if ($status === null || (is_array($status) && count($status) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $status when calling healthCheckControllerItemByKey'
            );
        }


        $resourcePath = '/sync-core/health-check/by-key/{key}/{status}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }
        // path params
        if ($status !== null) {
            $resourcePath = str_replace(
                '{' . 'status' . '}',
                ObjectSerializer::toPathValue($status),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation healthCheckControllerItemByKeyActive
     *
     * @param  string $key key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItemByKeyActive'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity
     */
    public function healthCheckControllerItemByKeyActive($key, string $contentType = self::contentTypes['healthCheckControllerItemByKeyActive'][0])
    {
        list($response) = $this->healthCheckControllerItemByKeyActiveWithHttpInfo($key, $contentType);
        return $response;
    }

    /**
     * Operation healthCheckControllerItemByKeyActiveWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItemByKeyActive'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function healthCheckControllerItemByKeyActiveWithHttpInfo($key, string $contentType = self::contentTypes['healthCheckControllerItemByKeyActive'][0])
    {
        $request = $this->healthCheckControllerItemByKeyActiveRequest($key, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation healthCheckControllerItemByKeyActiveAsync
     *
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItemByKeyActive'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthCheckControllerItemByKeyActiveAsync($key, string $contentType = self::contentTypes['healthCheckControllerItemByKeyActive'][0])
    {
        return $this->healthCheckControllerItemByKeyActiveAsyncWithHttpInfo($key, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation healthCheckControllerItemByKeyActiveAsyncWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItemByKeyActive'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthCheckControllerItemByKeyActiveAsyncWithHttpInfo($key, string $contentType = self::contentTypes['healthCheckControllerItemByKeyActive'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity';
        $request = $this->healthCheckControllerItemByKeyActiveRequest($key, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'healthCheckControllerItemByKeyActive'
     *
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerItemByKeyActive'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function healthCheckControllerItemByKeyActiveRequest($key, string $contentType = self::contentTypes['healthCheckControllerItemByKeyActive'][0])
    {

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling healthCheckControllerItemByKeyActive'
            );
        }


        $resourcePath = '/sync-core/health-check/key/{key}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation healthCheckControllerList
     *
     * @param  mixed $statuses statuses (optional)
     * @param  mixed $status status (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse
     */
    public function healthCheckControllerList($statuses = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['healthCheckControllerList'][0])
    {
        list($response) = $this->healthCheckControllerListWithHttpInfo($statuses, $status, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation healthCheckControllerListWithHttpInfo
     *
     * @param  mixed $statuses (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function healthCheckControllerListWithHttpInfo($statuses = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['healthCheckControllerList'][0])
    {
        $request = $this->healthCheckControllerListRequest($statuses, $status, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation healthCheckControllerListAsync
     *
     * @param  mixed $statuses (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthCheckControllerListAsync($statuses = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['healthCheckControllerList'][0])
    {
        return $this->healthCheckControllerListAsyncWithHttpInfo($statuses, $status, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation healthCheckControllerListAsyncWithHttpInfo
     *
     * @param  mixed $statuses (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthCheckControllerListAsyncWithHttpInfo($statuses = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['healthCheckControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse';
        $request = $this->healthCheckControllerListRequest($statuses, $status, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'healthCheckControllerList'
     *
     * @param  mixed $statuses (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function healthCheckControllerListRequest($statuses = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['healthCheckControllerList'][0])
    {






        $resourcePath = '/sync-core/health-check';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $statuses,
            'statuses', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation healthCheckControllerRevisionsByPreviousStatus
     *
     * @param  string $key key (required)
     * @param  string $status status (required)
     * @param  mixed $itemsPerPage itemsPerPage (optional)
     * @param  mixed $page page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse
     */
    public function healthCheckControllerRevisionsByPreviousStatus($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['healthCheckControllerRevisionsByPreviousStatus'][0])
    {
        list($response) = $this->healthCheckControllerRevisionsByPreviousStatusWithHttpInfo($key, $status, $itemsPerPage, $page, $contentType);
        return $response;
    }

    /**
     * Operation healthCheckControllerRevisionsByPreviousStatusWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function healthCheckControllerRevisionsByPreviousStatusWithHttpInfo($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['healthCheckControllerRevisionsByPreviousStatus'][0])
    {
        $request = $this->healthCheckControllerRevisionsByPreviousStatusRequest($key, $status, $itemsPerPage, $page, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation healthCheckControllerRevisionsByPreviousStatusAsync
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthCheckControllerRevisionsByPreviousStatusAsync($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['healthCheckControllerRevisionsByPreviousStatus'][0])
    {
        return $this->healthCheckControllerRevisionsByPreviousStatusAsyncWithHttpInfo($key, $status, $itemsPerPage, $page, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation healthCheckControllerRevisionsByPreviousStatusAsyncWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthCheckControllerRevisionsByPreviousStatusAsyncWithHttpInfo($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['healthCheckControllerRevisionsByPreviousStatus'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedHealthCheckListResponse';
        $request = $this->healthCheckControllerRevisionsByPreviousStatusRequest($key, $status, $itemsPerPage, $page, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'healthCheckControllerRevisionsByPreviousStatus'
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function healthCheckControllerRevisionsByPreviousStatusRequest($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['healthCheckControllerRevisionsByPreviousStatus'][0])
    {

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling healthCheckControllerRevisionsByPreviousStatus'
            );
        }

        // verify the required parameter 'status' is set
        if ($status === null || (is_array($status) && count($status) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $status when calling healthCheckControllerRevisionsByPreviousStatus'
            );
        }




        $resourcePath = '/sync-core/health-check/by-key/{key}/{status}/revisions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }
        // path params
        if ($status !== null) {
            $resourcePath = str_replace(
                '{' . 'status' . '}',
                ObjectSerializer::toPathValue($status),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation healthCheckControllerUpdate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity $healthCheckEntity healthCheckEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity
     */
    public function healthCheckControllerUpdate($healthCheckEntity, string $contentType = self::contentTypes['healthCheckControllerUpdate'][0])
    {
        list($response) = $this->healthCheckControllerUpdateWithHttpInfo($healthCheckEntity, $contentType);
        return $response;
    }

    /**
     * Operation healthCheckControllerUpdateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity $healthCheckEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function healthCheckControllerUpdateWithHttpInfo($healthCheckEntity, string $contentType = self::contentTypes['healthCheckControllerUpdate'][0])
    {
        $request = $this->healthCheckControllerUpdateRequest($healthCheckEntity, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation healthCheckControllerUpdateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity $healthCheckEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthCheckControllerUpdateAsync($healthCheckEntity, string $contentType = self::contentTypes['healthCheckControllerUpdate'][0])
    {
        return $this->healthCheckControllerUpdateAsyncWithHttpInfo($healthCheckEntity, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation healthCheckControllerUpdateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity $healthCheckEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthCheckControllerUpdateAsyncWithHttpInfo($healthCheckEntity, string $contentType = self::contentTypes['healthCheckControllerUpdate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity';
        $request = $this->healthCheckControllerUpdateRequest($healthCheckEntity, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'healthCheckControllerUpdate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\HealthCheckEntity $healthCheckEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthCheckControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function healthCheckControllerUpdateRequest($healthCheckEntity, string $contentType = self::contentTypes['healthCheckControllerUpdate'][0])
    {

        // verify the required parameter 'healthCheckEntity' is set
        if ($healthCheckEntity === null || (is_array($healthCheckEntity) && count($healthCheckEntity) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $healthCheckEntity when calling healthCheckControllerUpdate'
            );
        }


        $resourcePath = '/sync-core/health-check';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($healthCheckEntity)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($healthCheckEntity));
            } else {
                $httpBody = $healthCheckEntity;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'PATCH',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation healthControllerLive
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthControllerLive'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response|\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady503Response
     */
    public function healthControllerLive(string $contentType = self::contentTypes['healthControllerLive'][0])
    {
        list($response) = $this->healthControllerLiveWithHttpInfo($contentType);
        return $response;
    }

    /**
     * Operation healthControllerLiveWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthControllerLive'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response|\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady503Response, HTTP status code, HTTP response headers (array of strings)
     */
    public function healthControllerLiveWithHttpInfo(string $contentType = self::contentTypes['healthControllerLive'][0])
    {
        $request = $this->healthControllerLiveRequest($contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                case 503:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady503Response' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady503Response' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady503Response', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
                case 503:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady503Response',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation healthControllerLiveAsync
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthControllerLive'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthControllerLiveAsync(string $contentType = self::contentTypes['healthControllerLive'][0])
    {
        return $this->healthControllerLiveAsyncWithHttpInfo($contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation healthControllerLiveAsyncWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthControllerLive'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthControllerLiveAsyncWithHttpInfo(string $contentType = self::contentTypes['healthControllerLive'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response';
        $request = $this->healthControllerLiveRequest($contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'healthControllerLive'
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthControllerLive'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function healthControllerLiveRequest(string $contentType = self::contentTypes['healthControllerLive'][0])
    {


        $resourcePath = '/sync-core/healthz/live';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }


        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation healthControllerReady
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthControllerReady'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response|\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady503Response
     */
    public function healthControllerReady(string $contentType = self::contentTypes['healthControllerReady'][0])
    {
        list($response) = $this->healthControllerReadyWithHttpInfo($contentType);
        return $response;
    }

    /**
     * Operation healthControllerReadyWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthControllerReady'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response|\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady503Response, HTTP status code, HTTP response headers (array of strings)
     */
    public function healthControllerReadyWithHttpInfo(string $contentType = self::contentTypes['healthControllerReady'][0])
    {
        $request = $this->healthControllerReadyRequest($contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                case 503:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady503Response' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady503Response' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady503Response', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
                case 503:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady503Response',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation healthControllerReadyAsync
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthControllerReady'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthControllerReadyAsync(string $contentType = self::contentTypes['healthControllerReady'][0])
    {
        return $this->healthControllerReadyAsyncWithHttpInfo($contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation healthControllerReadyAsyncWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthControllerReady'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function healthControllerReadyAsyncWithHttpInfo(string $contentType = self::contentTypes['healthControllerReady'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\HealthControllerReady200Response';
        $request = $this->healthControllerReadyRequest($contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'healthControllerReady'
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['healthControllerReady'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function healthControllerReadyRequest(string $contentType = self::contentTypes['healthControllerReady'][0])
    {


        $resourcePath = '/sync-core/healthz/ready';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }


        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation issueControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['issueControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\IssueEntity
     */
    public function issueControllerItem($id, string $contentType = self::contentTypes['issueControllerItem'][0])
    {
        list($response) = $this->issueControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation issueControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['issueControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\IssueEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function issueControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['issueControllerItem'][0])
    {
        $request = $this->issueControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\IssueEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\IssueEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\IssueEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\IssueEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\IssueEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation issueControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['issueControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function issueControllerItemAsync($id, string $contentType = self::contentTypes['issueControllerItem'][0])
    {
        return $this->issueControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation issueControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['issueControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function issueControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['issueControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\IssueEntity';
        $request = $this->issueControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'issueControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['issueControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function issueControllerItemRequest($id, string $contentType = self::contentTypes['issueControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling issueControllerItem'
            );
        }


        $resourcePath = '/sync-core/issue/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation issueControllerList
     *
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['issueControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedIssueListResponse
     */
    public function issueControllerList($page = null, $itemsPerPage = null, string $contentType = self::contentTypes['issueControllerList'][0])
    {
        list($response) = $this->issueControllerListWithHttpInfo($page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation issueControllerListWithHttpInfo
     *
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['issueControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedIssueListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function issueControllerListWithHttpInfo($page = null, $itemsPerPage = null, string $contentType = self::contentTypes['issueControllerList'][0])
    {
        $request = $this->issueControllerListRequest($page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedIssueListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedIssueListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedIssueListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedIssueListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedIssueListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation issueControllerListAsync
     *
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['issueControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function issueControllerListAsync($page = null, $itemsPerPage = null, string $contentType = self::contentTypes['issueControllerList'][0])
    {
        return $this->issueControllerListAsyncWithHttpInfo($page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation issueControllerListAsyncWithHttpInfo
     *
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['issueControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function issueControllerListAsyncWithHttpInfo($page = null, $itemsPerPage = null, string $contentType = self::contentTypes['issueControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedIssueListResponse';
        $request = $this->issueControllerListRequest($page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'issueControllerList'
     *
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['issueControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function issueControllerListRequest($page = null, $itemsPerPage = null, string $contentType = self::contentTypes['issueControllerList'][0])
    {




        $resourcePath = '/sync-core/issue';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation localFileControllerDownload
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localFileControllerDownload'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function localFileControllerDownload($id, string $contentType = self::contentTypes['localFileControllerDownload'][0])
    {
        list($response) = $this->localFileControllerDownloadWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation localFileControllerDownloadWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localFileControllerDownload'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function localFileControllerDownloadWithHttpInfo($id, string $contentType = self::contentTypes['localFileControllerDownload'][0])
    {
        $request = $this->localFileControllerDownloadRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation localFileControllerDownloadAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localFileControllerDownload'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localFileControllerDownloadAsync($id, string $contentType = self::contentTypes['localFileControllerDownload'][0])
    {
        return $this->localFileControllerDownloadAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation localFileControllerDownloadAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localFileControllerDownload'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localFileControllerDownloadAsyncWithHttpInfo($id, string $contentType = self::contentTypes['localFileControllerDownload'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->localFileControllerDownloadRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'localFileControllerDownload'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localFileControllerDownload'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function localFileControllerDownloadRequest($id, string $contentType = self::contentTypes['localFileControllerDownload'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling localFileControllerDownload'
            );
        }


        $resourcePath = '/sync-core/file/local/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }


        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation localFileControllerUpload
     *
     * @param  string $id id (required)
     * @param  \SplFileObject $file file (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localFileControllerUpload'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function localFileControllerUpload($id, $file = null, string $contentType = self::contentTypes['localFileControllerUpload'][0])
    {
        list($response) = $this->localFileControllerUploadWithHttpInfo($id, $file, $contentType);
        return $response;
    }

    /**
     * Operation localFileControllerUploadWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \SplFileObject $file (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localFileControllerUpload'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function localFileControllerUploadWithHttpInfo($id, $file = null, string $contentType = self::contentTypes['localFileControllerUpload'][0])
    {
        $request = $this->localFileControllerUploadRequest($id, $file, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation localFileControllerUploadAsync
     *
     * @param  string $id (required)
     * @param  \SplFileObject $file (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localFileControllerUpload'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localFileControllerUploadAsync($id, $file = null, string $contentType = self::contentTypes['localFileControllerUpload'][0])
    {
        return $this->localFileControllerUploadAsyncWithHttpInfo($id, $file, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation localFileControllerUploadAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \SplFileObject $file (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localFileControllerUpload'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localFileControllerUploadAsyncWithHttpInfo($id, $file = null, string $contentType = self::contentTypes['localFileControllerUpload'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->localFileControllerUploadRequest($id, $file, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'localFileControllerUpload'
     *
     * @param  string $id (required)
     * @param  \SplFileObject $file (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localFileControllerUpload'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function localFileControllerUploadRequest($id, $file = null, string $contentType = self::contentTypes['localFileControllerUpload'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling localFileControllerUpload'
            );
        }



        $resourcePath = '/sync-core/file/local/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }

        // form params
        if ($file !== null) {
            $multipart = true;
            $formParams['file'] = [];
            $paramFiles = is_array($file) ? $file : [$file];
            foreach ($paramFiles as $paramFile) {
                $formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen(
                    ObjectSerializer::toFormValue($paramFile),
                    'rb'
                );
            }
        }

        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }


        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'PUT',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation localeControllerByCode
     *
     * @param  string $code code (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerByCode'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity
     */
    public function localeControllerByCode($code, string $contentType = self::contentTypes['localeControllerByCode'][0])
    {
        list($response) = $this->localeControllerByCodeWithHttpInfo($code, $contentType);
        return $response;
    }

    /**
     * Operation localeControllerByCodeWithHttpInfo
     *
     * @param  string $code (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerByCode'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function localeControllerByCodeWithHttpInfo($code, string $contentType = self::contentTypes['localeControllerByCode'][0])
    {
        $request = $this->localeControllerByCodeRequest($code, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation localeControllerByCodeAsync
     *
     * @param  string $code (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerByCode'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localeControllerByCodeAsync($code, string $contentType = self::contentTypes['localeControllerByCode'][0])
    {
        return $this->localeControllerByCodeAsyncWithHttpInfo($code, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation localeControllerByCodeAsyncWithHttpInfo
     *
     * @param  string $code (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerByCode'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localeControllerByCodeAsyncWithHttpInfo($code, string $contentType = self::contentTypes['localeControllerByCode'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity';
        $request = $this->localeControllerByCodeRequest($code, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'localeControllerByCode'
     *
     * @param  string $code (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerByCode'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function localeControllerByCodeRequest($code, string $contentType = self::contentTypes['localeControllerByCode'][0])
    {

        // verify the required parameter 'code' is set
        if ($code === null || (is_array($code) && count($code) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $code when calling localeControllerByCode'
            );
        }


        $resourcePath = '/sync-core/locale/by-code/{code}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($code !== null) {
            $resourcePath = str_replace(
                '{' . 'code' . '}',
                ObjectSerializer::toPathValue($code),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation localeControllerByIsoCode
     *
     * @param  string $isoCode isoCode (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerByIsoCode'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity
     */
    public function localeControllerByIsoCode($isoCode, string $contentType = self::contentTypes['localeControllerByIsoCode'][0])
    {
        list($response) = $this->localeControllerByIsoCodeWithHttpInfo($isoCode, $contentType);
        return $response;
    }

    /**
     * Operation localeControllerByIsoCodeWithHttpInfo
     *
     * @param  string $isoCode (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerByIsoCode'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function localeControllerByIsoCodeWithHttpInfo($isoCode, string $contentType = self::contentTypes['localeControllerByIsoCode'][0])
    {
        $request = $this->localeControllerByIsoCodeRequest($isoCode, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation localeControllerByIsoCodeAsync
     *
     * @param  string $isoCode (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerByIsoCode'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localeControllerByIsoCodeAsync($isoCode, string $contentType = self::contentTypes['localeControllerByIsoCode'][0])
    {
        return $this->localeControllerByIsoCodeAsyncWithHttpInfo($isoCode, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation localeControllerByIsoCodeAsyncWithHttpInfo
     *
     * @param  string $isoCode (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerByIsoCode'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localeControllerByIsoCodeAsyncWithHttpInfo($isoCode, string $contentType = self::contentTypes['localeControllerByIsoCode'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity';
        $request = $this->localeControllerByIsoCodeRequest($isoCode, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'localeControllerByIsoCode'
     *
     * @param  string $isoCode (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerByIsoCode'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function localeControllerByIsoCodeRequest($isoCode, string $contentType = self::contentTypes['localeControllerByIsoCode'][0])
    {

        // verify the required parameter 'isoCode' is set
        if ($isoCode === null || (is_array($isoCode) && count($isoCode) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $isoCode when calling localeControllerByIsoCode'
            );
        }


        $resourcePath = '/sync-core/locale/by-iso-code/{isoCode}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($isoCode !== null) {
            $resourcePath = str_replace(
                '{' . 'isoCode' . '}',
                ObjectSerializer::toPathValue($isoCode),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation localeControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateLocaleDto $createLocaleDto createLocaleDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity
     */
    public function localeControllerCreate($createLocaleDto, string $contentType = self::contentTypes['localeControllerCreate'][0])
    {
        list($response) = $this->localeControllerCreateWithHttpInfo($createLocaleDto, $contentType);
        return $response;
    }

    /**
     * Operation localeControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateLocaleDto $createLocaleDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function localeControllerCreateWithHttpInfo($createLocaleDto, string $contentType = self::contentTypes['localeControllerCreate'][0])
    {
        $request = $this->localeControllerCreateRequest($createLocaleDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation localeControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateLocaleDto $createLocaleDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localeControllerCreateAsync($createLocaleDto, string $contentType = self::contentTypes['localeControllerCreate'][0])
    {
        return $this->localeControllerCreateAsyncWithHttpInfo($createLocaleDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation localeControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateLocaleDto $createLocaleDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localeControllerCreateAsyncWithHttpInfo($createLocaleDto, string $contentType = self::contentTypes['localeControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity';
        $request = $this->localeControllerCreateRequest($createLocaleDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'localeControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateLocaleDto $createLocaleDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function localeControllerCreateRequest($createLocaleDto, string $contentType = self::contentTypes['localeControllerCreate'][0])
    {

        // verify the required parameter 'createLocaleDto' is set
        if ($createLocaleDto === null || (is_array($createLocaleDto) && count($createLocaleDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createLocaleDto when calling localeControllerCreate'
            );
        }


        $resourcePath = '/sync-core/locale';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createLocaleDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createLocaleDto));
            } else {
                $httpBody = $createLocaleDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation localeControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity
     */
    public function localeControllerItem($id, string $contentType = self::contentTypes['localeControllerItem'][0])
    {
        list($response) = $this->localeControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation localeControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function localeControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['localeControllerItem'][0])
    {
        $request = $this->localeControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation localeControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localeControllerItemAsync($id, string $contentType = self::contentTypes['localeControllerItem'][0])
    {
        return $this->localeControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation localeControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localeControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['localeControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity';
        $request = $this->localeControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'localeControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function localeControllerItemRequest($id, string $contentType = self::contentTypes['localeControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling localeControllerItem'
            );
        }


        $resourcePath = '/sync-core/locale/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation localeControllerList
     *
     * @param  string $search search (optional)
     * @param  mixed $projectId projectId (optional)
     * @param  mixed $customerId customerId (optional)
     * @param  mixed $locale locale (optional)
     * @param  mixed $country country (optional)
     * @param  mixed $status status (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedLocaleListResponse
     */
    public function localeControllerList($search = null, $projectId = null, $customerId = null, $locale = null, $country = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['localeControllerList'][0])
    {
        list($response) = $this->localeControllerListWithHttpInfo($search, $projectId, $customerId, $locale, $country, $status, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation localeControllerListWithHttpInfo
     *
     * @param  string $search (optional)
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $locale (optional)
     * @param  mixed $country (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedLocaleListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function localeControllerListWithHttpInfo($search = null, $projectId = null, $customerId = null, $locale = null, $country = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['localeControllerList'][0])
    {
        $request = $this->localeControllerListRequest($search, $projectId, $customerId, $locale, $country, $status, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedLocaleListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedLocaleListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedLocaleListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedLocaleListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedLocaleListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation localeControllerListAsync
     *
     * @param  string $search (optional)
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $locale (optional)
     * @param  mixed $country (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localeControllerListAsync($search = null, $projectId = null, $customerId = null, $locale = null, $country = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['localeControllerList'][0])
    {
        return $this->localeControllerListAsyncWithHttpInfo($search, $projectId, $customerId, $locale, $country, $status, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation localeControllerListAsyncWithHttpInfo
     *
     * @param  string $search (optional)
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $locale (optional)
     * @param  mixed $country (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localeControllerListAsyncWithHttpInfo($search = null, $projectId = null, $customerId = null, $locale = null, $country = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['localeControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedLocaleListResponse';
        $request = $this->localeControllerListRequest($search, $projectId, $customerId, $locale, $country, $status, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'localeControllerList'
     *
     * @param  string $search (optional)
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $locale (optional)
     * @param  mixed $country (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function localeControllerListRequest($search = null, $projectId = null, $customerId = null, $locale = null, $country = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['localeControllerList'][0])
    {










        $resourcePath = '/sync-core/locale';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $search,
            'search', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $projectId,
            'projectId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $customerId,
            'customerId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $locale,
            'locale', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $country,
            'country', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation localeControllerUpdate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity $localeEntity localeEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity
     */
    public function localeControllerUpdate($localeEntity, string $contentType = self::contentTypes['localeControllerUpdate'][0])
    {
        list($response) = $this->localeControllerUpdateWithHttpInfo($localeEntity, $contentType);
        return $response;
    }

    /**
     * Operation localeControllerUpdateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity $localeEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function localeControllerUpdateWithHttpInfo($localeEntity, string $contentType = self::contentTypes['localeControllerUpdate'][0])
    {
        $request = $this->localeControllerUpdateRequest($localeEntity, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation localeControllerUpdateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity $localeEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localeControllerUpdateAsync($localeEntity, string $contentType = self::contentTypes['localeControllerUpdate'][0])
    {
        return $this->localeControllerUpdateAsyncWithHttpInfo($localeEntity, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation localeControllerUpdateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity $localeEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function localeControllerUpdateAsyncWithHttpInfo($localeEntity, string $contentType = self::contentTypes['localeControllerUpdate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity';
        $request = $this->localeControllerUpdateRequest($localeEntity, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'localeControllerUpdate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\LocaleEntity $localeEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['localeControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function localeControllerUpdateRequest($localeEntity, string $contentType = self::contentTypes['localeControllerUpdate'][0])
    {

        // verify the required parameter 'localeEntity' is set
        if ($localeEntity === null || (is_array($localeEntity) && count($localeEntity) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $localeEntity when calling localeControllerUpdate'
            );
        }


        $resourcePath = '/sync-core/locale';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($localeEntity)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($localeEntity));
            } else {
                $httpBody = $localeEntity;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'PATCH',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation loggingControllerList
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\LoggingIdsRequest $loggingIdsRequest loggingIdsRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['loggingControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\LoggingIdsResponse
     */
    public function loggingControllerList($loggingIdsRequest, string $contentType = self::contentTypes['loggingControllerList'][0])
    {
        list($response) = $this->loggingControllerListWithHttpInfo($loggingIdsRequest, $contentType);
        return $response;
    }

    /**
     * Operation loggingControllerListWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\LoggingIdsRequest $loggingIdsRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['loggingControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\LoggingIdsResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function loggingControllerListWithHttpInfo($loggingIdsRequest, string $contentType = self::contentTypes['loggingControllerList'][0])
    {
        $request = $this->loggingControllerListRequest($loggingIdsRequest, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\LoggingIdsResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\LoggingIdsResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\LoggingIdsResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\LoggingIdsResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\LoggingIdsResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation loggingControllerListAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\LoggingIdsRequest $loggingIdsRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['loggingControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function loggingControllerListAsync($loggingIdsRequest, string $contentType = self::contentTypes['loggingControllerList'][0])
    {
        return $this->loggingControllerListAsyncWithHttpInfo($loggingIdsRequest, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation loggingControllerListAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\LoggingIdsRequest $loggingIdsRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['loggingControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function loggingControllerListAsyncWithHttpInfo($loggingIdsRequest, string $contentType = self::contentTypes['loggingControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\LoggingIdsResponse';
        $request = $this->loggingControllerListRequest($loggingIdsRequest, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'loggingControllerList'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\LoggingIdsRequest $loggingIdsRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['loggingControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function loggingControllerListRequest($loggingIdsRequest, string $contentType = self::contentTypes['loggingControllerList'][0])
    {

        // verify the required parameter 'loggingIdsRequest' is set
        if ($loggingIdsRequest === null || (is_array($loggingIdsRequest) && count($loggingIdsRequest) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $loggingIdsRequest when calling loggingControllerList'
            );
        }


        $resourcePath = '/sync-core/logging/map-ids';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($loggingIdsRequest)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($loggingIdsRequest));
            } else {
                $httpBody = $loggingIdsRequest;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation migrationControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskGroupDto $createTaskGroupDto createTaskGroupDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity
     */
    public function migrationControllerCreate($createTaskGroupDto, string $contentType = self::contentTypes['migrationControllerCreate'][0])
    {
        list($response) = $this->migrationControllerCreateWithHttpInfo($createTaskGroupDto, $contentType);
        return $response;
    }

    /**
     * Operation migrationControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskGroupDto $createTaskGroupDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function migrationControllerCreateWithHttpInfo($createTaskGroupDto, string $contentType = self::contentTypes['migrationControllerCreate'][0])
    {
        $request = $this->migrationControllerCreateRequest($createTaskGroupDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation migrationControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskGroupDto $createTaskGroupDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function migrationControllerCreateAsync($createTaskGroupDto, string $contentType = self::contentTypes['migrationControllerCreate'][0])
    {
        return $this->migrationControllerCreateAsyncWithHttpInfo($createTaskGroupDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation migrationControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskGroupDto $createTaskGroupDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function migrationControllerCreateAsyncWithHttpInfo($createTaskGroupDto, string $contentType = self::contentTypes['migrationControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity';
        $request = $this->migrationControllerCreateRequest($createTaskGroupDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'migrationControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskGroupDto $createTaskGroupDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function migrationControllerCreateRequest($createTaskGroupDto, string $contentType = self::contentTypes['migrationControllerCreate'][0])
    {

        // verify the required parameter 'createTaskGroupDto' is set
        if ($createTaskGroupDto === null || (is_array($createTaskGroupDto) && count($createTaskGroupDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createTaskGroupDto when calling migrationControllerCreate'
            );
        }


        $resourcePath = '/sync-core/migration';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createTaskGroupDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createTaskGroupDto));
            } else {
                $httpBody = $createTaskGroupDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation migrationControllerDelete
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerDelete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity
     */
    public function migrationControllerDelete($id, string $contentType = self::contentTypes['migrationControllerDelete'][0])
    {
        list($response) = $this->migrationControllerDeleteWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation migrationControllerDeleteWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerDelete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function migrationControllerDeleteWithHttpInfo($id, string $contentType = self::contentTypes['migrationControllerDelete'][0])
    {
        $request = $this->migrationControllerDeleteRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation migrationControllerDeleteAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function migrationControllerDeleteAsync($id, string $contentType = self::contentTypes['migrationControllerDelete'][0])
    {
        return $this->migrationControllerDeleteAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation migrationControllerDeleteAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function migrationControllerDeleteAsyncWithHttpInfo($id, string $contentType = self::contentTypes['migrationControllerDelete'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity';
        $request = $this->migrationControllerDeleteRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'migrationControllerDelete'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function migrationControllerDeleteRequest($id, string $contentType = self::contentTypes['migrationControllerDelete'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling migrationControllerDelete'
            );
        }


        $resourcePath = '/sync-core/migration/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'DELETE',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation migrationControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity
     */
    public function migrationControllerItem($id, string $contentType = self::contentTypes['migrationControllerItem'][0])
    {
        list($response) = $this->migrationControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation migrationControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function migrationControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['migrationControllerItem'][0])
    {
        $request = $this->migrationControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation migrationControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function migrationControllerItemAsync($id, string $contentType = self::contentTypes['migrationControllerItem'][0])
    {
        return $this->migrationControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation migrationControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function migrationControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['migrationControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity';
        $request = $this->migrationControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'migrationControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function migrationControllerItemRequest($id, string $contentType = self::contentTypes['migrationControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling migrationControllerItem'
            );
        }


        $resourcePath = '/sync-core/migration/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation migrationControllerList
     *
     * @param  string $groupByEntityTypeAndFlowAndSite groupByEntityTypeAndFlowAndSite (optional)
     * @param  string $entityTypeMachineName entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName entityTypeNamespaceMachineName (optional)
     * @param  string $flowMachineName flowMachineName (optional)
     * @param  string $domains domains (optional)
     * @param  string $scopes scopes (optional)
     * @param  string $statuses statuses (optional)
     * @param  string $types types (optional)
     * @param  string $siteUuid siteUuid (optional)
     * @param  string $siteId siteId (optional)
     * @param  string $initialSetup initialSetup (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList
     */
    public function migrationControllerList($groupByEntityTypeAndFlowAndSite = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $flowMachineName = null, $domains = null, $scopes = null, $statuses = null, $types = null, $siteUuid = null, $siteId = null, $initialSetup = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['migrationControllerList'][0])
    {
        list($response) = $this->migrationControllerListWithHttpInfo($groupByEntityTypeAndFlowAndSite, $entityTypeMachineName, $entityTypeNamespaceMachineName, $flowMachineName, $domains, $scopes, $statuses, $types, $siteUuid, $siteId, $initialSetup, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation migrationControllerListWithHttpInfo
     *
     * @param  string $groupByEntityTypeAndFlowAndSite (optional)
     * @param  string $entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName (optional)
     * @param  string $flowMachineName (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $statuses (optional)
     * @param  string $types (optional)
     * @param  string $siteUuid (optional)
     * @param  string $siteId (optional)
     * @param  string $initialSetup (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList, HTTP status code, HTTP response headers (array of strings)
     */
    public function migrationControllerListWithHttpInfo($groupByEntityTypeAndFlowAndSite = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $flowMachineName = null, $domains = null, $scopes = null, $statuses = null, $types = null, $siteUuid = null, $siteId = null, $initialSetup = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['migrationControllerList'][0])
    {
        $request = $this->migrationControllerListRequest($groupByEntityTypeAndFlowAndSite, $entityTypeMachineName, $entityTypeNamespaceMachineName, $flowMachineName, $domains, $scopes, $statuses, $types, $siteUuid, $siteId, $initialSetup, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation migrationControllerListAsync
     *
     * @param  string $groupByEntityTypeAndFlowAndSite (optional)
     * @param  string $entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName (optional)
     * @param  string $flowMachineName (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $statuses (optional)
     * @param  string $types (optional)
     * @param  string $siteUuid (optional)
     * @param  string $siteId (optional)
     * @param  string $initialSetup (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function migrationControllerListAsync($groupByEntityTypeAndFlowAndSite = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $flowMachineName = null, $domains = null, $scopes = null, $statuses = null, $types = null, $siteUuid = null, $siteId = null, $initialSetup = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['migrationControllerList'][0])
    {
        return $this->migrationControllerListAsyncWithHttpInfo($groupByEntityTypeAndFlowAndSite, $entityTypeMachineName, $entityTypeNamespaceMachineName, $flowMachineName, $domains, $scopes, $statuses, $types, $siteUuid, $siteId, $initialSetup, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation migrationControllerListAsyncWithHttpInfo
     *
     * @param  string $groupByEntityTypeAndFlowAndSite (optional)
     * @param  string $entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName (optional)
     * @param  string $flowMachineName (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $statuses (optional)
     * @param  string $types (optional)
     * @param  string $siteUuid (optional)
     * @param  string $siteId (optional)
     * @param  string $initialSetup (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function migrationControllerListAsyncWithHttpInfo($groupByEntityTypeAndFlowAndSite = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $flowMachineName = null, $domains = null, $scopes = null, $statuses = null, $types = null, $siteUuid = null, $siteId = null, $initialSetup = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['migrationControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList';
        $request = $this->migrationControllerListRequest($groupByEntityTypeAndFlowAndSite, $entityTypeMachineName, $entityTypeNamespaceMachineName, $flowMachineName, $domains, $scopes, $statuses, $types, $siteUuid, $siteId, $initialSetup, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'migrationControllerList'
     *
     * @param  string $groupByEntityTypeAndFlowAndSite (optional)
     * @param  string $entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName (optional)
     * @param  string $flowMachineName (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $statuses (optional)
     * @param  string $types (optional)
     * @param  string $siteUuid (optional)
     * @param  string $siteId (optional)
     * @param  string $initialSetup (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function migrationControllerListRequest($groupByEntityTypeAndFlowAndSite = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $flowMachineName = null, $domains = null, $scopes = null, $statuses = null, $types = null, $siteUuid = null, $siteId = null, $initialSetup = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['migrationControllerList'][0])
    {















        $resourcePath = '/sync-core/migration';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $groupByEntityTypeAndFlowAndSite,
            'groupByEntityTypeAndFlowAndSite', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityTypeMachineName,
            'entityTypeMachineName', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityTypeNamespaceMachineName,
            'entityTypeNamespaceMachineName', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $flowMachineName,
            'flowMachineName', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $domains,
            'domains', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $scopes,
            'scopes', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $statuses,
            'statuses', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $types,
            'types', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $siteUuid,
            'siteUuid', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $siteId,
            'siteId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $initialSetup,
            'initialSetup', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation migrationControllerSummary
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerSummary'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary
     */
    public function migrationControllerSummary($id, string $contentType = self::contentTypes['migrationControllerSummary'][0])
    {
        list($response) = $this->migrationControllerSummaryWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation migrationControllerSummaryWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerSummary'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary, HTTP status code, HTTP response headers (array of strings)
     */
    public function migrationControllerSummaryWithHttpInfo($id, string $contentType = self::contentTypes['migrationControllerSummary'][0])
    {
        $request = $this->migrationControllerSummaryRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation migrationControllerSummaryAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function migrationControllerSummaryAsync($id, string $contentType = self::contentTypes['migrationControllerSummary'][0])
    {
        return $this->migrationControllerSummaryAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation migrationControllerSummaryAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function migrationControllerSummaryAsyncWithHttpInfo($id, string $contentType = self::contentTypes['migrationControllerSummary'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary';
        $request = $this->migrationControllerSummaryRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'migrationControllerSummary'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['migrationControllerSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function migrationControllerSummaryRequest($id, string $contentType = self::contentTypes['migrationControllerSummary'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling migrationControllerSummary'
            );
        }


        $resourcePath = '/sync-core/migration/{id}/summary';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation monitoringPromptControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateMonitoringPromptDto $createMonitoringPromptDto createMonitoringPromptDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity
     */
    public function monitoringPromptControllerCreate($createMonitoringPromptDto, string $contentType = self::contentTypes['monitoringPromptControllerCreate'][0])
    {
        list($response) = $this->monitoringPromptControllerCreateWithHttpInfo($createMonitoringPromptDto, $contentType);
        return $response;
    }

    /**
     * Operation monitoringPromptControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateMonitoringPromptDto $createMonitoringPromptDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function monitoringPromptControllerCreateWithHttpInfo($createMonitoringPromptDto, string $contentType = self::contentTypes['monitoringPromptControllerCreate'][0])
    {
        $request = $this->monitoringPromptControllerCreateRequest($createMonitoringPromptDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation monitoringPromptControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateMonitoringPromptDto $createMonitoringPromptDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptControllerCreateAsync($createMonitoringPromptDto, string $contentType = self::contentTypes['monitoringPromptControllerCreate'][0])
    {
        return $this->monitoringPromptControllerCreateAsyncWithHttpInfo($createMonitoringPromptDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation monitoringPromptControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateMonitoringPromptDto $createMonitoringPromptDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptControllerCreateAsyncWithHttpInfo($createMonitoringPromptDto, string $contentType = self::contentTypes['monitoringPromptControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity';
        $request = $this->monitoringPromptControllerCreateRequest($createMonitoringPromptDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'monitoringPromptControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateMonitoringPromptDto $createMonitoringPromptDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function monitoringPromptControllerCreateRequest($createMonitoringPromptDto, string $contentType = self::contentTypes['monitoringPromptControllerCreate'][0])
    {

        // verify the required parameter 'createMonitoringPromptDto' is set
        if ($createMonitoringPromptDto === null || (is_array($createMonitoringPromptDto) && count($createMonitoringPromptDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createMonitoringPromptDto when calling monitoringPromptControllerCreate'
            );
        }


        $resourcePath = '/sync-core/monitoring-prompt';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createMonitoringPromptDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createMonitoringPromptDto));
            } else {
                $httpBody = $createMonitoringPromptDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation monitoringPromptControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity
     */
    public function monitoringPromptControllerItem($id, string $contentType = self::contentTypes['monitoringPromptControllerItem'][0])
    {
        list($response) = $this->monitoringPromptControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation monitoringPromptControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function monitoringPromptControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['monitoringPromptControllerItem'][0])
    {
        $request = $this->monitoringPromptControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation monitoringPromptControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptControllerItemAsync($id, string $contentType = self::contentTypes['monitoringPromptControllerItem'][0])
    {
        return $this->monitoringPromptControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation monitoringPromptControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['monitoringPromptControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity';
        $request = $this->monitoringPromptControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'monitoringPromptControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function monitoringPromptControllerItemRequest($id, string $contentType = self::contentTypes['monitoringPromptControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling monitoringPromptControllerItem'
            );
        }


        $resourcePath = '/sync-core/monitoring-prompt/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation monitoringPromptControllerItemByKey
     *
     * @param  string $key key (required)
     * @param  string $status status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity
     */
    public function monitoringPromptControllerItemByKey($key, $status, string $contentType = self::contentTypes['monitoringPromptControllerItemByKey'][0])
    {
        list($response) = $this->monitoringPromptControllerItemByKeyWithHttpInfo($key, $status, $contentType);
        return $response;
    }

    /**
     * Operation monitoringPromptControllerItemByKeyWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function monitoringPromptControllerItemByKeyWithHttpInfo($key, $status, string $contentType = self::contentTypes['monitoringPromptControllerItemByKey'][0])
    {
        $request = $this->monitoringPromptControllerItemByKeyRequest($key, $status, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation monitoringPromptControllerItemByKeyAsync
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptControllerItemByKeyAsync($key, $status, string $contentType = self::contentTypes['monitoringPromptControllerItemByKey'][0])
    {
        return $this->monitoringPromptControllerItemByKeyAsyncWithHttpInfo($key, $status, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation monitoringPromptControllerItemByKeyAsyncWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptControllerItemByKeyAsyncWithHttpInfo($key, $status, string $contentType = self::contentTypes['monitoringPromptControllerItemByKey'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity';
        $request = $this->monitoringPromptControllerItemByKeyRequest($key, $status, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'monitoringPromptControllerItemByKey'
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function monitoringPromptControllerItemByKeyRequest($key, $status, string $contentType = self::contentTypes['monitoringPromptControllerItemByKey'][0])
    {

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling monitoringPromptControllerItemByKey'
            );
        }

        // verify the required parameter 'status' is set
        if ($status === null || (is_array($status) && count($status) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $status when calling monitoringPromptControllerItemByKey'
            );
        }


        $resourcePath = '/sync-core/monitoring-prompt/by-key/{key}/{status}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }
        // path params
        if ($status !== null) {
            $resourcePath = str_replace(
                '{' . 'status' . '}',
                ObjectSerializer::toPathValue($status),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation monitoringPromptControllerList
     *
     * @param  mixed $staticTermsKey staticTermsKey (optional)
     * @param  mixed $enginesKey enginesKey (optional)
     * @param  mixed $localesKey localesKey (optional)
     * @param  mixed $templateTermsKey templateTermsKey (optional)
     * @param  mixed $promptLocaleKey promptLocaleKey (optional)
     * @param  mixed $templatePromptKey templatePromptKey (optional)
     * @param  mixed $countries countries (optional)
     * @param  mixed $type type (optional)
     * @param  mixed $status status (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse
     */
    public function monitoringPromptControllerList($staticTermsKey = null, $enginesKey = null, $localesKey = null, $templateTermsKey = null, $promptLocaleKey = null, $templatePromptKey = null, $countries = null, $type = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['monitoringPromptControllerList'][0])
    {
        list($response) = $this->monitoringPromptControllerListWithHttpInfo($staticTermsKey, $enginesKey, $localesKey, $templateTermsKey, $promptLocaleKey, $templatePromptKey, $countries, $type, $status, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation monitoringPromptControllerListWithHttpInfo
     *
     * @param  mixed $staticTermsKey (optional)
     * @param  mixed $enginesKey (optional)
     * @param  mixed $localesKey (optional)
     * @param  mixed $templateTermsKey (optional)
     * @param  mixed $promptLocaleKey (optional)
     * @param  mixed $templatePromptKey (optional)
     * @param  mixed $countries (optional)
     * @param  mixed $type (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function monitoringPromptControllerListWithHttpInfo($staticTermsKey = null, $enginesKey = null, $localesKey = null, $templateTermsKey = null, $promptLocaleKey = null, $templatePromptKey = null, $countries = null, $type = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['monitoringPromptControllerList'][0])
    {
        $request = $this->monitoringPromptControllerListRequest($staticTermsKey, $enginesKey, $localesKey, $templateTermsKey, $promptLocaleKey, $templatePromptKey, $countries, $type, $status, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation monitoringPromptControllerListAsync
     *
     * @param  mixed $staticTermsKey (optional)
     * @param  mixed $enginesKey (optional)
     * @param  mixed $localesKey (optional)
     * @param  mixed $templateTermsKey (optional)
     * @param  mixed $promptLocaleKey (optional)
     * @param  mixed $templatePromptKey (optional)
     * @param  mixed $countries (optional)
     * @param  mixed $type (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptControllerListAsync($staticTermsKey = null, $enginesKey = null, $localesKey = null, $templateTermsKey = null, $promptLocaleKey = null, $templatePromptKey = null, $countries = null, $type = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['monitoringPromptControllerList'][0])
    {
        return $this->monitoringPromptControllerListAsyncWithHttpInfo($staticTermsKey, $enginesKey, $localesKey, $templateTermsKey, $promptLocaleKey, $templatePromptKey, $countries, $type, $status, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation monitoringPromptControllerListAsyncWithHttpInfo
     *
     * @param  mixed $staticTermsKey (optional)
     * @param  mixed $enginesKey (optional)
     * @param  mixed $localesKey (optional)
     * @param  mixed $templateTermsKey (optional)
     * @param  mixed $promptLocaleKey (optional)
     * @param  mixed $templatePromptKey (optional)
     * @param  mixed $countries (optional)
     * @param  mixed $type (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptControllerListAsyncWithHttpInfo($staticTermsKey = null, $enginesKey = null, $localesKey = null, $templateTermsKey = null, $promptLocaleKey = null, $templatePromptKey = null, $countries = null, $type = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['monitoringPromptControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse';
        $request = $this->monitoringPromptControllerListRequest($staticTermsKey, $enginesKey, $localesKey, $templateTermsKey, $promptLocaleKey, $templatePromptKey, $countries, $type, $status, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'monitoringPromptControllerList'
     *
     * @param  mixed $staticTermsKey (optional)
     * @param  mixed $enginesKey (optional)
     * @param  mixed $localesKey (optional)
     * @param  mixed $templateTermsKey (optional)
     * @param  mixed $promptLocaleKey (optional)
     * @param  mixed $templatePromptKey (optional)
     * @param  mixed $countries (optional)
     * @param  mixed $type (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function monitoringPromptControllerListRequest($staticTermsKey = null, $enginesKey = null, $localesKey = null, $templateTermsKey = null, $promptLocaleKey = null, $templatePromptKey = null, $countries = null, $type = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['monitoringPromptControllerList'][0])
    {













        $resourcePath = '/sync-core/monitoring-prompt';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $staticTermsKey,
            'staticTermsKey', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $enginesKey,
            'enginesKey', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $localesKey,
            'localesKey', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $templateTermsKey,
            'templateTermsKey', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $promptLocaleKey,
            'promptLocaleKey', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $templatePromptKey,
            'templatePromptKey', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $countries,
            'countries', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $type,
            'type', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation monitoringPromptControllerRevisionsByPreviousStatus
     *
     * @param  string $key key (required)
     * @param  string $status status (required)
     * @param  mixed $itemsPerPage itemsPerPage (optional)
     * @param  mixed $page page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse
     */
    public function monitoringPromptControllerRevisionsByPreviousStatus($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['monitoringPromptControllerRevisionsByPreviousStatus'][0])
    {
        list($response) = $this->monitoringPromptControllerRevisionsByPreviousStatusWithHttpInfo($key, $status, $itemsPerPage, $page, $contentType);
        return $response;
    }

    /**
     * Operation monitoringPromptControllerRevisionsByPreviousStatusWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function monitoringPromptControllerRevisionsByPreviousStatusWithHttpInfo($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['monitoringPromptControllerRevisionsByPreviousStatus'][0])
    {
        $request = $this->monitoringPromptControllerRevisionsByPreviousStatusRequest($key, $status, $itemsPerPage, $page, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation monitoringPromptControllerRevisionsByPreviousStatusAsync
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptControllerRevisionsByPreviousStatusAsync($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['monitoringPromptControllerRevisionsByPreviousStatus'][0])
    {
        return $this->monitoringPromptControllerRevisionsByPreviousStatusAsyncWithHttpInfo($key, $status, $itemsPerPage, $page, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation monitoringPromptControllerRevisionsByPreviousStatusAsyncWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptControllerRevisionsByPreviousStatusAsyncWithHttpInfo($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['monitoringPromptControllerRevisionsByPreviousStatus'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptListResponse';
        $request = $this->monitoringPromptControllerRevisionsByPreviousStatusRequest($key, $status, $itemsPerPage, $page, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'monitoringPromptControllerRevisionsByPreviousStatus'
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function monitoringPromptControllerRevisionsByPreviousStatusRequest($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['monitoringPromptControllerRevisionsByPreviousStatus'][0])
    {

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling monitoringPromptControllerRevisionsByPreviousStatus'
            );
        }

        // verify the required parameter 'status' is set
        if ($status === null || (is_array($status) && count($status) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $status when calling monitoringPromptControllerRevisionsByPreviousStatus'
            );
        }




        $resourcePath = '/sync-core/monitoring-prompt/by-key/{key}/{status}/revisions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }
        // path params
        if ($status !== null) {
            $resourcePath = str_replace(
                '{' . 'status' . '}',
                ObjectSerializer::toPathValue($status),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation monitoringPromptControllerUpdate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptUpdateFlagsDto $monitoringPromptUpdateFlagsDto monitoringPromptUpdateFlagsDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity
     */
    public function monitoringPromptControllerUpdate($monitoringPromptUpdateFlagsDto, string $contentType = self::contentTypes['monitoringPromptControllerUpdate'][0])
    {
        list($response) = $this->monitoringPromptControllerUpdateWithHttpInfo($monitoringPromptUpdateFlagsDto, $contentType);
        return $response;
    }

    /**
     * Operation monitoringPromptControllerUpdateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptUpdateFlagsDto $monitoringPromptUpdateFlagsDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function monitoringPromptControllerUpdateWithHttpInfo($monitoringPromptUpdateFlagsDto, string $contentType = self::contentTypes['monitoringPromptControllerUpdate'][0])
    {
        $request = $this->monitoringPromptControllerUpdateRequest($monitoringPromptUpdateFlagsDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation monitoringPromptControllerUpdateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptUpdateFlagsDto $monitoringPromptUpdateFlagsDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptControllerUpdateAsync($monitoringPromptUpdateFlagsDto, string $contentType = self::contentTypes['monitoringPromptControllerUpdate'][0])
    {
        return $this->monitoringPromptControllerUpdateAsyncWithHttpInfo($monitoringPromptUpdateFlagsDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation monitoringPromptControllerUpdateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptUpdateFlagsDto $monitoringPromptUpdateFlagsDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptControllerUpdateAsyncWithHttpInfo($monitoringPromptUpdateFlagsDto, string $contentType = self::contentTypes['monitoringPromptControllerUpdate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptEntity';
        $request = $this->monitoringPromptControllerUpdateRequest($monitoringPromptUpdateFlagsDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'monitoringPromptControllerUpdate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptUpdateFlagsDto $monitoringPromptUpdateFlagsDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function monitoringPromptControllerUpdateRequest($monitoringPromptUpdateFlagsDto, string $contentType = self::contentTypes['monitoringPromptControllerUpdate'][0])
    {

        // verify the required parameter 'monitoringPromptUpdateFlagsDto' is set
        if ($monitoringPromptUpdateFlagsDto === null || (is_array($monitoringPromptUpdateFlagsDto) && count($monitoringPromptUpdateFlagsDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $monitoringPromptUpdateFlagsDto when calling monitoringPromptControllerUpdate'
            );
        }


        $resourcePath = '/sync-core/monitoring-prompt';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($monitoringPromptUpdateFlagsDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($monitoringPromptUpdateFlagsDto));
            } else {
                $httpBody = $monitoringPromptUpdateFlagsDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'PATCH',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation monitoringPromptRunControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptRunControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptRunEntity
     */
    public function monitoringPromptRunControllerItem($id, string $contentType = self::contentTypes['monitoringPromptRunControllerItem'][0])
    {
        list($response) = $this->monitoringPromptRunControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation monitoringPromptRunControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptRunControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptRunEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function monitoringPromptRunControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['monitoringPromptRunControllerItem'][0])
    {
        $request = $this->monitoringPromptRunControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptRunEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptRunEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptRunEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptRunEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptRunEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation monitoringPromptRunControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptRunControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptRunControllerItemAsync($id, string $contentType = self::contentTypes['monitoringPromptRunControllerItem'][0])
    {
        return $this->monitoringPromptRunControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation monitoringPromptRunControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptRunControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptRunControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['monitoringPromptRunControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MonitoringPromptRunEntity';
        $request = $this->monitoringPromptRunControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'monitoringPromptRunControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptRunControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function monitoringPromptRunControllerItemRequest($id, string $contentType = self::contentTypes['monitoringPromptRunControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling monitoringPromptRunControllerItem'
            );
        }


        $resourcePath = '/sync-core/monitoring-prompt-run/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation monitoringPromptRunControllerList
     *
     * @param  mixed $promptKey promptKey (optional)
     * @param  mixed $status status (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptRunControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptRunListResponse
     */
    public function monitoringPromptRunControllerList($promptKey = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['monitoringPromptRunControllerList'][0])
    {
        list($response) = $this->monitoringPromptRunControllerListWithHttpInfo($promptKey, $status, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation monitoringPromptRunControllerListWithHttpInfo
     *
     * @param  mixed $promptKey (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptRunControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptRunListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function monitoringPromptRunControllerListWithHttpInfo($promptKey = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['monitoringPromptRunControllerList'][0])
    {
        $request = $this->monitoringPromptRunControllerListRequest($promptKey, $status, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptRunListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptRunListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptRunListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptRunListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptRunListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation monitoringPromptRunControllerListAsync
     *
     * @param  mixed $promptKey (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptRunControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptRunControllerListAsync($promptKey = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['monitoringPromptRunControllerList'][0])
    {
        return $this->monitoringPromptRunControllerListAsyncWithHttpInfo($promptKey, $status, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation monitoringPromptRunControllerListAsyncWithHttpInfo
     *
     * @param  mixed $promptKey (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptRunControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function monitoringPromptRunControllerListAsyncWithHttpInfo($promptKey = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['monitoringPromptRunControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedMonitoringPromptRunListResponse';
        $request = $this->monitoringPromptRunControllerListRequest($promptKey, $status, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'monitoringPromptRunControllerList'
     *
     * @param  mixed $promptKey (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['monitoringPromptRunControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function monitoringPromptRunControllerListRequest($promptKey = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['monitoringPromptRunControllerList'][0])
    {






        $resourcePath = '/sync-core/monitoring-prompt-run';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $promptKey,
            'promptKey', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation onboardingUtilityControllerGetContentItemTerms
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskGroupId taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetContentItemTerms'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\OnboardingContentItemTermsExtractionResultDto[]
     */
    public function onboardingUtilityControllerGetContentItemTerms($minCompatibilityDate = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetContentItemTerms'][0])
    {
        list($response) = $this->onboardingUtilityControllerGetContentItemTermsWithHttpInfo($minCompatibilityDate, $taskGroupId, $contentType);
        return $response;
    }

    /**
     * Operation onboardingUtilityControllerGetContentItemTermsWithHttpInfo
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetContentItemTerms'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\OnboardingContentItemTermsExtractionResultDto[], HTTP status code, HTTP response headers (array of strings)
     */
    public function onboardingUtilityControllerGetContentItemTermsWithHttpInfo($minCompatibilityDate = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetContentItemTerms'][0])
    {
        $request = $this->onboardingUtilityControllerGetContentItemTermsRequest($minCompatibilityDate, $taskGroupId, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingContentItemTermsExtractionResultDto[]' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingContentItemTermsExtractionResultDto[]' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingContentItemTermsExtractionResultDto[]', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingContentItemTermsExtractionResultDto[]';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingContentItemTermsExtractionResultDto[]',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation onboardingUtilityControllerGetContentItemTermsAsync
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetContentItemTerms'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerGetContentItemTermsAsync($minCompatibilityDate = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetContentItemTerms'][0])
    {
        return $this->onboardingUtilityControllerGetContentItemTermsAsyncWithHttpInfo($minCompatibilityDate, $taskGroupId, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation onboardingUtilityControllerGetContentItemTermsAsyncWithHttpInfo
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetContentItemTerms'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerGetContentItemTermsAsyncWithHttpInfo($minCompatibilityDate = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetContentItemTerms'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingContentItemTermsExtractionResultDto[]';
        $request = $this->onboardingUtilityControllerGetContentItemTermsRequest($minCompatibilityDate, $taskGroupId, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'onboardingUtilityControllerGetContentItemTerms'
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetContentItemTerms'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function onboardingUtilityControllerGetContentItemTermsRequest($minCompatibilityDate = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetContentItemTerms'][0])
    {




        $resourcePath = '/sync-core/onboarding/governance/content-item-terms';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $minCompatibilityDate,
            'minCompatibilityDate', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskGroupId,
            'taskGroupId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageDataExtraction
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId taskId (optional)
     * @param  string $taskGroupId taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageDataExtraction'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageDataExtractionDto
     */
    public function onboardingUtilityControllerGetMainPageDataExtraction($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageDataExtraction'][0])
    {
        list($response) = $this->onboardingUtilityControllerGetMainPageDataExtractionWithHttpInfo($minCompatibilityDate, $taskId, $taskGroupId, $contentType);
        return $response;
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageDataExtractionWithHttpInfo
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageDataExtraction'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageDataExtractionDto, HTTP status code, HTTP response headers (array of strings)
     */
    public function onboardingUtilityControllerGetMainPageDataExtractionWithHttpInfo($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageDataExtraction'][0])
    {
        $request = $this->onboardingUtilityControllerGetMainPageDataExtractionRequest($minCompatibilityDate, $taskId, $taskGroupId, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageDataExtractionDto' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageDataExtractionDto' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageDataExtractionDto', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageDataExtractionDto';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageDataExtractionDto',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageDataExtractionAsync
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageDataExtraction'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerGetMainPageDataExtractionAsync($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageDataExtraction'][0])
    {
        return $this->onboardingUtilityControllerGetMainPageDataExtractionAsyncWithHttpInfo($minCompatibilityDate, $taskId, $taskGroupId, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageDataExtractionAsyncWithHttpInfo
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageDataExtraction'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerGetMainPageDataExtractionAsyncWithHttpInfo($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageDataExtraction'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageDataExtractionDto';
        $request = $this->onboardingUtilityControllerGetMainPageDataExtractionRequest($minCompatibilityDate, $taskId, $taskGroupId, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'onboardingUtilityControllerGetMainPageDataExtraction'
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageDataExtraction'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function onboardingUtilityControllerGetMainPageDataExtractionRequest($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageDataExtraction'][0])
    {





        $resourcePath = '/sync-core/onboarding/governance/main-page/data-extraction';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $minCompatibilityDate,
            'minCompatibilityDate', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskId,
            'taskId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskGroupId,
            'taskGroupId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageHtmlDom
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId taskId (optional)
     * @param  string $taskGroupId taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageHtmlDom'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\OnboardingHtmlDomResultDto
     */
    public function onboardingUtilityControllerGetMainPageHtmlDom($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageHtmlDom'][0])
    {
        list($response) = $this->onboardingUtilityControllerGetMainPageHtmlDomWithHttpInfo($minCompatibilityDate, $taskId, $taskGroupId, $contentType);
        return $response;
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageHtmlDomWithHttpInfo
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageHtmlDom'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\OnboardingHtmlDomResultDto, HTTP status code, HTTP response headers (array of strings)
     */
    public function onboardingUtilityControllerGetMainPageHtmlDomWithHttpInfo($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageHtmlDom'][0])
    {
        $request = $this->onboardingUtilityControllerGetMainPageHtmlDomRequest($minCompatibilityDate, $taskId, $taskGroupId, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingHtmlDomResultDto' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingHtmlDomResultDto' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingHtmlDomResultDto', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingHtmlDomResultDto';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingHtmlDomResultDto',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageHtmlDomAsync
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageHtmlDom'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerGetMainPageHtmlDomAsync($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageHtmlDom'][0])
    {
        return $this->onboardingUtilityControllerGetMainPageHtmlDomAsyncWithHttpInfo($minCompatibilityDate, $taskId, $taskGroupId, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageHtmlDomAsyncWithHttpInfo
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageHtmlDom'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerGetMainPageHtmlDomAsyncWithHttpInfo($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageHtmlDom'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingHtmlDomResultDto';
        $request = $this->onboardingUtilityControllerGetMainPageHtmlDomRequest($minCompatibilityDate, $taskId, $taskGroupId, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'onboardingUtilityControllerGetMainPageHtmlDom'
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageHtmlDom'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function onboardingUtilityControllerGetMainPageHtmlDomRequest($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageHtmlDom'][0])
    {





        $resourcePath = '/sync-core/onboarding/governance/main-page/html-dom';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $minCompatibilityDate,
            'minCompatibilityDate', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskId,
            'taskId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskGroupId,
            'taskGroupId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageMarkdown
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId taskId (optional)
     * @param  string $taskGroupId taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageMarkdown'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\OnboardingMarkdownResultDto
     */
    public function onboardingUtilityControllerGetMainPageMarkdown($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageMarkdown'][0])
    {
        list($response) = $this->onboardingUtilityControllerGetMainPageMarkdownWithHttpInfo($minCompatibilityDate, $taskId, $taskGroupId, $contentType);
        return $response;
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageMarkdownWithHttpInfo
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageMarkdown'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\OnboardingMarkdownResultDto, HTTP status code, HTTP response headers (array of strings)
     */
    public function onboardingUtilityControllerGetMainPageMarkdownWithHttpInfo($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageMarkdown'][0])
    {
        $request = $this->onboardingUtilityControllerGetMainPageMarkdownRequest($minCompatibilityDate, $taskId, $taskGroupId, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMarkdownResultDto' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMarkdownResultDto' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMarkdownResultDto', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMarkdownResultDto';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMarkdownResultDto',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageMarkdownAsync
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageMarkdown'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerGetMainPageMarkdownAsync($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageMarkdown'][0])
    {
        return $this->onboardingUtilityControllerGetMainPageMarkdownAsyncWithHttpInfo($minCompatibilityDate, $taskId, $taskGroupId, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageMarkdownAsyncWithHttpInfo
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageMarkdown'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerGetMainPageMarkdownAsyncWithHttpInfo($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageMarkdown'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMarkdownResultDto';
        $request = $this->onboardingUtilityControllerGetMainPageMarkdownRequest($minCompatibilityDate, $taskId, $taskGroupId, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'onboardingUtilityControllerGetMainPageMarkdown'
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageMarkdown'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function onboardingUtilityControllerGetMainPageMarkdownRequest($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageMarkdown'][0])
    {





        $resourcePath = '/sync-core/onboarding/governance/main-page/markdown';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $minCompatibilityDate,
            'minCompatibilityDate', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskId,
            'taskId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskGroupId,
            'taskGroupId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageRetrieve
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId taskId (optional)
     * @param  string $taskGroupId taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageRetrieve'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageRetrieveResultDto
     */
    public function onboardingUtilityControllerGetMainPageRetrieve($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageRetrieve'][0])
    {
        list($response) = $this->onboardingUtilityControllerGetMainPageRetrieveWithHttpInfo($minCompatibilityDate, $taskId, $taskGroupId, $contentType);
        return $response;
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageRetrieveWithHttpInfo
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageRetrieve'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageRetrieveResultDto, HTTP status code, HTTP response headers (array of strings)
     */
    public function onboardingUtilityControllerGetMainPageRetrieveWithHttpInfo($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageRetrieve'][0])
    {
        $request = $this->onboardingUtilityControllerGetMainPageRetrieveRequest($minCompatibilityDate, $taskId, $taskGroupId, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageRetrieveResultDto' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageRetrieveResultDto' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageRetrieveResultDto', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageRetrieveResultDto';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageRetrieveResultDto',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageRetrieveAsync
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageRetrieve'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerGetMainPageRetrieveAsync($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageRetrieve'][0])
    {
        return $this->onboardingUtilityControllerGetMainPageRetrieveAsyncWithHttpInfo($minCompatibilityDate, $taskId, $taskGroupId, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageRetrieveAsyncWithHttpInfo
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageRetrieve'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerGetMainPageRetrieveAsyncWithHttpInfo($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageRetrieve'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingMainPageRetrieveResultDto';
        $request = $this->onboardingUtilityControllerGetMainPageRetrieveRequest($minCompatibilityDate, $taskId, $taskGroupId, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'onboardingUtilityControllerGetMainPageRetrieve'
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageRetrieve'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function onboardingUtilityControllerGetMainPageRetrieveRequest($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageRetrieve'][0])
    {





        $resourcePath = '/sync-core/onboarding/governance/main-page/retrieve';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $minCompatibilityDate,
            'minCompatibilityDate', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskId,
            'taskId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskGroupId,
            'taskGroupId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageSystemPage
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId taskId (optional)
     * @param  string $taskGroupId taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageSystemPage'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\OnboardingSystemPageResultDto
     */
    public function onboardingUtilityControllerGetMainPageSystemPage($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageSystemPage'][0])
    {
        list($response) = $this->onboardingUtilityControllerGetMainPageSystemPageWithHttpInfo($minCompatibilityDate, $taskId, $taskGroupId, $contentType);
        return $response;
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageSystemPageWithHttpInfo
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageSystemPage'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\OnboardingSystemPageResultDto, HTTP status code, HTTP response headers (array of strings)
     */
    public function onboardingUtilityControllerGetMainPageSystemPageWithHttpInfo($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageSystemPage'][0])
    {
        $request = $this->onboardingUtilityControllerGetMainPageSystemPageRequest($minCompatibilityDate, $taskId, $taskGroupId, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingSystemPageResultDto' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingSystemPageResultDto' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingSystemPageResultDto', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingSystemPageResultDto';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingSystemPageResultDto',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageSystemPageAsync
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageSystemPage'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerGetMainPageSystemPageAsync($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageSystemPage'][0])
    {
        return $this->onboardingUtilityControllerGetMainPageSystemPageAsyncWithHttpInfo($minCompatibilityDate, $taskId, $taskGroupId, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation onboardingUtilityControllerGetMainPageSystemPageAsyncWithHttpInfo
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageSystemPage'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerGetMainPageSystemPageAsyncWithHttpInfo($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageSystemPage'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingSystemPageResultDto';
        $request = $this->onboardingUtilityControllerGetMainPageSystemPageRequest($minCompatibilityDate, $taskId, $taskGroupId, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'onboardingUtilityControllerGetMainPageSystemPage'
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetMainPageSystemPage'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function onboardingUtilityControllerGetMainPageSystemPageRequest($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetMainPageSystemPage'][0])
    {





        $resourcePath = '/sync-core/onboarding/governance/main-page/system-page';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $minCompatibilityDate,
            'minCompatibilityDate', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskId,
            'taskId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskGroupId,
            'taskGroupId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation onboardingUtilityControllerGetReducedTerms
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId taskId (optional)
     * @param  string $taskGroupId taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetReducedTerms'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\OnboardingReducedTermsResultDto
     */
    public function onboardingUtilityControllerGetReducedTerms($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetReducedTerms'][0])
    {
        list($response) = $this->onboardingUtilityControllerGetReducedTermsWithHttpInfo($minCompatibilityDate, $taskId, $taskGroupId, $contentType);
        return $response;
    }

    /**
     * Operation onboardingUtilityControllerGetReducedTermsWithHttpInfo
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetReducedTerms'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\OnboardingReducedTermsResultDto, HTTP status code, HTTP response headers (array of strings)
     */
    public function onboardingUtilityControllerGetReducedTermsWithHttpInfo($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetReducedTerms'][0])
    {
        $request = $this->onboardingUtilityControllerGetReducedTermsRequest($minCompatibilityDate, $taskId, $taskGroupId, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingReducedTermsResultDto' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingReducedTermsResultDto' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingReducedTermsResultDto', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingReducedTermsResultDto';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingReducedTermsResultDto',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation onboardingUtilityControllerGetReducedTermsAsync
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetReducedTerms'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerGetReducedTermsAsync($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetReducedTerms'][0])
    {
        return $this->onboardingUtilityControllerGetReducedTermsAsyncWithHttpInfo($minCompatibilityDate, $taskId, $taskGroupId, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation onboardingUtilityControllerGetReducedTermsAsyncWithHttpInfo
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetReducedTerms'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerGetReducedTermsAsyncWithHttpInfo($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetReducedTerms'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingReducedTermsResultDto';
        $request = $this->onboardingUtilityControllerGetReducedTermsRequest($minCompatibilityDate, $taskId, $taskGroupId, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'onboardingUtilityControllerGetReducedTerms'
     *
     * @param  string $minCompatibilityDate YYYY-MM-DD or any (optional)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerGetReducedTerms'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function onboardingUtilityControllerGetReducedTermsRequest($minCompatibilityDate = null, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerGetReducedTerms'][0])
    {





        $resourcePath = '/sync-core/onboarding/governance/reduced-terms';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $minCompatibilityDate,
            'minCompatibilityDate', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskId,
            'taskId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskGroupId,
            'taskGroupId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation onboardingUtilityControllerSubmitSelectedPages
     *
     * @param  object $body body (required)
     * @param  string $taskId taskId (optional)
     * @param  string $taskGroupId taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerSubmitSelectedPages'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\OnboardingSelectedPagesResultDto
     */
    public function onboardingUtilityControllerSubmitSelectedPages($body, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerSubmitSelectedPages'][0])
    {
        list($response) = $this->onboardingUtilityControllerSubmitSelectedPagesWithHttpInfo($body, $taskId, $taskGroupId, $contentType);
        return $response;
    }

    /**
     * Operation onboardingUtilityControllerSubmitSelectedPagesWithHttpInfo
     *
     * @param  object $body (required)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerSubmitSelectedPages'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\OnboardingSelectedPagesResultDto, HTTP status code, HTTP response headers (array of strings)
     */
    public function onboardingUtilityControllerSubmitSelectedPagesWithHttpInfo($body, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerSubmitSelectedPages'][0])
    {
        $request = $this->onboardingUtilityControllerSubmitSelectedPagesRequest($body, $taskId, $taskGroupId, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingSelectedPagesResultDto' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\OnboardingSelectedPagesResultDto' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingSelectedPagesResultDto', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingSelectedPagesResultDto';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingSelectedPagesResultDto',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation onboardingUtilityControllerSubmitSelectedPagesAsync
     *
     * @param  object $body (required)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerSubmitSelectedPages'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerSubmitSelectedPagesAsync($body, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerSubmitSelectedPages'][0])
    {
        return $this->onboardingUtilityControllerSubmitSelectedPagesAsyncWithHttpInfo($body, $taskId, $taskGroupId, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation onboardingUtilityControllerSubmitSelectedPagesAsyncWithHttpInfo
     *
     * @param  object $body (required)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerSubmitSelectedPages'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function onboardingUtilityControllerSubmitSelectedPagesAsyncWithHttpInfo($body, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerSubmitSelectedPages'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\OnboardingSelectedPagesResultDto';
        $request = $this->onboardingUtilityControllerSubmitSelectedPagesRequest($body, $taskId, $taskGroupId, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'onboardingUtilityControllerSubmitSelectedPages'
     *
     * @param  object $body (required)
     * @param  string $taskId (optional)
     * @param  string $taskGroupId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['onboardingUtilityControllerSubmitSelectedPages'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function onboardingUtilityControllerSubmitSelectedPagesRequest($body, $taskId = null, $taskGroupId = null, string $contentType = self::contentTypes['onboardingUtilityControllerSubmitSelectedPages'][0])
    {

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling onboardingUtilityControllerSubmitSelectedPages'
            );
        }




        $resourcePath = '/sync-core/onboarding/governance/selected-pages';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskId,
            'taskId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taskGroupId,
            'taskGroupId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation poolControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreatePoolDto $createPoolDto createPoolDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PoolEntity
     */
    public function poolControllerCreate($createPoolDto, string $contentType = self::contentTypes['poolControllerCreate'][0])
    {
        list($response) = $this->poolControllerCreateWithHttpInfo($createPoolDto, $contentType);
        return $response;
    }

    /**
     * Operation poolControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreatePoolDto $createPoolDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PoolEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function poolControllerCreateWithHttpInfo($createPoolDto, string $contentType = self::contentTypes['poolControllerCreate'][0])
    {
        $request = $this->poolControllerCreateRequest($createPoolDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation poolControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreatePoolDto $createPoolDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function poolControllerCreateAsync($createPoolDto, string $contentType = self::contentTypes['poolControllerCreate'][0])
    {
        return $this->poolControllerCreateAsyncWithHttpInfo($createPoolDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation poolControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreatePoolDto $createPoolDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function poolControllerCreateAsyncWithHttpInfo($createPoolDto, string $contentType = self::contentTypes['poolControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity';
        $request = $this->poolControllerCreateRequest($createPoolDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'poolControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreatePoolDto $createPoolDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function poolControllerCreateRequest($createPoolDto, string $contentType = self::contentTypes['poolControllerCreate'][0])
    {

        // verify the required parameter 'createPoolDto' is set
        if ($createPoolDto === null || (is_array($createPoolDto) && count($createPoolDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createPoolDto when calling poolControllerCreate'
            );
        }


        $resourcePath = '/sync-core/pool';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createPoolDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createPoolDto));
            } else {
                $httpBody = $createPoolDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation poolControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PoolEntity
     */
    public function poolControllerItem($id, string $contentType = self::contentTypes['poolControllerItem'][0])
    {
        list($response) = $this->poolControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation poolControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PoolEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function poolControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['poolControllerItem'][0])
    {
        $request = $this->poolControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation poolControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function poolControllerItemAsync($id, string $contentType = self::contentTypes['poolControllerItem'][0])
    {
        return $this->poolControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation poolControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function poolControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['poolControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity';
        $request = $this->poolControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'poolControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function poolControllerItemRequest($id, string $contentType = self::contentTypes['poolControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling poolControllerItem'
            );
        }


        $resourcePath = '/sync-core/pool/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation poolControllerList
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PoolEntity[]
     */
    public function poolControllerList(string $contentType = self::contentTypes['poolControllerList'][0])
    {
        list($response) = $this->poolControllerListWithHttpInfo($contentType);
        return $response;
    }

    /**
     * Operation poolControllerListWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PoolEntity[], HTTP status code, HTTP response headers (array of strings)
     */
    public function poolControllerListWithHttpInfo(string $contentType = self::contentTypes['poolControllerList'][0])
    {
        $request = $this->poolControllerListRequest($contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity[]' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity[]' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity[]', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity[]';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity[]',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation poolControllerListAsync
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function poolControllerListAsync(string $contentType = self::contentTypes['poolControllerList'][0])
    {
        return $this->poolControllerListAsyncWithHttpInfo($contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation poolControllerListAsyncWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function poolControllerListAsyncWithHttpInfo(string $contentType = self::contentTypes['poolControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PoolEntity[]';
        $request = $this->poolControllerListRequest($contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'poolControllerList'
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['poolControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function poolControllerListRequest(string $contentType = self::contentTypes['poolControllerList'][0])
    {


        $resourcePath = '/sync-core/pool';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation previewsControllerList
     *
     * @param  string $existsLocally existsLocally (optional)
     * @param  string $deletedLocally deletedLocally (optional)
     * @param  string $deleted deleted (optional)
     * @param  string $sourceSiteId sourceSiteId (optional)
     * @param  string $entityTypeMachineNames entityTypeMachineNames (optional)
     * @param  string $entityTypeNamespaceMachineNames entityTypeNamespaceMachineNames (optional)
     * @param  string $publishedLatest publishedLatest (optional)
     * @param  string $publishedEarliest publishedEarliest (optional)
     * @param  string $poolMachineNames poolMachineNames (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $page page (optional)
     * @param  string $search search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['previewsControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse
     */
    public function previewsControllerList($existsLocally = null, $deletedLocally = null, $deleted = null, $sourceSiteId = null, $entityTypeMachineNames = null, $entityTypeNamespaceMachineNames = null, $publishedLatest = null, $publishedEarliest = null, $poolMachineNames = null, $itemsPerPage = null, $page = null, $search = null, string $contentType = self::contentTypes['previewsControllerList'][0])
    {
        list($response) = $this->previewsControllerListWithHttpInfo($existsLocally, $deletedLocally, $deleted, $sourceSiteId, $entityTypeMachineNames, $entityTypeNamespaceMachineNames, $publishedLatest, $publishedEarliest, $poolMachineNames, $itemsPerPage, $page, $search, $contentType);
        return $response;
    }

    /**
     * Operation previewsControllerListWithHttpInfo
     *
     * @param  string $existsLocally (optional)
     * @param  string $deletedLocally (optional)
     * @param  string $deleted (optional)
     * @param  string $sourceSiteId (optional)
     * @param  string $entityTypeMachineNames (optional)
     * @param  string $entityTypeNamespaceMachineNames (optional)
     * @param  string $publishedLatest (optional)
     * @param  string $publishedEarliest (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['previewsControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function previewsControllerListWithHttpInfo($existsLocally = null, $deletedLocally = null, $deleted = null, $sourceSiteId = null, $entityTypeMachineNames = null, $entityTypeNamespaceMachineNames = null, $publishedLatest = null, $publishedEarliest = null, $poolMachineNames = null, $itemsPerPage = null, $page = null, $search = null, string $contentType = self::contentTypes['previewsControllerList'][0])
    {
        $request = $this->previewsControllerListRequest($existsLocally, $deletedLocally, $deleted, $sourceSiteId, $entityTypeMachineNames, $entityTypeNamespaceMachineNames, $publishedLatest, $publishedEarliest, $poolMachineNames, $itemsPerPage, $page, $search, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation previewsControllerListAsync
     *
     * @param  string $existsLocally (optional)
     * @param  string $deletedLocally (optional)
     * @param  string $deleted (optional)
     * @param  string $sourceSiteId (optional)
     * @param  string $entityTypeMachineNames (optional)
     * @param  string $entityTypeNamespaceMachineNames (optional)
     * @param  string $publishedLatest (optional)
     * @param  string $publishedEarliest (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['previewsControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function previewsControllerListAsync($existsLocally = null, $deletedLocally = null, $deleted = null, $sourceSiteId = null, $entityTypeMachineNames = null, $entityTypeNamespaceMachineNames = null, $publishedLatest = null, $publishedEarliest = null, $poolMachineNames = null, $itemsPerPage = null, $page = null, $search = null, string $contentType = self::contentTypes['previewsControllerList'][0])
    {
        return $this->previewsControllerListAsyncWithHttpInfo($existsLocally, $deletedLocally, $deleted, $sourceSiteId, $entityTypeMachineNames, $entityTypeNamespaceMachineNames, $publishedLatest, $publishedEarliest, $poolMachineNames, $itemsPerPage, $page, $search, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation previewsControllerListAsyncWithHttpInfo
     *
     * @param  string $existsLocally (optional)
     * @param  string $deletedLocally (optional)
     * @param  string $deleted (optional)
     * @param  string $sourceSiteId (optional)
     * @param  string $entityTypeMachineNames (optional)
     * @param  string $entityTypeNamespaceMachineNames (optional)
     * @param  string $publishedLatest (optional)
     * @param  string $publishedEarliest (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['previewsControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function previewsControllerListAsyncWithHttpInfo($existsLocally = null, $deletedLocally = null, $deleted = null, $sourceSiteId = null, $entityTypeMachineNames = null, $entityTypeNamespaceMachineNames = null, $publishedLatest = null, $publishedEarliest = null, $poolMachineNames = null, $itemsPerPage = null, $page = null, $search = null, string $contentType = self::contentTypes['previewsControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse';
        $request = $this->previewsControllerListRequest($existsLocally, $deletedLocally, $deleted, $sourceSiteId, $entityTypeMachineNames, $entityTypeNamespaceMachineNames, $publishedLatest, $publishedEarliest, $poolMachineNames, $itemsPerPage, $page, $search, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'previewsControllerList'
     *
     * @param  string $existsLocally (optional)
     * @param  string $deletedLocally (optional)
     * @param  string $deleted (optional)
     * @param  string $sourceSiteId (optional)
     * @param  string $entityTypeMachineNames (optional)
     * @param  string $entityTypeNamespaceMachineNames (optional)
     * @param  string $publishedLatest (optional)
     * @param  string $publishedEarliest (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['previewsControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function previewsControllerListRequest($existsLocally = null, $deletedLocally = null, $deleted = null, $sourceSiteId = null, $entityTypeMachineNames = null, $entityTypeNamespaceMachineNames = null, $publishedLatest = null, $publishedEarliest = null, $poolMachineNames = null, $itemsPerPage = null, $page = null, $search = null, string $contentType = self::contentTypes['previewsControllerList'][0])
    {














        $resourcePath = '/sync-core/previews';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $existsLocally,
            'existsLocally', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $deletedLocally,
            'deletedLocally', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $deleted,
            'deleted', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $sourceSiteId,
            'sourceSiteId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityTypeMachineNames,
            'entityTypeMachineNames', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityTypeNamespaceMachineNames,
            'entityTypeNamespaceMachineNames', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $publishedLatest,
            'publishedLatest', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $publishedEarliest,
            'publishedEarliest', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $poolMachineNames,
            'poolMachineNames', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $search,
            'search', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation previewsControllerListForFlow
     *
     * @param  string $flowMachineName flowMachineName (required)
     * @param  string $existsLocally existsLocally (optional)
     * @param  string $deletedLocally deletedLocally (optional)
     * @param  string $deleted deleted (optional)
     * @param  string $sourceSiteId sourceSiteId (optional)
     * @param  string $entityTypeMachineNames entityTypeMachineNames (optional)
     * @param  string $entityTypeNamespaceMachineNames entityTypeNamespaceMachineNames (optional)
     * @param  string $publishedLatest publishedLatest (optional)
     * @param  string $publishedEarliest publishedEarliest (optional)
     * @param  string $poolMachineNames poolMachineNames (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $page page (optional)
     * @param  string $search search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['previewsControllerListForFlow'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse
     */
    public function previewsControllerListForFlow($flowMachineName, $existsLocally = null, $deletedLocally = null, $deleted = null, $sourceSiteId = null, $entityTypeMachineNames = null, $entityTypeNamespaceMachineNames = null, $publishedLatest = null, $publishedEarliest = null, $poolMachineNames = null, $itemsPerPage = null, $page = null, $search = null, string $contentType = self::contentTypes['previewsControllerListForFlow'][0])
    {
        list($response) = $this->previewsControllerListForFlowWithHttpInfo($flowMachineName, $existsLocally, $deletedLocally, $deleted, $sourceSiteId, $entityTypeMachineNames, $entityTypeNamespaceMachineNames, $publishedLatest, $publishedEarliest, $poolMachineNames, $itemsPerPage, $page, $search, $contentType);
        return $response;
    }

    /**
     * Operation previewsControllerListForFlowWithHttpInfo
     *
     * @param  string $flowMachineName (required)
     * @param  string $existsLocally (optional)
     * @param  string $deletedLocally (optional)
     * @param  string $deleted (optional)
     * @param  string $sourceSiteId (optional)
     * @param  string $entityTypeMachineNames (optional)
     * @param  string $entityTypeNamespaceMachineNames (optional)
     * @param  string $publishedLatest (optional)
     * @param  string $publishedEarliest (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['previewsControllerListForFlow'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function previewsControllerListForFlowWithHttpInfo($flowMachineName, $existsLocally = null, $deletedLocally = null, $deleted = null, $sourceSiteId = null, $entityTypeMachineNames = null, $entityTypeNamespaceMachineNames = null, $publishedLatest = null, $publishedEarliest = null, $poolMachineNames = null, $itemsPerPage = null, $page = null, $search = null, string $contentType = self::contentTypes['previewsControllerListForFlow'][0])
    {
        $request = $this->previewsControllerListForFlowRequest($flowMachineName, $existsLocally, $deletedLocally, $deleted, $sourceSiteId, $entityTypeMachineNames, $entityTypeNamespaceMachineNames, $publishedLatest, $publishedEarliest, $poolMachineNames, $itemsPerPage, $page, $search, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation previewsControllerListForFlowAsync
     *
     * @param  string $flowMachineName (required)
     * @param  string $existsLocally (optional)
     * @param  string $deletedLocally (optional)
     * @param  string $deleted (optional)
     * @param  string $sourceSiteId (optional)
     * @param  string $entityTypeMachineNames (optional)
     * @param  string $entityTypeNamespaceMachineNames (optional)
     * @param  string $publishedLatest (optional)
     * @param  string $publishedEarliest (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['previewsControllerListForFlow'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function previewsControllerListForFlowAsync($flowMachineName, $existsLocally = null, $deletedLocally = null, $deleted = null, $sourceSiteId = null, $entityTypeMachineNames = null, $entityTypeNamespaceMachineNames = null, $publishedLatest = null, $publishedEarliest = null, $poolMachineNames = null, $itemsPerPage = null, $page = null, $search = null, string $contentType = self::contentTypes['previewsControllerListForFlow'][0])
    {
        return $this->previewsControllerListForFlowAsyncWithHttpInfo($flowMachineName, $existsLocally, $deletedLocally, $deleted, $sourceSiteId, $entityTypeMachineNames, $entityTypeNamespaceMachineNames, $publishedLatest, $publishedEarliest, $poolMachineNames, $itemsPerPage, $page, $search, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation previewsControllerListForFlowAsyncWithHttpInfo
     *
     * @param  string $flowMachineName (required)
     * @param  string $existsLocally (optional)
     * @param  string $deletedLocally (optional)
     * @param  string $deleted (optional)
     * @param  string $sourceSiteId (optional)
     * @param  string $entityTypeMachineNames (optional)
     * @param  string $entityTypeNamespaceMachineNames (optional)
     * @param  string $publishedLatest (optional)
     * @param  string $publishedEarliest (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['previewsControllerListForFlow'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function previewsControllerListForFlowAsyncWithHttpInfo($flowMachineName, $existsLocally = null, $deletedLocally = null, $deleted = null, $sourceSiteId = null, $entityTypeMachineNames = null, $entityTypeNamespaceMachineNames = null, $publishedLatest = null, $publishedEarliest = null, $poolMachineNames = null, $itemsPerPage = null, $page = null, $search = null, string $contentType = self::contentTypes['previewsControllerListForFlow'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PreviewsListResponse';
        $request = $this->previewsControllerListForFlowRequest($flowMachineName, $existsLocally, $deletedLocally, $deleted, $sourceSiteId, $entityTypeMachineNames, $entityTypeNamespaceMachineNames, $publishedLatest, $publishedEarliest, $poolMachineNames, $itemsPerPage, $page, $search, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'previewsControllerListForFlow'
     *
     * @param  string $flowMachineName (required)
     * @param  string $existsLocally (optional)
     * @param  string $deletedLocally (optional)
     * @param  string $deleted (optional)
     * @param  string $sourceSiteId (optional)
     * @param  string $entityTypeMachineNames (optional)
     * @param  string $entityTypeNamespaceMachineNames (optional)
     * @param  string $publishedLatest (optional)
     * @param  string $publishedEarliest (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $search (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['previewsControllerListForFlow'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function previewsControllerListForFlowRequest($flowMachineName, $existsLocally = null, $deletedLocally = null, $deleted = null, $sourceSiteId = null, $entityTypeMachineNames = null, $entityTypeNamespaceMachineNames = null, $publishedLatest = null, $publishedEarliest = null, $poolMachineNames = null, $itemsPerPage = null, $page = null, $search = null, string $contentType = self::contentTypes['previewsControllerListForFlow'][0])
    {

        // verify the required parameter 'flowMachineName' is set
        if ($flowMachineName === null || (is_array($flowMachineName) && count($flowMachineName) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $flowMachineName when calling previewsControllerListForFlow'
            );
        }














        $resourcePath = '/sync-core/previews/{flowMachineName}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $existsLocally,
            'existsLocally', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $deletedLocally,
            'deletedLocally', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $deleted,
            'deleted', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $sourceSiteId,
            'sourceSiteId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityTypeMachineNames,
            'entityTypeMachineNames', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityTypeNamespaceMachineNames,
            'entityTypeNamespaceMachineNames', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $publishedLatest,
            'publishedLatest', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $publishedEarliest,
            'publishedEarliest', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $poolMachineNames,
            'poolMachineNames', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $search,
            'search', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($flowMachineName !== null) {
            $resourcePath = str_replace(
                '{' . 'flowMachineName' . '}',
                ObjectSerializer::toPathValue($flowMachineName),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation projectControllerGetLanguages
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerGetLanguages'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedLanguageDefinitionList
     */
    public function projectControllerGetLanguages($id, string $contentType = self::contentTypes['projectControllerGetLanguages'][0])
    {
        list($response) = $this->projectControllerGetLanguagesWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation projectControllerGetLanguagesWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerGetLanguages'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedLanguageDefinitionList, HTTP status code, HTTP response headers (array of strings)
     */
    public function projectControllerGetLanguagesWithHttpInfo($id, string $contentType = self::contentTypes['projectControllerGetLanguages'][0])
    {
        $request = $this->projectControllerGetLanguagesRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedLanguageDefinitionList' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedLanguageDefinitionList' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedLanguageDefinitionList', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedLanguageDefinitionList';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedLanguageDefinitionList',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation projectControllerGetLanguagesAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerGetLanguages'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function projectControllerGetLanguagesAsync($id, string $contentType = self::contentTypes['projectControllerGetLanguages'][0])
    {
        return $this->projectControllerGetLanguagesAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation projectControllerGetLanguagesAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerGetLanguages'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function projectControllerGetLanguagesAsyncWithHttpInfo($id, string $contentType = self::contentTypes['projectControllerGetLanguages'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedLanguageDefinitionList';
        $request = $this->projectControllerGetLanguagesRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'projectControllerGetLanguages'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerGetLanguages'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function projectControllerGetLanguagesRequest($id, string $contentType = self::contentTypes['projectControllerGetLanguages'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling projectControllerGetLanguages'
            );
        }


        $resourcePath = '/sync-core/project/{id}/languages';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation projectControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity
     */
    public function projectControllerItem($id, string $contentType = self::contentTypes['projectControllerItem'][0])
    {
        list($response) = $this->projectControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation projectControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function projectControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['projectControllerItem'][0])
    {
        $request = $this->projectControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation projectControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function projectControllerItemAsync($id, string $contentType = self::contentTypes['projectControllerItem'][0])
    {
        return $this->projectControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation projectControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function projectControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['projectControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity';
        $request = $this->projectControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'projectControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function projectControllerItemRequest($id, string $contentType = self::contentTypes['projectControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling projectControllerItem'
            );
        }


        $resourcePath = '/sync-core/project/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation projectControllerItemByUuid
     *
     * @param  string $uuid uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity
     */
    public function projectControllerItemByUuid($uuid, string $contentType = self::contentTypes['projectControllerItemByUuid'][0])
    {
        list($response) = $this->projectControllerItemByUuidWithHttpInfo($uuid, $contentType);
        return $response;
    }

    /**
     * Operation projectControllerItemByUuidWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function projectControllerItemByUuidWithHttpInfo($uuid, string $contentType = self::contentTypes['projectControllerItemByUuid'][0])
    {
        $request = $this->projectControllerItemByUuidRequest($uuid, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation projectControllerItemByUuidAsync
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function projectControllerItemByUuidAsync($uuid, string $contentType = self::contentTypes['projectControllerItemByUuid'][0])
    {
        return $this->projectControllerItemByUuidAsyncWithHttpInfo($uuid, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation projectControllerItemByUuidAsyncWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function projectControllerItemByUuidAsyncWithHttpInfo($uuid, string $contentType = self::contentTypes['projectControllerItemByUuid'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity';
        $request = $this->projectControllerItemByUuidRequest($uuid, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'projectControllerItemByUuid'
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function projectControllerItemByUuidRequest($uuid, string $contentType = self::contentTypes['projectControllerItemByUuid'][0])
    {

        // verify the required parameter 'uuid' is set
        if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $uuid when calling projectControllerItemByUuid'
            );
        }


        $resourcePath = '/sync-core/project/by-uuid/{uuid}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($uuid !== null) {
            $resourcePath = str_replace(
                '{' . 'uuid' . '}',
                ObjectSerializer::toPathValue($uuid),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation projectControllerUpdateCrawlingSettings
     *
     * @param  string $id id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ExtendedProjectCrawlingSettings $extendedProjectCrawlingSettings extendedProjectCrawlingSettings (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerUpdateCrawlingSettings'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity
     */
    public function projectControllerUpdateCrawlingSettings($id, $extendedProjectCrawlingSettings, string $contentType = self::contentTypes['projectControllerUpdateCrawlingSettings'][0])
    {
        list($response) = $this->projectControllerUpdateCrawlingSettingsWithHttpInfo($id, $extendedProjectCrawlingSettings, $contentType);
        return $response;
    }

    /**
     * Operation projectControllerUpdateCrawlingSettingsWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ExtendedProjectCrawlingSettings $extendedProjectCrawlingSettings (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerUpdateCrawlingSettings'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function projectControllerUpdateCrawlingSettingsWithHttpInfo($id, $extendedProjectCrawlingSettings, string $contentType = self::contentTypes['projectControllerUpdateCrawlingSettings'][0])
    {
        $request = $this->projectControllerUpdateCrawlingSettingsRequest($id, $extendedProjectCrawlingSettings, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation projectControllerUpdateCrawlingSettingsAsync
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ExtendedProjectCrawlingSettings $extendedProjectCrawlingSettings (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerUpdateCrawlingSettings'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function projectControllerUpdateCrawlingSettingsAsync($id, $extendedProjectCrawlingSettings, string $contentType = self::contentTypes['projectControllerUpdateCrawlingSettings'][0])
    {
        return $this->projectControllerUpdateCrawlingSettingsAsyncWithHttpInfo($id, $extendedProjectCrawlingSettings, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation projectControllerUpdateCrawlingSettingsAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ExtendedProjectCrawlingSettings $extendedProjectCrawlingSettings (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerUpdateCrawlingSettings'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function projectControllerUpdateCrawlingSettingsAsyncWithHttpInfo($id, $extendedProjectCrawlingSettings, string $contentType = self::contentTypes['projectControllerUpdateCrawlingSettings'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ProjectEntity';
        $request = $this->projectControllerUpdateCrawlingSettingsRequest($id, $extendedProjectCrawlingSettings, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'projectControllerUpdateCrawlingSettings'
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\ExtendedProjectCrawlingSettings $extendedProjectCrawlingSettings (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectControllerUpdateCrawlingSettings'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function projectControllerUpdateCrawlingSettingsRequest($id, $extendedProjectCrawlingSettings, string $contentType = self::contentTypes['projectControllerUpdateCrawlingSettings'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling projectControllerUpdateCrawlingSettings'
            );
        }

        // verify the required parameter 'extendedProjectCrawlingSettings' is set
        if ($extendedProjectCrawlingSettings === null || (is_array($extendedProjectCrawlingSettings) && count($extendedProjectCrawlingSettings) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $extendedProjectCrawlingSettings when calling projectControllerUpdateCrawlingSettings'
            );
        }


        $resourcePath = '/sync-core/project/{id}/crawling';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($extendedProjectCrawlingSettings)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($extendedProjectCrawlingSettings));
            } else {
                $httpBody = $extendedProjectCrawlingSettings;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'PUT',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation projectLinkControllerImport
     *
     * @param  string $uuid uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerImport'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity
     */
    public function projectLinkControllerImport($uuid, string $contentType = self::contentTypes['projectLinkControllerImport'][0])
    {
        list($response) = $this->projectLinkControllerImportWithHttpInfo($uuid, $contentType);
        return $response;
    }

    /**
     * Operation projectLinkControllerImportWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerImport'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function projectLinkControllerImportWithHttpInfo($uuid, string $contentType = self::contentTypes['projectLinkControllerImport'][0])
    {
        $request = $this->projectLinkControllerImportRequest($uuid, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation projectLinkControllerImportAsync
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerImport'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function projectLinkControllerImportAsync($uuid, string $contentType = self::contentTypes['projectLinkControllerImport'][0])
    {
        return $this->projectLinkControllerImportAsyncWithHttpInfo($uuid, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation projectLinkControllerImportAsyncWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerImport'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function projectLinkControllerImportAsyncWithHttpInfo($uuid, string $contentType = self::contentTypes['projectLinkControllerImport'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity';
        $request = $this->projectLinkControllerImportRequest($uuid, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'projectLinkControllerImport'
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerImport'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function projectLinkControllerImportRequest($uuid, string $contentType = self::contentTypes['projectLinkControllerImport'][0])
    {

        // verify the required parameter 'uuid' is set
        if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $uuid when calling projectLinkControllerImport'
            );
        }


        $resourcePath = '/sync-core/project-link/import/{uuid}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($uuid !== null) {
            $resourcePath = str_replace(
                '{' . 'uuid' . '}',
                ObjectSerializer::toPathValue($uuid),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation projectLinkControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity
     */
    public function projectLinkControllerItem($id, string $contentType = self::contentTypes['projectLinkControllerItem'][0])
    {
        list($response) = $this->projectLinkControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation projectLinkControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function projectLinkControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['projectLinkControllerItem'][0])
    {
        $request = $this->projectLinkControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation projectLinkControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function projectLinkControllerItemAsync($id, string $contentType = self::contentTypes['projectLinkControllerItem'][0])
    {
        return $this->projectLinkControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation projectLinkControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function projectLinkControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['projectLinkControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity';
        $request = $this->projectLinkControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'projectLinkControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function projectLinkControllerItemRequest($id, string $contentType = self::contentTypes['projectLinkControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling projectLinkControllerItem'
            );
        }


        $resourcePath = '/sync-core/project-link/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation projectLinkControllerItemByUuid
     *
     * @param  string $uuid uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity
     */
    public function projectLinkControllerItemByUuid($uuid, string $contentType = self::contentTypes['projectLinkControllerItemByUuid'][0])
    {
        list($response) = $this->projectLinkControllerItemByUuidWithHttpInfo($uuid, $contentType);
        return $response;
    }

    /**
     * Operation projectLinkControllerItemByUuidWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function projectLinkControllerItemByUuidWithHttpInfo($uuid, string $contentType = self::contentTypes['projectLinkControllerItemByUuid'][0])
    {
        $request = $this->projectLinkControllerItemByUuidRequest($uuid, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation projectLinkControllerItemByUuidAsync
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function projectLinkControllerItemByUuidAsync($uuid, string $contentType = self::contentTypes['projectLinkControllerItemByUuid'][0])
    {
        return $this->projectLinkControllerItemByUuidAsyncWithHttpInfo($uuid, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation projectLinkControllerItemByUuidAsyncWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function projectLinkControllerItemByUuidAsyncWithHttpInfo($uuid, string $contentType = self::contentTypes['projectLinkControllerItemByUuid'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ProjectLinkEntity';
        $request = $this->projectLinkControllerItemByUuidRequest($uuid, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'projectLinkControllerItemByUuid'
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['projectLinkControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function projectLinkControllerItemByUuidRequest($uuid, string $contentType = self::contentTypes['projectLinkControllerItemByUuid'][0])
    {

        // verify the required parameter 'uuid' is set
        if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $uuid when calling projectLinkControllerItemByUuid'
            );
        }


        $resourcePath = '/sync-core/project-link/by-uuid/{uuid}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($uuid !== null) {
            $resourcePath = str_replace(
                '{' . 'uuid' . '}',
                ObjectSerializer::toPathValue($uuid),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityCloneControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity
     */
    public function remoteEntityCloneControllerItem($id, string $contentType = self::contentTypes['remoteEntityCloneControllerItem'][0])
    {
        list($response) = $this->remoteEntityCloneControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityCloneControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityCloneControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['remoteEntityCloneControllerItem'][0])
    {
        $request = $this->remoteEntityCloneControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityCloneControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityCloneControllerItemAsync($id, string $contentType = self::contentTypes['remoteEntityCloneControllerItem'][0])
    {
        return $this->remoteEntityCloneControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityCloneControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityCloneControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['remoteEntityCloneControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity';
        $request = $this->remoteEntityCloneControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityCloneControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityCloneControllerItemRequest($id, string $contentType = self::contentTypes['remoteEntityCloneControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling remoteEntityCloneControllerItem'
            );
        }


        $resourcePath = '/sync-core/remote-entity-clone/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityCloneControllerItemByTargetUuid
     *
     * @param  string $uuid uuid (required)
     * @param  string $siteId siteId (required)
     * @param  string $entityTypeId entityTypeId (optional)
     * @param  string $flowId flowId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerItemByTargetUuid'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity
     */
    public function remoteEntityCloneControllerItemByTargetUuid($uuid, $siteId, $entityTypeId = null, $flowId = null, string $contentType = self::contentTypes['remoteEntityCloneControllerItemByTargetUuid'][0])
    {
        list($response) = $this->remoteEntityCloneControllerItemByTargetUuidWithHttpInfo($uuid, $siteId, $entityTypeId, $flowId, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityCloneControllerItemByTargetUuidWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $siteId (required)
     * @param  string $entityTypeId (optional)
     * @param  string $flowId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerItemByTargetUuid'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityCloneControllerItemByTargetUuidWithHttpInfo($uuid, $siteId, $entityTypeId = null, $flowId = null, string $contentType = self::contentTypes['remoteEntityCloneControllerItemByTargetUuid'][0])
    {
        $request = $this->remoteEntityCloneControllerItemByTargetUuidRequest($uuid, $siteId, $entityTypeId, $flowId, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityCloneControllerItemByTargetUuidAsync
     *
     * @param  string $uuid (required)
     * @param  string $siteId (required)
     * @param  string $entityTypeId (optional)
     * @param  string $flowId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerItemByTargetUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityCloneControllerItemByTargetUuidAsync($uuid, $siteId, $entityTypeId = null, $flowId = null, string $contentType = self::contentTypes['remoteEntityCloneControllerItemByTargetUuid'][0])
    {
        return $this->remoteEntityCloneControllerItemByTargetUuidAsyncWithHttpInfo($uuid, $siteId, $entityTypeId, $flowId, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityCloneControllerItemByTargetUuidAsyncWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $siteId (required)
     * @param  string $entityTypeId (optional)
     * @param  string $flowId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerItemByTargetUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityCloneControllerItemByTargetUuidAsyncWithHttpInfo($uuid, $siteId, $entityTypeId = null, $flowId = null, string $contentType = self::contentTypes['remoteEntityCloneControllerItemByTargetUuid'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityCloneEntity';
        $request = $this->remoteEntityCloneControllerItemByTargetUuidRequest($uuid, $siteId, $entityTypeId, $flowId, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityCloneControllerItemByTargetUuid'
     *
     * @param  string $uuid (required)
     * @param  string $siteId (required)
     * @param  string $entityTypeId (optional)
     * @param  string $flowId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerItemByTargetUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityCloneControllerItemByTargetUuidRequest($uuid, $siteId, $entityTypeId = null, $flowId = null, string $contentType = self::contentTypes['remoteEntityCloneControllerItemByTargetUuid'][0])
    {

        // verify the required parameter 'uuid' is set
        if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $uuid when calling remoteEntityCloneControllerItemByTargetUuid'
            );
        }

        // verify the required parameter 'siteId' is set
        if ($siteId === null || (is_array($siteId) && count($siteId) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $siteId when calling remoteEntityCloneControllerItemByTargetUuid'
            );
        }




        $resourcePath = '/sync-core/remote-entity-clone/site/{siteId}/by-target-uuid/{uuid}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityTypeId,
            'entityTypeId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $flowId,
            'flowId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($uuid !== null) {
            $resourcePath = str_replace(
                '{' . 'uuid' . '}',
                ObjectSerializer::toPathValue($uuid),
                $resourcePath
            );
        }
        // path params
        if ($siteId !== null) {
            $resourcePath = str_replace(
                '{' . 'siteId' . '}',
                ObjectSerializer::toPathValue($siteId),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityCloneControllerList
     *
     * @param  string $entityTypeId entityTypeId (optional)
     * @param  string $flowId flowId (optional)
     * @param  string $siteId siteId (optional)
     * @param  string $targetRemoteUniqueId targetRemoteUniqueId (optional)
     * @param  string $sourceRemoteUniqueId sourceRemoteUniqueId (optional)
     * @param  string $targetRemoteUuid targetRemoteUuid (optional)
     * @param  string $sourceRemoteUuid sourceRemoteUuid (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse
     */
    public function remoteEntityCloneControllerList($entityTypeId = null, $flowId = null, $siteId = null, $targetRemoteUniqueId = null, $sourceRemoteUniqueId = null, $targetRemoteUuid = null, $sourceRemoteUuid = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityCloneControllerList'][0])
    {
        list($response) = $this->remoteEntityCloneControllerListWithHttpInfo($entityTypeId, $flowId, $siteId, $targetRemoteUniqueId, $sourceRemoteUniqueId, $targetRemoteUuid, $sourceRemoteUuid, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityCloneControllerListWithHttpInfo
     *
     * @param  string $entityTypeId (optional)
     * @param  string $flowId (optional)
     * @param  string $siteId (optional)
     * @param  string $targetRemoteUniqueId (optional)
     * @param  string $sourceRemoteUniqueId (optional)
     * @param  string $targetRemoteUuid (optional)
     * @param  string $sourceRemoteUuid (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityCloneControllerListWithHttpInfo($entityTypeId = null, $flowId = null, $siteId = null, $targetRemoteUniqueId = null, $sourceRemoteUniqueId = null, $targetRemoteUuid = null, $sourceRemoteUuid = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityCloneControllerList'][0])
    {
        $request = $this->remoteEntityCloneControllerListRequest($entityTypeId, $flowId, $siteId, $targetRemoteUniqueId, $sourceRemoteUniqueId, $targetRemoteUuid, $sourceRemoteUuid, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityCloneControllerListAsync
     *
     * @param  string $entityTypeId (optional)
     * @param  string $flowId (optional)
     * @param  string $siteId (optional)
     * @param  string $targetRemoteUniqueId (optional)
     * @param  string $sourceRemoteUniqueId (optional)
     * @param  string $targetRemoteUuid (optional)
     * @param  string $sourceRemoteUuid (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityCloneControllerListAsync($entityTypeId = null, $flowId = null, $siteId = null, $targetRemoteUniqueId = null, $sourceRemoteUniqueId = null, $targetRemoteUuid = null, $sourceRemoteUuid = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityCloneControllerList'][0])
    {
        return $this->remoteEntityCloneControllerListAsyncWithHttpInfo($entityTypeId, $flowId, $siteId, $targetRemoteUniqueId, $sourceRemoteUniqueId, $targetRemoteUuid, $sourceRemoteUuid, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityCloneControllerListAsyncWithHttpInfo
     *
     * @param  string $entityTypeId (optional)
     * @param  string $flowId (optional)
     * @param  string $siteId (optional)
     * @param  string $targetRemoteUniqueId (optional)
     * @param  string $sourceRemoteUniqueId (optional)
     * @param  string $targetRemoteUuid (optional)
     * @param  string $sourceRemoteUuid (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityCloneControllerListAsyncWithHttpInfo($entityTypeId = null, $flowId = null, $siteId = null, $targetRemoteUniqueId = null, $sourceRemoteUniqueId = null, $targetRemoteUuid = null, $sourceRemoteUuid = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityCloneControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse';
        $request = $this->remoteEntityCloneControllerListRequest($entityTypeId, $flowId, $siteId, $targetRemoteUniqueId, $sourceRemoteUniqueId, $targetRemoteUuid, $sourceRemoteUuid, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityCloneControllerList'
     *
     * @param  string $entityTypeId (optional)
     * @param  string $flowId (optional)
     * @param  string $siteId (optional)
     * @param  string $targetRemoteUniqueId (optional)
     * @param  string $sourceRemoteUniqueId (optional)
     * @param  string $targetRemoteUuid (optional)
     * @param  string $sourceRemoteUuid (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityCloneControllerListRequest($entityTypeId = null, $flowId = null, $siteId = null, $targetRemoteUniqueId = null, $sourceRemoteUniqueId = null, $targetRemoteUuid = null, $sourceRemoteUuid = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityCloneControllerList'][0])
    {











        $resourcePath = '/sync-core/remote-entity-clone';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityTypeId,
            'entityTypeId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $flowId,
            'flowId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $siteId,
            'siteId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $targetRemoteUniqueId,
            'targetRemoteUniqueId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $sourceRemoteUniqueId,
            'sourceRemoteUniqueId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $targetRemoteUuid,
            'targetRemoteUuid', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $sourceRemoteUuid,
            'sourceRemoteUuid', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityCloneControllerListBySourceUuid
     *
     * @param  string $uuid uuid (required)
     * @param  string $siteId siteId (required)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $page page (optional)
     * @param  string $entityTypeId entityTypeId (optional)
     * @param  string $flowId flowId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerListBySourceUuid'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse
     */
    public function remoteEntityCloneControllerListBySourceUuid($uuid, $siteId, $itemsPerPage = null, $page = null, $entityTypeId = null, $flowId = null, string $contentType = self::contentTypes['remoteEntityCloneControllerListBySourceUuid'][0])
    {
        list($response) = $this->remoteEntityCloneControllerListBySourceUuidWithHttpInfo($uuid, $siteId, $itemsPerPage, $page, $entityTypeId, $flowId, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityCloneControllerListBySourceUuidWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $siteId (required)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $entityTypeId (optional)
     * @param  string $flowId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerListBySourceUuid'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityCloneControllerListBySourceUuidWithHttpInfo($uuid, $siteId, $itemsPerPage = null, $page = null, $entityTypeId = null, $flowId = null, string $contentType = self::contentTypes['remoteEntityCloneControllerListBySourceUuid'][0])
    {
        $request = $this->remoteEntityCloneControllerListBySourceUuidRequest($uuid, $siteId, $itemsPerPage, $page, $entityTypeId, $flowId, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityCloneControllerListBySourceUuidAsync
     *
     * @param  string $uuid (required)
     * @param  string $siteId (required)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $entityTypeId (optional)
     * @param  string $flowId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerListBySourceUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityCloneControllerListBySourceUuidAsync($uuid, $siteId, $itemsPerPage = null, $page = null, $entityTypeId = null, $flowId = null, string $contentType = self::contentTypes['remoteEntityCloneControllerListBySourceUuid'][0])
    {
        return $this->remoteEntityCloneControllerListBySourceUuidAsyncWithHttpInfo($uuid, $siteId, $itemsPerPage, $page, $entityTypeId, $flowId, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityCloneControllerListBySourceUuidAsyncWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $siteId (required)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $entityTypeId (optional)
     * @param  string $flowId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerListBySourceUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityCloneControllerListBySourceUuidAsyncWithHttpInfo($uuid, $siteId, $itemsPerPage = null, $page = null, $entityTypeId = null, $flowId = null, string $contentType = self::contentTypes['remoteEntityCloneControllerListBySourceUuid'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityCloneListResponse';
        $request = $this->remoteEntityCloneControllerListBySourceUuidRequest($uuid, $siteId, $itemsPerPage, $page, $entityTypeId, $flowId, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityCloneControllerListBySourceUuid'
     *
     * @param  string $uuid (required)
     * @param  string $siteId (required)
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $entityTypeId (optional)
     * @param  string $flowId (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityCloneControllerListBySourceUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityCloneControllerListBySourceUuidRequest($uuid, $siteId, $itemsPerPage = null, $page = null, $entityTypeId = null, $flowId = null, string $contentType = self::contentTypes['remoteEntityCloneControllerListBySourceUuid'][0])
    {

        // verify the required parameter 'uuid' is set
        if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $uuid when calling remoteEntityCloneControllerListBySourceUuid'
            );
        }

        // verify the required parameter 'siteId' is set
        if ($siteId === null || (is_array($siteId) && count($siteId) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $siteId when calling remoteEntityCloneControllerListBySourceUuid'
            );
        }






        $resourcePath = '/sync-core/remote-entity-clone/site/{siteId}/by-source-uuid/{uuid}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityTypeId,
            'entityTypeId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $flowId,
            'flowId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($uuid !== null) {
            $resourcePath = str_replace(
                '{' . 'uuid' . '}',
                ObjectSerializer::toPathValue($uuid),
                $resourcePath
            );
        }
        // path params
        if ($siteId !== null) {
            $resourcePath = str_replace(
                '{' . 'siteId' . '}',
                ObjectSerializer::toPathValue($siteId),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityRevisionControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateRemoteEntityRevisionDto $createRemoteEntityRevisionDto createRemoteEntityRevisionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntityPushResult
     */
    public function remoteEntityRevisionControllerCreate($createRemoteEntityRevisionDto, string $contentType = self::contentTypes['remoteEntityRevisionControllerCreate'][0])
    {
        list($response) = $this->remoteEntityRevisionControllerCreateWithHttpInfo($createRemoteEntityRevisionDto, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityRevisionControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateRemoteEntityRevisionDto $createRemoteEntityRevisionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntityPushResult, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityRevisionControllerCreateWithHttpInfo($createRemoteEntityRevisionDto, string $contentType = self::contentTypes['remoteEntityRevisionControllerCreate'][0])
    {
        $request = $this->remoteEntityRevisionControllerCreateRequest($createRemoteEntityRevisionDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntityPushResult' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntityPushResult' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntityPushResult', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntityPushResult';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntityPushResult',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityRevisionControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateRemoteEntityRevisionDto $createRemoteEntityRevisionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityRevisionControllerCreateAsync($createRemoteEntityRevisionDto, string $contentType = self::contentTypes['remoteEntityRevisionControllerCreate'][0])
    {
        return $this->remoteEntityRevisionControllerCreateAsyncWithHttpInfo($createRemoteEntityRevisionDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityRevisionControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateRemoteEntityRevisionDto $createRemoteEntityRevisionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityRevisionControllerCreateAsyncWithHttpInfo($createRemoteEntityRevisionDto, string $contentType = self::contentTypes['remoteEntityRevisionControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntityPushResult';
        $request = $this->remoteEntityRevisionControllerCreateRequest($createRemoteEntityRevisionDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityRevisionControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateRemoteEntityRevisionDto $createRemoteEntityRevisionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityRevisionControllerCreateRequest($createRemoteEntityRevisionDto, string $contentType = self::contentTypes['remoteEntityRevisionControllerCreate'][0])
    {

        // verify the required parameter 'createRemoteEntityRevisionDto' is set
        if ($createRemoteEntityRevisionDto === null || (is_array($createRemoteEntityRevisionDto) && count($createRemoteEntityRevisionDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createRemoteEntityRevisionDto when calling remoteEntityRevisionControllerCreate'
            );
        }


        $resourcePath = '/sync-core/remote-entity-revision';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createRemoteEntityRevisionDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createRemoteEntityRevisionDto));
            } else {
                $httpBody = $createRemoteEntityRevisionDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityRevisionControllerDelete
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\DeleteRemoteEntityRevisionDto $deleteRemoteEntityRevisionDto deleteRemoteEntityRevisionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerDelete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function remoteEntityRevisionControllerDelete($deleteRemoteEntityRevisionDto, string $contentType = self::contentTypes['remoteEntityRevisionControllerDelete'][0])
    {
        list($response) = $this->remoteEntityRevisionControllerDeleteWithHttpInfo($deleteRemoteEntityRevisionDto, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityRevisionControllerDeleteWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\DeleteRemoteEntityRevisionDto $deleteRemoteEntityRevisionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerDelete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityRevisionControllerDeleteWithHttpInfo($deleteRemoteEntityRevisionDto, string $contentType = self::contentTypes['remoteEntityRevisionControllerDelete'][0])
    {
        $request = $this->remoteEntityRevisionControllerDeleteRequest($deleteRemoteEntityRevisionDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityRevisionControllerDeleteAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\DeleteRemoteEntityRevisionDto $deleteRemoteEntityRevisionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityRevisionControllerDeleteAsync($deleteRemoteEntityRevisionDto, string $contentType = self::contentTypes['remoteEntityRevisionControllerDelete'][0])
    {
        return $this->remoteEntityRevisionControllerDeleteAsyncWithHttpInfo($deleteRemoteEntityRevisionDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityRevisionControllerDeleteAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\DeleteRemoteEntityRevisionDto $deleteRemoteEntityRevisionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityRevisionControllerDeleteAsyncWithHttpInfo($deleteRemoteEntityRevisionDto, string $contentType = self::contentTypes['remoteEntityRevisionControllerDelete'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->remoteEntityRevisionControllerDeleteRequest($deleteRemoteEntityRevisionDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityRevisionControllerDelete'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\DeleteRemoteEntityRevisionDto $deleteRemoteEntityRevisionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityRevisionControllerDeleteRequest($deleteRemoteEntityRevisionDto, string $contentType = self::contentTypes['remoteEntityRevisionControllerDelete'][0])
    {

        // verify the required parameter 'deleteRemoteEntityRevisionDto' is set
        if ($deleteRemoteEntityRevisionDto === null || (is_array($deleteRemoteEntityRevisionDto) && count($deleteRemoteEntityRevisionDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $deleteRemoteEntityRevisionDto when calling remoteEntityRevisionControllerDelete'
            );
        }


        $resourcePath = '/sync-core/remote-entity-revision';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($deleteRemoteEntityRevisionDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($deleteRemoteEntityRevisionDto));
            } else {
                $httpBody = $deleteRemoteEntityRevisionDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'DELETE',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityRevisionControllerGetTranslationLanguages
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerGetTranslationLanguages'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedTranslationDefinitionList
     */
    public function remoteEntityRevisionControllerGetTranslationLanguages($id, string $contentType = self::contentTypes['remoteEntityRevisionControllerGetTranslationLanguages'][0])
    {
        list($response) = $this->remoteEntityRevisionControllerGetTranslationLanguagesWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityRevisionControllerGetTranslationLanguagesWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerGetTranslationLanguages'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedTranslationDefinitionList, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityRevisionControllerGetTranslationLanguagesWithHttpInfo($id, string $contentType = self::contentTypes['remoteEntityRevisionControllerGetTranslationLanguages'][0])
    {
        $request = $this->remoteEntityRevisionControllerGetTranslationLanguagesRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedTranslationDefinitionList' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedTranslationDefinitionList' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedTranslationDefinitionList', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedTranslationDefinitionList';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedTranslationDefinitionList',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityRevisionControllerGetTranslationLanguagesAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerGetTranslationLanguages'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityRevisionControllerGetTranslationLanguagesAsync($id, string $contentType = self::contentTypes['remoteEntityRevisionControllerGetTranslationLanguages'][0])
    {
        return $this->remoteEntityRevisionControllerGetTranslationLanguagesAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityRevisionControllerGetTranslationLanguagesAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerGetTranslationLanguages'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityRevisionControllerGetTranslationLanguagesAsyncWithHttpInfo($id, string $contentType = self::contentTypes['remoteEntityRevisionControllerGetTranslationLanguages'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedTranslationDefinitionList';
        $request = $this->remoteEntityRevisionControllerGetTranslationLanguagesRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityRevisionControllerGetTranslationLanguages'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerGetTranslationLanguages'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityRevisionControllerGetTranslationLanguagesRequest($id, string $contentType = self::contentTypes['remoteEntityRevisionControllerGetTranslationLanguages'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling remoteEntityRevisionControllerGetTranslationLanguages'
            );
        }


        $resourcePath = '/sync-core/remote-entity-revision/{id}/translations';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityRevisionControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntity
     */
    public function remoteEntityRevisionControllerItem($id, string $contentType = self::contentTypes['remoteEntityRevisionControllerItem'][0])
    {
        list($response) = $this->remoteEntityRevisionControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityRevisionControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityRevisionControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['remoteEntityRevisionControllerItem'][0])
    {
        $request = $this->remoteEntityRevisionControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityRevisionControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityRevisionControllerItemAsync($id, string $contentType = self::contentTypes['remoteEntityRevisionControllerItem'][0])
    {
        return $this->remoteEntityRevisionControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityRevisionControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityRevisionControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['remoteEntityRevisionControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityRevisionEntity';
        $request = $this->remoteEntityRevisionControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityRevisionControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityRevisionControllerItemRequest($id, string $contentType = self::contentTypes['remoteEntityRevisionControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling remoteEntityRevisionControllerItem'
            );
        }


        $resourcePath = '/sync-core/remote-entity-revision/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityRevisionControllerList
     *
     * @param  string $latest latest (optional)
     * @param  string $forCustomer forCustomer (optional)
     * @param  string $poolMachineName poolMachineName (optional)
     * @param  string $entityTypeMachineName entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName entityTypeNamespaceMachineName (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityRevisionList
     */
    public function remoteEntityRevisionControllerList($latest = null, $forCustomer = null, $poolMachineName = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityRevisionControllerList'][0])
    {
        list($response) = $this->remoteEntityRevisionControllerListWithHttpInfo($latest, $forCustomer, $poolMachineName, $entityTypeMachineName, $entityTypeNamespaceMachineName, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityRevisionControllerListWithHttpInfo
     *
     * @param  string $latest (optional)
     * @param  string $forCustomer (optional)
     * @param  string $poolMachineName (optional)
     * @param  string $entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityRevisionList, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityRevisionControllerListWithHttpInfo($latest = null, $forCustomer = null, $poolMachineName = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityRevisionControllerList'][0])
    {
        $request = $this->remoteEntityRevisionControllerListRequest($latest, $forCustomer, $poolMachineName, $entityTypeMachineName, $entityTypeNamespaceMachineName, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityRevisionList' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityRevisionList' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityRevisionList', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityRevisionList';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityRevisionList',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityRevisionControllerListAsync
     *
     * @param  string $latest (optional)
     * @param  string $forCustomer (optional)
     * @param  string $poolMachineName (optional)
     * @param  string $entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityRevisionControllerListAsync($latest = null, $forCustomer = null, $poolMachineName = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityRevisionControllerList'][0])
    {
        return $this->remoteEntityRevisionControllerListAsyncWithHttpInfo($latest, $forCustomer, $poolMachineName, $entityTypeMachineName, $entityTypeNamespaceMachineName, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityRevisionControllerListAsyncWithHttpInfo
     *
     * @param  string $latest (optional)
     * @param  string $forCustomer (optional)
     * @param  string $poolMachineName (optional)
     * @param  string $entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityRevisionControllerListAsyncWithHttpInfo($latest = null, $forCustomer = null, $poolMachineName = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityRevisionControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityRevisionList';
        $request = $this->remoteEntityRevisionControllerListRequest($latest, $forCustomer, $poolMachineName, $entityTypeMachineName, $entityTypeNamespaceMachineName, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityRevisionControllerList'
     *
     * @param  string $latest (optional)
     * @param  string $forCustomer (optional)
     * @param  string $poolMachineName (optional)
     * @param  string $entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityRevisionControllerListRequest($latest = null, $forCustomer = null, $poolMachineName = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityRevisionControllerList'][0])
    {









        $resourcePath = '/sync-core/remote-entity-revision';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $latest,
            'latest', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $forCustomer,
            'forCustomer', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $poolMachineName,
            'poolMachineName', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityTypeMachineName,
            'entityTypeMachineName', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityTypeNamespaceMachineName,
            'entityTypeNamespaceMachineName', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityRevisionControllerSerialize
     *
     * @param  string $id id (required)
     * @param  string $values values (optional)
     * @param  string $structure structure (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerSerialize'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return string
     */
    public function remoteEntityRevisionControllerSerialize($id, $values = null, $structure = null, string $contentType = self::contentTypes['remoteEntityRevisionControllerSerialize'][0])
    {
        list($response) = $this->remoteEntityRevisionControllerSerializeWithHttpInfo($id, $values, $structure, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityRevisionControllerSerializeWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $values (optional)
     * @param  string $structure (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerSerialize'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of string, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityRevisionControllerSerializeWithHttpInfo($id, $values = null, $structure = null, string $contentType = self::contentTypes['remoteEntityRevisionControllerSerialize'][0])
    {
        $request = $this->remoteEntityRevisionControllerSerializeRequest($id, $values, $structure, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('string' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('string' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, 'string', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = 'string';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        'string',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityRevisionControllerSerializeAsync
     *
     * @param  string $id (required)
     * @param  string $values (optional)
     * @param  string $structure (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerSerialize'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityRevisionControllerSerializeAsync($id, $values = null, $structure = null, string $contentType = self::contentTypes['remoteEntityRevisionControllerSerialize'][0])
    {
        return $this->remoteEntityRevisionControllerSerializeAsyncWithHttpInfo($id, $values, $structure, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityRevisionControllerSerializeAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $values (optional)
     * @param  string $structure (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerSerialize'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityRevisionControllerSerializeAsyncWithHttpInfo($id, $values = null, $structure = null, string $contentType = self::contentTypes['remoteEntityRevisionControllerSerialize'][0])
    {
        $returnType = 'string';
        $request = $this->remoteEntityRevisionControllerSerializeRequest($id, $values, $structure, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityRevisionControllerSerialize'
     *
     * @param  string $id (required)
     * @param  string $values (optional)
     * @param  string $structure (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityRevisionControllerSerialize'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityRevisionControllerSerializeRequest($id, $values = null, $structure = null, string $contentType = self::contentTypes['remoteEntityRevisionControllerSerialize'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling remoteEntityRevisionControllerSerialize'
            );
        }




        $resourcePath = '/sync-core/remote-entity-revision/{id}/serialize';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $values,
            'values', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $structure,
            'structure', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['text/yaml', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityTypeControllerByMachineName
     *
     * @param  string $machineName machineName (required)
     * @param  string $namespaceMachineName namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerByMachineName'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity
     */
    public function remoteEntityTypeControllerByMachineName($machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeControllerByMachineName'][0])
    {
        list($response) = $this->remoteEntityTypeControllerByMachineNameWithHttpInfo($machineName, $namespaceMachineName, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityTypeControllerByMachineNameWithHttpInfo
     *
     * @param  string $machineName (required)
     * @param  string $namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerByMachineName'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityTypeControllerByMachineNameWithHttpInfo($machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeControllerByMachineName'][0])
    {
        $request = $this->remoteEntityTypeControllerByMachineNameRequest($machineName, $namespaceMachineName, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityTypeControllerByMachineNameAsync
     *
     * @param  string $machineName (required)
     * @param  string $namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerByMachineName'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityTypeControllerByMachineNameAsync($machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeControllerByMachineName'][0])
    {
        return $this->remoteEntityTypeControllerByMachineNameAsyncWithHttpInfo($machineName, $namespaceMachineName, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityTypeControllerByMachineNameAsyncWithHttpInfo
     *
     * @param  string $machineName (required)
     * @param  string $namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerByMachineName'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityTypeControllerByMachineNameAsyncWithHttpInfo($machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeControllerByMachineName'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity';
        $request = $this->remoteEntityTypeControllerByMachineNameRequest($machineName, $namespaceMachineName, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityTypeControllerByMachineName'
     *
     * @param  string $machineName (required)
     * @param  string $namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerByMachineName'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityTypeControllerByMachineNameRequest($machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeControllerByMachineName'][0])
    {

        // verify the required parameter 'machineName' is set
        if ($machineName === null || (is_array($machineName) && count($machineName) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $machineName when calling remoteEntityTypeControllerByMachineName'
            );
        }

        // verify the required parameter 'namespaceMachineName' is set
        if ($namespaceMachineName === null || (is_array($namespaceMachineName) && count($namespaceMachineName) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $namespaceMachineName when calling remoteEntityTypeControllerByMachineName'
            );
        }


        $resourcePath = '/sync-core/remote-entity-type/by-machine-name/{namespaceMachineName}/{machineName}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($machineName !== null) {
            $resourcePath = str_replace(
                '{' . 'machineName' . '}',
                ObjectSerializer::toPathValue($machineName),
                $resourcePath
            );
        }
        // path params
        if ($namespaceMachineName !== null) {
            $resourcePath = str_replace(
                '{' . 'namespaceMachineName' . '}',
                ObjectSerializer::toPathValue($namespaceMachineName),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityTypeControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity
     */
    public function remoteEntityTypeControllerItem($id, string $contentType = self::contentTypes['remoteEntityTypeControllerItem'][0])
    {
        list($response) = $this->remoteEntityTypeControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityTypeControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityTypeControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['remoteEntityTypeControllerItem'][0])
    {
        $request = $this->remoteEntityTypeControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityTypeControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityTypeControllerItemAsync($id, string $contentType = self::contentTypes['remoteEntityTypeControllerItem'][0])
    {
        return $this->remoteEntityTypeControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityTypeControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityTypeControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['remoteEntityTypeControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity';
        $request = $this->remoteEntityTypeControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityTypeControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityTypeControllerItemRequest($id, string $contentType = self::contentTypes['remoteEntityTypeControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling remoteEntityTypeControllerItem'
            );
        }


        $resourcePath = '/sync-core/remote-entity-type/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityTypeControllerList
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity[]
     */
    public function remoteEntityTypeControllerList(string $contentType = self::contentTypes['remoteEntityTypeControllerList'][0])
    {
        list($response) = $this->remoteEntityTypeControllerListWithHttpInfo($contentType);
        return $response;
    }

    /**
     * Operation remoteEntityTypeControllerListWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity[], HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityTypeControllerListWithHttpInfo(string $contentType = self::contentTypes['remoteEntityTypeControllerList'][0])
    {
        $request = $this->remoteEntityTypeControllerListRequest($contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity[]' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity[]' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity[]', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity[]';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity[]',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityTypeControllerListAsync
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityTypeControllerListAsync(string $contentType = self::contentTypes['remoteEntityTypeControllerList'][0])
    {
        return $this->remoteEntityTypeControllerListAsyncWithHttpInfo($contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityTypeControllerListAsyncWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityTypeControllerListAsyncWithHttpInfo(string $contentType = self::contentTypes['remoteEntityTypeControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeEntity[]';
        $request = $this->remoteEntityTypeControllerListRequest($contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityTypeControllerList'
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityTypeControllerListRequest(string $contentType = self::contentTypes['remoteEntityTypeControllerList'][0])
    {


        $resourcePath = '/sync-core/remote-entity-type';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityTypeVersionControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateRemoteEntityTypeVersionDto $createRemoteEntityTypeVersionDto createRemoteEntityTypeVersionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity
     */
    public function remoteEntityTypeVersionControllerCreate($createRemoteEntityTypeVersionDto, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerCreate'][0])
    {
        list($response) = $this->remoteEntityTypeVersionControllerCreateWithHttpInfo($createRemoteEntityTypeVersionDto, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityTypeVersionControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateRemoteEntityTypeVersionDto $createRemoteEntityTypeVersionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityTypeVersionControllerCreateWithHttpInfo($createRemoteEntityTypeVersionDto, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerCreate'][0])
    {
        $request = $this->remoteEntityTypeVersionControllerCreateRequest($createRemoteEntityTypeVersionDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityTypeVersionControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateRemoteEntityTypeVersionDto $createRemoteEntityTypeVersionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityTypeVersionControllerCreateAsync($createRemoteEntityTypeVersionDto, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerCreate'][0])
    {
        return $this->remoteEntityTypeVersionControllerCreateAsyncWithHttpInfo($createRemoteEntityTypeVersionDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityTypeVersionControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateRemoteEntityTypeVersionDto $createRemoteEntityTypeVersionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityTypeVersionControllerCreateAsyncWithHttpInfo($createRemoteEntityTypeVersionDto, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity';
        $request = $this->remoteEntityTypeVersionControllerCreateRequest($createRemoteEntityTypeVersionDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityTypeVersionControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateRemoteEntityTypeVersionDto $createRemoteEntityTypeVersionDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityTypeVersionControllerCreateRequest($createRemoteEntityTypeVersionDto, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerCreate'][0])
    {

        // verify the required parameter 'createRemoteEntityTypeVersionDto' is set
        if ($createRemoteEntityTypeVersionDto === null || (is_array($createRemoteEntityTypeVersionDto) && count($createRemoteEntityTypeVersionDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createRemoteEntityTypeVersionDto when calling remoteEntityTypeVersionControllerCreate'
            );
        }


        $resourcePath = '/sync-core/remote-entity-type-version';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createRemoteEntityTypeVersionDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createRemoteEntityTypeVersionDto));
            } else {
                $httpBody = $createRemoteEntityTypeVersionDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityTypeVersionControllerGetVersionUsage
     *
     * @param  string $versionId versionId (required)
     * @param  string $machineName machineName (required)
     * @param  string $namespaceMachineName namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerGetVersionUsage'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\EntityTypeVersionUsage
     */
    public function remoteEntityTypeVersionControllerGetVersionUsage($versionId, $machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerGetVersionUsage'][0])
    {
        list($response) = $this->remoteEntityTypeVersionControllerGetVersionUsageWithHttpInfo($versionId, $machineName, $namespaceMachineName, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityTypeVersionControllerGetVersionUsageWithHttpInfo
     *
     * @param  string $versionId (required)
     * @param  string $machineName (required)
     * @param  string $namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerGetVersionUsage'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\EntityTypeVersionUsage, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityTypeVersionControllerGetVersionUsageWithHttpInfo($versionId, $machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerGetVersionUsage'][0])
    {
        $request = $this->remoteEntityTypeVersionControllerGetVersionUsageRequest($versionId, $machineName, $namespaceMachineName, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\EntityTypeVersionUsage' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\EntityTypeVersionUsage' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\EntityTypeVersionUsage', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\EntityTypeVersionUsage';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\EntityTypeVersionUsage',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityTypeVersionControllerGetVersionUsageAsync
     *
     * @param  string $versionId (required)
     * @param  string $machineName (required)
     * @param  string $namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerGetVersionUsage'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityTypeVersionControllerGetVersionUsageAsync($versionId, $machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerGetVersionUsage'][0])
    {
        return $this->remoteEntityTypeVersionControllerGetVersionUsageAsyncWithHttpInfo($versionId, $machineName, $namespaceMachineName, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityTypeVersionControllerGetVersionUsageAsyncWithHttpInfo
     *
     * @param  string $versionId (required)
     * @param  string $machineName (required)
     * @param  string $namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerGetVersionUsage'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityTypeVersionControllerGetVersionUsageAsyncWithHttpInfo($versionId, $machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerGetVersionUsage'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\EntityTypeVersionUsage';
        $request = $this->remoteEntityTypeVersionControllerGetVersionUsageRequest($versionId, $machineName, $namespaceMachineName, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityTypeVersionControllerGetVersionUsage'
     *
     * @param  string $versionId (required)
     * @param  string $machineName (required)
     * @param  string $namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerGetVersionUsage'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityTypeVersionControllerGetVersionUsageRequest($versionId, $machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerGetVersionUsage'][0])
    {

        // verify the required parameter 'versionId' is set
        if ($versionId === null || (is_array($versionId) && count($versionId) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $versionId when calling remoteEntityTypeVersionControllerGetVersionUsage'
            );
        }

        // verify the required parameter 'machineName' is set
        if ($machineName === null || (is_array($machineName) && count($machineName) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $machineName when calling remoteEntityTypeVersionControllerGetVersionUsage'
            );
        }

        // verify the required parameter 'namespaceMachineName' is set
        if ($namespaceMachineName === null || (is_array($namespaceMachineName) && count($namespaceMachineName) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $namespaceMachineName when calling remoteEntityTypeVersionControllerGetVersionUsage'
            );
        }


        $resourcePath = '/sync-core/remote-entity-type-version/differences/{namespaceMachineName}/{machineName}/{versionId}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($versionId !== null) {
            $resourcePath = str_replace(
                '{' . 'versionId' . '}',
                ObjectSerializer::toPathValue($versionId),
                $resourcePath
            );
        }
        // path params
        if ($machineName !== null) {
            $resourcePath = str_replace(
                '{' . 'machineName' . '}',
                ObjectSerializer::toPathValue($machineName),
                $resourcePath
            );
        }
        // path params
        if ($namespaceMachineName !== null) {
            $resourcePath = str_replace(
                '{' . 'namespaceMachineName' . '}',
                ObjectSerializer::toPathValue($namespaceMachineName),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityTypeVersionControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity
     */
    public function remoteEntityTypeVersionControllerItem($id, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerItem'][0])
    {
        list($response) = $this->remoteEntityTypeVersionControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityTypeVersionControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityTypeVersionControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerItem'][0])
    {
        $request = $this->remoteEntityTypeVersionControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityTypeVersionControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityTypeVersionControllerItemAsync($id, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerItem'][0])
    {
        return $this->remoteEntityTypeVersionControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityTypeVersionControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityTypeVersionControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity';
        $request = $this->remoteEntityTypeVersionControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityTypeVersionControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityTypeVersionControllerItemRequest($id, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling remoteEntityTypeVersionControllerItem'
            );
        }


        $resourcePath = '/sync-core/remote-entity-type-version/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityTypeVersionControllerItemByMachineName
     *
     * @param  string $versionId versionId (required)
     * @param  string $machineName machineName (required)
     * @param  string $namespaceMachineName namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerItemByMachineName'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity
     */
    public function remoteEntityTypeVersionControllerItemByMachineName($versionId, $machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerItemByMachineName'][0])
    {
        list($response) = $this->remoteEntityTypeVersionControllerItemByMachineNameWithHttpInfo($versionId, $machineName, $namespaceMachineName, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityTypeVersionControllerItemByMachineNameWithHttpInfo
     *
     * @param  string $versionId (required)
     * @param  string $machineName (required)
     * @param  string $namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerItemByMachineName'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityTypeVersionControllerItemByMachineNameWithHttpInfo($versionId, $machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerItemByMachineName'][0])
    {
        $request = $this->remoteEntityTypeVersionControllerItemByMachineNameRequest($versionId, $machineName, $namespaceMachineName, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityTypeVersionControllerItemByMachineNameAsync
     *
     * @param  string $versionId (required)
     * @param  string $machineName (required)
     * @param  string $namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerItemByMachineName'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityTypeVersionControllerItemByMachineNameAsync($versionId, $machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerItemByMachineName'][0])
    {
        return $this->remoteEntityTypeVersionControllerItemByMachineNameAsyncWithHttpInfo($versionId, $machineName, $namespaceMachineName, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityTypeVersionControllerItemByMachineNameAsyncWithHttpInfo
     *
     * @param  string $versionId (required)
     * @param  string $machineName (required)
     * @param  string $namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerItemByMachineName'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityTypeVersionControllerItemByMachineNameAsyncWithHttpInfo($versionId, $machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerItemByMachineName'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityTypeVersionEntity';
        $request = $this->remoteEntityTypeVersionControllerItemByMachineNameRequest($versionId, $machineName, $namespaceMachineName, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityTypeVersionControllerItemByMachineName'
     *
     * @param  string $versionId (required)
     * @param  string $machineName (required)
     * @param  string $namespaceMachineName (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityTypeVersionControllerItemByMachineName'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityTypeVersionControllerItemByMachineNameRequest($versionId, $machineName, $namespaceMachineName, string $contentType = self::contentTypes['remoteEntityTypeVersionControllerItemByMachineName'][0])
    {

        // verify the required parameter 'versionId' is set
        if ($versionId === null || (is_array($versionId) && count($versionId) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $versionId when calling remoteEntityTypeVersionControllerItemByMachineName'
            );
        }

        // verify the required parameter 'machineName' is set
        if ($machineName === null || (is_array($machineName) && count($machineName) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $machineName when calling remoteEntityTypeVersionControllerItemByMachineName'
            );
        }

        // verify the required parameter 'namespaceMachineName' is set
        if ($namespaceMachineName === null || (is_array($namespaceMachineName) && count($namespaceMachineName) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $namespaceMachineName when calling remoteEntityTypeVersionControllerItemByMachineName'
            );
        }


        $resourcePath = '/sync-core/remote-entity-type-version/by-machine-name/{namespaceMachineName}/{machineName}/{versionId}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($versionId !== null) {
            $resourcePath = str_replace(
                '{' . 'versionId' . '}',
                ObjectSerializer::toPathValue($versionId),
                $resourcePath
            );
        }
        // path params
        if ($machineName !== null) {
            $resourcePath = str_replace(
                '{' . 'machineName' . '}',
                ObjectSerializer::toPathValue($machineName),
                $resourcePath
            );
        }
        // path params
        if ($namespaceMachineName !== null) {
            $resourcePath = str_replace(
                '{' . 'namespaceMachineName' . '}',
                ObjectSerializer::toPathValue($namespaceMachineName),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityUsageControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityUsageControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityUsageEntity
     */
    public function remoteEntityUsageControllerItem($id, string $contentType = self::contentTypes['remoteEntityUsageControllerItem'][0])
    {
        list($response) = $this->remoteEntityUsageControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityUsageControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityUsageControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityUsageEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityUsageControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['remoteEntityUsageControllerItem'][0])
    {
        $request = $this->remoteEntityUsageControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityUsageEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityUsageEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityUsageEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityUsageEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityUsageEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityUsageControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityUsageControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityUsageControllerItemAsync($id, string $contentType = self::contentTypes['remoteEntityUsageControllerItem'][0])
    {
        return $this->remoteEntityUsageControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityUsageControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityUsageControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityUsageControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['remoteEntityUsageControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\RemoteEntityUsageEntity';
        $request = $this->remoteEntityUsageControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityUsageControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityUsageControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityUsageControllerItemRequest($id, string $contentType = self::contentTypes['remoteEntityUsageControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling remoteEntityUsageControllerItem'
            );
        }


        $resourcePath = '/sync-core/remote-entity-usage/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation remoteEntityUsageControllerList
     *
     * @param  string $entityTypeId entityTypeId (optional)
     * @param  string $siteId siteId (optional)
     * @param  string $entityId entityId (optional)
     * @param  string $remoteUniqueId remoteUniqueId (optional)
     * @param  string $remoteUuid remoteUuid (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityUsageControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityUsageListResponse
     */
    public function remoteEntityUsageControllerList($entityTypeId = null, $siteId = null, $entityId = null, $remoteUniqueId = null, $remoteUuid = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityUsageControllerList'][0])
    {
        list($response) = $this->remoteEntityUsageControllerListWithHttpInfo($entityTypeId, $siteId, $entityId, $remoteUniqueId, $remoteUuid, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation remoteEntityUsageControllerListWithHttpInfo
     *
     * @param  string $entityTypeId (optional)
     * @param  string $siteId (optional)
     * @param  string $entityId (optional)
     * @param  string $remoteUniqueId (optional)
     * @param  string $remoteUuid (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityUsageControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityUsageListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function remoteEntityUsageControllerListWithHttpInfo($entityTypeId = null, $siteId = null, $entityId = null, $remoteUniqueId = null, $remoteUuid = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityUsageControllerList'][0])
    {
        $request = $this->remoteEntityUsageControllerListRequest($entityTypeId, $siteId, $entityId, $remoteUniqueId, $remoteUuid, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityUsageListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityUsageListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityUsageListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityUsageListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityUsageListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation remoteEntityUsageControllerListAsync
     *
     * @param  string $entityTypeId (optional)
     * @param  string $siteId (optional)
     * @param  string $entityId (optional)
     * @param  string $remoteUniqueId (optional)
     * @param  string $remoteUuid (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityUsageControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityUsageControllerListAsync($entityTypeId = null, $siteId = null, $entityId = null, $remoteUniqueId = null, $remoteUuid = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityUsageControllerList'][0])
    {
        return $this->remoteEntityUsageControllerListAsyncWithHttpInfo($entityTypeId, $siteId, $entityId, $remoteUniqueId, $remoteUuid, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation remoteEntityUsageControllerListAsyncWithHttpInfo
     *
     * @param  string $entityTypeId (optional)
     * @param  string $siteId (optional)
     * @param  string $entityId (optional)
     * @param  string $remoteUniqueId (optional)
     * @param  string $remoteUuid (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityUsageControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function remoteEntityUsageControllerListAsyncWithHttpInfo($entityTypeId = null, $siteId = null, $entityId = null, $remoteUniqueId = null, $remoteUuid = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityUsageControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedRemoteEntityUsageListResponse';
        $request = $this->remoteEntityUsageControllerListRequest($entityTypeId, $siteId, $entityId, $remoteUniqueId, $remoteUuid, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'remoteEntityUsageControllerList'
     *
     * @param  string $entityTypeId (optional)
     * @param  string $siteId (optional)
     * @param  string $entityId (optional)
     * @param  string $remoteUniqueId (optional)
     * @param  string $remoteUuid (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['remoteEntityUsageControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function remoteEntityUsageControllerListRequest($entityTypeId = null, $siteId = null, $entityId = null, $remoteUniqueId = null, $remoteUuid = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['remoteEntityUsageControllerList'][0])
    {









        $resourcePath = '/sync-core/remote-entity-usage';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityTypeId,
            'entityTypeId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $siteId,
            'siteId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityId,
            'entityId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $remoteUniqueId,
            'remoteUniqueId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $remoteUuid,
            'remoteUuid', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation serviceSecretsControllerActiveByTarget
     *
     * @param  string $targetId targetId (required)
     * @param  string $targetType targetType (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerActiveByTarget'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity
     */
    public function serviceSecretsControllerActiveByTarget($targetId, $targetType, string $contentType = self::contentTypes['serviceSecretsControllerActiveByTarget'][0])
    {
        list($response) = $this->serviceSecretsControllerActiveByTargetWithHttpInfo($targetId, $targetType, $contentType);
        return $response;
    }

    /**
     * Operation serviceSecretsControllerActiveByTargetWithHttpInfo
     *
     * @param  string $targetId (required)
     * @param  string $targetType (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerActiveByTarget'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function serviceSecretsControllerActiveByTargetWithHttpInfo($targetId, $targetType, string $contentType = self::contentTypes['serviceSecretsControllerActiveByTarget'][0])
    {
        $request = $this->serviceSecretsControllerActiveByTargetRequest($targetId, $targetType, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation serviceSecretsControllerActiveByTargetAsync
     *
     * @param  string $targetId (required)
     * @param  string $targetType (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerActiveByTarget'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function serviceSecretsControllerActiveByTargetAsync($targetId, $targetType, string $contentType = self::contentTypes['serviceSecretsControllerActiveByTarget'][0])
    {
        return $this->serviceSecretsControllerActiveByTargetAsyncWithHttpInfo($targetId, $targetType, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation serviceSecretsControllerActiveByTargetAsyncWithHttpInfo
     *
     * @param  string $targetId (required)
     * @param  string $targetType (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerActiveByTarget'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function serviceSecretsControllerActiveByTargetAsyncWithHttpInfo($targetId, $targetType, string $contentType = self::contentTypes['serviceSecretsControllerActiveByTarget'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity';
        $request = $this->serviceSecretsControllerActiveByTargetRequest($targetId, $targetType, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'serviceSecretsControllerActiveByTarget'
     *
     * @param  string $targetId (required)
     * @param  string $targetType (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerActiveByTarget'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function serviceSecretsControllerActiveByTargetRequest($targetId, $targetType, string $contentType = self::contentTypes['serviceSecretsControllerActiveByTarget'][0])
    {

        // verify the required parameter 'targetId' is set
        if ($targetId === null || (is_array($targetId) && count($targetId) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $targetId when calling serviceSecretsControllerActiveByTarget'
            );
        }

        // verify the required parameter 'targetType' is set
        if ($targetType === null || (is_array($targetType) && count($targetType) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $targetType when calling serviceSecretsControllerActiveByTarget'
            );
        }


        $resourcePath = '/sync-core/service-secret/active/{targetType}/{targetId}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($targetId !== null) {
            $resourcePath = str_replace(
                '{' . 'targetId' . '}',
                ObjectSerializer::toPathValue($targetId),
                $resourcePath
            );
        }
        // path params
        if ($targetType !== null) {
            $resourcePath = str_replace(
                '{' . 'targetType' . '}',
                ObjectSerializer::toPathValue($targetType),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation serviceSecretsControllerArchiveAiProviderSecrets
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerArchiveAiProviderSecrets'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function serviceSecretsControllerArchiveAiProviderSecrets($id, string $contentType = self::contentTypes['serviceSecretsControllerArchiveAiProviderSecrets'][0])
    {
        list($response) = $this->serviceSecretsControllerArchiveAiProviderSecretsWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation serviceSecretsControllerArchiveAiProviderSecretsWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerArchiveAiProviderSecrets'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function serviceSecretsControllerArchiveAiProviderSecretsWithHttpInfo($id, string $contentType = self::contentTypes['serviceSecretsControllerArchiveAiProviderSecrets'][0])
    {
        $request = $this->serviceSecretsControllerArchiveAiProviderSecretsRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation serviceSecretsControllerArchiveAiProviderSecretsAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerArchiveAiProviderSecrets'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function serviceSecretsControllerArchiveAiProviderSecretsAsync($id, string $contentType = self::contentTypes['serviceSecretsControllerArchiveAiProviderSecrets'][0])
    {
        return $this->serviceSecretsControllerArchiveAiProviderSecretsAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation serviceSecretsControllerArchiveAiProviderSecretsAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerArchiveAiProviderSecrets'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function serviceSecretsControllerArchiveAiProviderSecretsAsyncWithHttpInfo($id, string $contentType = self::contentTypes['serviceSecretsControllerArchiveAiProviderSecrets'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->serviceSecretsControllerArchiveAiProviderSecretsRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'serviceSecretsControllerArchiveAiProviderSecrets'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerArchiveAiProviderSecrets'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function serviceSecretsControllerArchiveAiProviderSecretsRequest($id, string $contentType = self::contentTypes['serviceSecretsControllerArchiveAiProviderSecrets'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling serviceSecretsControllerArchiveAiProviderSecrets'
            );
        }


        $resourcePath = '/sync-core/service-secret/ai-provider/{id}/archive';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation serviceSecretsControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity
     */
    public function serviceSecretsControllerItem($id, string $contentType = self::contentTypes['serviceSecretsControllerItem'][0])
    {
        list($response) = $this->serviceSecretsControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation serviceSecretsControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function serviceSecretsControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['serviceSecretsControllerItem'][0])
    {
        $request = $this->serviceSecretsControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation serviceSecretsControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function serviceSecretsControllerItemAsync($id, string $contentType = self::contentTypes['serviceSecretsControllerItem'][0])
    {
        return $this->serviceSecretsControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation serviceSecretsControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function serviceSecretsControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['serviceSecretsControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity';
        $request = $this->serviceSecretsControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'serviceSecretsControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function serviceSecretsControllerItemRequest($id, string $contentType = self::contentTypes['serviceSecretsControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling serviceSecretsControllerItem'
            );
        }


        $resourcePath = '/sync-core/service-secret/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation serviceSecretsControllerList
     *
     * @param  mixed $status status (optional)
     * @param  mixed $targetId targetId (optional)
     * @param  mixed $targetType targetType (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse
     */
    public function serviceSecretsControllerList($status = null, $targetId = null, $targetType = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['serviceSecretsControllerList'][0])
    {
        list($response) = $this->serviceSecretsControllerListWithHttpInfo($status, $targetId, $targetType, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation serviceSecretsControllerListWithHttpInfo
     *
     * @param  mixed $status (optional)
     * @param  mixed $targetId (optional)
     * @param  mixed $targetType (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function serviceSecretsControllerListWithHttpInfo($status = null, $targetId = null, $targetType = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['serviceSecretsControllerList'][0])
    {
        $request = $this->serviceSecretsControllerListRequest($status, $targetId, $targetType, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation serviceSecretsControllerListAsync
     *
     * @param  mixed $status (optional)
     * @param  mixed $targetId (optional)
     * @param  mixed $targetType (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function serviceSecretsControllerListAsync($status = null, $targetId = null, $targetType = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['serviceSecretsControllerList'][0])
    {
        return $this->serviceSecretsControllerListAsyncWithHttpInfo($status, $targetId, $targetType, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation serviceSecretsControllerListAsyncWithHttpInfo
     *
     * @param  mixed $status (optional)
     * @param  mixed $targetId (optional)
     * @param  mixed $targetType (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function serviceSecretsControllerListAsyncWithHttpInfo($status = null, $targetId = null, $targetType = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['serviceSecretsControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse';
        $request = $this->serviceSecretsControllerListRequest($status, $targetId, $targetType, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'serviceSecretsControllerList'
     *
     * @param  mixed $status (optional)
     * @param  mixed $targetId (optional)
     * @param  mixed $targetType (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function serviceSecretsControllerListRequest($status = null, $targetId = null, $targetType = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['serviceSecretsControllerList'][0])
    {







        $resourcePath = '/sync-core/service-secret';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $targetId,
            'targetId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $targetType,
            'targetType', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation serviceSecretsControllerRevisionsByPreviousStatus
     *
     * @param  string $status status (required)
     * @param  string $key key (required)
     * @param  mixed $itemsPerPage itemsPerPage (optional)
     * @param  mixed $page page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse
     */
    public function serviceSecretsControllerRevisionsByPreviousStatus($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['serviceSecretsControllerRevisionsByPreviousStatus'][0])
    {
        list($response) = $this->serviceSecretsControllerRevisionsByPreviousStatusWithHttpInfo($status, $key, $itemsPerPage, $page, $contentType);
        return $response;
    }

    /**
     * Operation serviceSecretsControllerRevisionsByPreviousStatusWithHttpInfo
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function serviceSecretsControllerRevisionsByPreviousStatusWithHttpInfo($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['serviceSecretsControllerRevisionsByPreviousStatus'][0])
    {
        $request = $this->serviceSecretsControllerRevisionsByPreviousStatusRequest($status, $key, $itemsPerPage, $page, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation serviceSecretsControllerRevisionsByPreviousStatusAsync
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function serviceSecretsControllerRevisionsByPreviousStatusAsync($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['serviceSecretsControllerRevisionsByPreviousStatus'][0])
    {
        return $this->serviceSecretsControllerRevisionsByPreviousStatusAsyncWithHttpInfo($status, $key, $itemsPerPage, $page, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation serviceSecretsControllerRevisionsByPreviousStatusAsyncWithHttpInfo
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function serviceSecretsControllerRevisionsByPreviousStatusAsyncWithHttpInfo($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['serviceSecretsControllerRevisionsByPreviousStatus'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedServiceSecretListResponse';
        $request = $this->serviceSecretsControllerRevisionsByPreviousStatusRequest($status, $key, $itemsPerPage, $page, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'serviceSecretsControllerRevisionsByPreviousStatus'
     *
     * @param  string $status (required)
     * @param  string $key (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function serviceSecretsControllerRevisionsByPreviousStatusRequest($status, $key, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['serviceSecretsControllerRevisionsByPreviousStatus'][0])
    {

        // verify the required parameter 'status' is set
        if ($status === null || (is_array($status) && count($status) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $status when calling serviceSecretsControllerRevisionsByPreviousStatus'
            );
        }

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling serviceSecretsControllerRevisionsByPreviousStatus'
            );
        }




        $resourcePath = '/sync-core/service-secret/by-key/{key}/{status}/revisions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($status !== null) {
            $resourcePath = str_replace(
                '{' . 'status' . '}',
                ObjectSerializer::toPathValue($status),
                $resourcePath
            );
        }
        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation serviceSecretsControllerSetAiProviderAccessKey
     *
     * @param  string $id id (required)
     * @param  object $body body (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerSetAiProviderAccessKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity
     */
    public function serviceSecretsControllerSetAiProviderAccessKey($id, $body, string $contentType = self::contentTypes['serviceSecretsControllerSetAiProviderAccessKey'][0])
    {
        list($response) = $this->serviceSecretsControllerSetAiProviderAccessKeyWithHttpInfo($id, $body, $contentType);
        return $response;
    }

    /**
     * Operation serviceSecretsControllerSetAiProviderAccessKeyWithHttpInfo
     *
     * @param  string $id (required)
     * @param  object $body (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerSetAiProviderAccessKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function serviceSecretsControllerSetAiProviderAccessKeyWithHttpInfo($id, $body, string $contentType = self::contentTypes['serviceSecretsControllerSetAiProviderAccessKey'][0])
    {
        $request = $this->serviceSecretsControllerSetAiProviderAccessKeyRequest($id, $body, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation serviceSecretsControllerSetAiProviderAccessKeyAsync
     *
     * @param  string $id (required)
     * @param  object $body (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerSetAiProviderAccessKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function serviceSecretsControllerSetAiProviderAccessKeyAsync($id, $body, string $contentType = self::contentTypes['serviceSecretsControllerSetAiProviderAccessKey'][0])
    {
        return $this->serviceSecretsControllerSetAiProviderAccessKeyAsyncWithHttpInfo($id, $body, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation serviceSecretsControllerSetAiProviderAccessKeyAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  object $body (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerSetAiProviderAccessKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function serviceSecretsControllerSetAiProviderAccessKeyAsyncWithHttpInfo($id, $body, string $contentType = self::contentTypes['serviceSecretsControllerSetAiProviderAccessKey'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\ServiceSecretEntity';
        $request = $this->serviceSecretsControllerSetAiProviderAccessKeyRequest($id, $body, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'serviceSecretsControllerSetAiProviderAccessKey'
     *
     * @param  string $id (required)
     * @param  object $body (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['serviceSecretsControllerSetAiProviderAccessKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function serviceSecretsControllerSetAiProviderAccessKeyRequest($id, $body, string $contentType = self::contentTypes['serviceSecretsControllerSetAiProviderAccessKey'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling serviceSecretsControllerSetAiProviderAccessKey'
            );
        }

        // verify the required parameter 'body' is set
        if ($body === null || (is_array($body) && count($body) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $body when calling serviceSecretsControllerSetAiProviderAccessKey'
            );
        }


        $resourcePath = '/sync-core/service-secret/ai-provider/{id}/access-key';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($body)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body));
            } else {
                $httpBody = $body;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation siteControllerGetRequests
     *
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $page page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerGetRequests'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedRequestList
     */
    public function siteControllerGetRequests($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['siteControllerGetRequests'][0])
    {
        list($response) = $this->siteControllerGetRequestsWithHttpInfo($itemsPerPage, $page, $contentType);
        return $response;
    }

    /**
     * Operation siteControllerGetRequestsWithHttpInfo
     *
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerGetRequests'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedRequestList, HTTP status code, HTTP response headers (array of strings)
     */
    public function siteControllerGetRequestsWithHttpInfo($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['siteControllerGetRequests'][0])
    {
        $request = $this->siteControllerGetRequestsRequest($itemsPerPage, $page, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedRequestList' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedRequestList' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedRequestList', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedRequestList';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedRequestList',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation siteControllerGetRequestsAsync
     *
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerGetRequests'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerGetRequestsAsync($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['siteControllerGetRequests'][0])
    {
        return $this->siteControllerGetRequestsAsyncWithHttpInfo($itemsPerPage, $page, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation siteControllerGetRequestsAsyncWithHttpInfo
     *
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerGetRequests'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerGetRequestsAsyncWithHttpInfo($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['siteControllerGetRequests'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedRequestList';
        $request = $this->siteControllerGetRequestsRequest($itemsPerPage, $page, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'siteControllerGetRequests'
     *
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerGetRequests'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function siteControllerGetRequestsRequest($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['siteControllerGetRequests'][0])
    {




        $resourcePath = '/sync-core/site/requests';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation siteControllerGetThrottling
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerGetThrottling'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto
     */
    public function siteControllerGetThrottling(string $contentType = self::contentTypes['siteControllerGetThrottling'][0])
    {
        list($response) = $this->siteControllerGetThrottlingWithHttpInfo($contentType);
        return $response;
    }

    /**
     * Operation siteControllerGetThrottlingWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerGetThrottling'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto, HTTP status code, HTTP response headers (array of strings)
     */
    public function siteControllerGetThrottlingWithHttpInfo(string $contentType = self::contentTypes['siteControllerGetThrottling'][0])
    {
        $request = $this->siteControllerGetThrottlingRequest($contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation siteControllerGetThrottlingAsync
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerGetThrottling'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerGetThrottlingAsync(string $contentType = self::contentTypes['siteControllerGetThrottling'][0])
    {
        return $this->siteControllerGetThrottlingAsyncWithHttpInfo($contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation siteControllerGetThrottlingAsyncWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerGetThrottling'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerGetThrottlingAsyncWithHttpInfo(string $contentType = self::contentTypes['siteControllerGetThrottling'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto';
        $request = $this->siteControllerGetThrottlingRequest($contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'siteControllerGetThrottling'
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerGetThrottling'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function siteControllerGetThrottlingRequest(string $contentType = self::contentTypes['siteControllerGetThrottling'][0])
    {


        $resourcePath = '/sync-core/site/throttling';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation siteControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails
     */
    public function siteControllerItem($id, string $contentType = self::contentTypes['siteControllerItem'][0])
    {
        list($response) = $this->siteControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation siteControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails, HTTP status code, HTTP response headers (array of strings)
     */
    public function siteControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['siteControllerItem'][0])
    {
        $request = $this->siteControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation siteControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerItemAsync($id, string $contentType = self::contentTypes['siteControllerItem'][0])
    {
        return $this->siteControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation siteControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['siteControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails';
        $request = $this->siteControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'siteControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function siteControllerItemRequest($id, string $contentType = self::contentTypes['siteControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling siteControllerItem'
            );
        }


        $resourcePath = '/sync-core/site/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation siteControllerItemByUuid
     *
     * @param  string $uuid uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails
     */
    public function siteControllerItemByUuid($uuid, string $contentType = self::contentTypes['siteControllerItemByUuid'][0])
    {
        list($response) = $this->siteControllerItemByUuidWithHttpInfo($uuid, $contentType);
        return $response;
    }

    /**
     * Operation siteControllerItemByUuidWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails, HTTP status code, HTTP response headers (array of strings)
     */
    public function siteControllerItemByUuidWithHttpInfo($uuid, string $contentType = self::contentTypes['siteControllerItemByUuid'][0])
    {
        $request = $this->siteControllerItemByUuidRequest($uuid, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation siteControllerItemByUuidAsync
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerItemByUuidAsync($uuid, string $contentType = self::contentTypes['siteControllerItemByUuid'][0])
    {
        return $this->siteControllerItemByUuidAsyncWithHttpInfo($uuid, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation siteControllerItemByUuidAsyncWithHttpInfo
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerItemByUuidAsyncWithHttpInfo($uuid, string $contentType = self::contentTypes['siteControllerItemByUuid'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SmallSiteEntityWithDetails';
        $request = $this->siteControllerItemByUuidRequest($uuid, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'siteControllerItemByUuid'
     *
     * @param  string $uuid (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerItemByUuid'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function siteControllerItemByUuidRequest($uuid, string $contentType = self::contentTypes['siteControllerItemByUuid'][0])
    {

        // verify the required parameter 'uuid' is set
        if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $uuid when calling siteControllerItemByUuid'
            );
        }


        $resourcePath = '/sync-core/site/by-uuid/{uuid}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($uuid !== null) {
            $resourcePath = str_replace(
                '{' . 'uuid' . '}',
                ObjectSerializer::toPathValue($uuid),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation siteControllerRegister
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RegisterSiteDto $registerSiteDto registerSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRegister'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SiteEntity
     */
    public function siteControllerRegister($registerSiteDto, string $contentType = self::contentTypes['siteControllerRegister'][0])
    {
        list($response) = $this->siteControllerRegisterWithHttpInfo($registerSiteDto, $contentType);
        return $response;
    }

    /**
     * Operation siteControllerRegisterWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RegisterSiteDto $registerSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRegister'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SiteEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function siteControllerRegisterWithHttpInfo($registerSiteDto, string $contentType = self::contentTypes['siteControllerRegister'][0])
    {
        $request = $this->siteControllerRegisterRequest($registerSiteDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation siteControllerRegisterAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RegisterSiteDto $registerSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRegister'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerRegisterAsync($registerSiteDto, string $contentType = self::contentTypes['siteControllerRegister'][0])
    {
        return $this->siteControllerRegisterAsyncWithHttpInfo($registerSiteDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation siteControllerRegisterAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RegisterSiteDto $registerSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRegister'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerRegisterAsyncWithHttpInfo($registerSiteDto, string $contentType = self::contentTypes['siteControllerRegister'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity';
        $request = $this->siteControllerRegisterRequest($registerSiteDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'siteControllerRegister'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RegisterSiteDto $registerSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRegister'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function siteControllerRegisterRequest($registerSiteDto, string $contentType = self::contentTypes['siteControllerRegister'][0])
    {

        // verify the required parameter 'registerSiteDto' is set
        if ($registerSiteDto === null || (is_array($registerSiteDto) && count($registerSiteDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $registerSiteDto when calling siteControllerRegister'
            );
        }


        $resourcePath = '/sync-core/site';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($registerSiteDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($registerSiteDto));
            } else {
                $httpBody = $registerSiteDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation siteControllerRegisterNew
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RegisterNewSiteDto $registerNewSiteDto registerNewSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRegisterNew'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SiteEntity
     */
    public function siteControllerRegisterNew($registerNewSiteDto, string $contentType = self::contentTypes['siteControllerRegisterNew'][0])
    {
        list($response) = $this->siteControllerRegisterNewWithHttpInfo($registerNewSiteDto, $contentType);
        return $response;
    }

    /**
     * Operation siteControllerRegisterNewWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RegisterNewSiteDto $registerNewSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRegisterNew'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SiteEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function siteControllerRegisterNewWithHttpInfo($registerNewSiteDto, string $contentType = self::contentTypes['siteControllerRegisterNew'][0])
    {
        $request = $this->siteControllerRegisterNewRequest($registerNewSiteDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation siteControllerRegisterNewAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RegisterNewSiteDto $registerNewSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRegisterNew'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerRegisterNewAsync($registerNewSiteDto, string $contentType = self::contentTypes['siteControllerRegisterNew'][0])
    {
        return $this->siteControllerRegisterNewAsyncWithHttpInfo($registerNewSiteDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation siteControllerRegisterNewAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RegisterNewSiteDto $registerNewSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRegisterNew'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerRegisterNewAsyncWithHttpInfo($registerNewSiteDto, string $contentType = self::contentTypes['siteControllerRegisterNew'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity';
        $request = $this->siteControllerRegisterNewRequest($registerNewSiteDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'siteControllerRegisterNew'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RegisterNewSiteDto $registerNewSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRegisterNew'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function siteControllerRegisterNewRequest($registerNewSiteDto, string $contentType = self::contentTypes['siteControllerRegisterNew'][0])
    {

        // verify the required parameter 'registerNewSiteDto' is set
        if ($registerNewSiteDto === null || (is_array($registerNewSiteDto) && count($registerNewSiteDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $registerNewSiteDto when calling siteControllerRegisterNew'
            );
        }


        $resourcePath = '/sync-core/site/new';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($registerNewSiteDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($registerNewSiteDto));
            } else {
                $httpBody = $registerNewSiteDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation siteControllerRespondToRequest
     *
     * @param  string $id id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RequestResponseDto $requestResponseDto requestResponseDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRespondToRequest'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function siteControllerRespondToRequest($id, $requestResponseDto, string $contentType = self::contentTypes['siteControllerRespondToRequest'][0])
    {
        list($response) = $this->siteControllerRespondToRequestWithHttpInfo($id, $requestResponseDto, $contentType);
        return $response;
    }

    /**
     * Operation siteControllerRespondToRequestWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RequestResponseDto $requestResponseDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRespondToRequest'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function siteControllerRespondToRequestWithHttpInfo($id, $requestResponseDto, string $contentType = self::contentTypes['siteControllerRespondToRequest'][0])
    {
        $request = $this->siteControllerRespondToRequestRequest($id, $requestResponseDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation siteControllerRespondToRequestAsync
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RequestResponseDto $requestResponseDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRespondToRequest'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerRespondToRequestAsync($id, $requestResponseDto, string $contentType = self::contentTypes['siteControllerRespondToRequest'][0])
    {
        return $this->siteControllerRespondToRequestAsyncWithHttpInfo($id, $requestResponseDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation siteControllerRespondToRequestAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RequestResponseDto $requestResponseDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRespondToRequest'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerRespondToRequestAsyncWithHttpInfo($id, $requestResponseDto, string $contentType = self::contentTypes['siteControllerRespondToRequest'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->siteControllerRespondToRequestRequest($id, $requestResponseDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'siteControllerRespondToRequest'
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\RequestResponseDto $requestResponseDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerRespondToRequest'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function siteControllerRespondToRequestRequest($id, $requestResponseDto, string $contentType = self::contentTypes['siteControllerRespondToRequest'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling siteControllerRespondToRequest'
            );
        }

        // verify the required parameter 'requestResponseDto' is set
        if ($requestResponseDto === null || (is_array($requestResponseDto) && count($requestResponseDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $requestResponseDto when calling siteControllerRespondToRequest'
            );
        }


        $resourcePath = '/sync-core/site/requests/{id}/respond';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($requestResponseDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($requestResponseDto));
            } else {
                $httpBody = $requestResponseDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation siteControllerSearch
     *
     * @param  string $search search (optional)
     * @param  string $baseUrl baseUrl (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSearch'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedSiteList
     */
    public function siteControllerSearch($search = null, $baseUrl = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['siteControllerSearch'][0])
    {
        list($response) = $this->siteControllerSearchWithHttpInfo($search, $baseUrl, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation siteControllerSearchWithHttpInfo
     *
     * @param  string $search (optional)
     * @param  string $baseUrl (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSearch'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedSiteList, HTTP status code, HTTP response headers (array of strings)
     */
    public function siteControllerSearchWithHttpInfo($search = null, $baseUrl = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['siteControllerSearch'][0])
    {
        $request = $this->siteControllerSearchRequest($search, $baseUrl, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedSiteList' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedSiteList' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedSiteList', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedSiteList';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedSiteList',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation siteControllerSearchAsync
     *
     * @param  string $search (optional)
     * @param  string $baseUrl (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSearch'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerSearchAsync($search = null, $baseUrl = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['siteControllerSearch'][0])
    {
        return $this->siteControllerSearchAsyncWithHttpInfo($search, $baseUrl, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation siteControllerSearchAsyncWithHttpInfo
     *
     * @param  string $search (optional)
     * @param  string $baseUrl (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSearch'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerSearchAsyncWithHttpInfo($search = null, $baseUrl = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['siteControllerSearch'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedSiteList';
        $request = $this->siteControllerSearchRequest($search, $baseUrl, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'siteControllerSearch'
     *
     * @param  string $search (optional)
     * @param  string $baseUrl (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSearch'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function siteControllerSearchRequest($search = null, $baseUrl = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['siteControllerSearch'][0])
    {






        $resourcePath = '/sync-core/site';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $search,
            'search', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $baseUrl,
            'baseUrl', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation siteControllerSelf
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSelf'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SiteSelfDto
     */
    public function siteControllerSelf(string $contentType = self::contentTypes['siteControllerSelf'][0])
    {
        list($response) = $this->siteControllerSelfWithHttpInfo($contentType);
        return $response;
    }

    /**
     * Operation siteControllerSelfWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSelf'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SiteSelfDto, HTTP status code, HTTP response headers (array of strings)
     */
    public function siteControllerSelfWithHttpInfo(string $contentType = self::contentTypes['siteControllerSelf'][0])
    {
        $request = $this->siteControllerSelfRequest($contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SiteSelfDto' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SiteSelfDto' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SiteSelfDto', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SiteSelfDto';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SiteSelfDto',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation siteControllerSelfAsync
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSelf'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerSelfAsync(string $contentType = self::contentTypes['siteControllerSelf'][0])
    {
        return $this->siteControllerSelfAsyncWithHttpInfo($contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation siteControllerSelfAsyncWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSelf'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerSelfAsyncWithHttpInfo(string $contentType = self::contentTypes['siteControllerSelf'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SiteSelfDto';
        $request = $this->siteControllerSelfRequest($contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'siteControllerSelf'
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSelf'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function siteControllerSelfRequest(string $contentType = self::contentTypes['siteControllerSelf'][0])
    {


        $resourcePath = '/sync-core/site/self';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation siteControllerSetThrottling
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetThrottlingDto $setThrottlingDto setThrottlingDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSetThrottling'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto
     */
    public function siteControllerSetThrottling($setThrottlingDto, string $contentType = self::contentTypes['siteControllerSetThrottling'][0])
    {
        list($response) = $this->siteControllerSetThrottlingWithHttpInfo($setThrottlingDto, $contentType);
        return $response;
    }

    /**
     * Operation siteControllerSetThrottlingWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetThrottlingDto $setThrottlingDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSetThrottling'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto, HTTP status code, HTTP response headers (array of strings)
     */
    public function siteControllerSetThrottlingWithHttpInfo($setThrottlingDto, string $contentType = self::contentTypes['siteControllerSetThrottling'][0])
    {
        $request = $this->siteControllerSetThrottlingRequest($setThrottlingDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation siteControllerSetThrottlingAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetThrottlingDto $setThrottlingDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSetThrottling'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerSetThrottlingAsync($setThrottlingDto, string $contentType = self::contentTypes['siteControllerSetThrottling'][0])
    {
        return $this->siteControllerSetThrottlingAsyncWithHttpInfo($setThrottlingDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation siteControllerSetThrottlingAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetThrottlingDto $setThrottlingDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSetThrottling'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerSetThrottlingAsyncWithHttpInfo($setThrottlingDto, string $contentType = self::contentTypes['siteControllerSetThrottling'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\GetThrottlingDto';
        $request = $this->siteControllerSetThrottlingRequest($setThrottlingDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'siteControllerSetThrottling'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SetThrottlingDto $setThrottlingDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerSetThrottling'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function siteControllerSetThrottlingRequest($setThrottlingDto, string $contentType = self::contentTypes['siteControllerSetThrottling'][0])
    {

        // verify the required parameter 'setThrottlingDto' is set
        if ($setThrottlingDto === null || (is_array($setThrottlingDto) && count($setThrottlingDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $setThrottlingDto when calling siteControllerSetThrottling'
            );
        }


        $resourcePath = '/sync-core/site/throttling';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($setThrottlingDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($setThrottlingDto));
            } else {
                $httpBody = $setThrottlingDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation siteControllerUpdate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateSiteDto $createSiteDto createSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SiteEntity
     */
    public function siteControllerUpdate($createSiteDto, string $contentType = self::contentTypes['siteControllerUpdate'][0])
    {
        list($response) = $this->siteControllerUpdateWithHttpInfo($createSiteDto, $contentType);
        return $response;
    }

    /**
     * Operation siteControllerUpdateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateSiteDto $createSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SiteEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function siteControllerUpdateWithHttpInfo($createSiteDto, string $contentType = self::contentTypes['siteControllerUpdate'][0])
    {
        $request = $this->siteControllerUpdateRequest($createSiteDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation siteControllerUpdateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateSiteDto $createSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerUpdateAsync($createSiteDto, string $contentType = self::contentTypes['siteControllerUpdate'][0])
    {
        return $this->siteControllerUpdateAsyncWithHttpInfo($createSiteDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation siteControllerUpdateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateSiteDto $createSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerUpdateAsyncWithHttpInfo($createSiteDto, string $contentType = self::contentTypes['siteControllerUpdate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SiteEntity';
        $request = $this->siteControllerUpdateRequest($createSiteDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'siteControllerUpdate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateSiteDto $createSiteDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function siteControllerUpdateRequest($createSiteDto, string $contentType = self::contentTypes['siteControllerUpdate'][0])
    {

        // verify the required parameter 'createSiteDto' is set
        if ($createSiteDto === null || (is_array($createSiteDto) && count($createSiteDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createSiteDto when calling siteControllerUpdate'
            );
        }


        $resourcePath = '/sync-core/site';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createSiteDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createSiteDto));
            } else {
                $httpBody = $createSiteDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'PATCH',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation siteControllerUpdateConfig
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SiteConfigUpdateRequestDto $siteConfigUpdateRequestDto siteConfigUpdateRequestDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerUpdateConfig'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity
     */
    public function siteControllerUpdateConfig($siteConfigUpdateRequestDto, string $contentType = self::contentTypes['siteControllerUpdateConfig'][0])
    {
        list($response) = $this->siteControllerUpdateConfigWithHttpInfo($siteConfigUpdateRequestDto, $contentType);
        return $response;
    }

    /**
     * Operation siteControllerUpdateConfigWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SiteConfigUpdateRequestDto $siteConfigUpdateRequestDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerUpdateConfig'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function siteControllerUpdateConfigWithHttpInfo($siteConfigUpdateRequestDto, string $contentType = self::contentTypes['siteControllerUpdateConfig'][0])
    {
        $request = $this->siteControllerUpdateConfigRequest($siteConfigUpdateRequestDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation siteControllerUpdateConfigAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SiteConfigUpdateRequestDto $siteConfigUpdateRequestDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerUpdateConfig'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerUpdateConfigAsync($siteConfigUpdateRequestDto, string $contentType = self::contentTypes['siteControllerUpdateConfig'][0])
    {
        return $this->siteControllerUpdateConfigAsyncWithHttpInfo($siteConfigUpdateRequestDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation siteControllerUpdateConfigAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SiteConfigUpdateRequestDto $siteConfigUpdateRequestDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerUpdateConfig'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function siteControllerUpdateConfigAsyncWithHttpInfo($siteConfigUpdateRequestDto, string $contentType = self::contentTypes['siteControllerUpdateConfig'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity';
        $request = $this->siteControllerUpdateConfigRequest($siteConfigUpdateRequestDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'siteControllerUpdateConfig'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SiteConfigUpdateRequestDto $siteConfigUpdateRequestDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['siteControllerUpdateConfig'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function siteControllerUpdateConfigRequest($siteConfigUpdateRequestDto, string $contentType = self::contentTypes['siteControllerUpdateConfig'][0])
    {

        // verify the required parameter 'siteConfigUpdateRequestDto' is set
        if ($siteConfigUpdateRequestDto === null || (is_array($siteConfigUpdateRequestDto) && count($siteConfigUpdateRequestDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $siteConfigUpdateRequestDto when calling siteControllerUpdateConfig'
            );
        }


        $resourcePath = '/sync-core/site/config';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($siteConfigUpdateRequestDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($siteConfigUpdateRequestDto));
            } else {
                $httpBody = $siteConfigUpdateRequestDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation syndicationControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskDto $createTaskDto createTaskDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity
     */
    public function syndicationControllerCreate($createTaskDto, string $contentType = self::contentTypes['syndicationControllerCreate'][0])
    {
        list($response) = $this->syndicationControllerCreateWithHttpInfo($createTaskDto, $contentType);
        return $response;
    }

    /**
     * Operation syndicationControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskDto $createTaskDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function syndicationControllerCreateWithHttpInfo($createTaskDto, string $contentType = self::contentTypes['syndicationControllerCreate'][0])
    {
        $request = $this->syndicationControllerCreateRequest($createTaskDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation syndicationControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskDto $createTaskDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerCreateAsync($createTaskDto, string $contentType = self::contentTypes['syndicationControllerCreate'][0])
    {
        return $this->syndicationControllerCreateAsyncWithHttpInfo($createTaskDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation syndicationControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskDto $createTaskDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerCreateAsyncWithHttpInfo($createTaskDto, string $contentType = self::contentTypes['syndicationControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity';
        $request = $this->syndicationControllerCreateRequest($createTaskDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'syndicationControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskDto $createTaskDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function syndicationControllerCreateRequest($createTaskDto, string $contentType = self::contentTypes['syndicationControllerCreate'][0])
    {

        // verify the required parameter 'createTaskDto' is set
        if ($createTaskDto === null || (is_array($createTaskDto) && count($createTaskDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createTaskDto when calling syndicationControllerCreate'
            );
        }


        $resourcePath = '/sync-core/syndication';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createTaskDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createTaskDto));
            } else {
                $httpBody = $createTaskDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation syndicationControllerDelete
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationDeleteRequest $syndicationDeleteRequest syndicationDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerDelete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[]
     */
    public function syndicationControllerDelete($syndicationDeleteRequest, string $contentType = self::contentTypes['syndicationControllerDelete'][0])
    {
        list($response) = $this->syndicationControllerDeleteWithHttpInfo($syndicationDeleteRequest, $contentType);
        return $response;
    }

    /**
     * Operation syndicationControllerDeleteWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationDeleteRequest $syndicationDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerDelete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[], HTTP status code, HTTP response headers (array of strings)
     */
    public function syndicationControllerDeleteWithHttpInfo($syndicationDeleteRequest, string $contentType = self::contentTypes['syndicationControllerDelete'][0])
    {
        $request = $this->syndicationControllerDeleteRequest($syndicationDeleteRequest, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[]' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[]' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[]', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[]';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[]',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation syndicationControllerDeleteAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationDeleteRequest $syndicationDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerDeleteAsync($syndicationDeleteRequest, string $contentType = self::contentTypes['syndicationControllerDelete'][0])
    {
        return $this->syndicationControllerDeleteAsyncWithHttpInfo($syndicationDeleteRequest, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation syndicationControllerDeleteAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationDeleteRequest $syndicationDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerDeleteAsyncWithHttpInfo($syndicationDeleteRequest, string $contentType = self::contentTypes['syndicationControllerDelete'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[]';
        $request = $this->syndicationControllerDeleteRequest($syndicationDeleteRequest, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'syndicationControllerDelete'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationDeleteRequest $syndicationDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function syndicationControllerDeleteRequest($syndicationDeleteRequest, string $contentType = self::contentTypes['syndicationControllerDelete'][0])
    {

        // verify the required parameter 'syndicationDeleteRequest' is set
        if ($syndicationDeleteRequest === null || (is_array($syndicationDeleteRequest) && count($syndicationDeleteRequest) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $syndicationDeleteRequest when calling syndicationControllerDelete'
            );
        }


        $resourcePath = '/sync-core/syndication';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($syndicationDeleteRequest)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($syndicationDeleteRequest));
            } else {
                $httpBody = $syndicationDeleteRequest;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'DELETE',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation syndicationControllerGetErrors
     *
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $page page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerGetErrors'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList
     */
    public function syndicationControllerGetErrors($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['syndicationControllerGetErrors'][0])
    {
        list($response) = $this->syndicationControllerGetErrorsWithHttpInfo($itemsPerPage, $page, $contentType);
        return $response;
    }

    /**
     * Operation syndicationControllerGetErrorsWithHttpInfo
     *
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerGetErrors'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList, HTTP status code, HTTP response headers (array of strings)
     */
    public function syndicationControllerGetErrorsWithHttpInfo($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['syndicationControllerGetErrors'][0])
    {
        $request = $this->syndicationControllerGetErrorsRequest($itemsPerPage, $page, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation syndicationControllerGetErrorsAsync
     *
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerGetErrors'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerGetErrorsAsync($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['syndicationControllerGetErrors'][0])
    {
        return $this->syndicationControllerGetErrorsAsyncWithHttpInfo($itemsPerPage, $page, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation syndicationControllerGetErrorsAsyncWithHttpInfo
     *
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerGetErrors'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerGetErrorsAsyncWithHttpInfo($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['syndicationControllerGetErrors'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList';
        $request = $this->syndicationControllerGetErrorsRequest($itemsPerPage, $page, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'syndicationControllerGetErrors'
     *
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerGetErrors'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function syndicationControllerGetErrorsRequest($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['syndicationControllerGetErrors'][0])
    {




        $resourcePath = '/sync-core/syndication/errors';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation syndicationControllerItem
     *
     * @param  string $id id (required)
     * @param  string $includeUsage includeUsage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage
     */
    public function syndicationControllerItem($id, $includeUsage = null, string $contentType = self::contentTypes['syndicationControllerItem'][0])
    {
        list($response) = $this->syndicationControllerItemWithHttpInfo($id, $includeUsage, $contentType);
        return $response;
    }

    /**
     * Operation syndicationControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $includeUsage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage, HTTP status code, HTTP response headers (array of strings)
     */
    public function syndicationControllerItemWithHttpInfo($id, $includeUsage = null, string $contentType = self::contentTypes['syndicationControllerItem'][0])
    {
        $request = $this->syndicationControllerItemRequest($id, $includeUsage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation syndicationControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $includeUsage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerItemAsync($id, $includeUsage = null, string $contentType = self::contentTypes['syndicationControllerItem'][0])
    {
        return $this->syndicationControllerItemAsyncWithHttpInfo($id, $includeUsage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation syndicationControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $includeUsage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerItemAsyncWithHttpInfo($id, $includeUsage = null, string $contentType = self::contentTypes['syndicationControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage';
        $request = $this->syndicationControllerItemRequest($id, $includeUsage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'syndicationControllerItem'
     *
     * @param  string $id (required)
     * @param  string $includeUsage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function syndicationControllerItemRequest($id, $includeUsage = null, string $contentType = self::contentTypes['syndicationControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling syndicationControllerItem'
            );
        }



        $resourcePath = '/sync-core/syndication/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $includeUsage,
            'includeUsage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation syndicationControllerList
     *
     * @param  string $isCloning isCloning (optional)
     * @param  string $domains domains (optional)
     * @param  string $scopes scopes (optional)
     * @param  string $types types (optional)
     * @param  string $isRegularSyndication isRegularSyndication (optional)
     * @param  string $isUpdate isUpdate (optional)
     * @param  string $statuses statuses (optional)
     * @param  string $migrationId migrationId (optional)
     * @param  string $includeUsage includeUsage (optional)
     * @param  string $sourceSyndicationId sourceSyndicationId (optional)
     * @param  string $flowMachineNames flowMachineNames (optional)
     * @param  string $flowIds flowIds (optional)
     * @param  string $poolMachineNames poolMachineNames (optional)
     * @param  string $poolIds poolIds (optional)
     * @param  string $siteUuids siteUuids (optional)
     * @param  string $siteIds siteIds (optional)
     * @param  string $entityRemoteUniqueIds entityRemoteUniqueIds (optional)
     * @param  string $entityRemoteUuids entityRemoteUuids (optional)
     * @param  string $entityIds entityIds (optional)
     * @param  string $groupBy groupBy (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList
     */
    public function syndicationControllerList($isCloning = null, $domains = null, $scopes = null, $types = null, $isRegularSyndication = null, $isUpdate = null, $statuses = null, $migrationId = null, $includeUsage = null, $sourceSyndicationId = null, $flowMachineNames = null, $flowIds = null, $poolMachineNames = null, $poolIds = null, $siteUuids = null, $siteIds = null, $entityRemoteUniqueIds = null, $entityRemoteUuids = null, $entityIds = null, $groupBy = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['syndicationControllerList'][0])
    {
        list($response) = $this->syndicationControllerListWithHttpInfo($isCloning, $domains, $scopes, $types, $isRegularSyndication, $isUpdate, $statuses, $migrationId, $includeUsage, $sourceSyndicationId, $flowMachineNames, $flowIds, $poolMachineNames, $poolIds, $siteUuids, $siteIds, $entityRemoteUniqueIds, $entityRemoteUuids, $entityIds, $groupBy, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation syndicationControllerListWithHttpInfo
     *
     * @param  string $isCloning (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $types (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $isUpdate (optional)
     * @param  string $statuses (optional)
     * @param  string $migrationId (optional)
     * @param  string $includeUsage (optional)
     * @param  string $sourceSyndicationId (optional)
     * @param  string $flowMachineNames (optional)
     * @param  string $flowIds (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $poolIds (optional)
     * @param  string $siteUuids (optional)
     * @param  string $siteIds (optional)
     * @param  string $entityRemoteUniqueIds (optional)
     * @param  string $entityRemoteUuids (optional)
     * @param  string $entityIds (optional)
     * @param  string $groupBy (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList, HTTP status code, HTTP response headers (array of strings)
     */
    public function syndicationControllerListWithHttpInfo($isCloning = null, $domains = null, $scopes = null, $types = null, $isRegularSyndication = null, $isUpdate = null, $statuses = null, $migrationId = null, $includeUsage = null, $sourceSyndicationId = null, $flowMachineNames = null, $flowIds = null, $poolMachineNames = null, $poolIds = null, $siteUuids = null, $siteIds = null, $entityRemoteUniqueIds = null, $entityRemoteUuids = null, $entityIds = null, $groupBy = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['syndicationControllerList'][0])
    {
        $request = $this->syndicationControllerListRequest($isCloning, $domains, $scopes, $types, $isRegularSyndication, $isUpdate, $statuses, $migrationId, $includeUsage, $sourceSyndicationId, $flowMachineNames, $flowIds, $poolMachineNames, $poolIds, $siteUuids, $siteIds, $entityRemoteUniqueIds, $entityRemoteUuids, $entityIds, $groupBy, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation syndicationControllerListAsync
     *
     * @param  string $isCloning (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $types (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $isUpdate (optional)
     * @param  string $statuses (optional)
     * @param  string $migrationId (optional)
     * @param  string $includeUsage (optional)
     * @param  string $sourceSyndicationId (optional)
     * @param  string $flowMachineNames (optional)
     * @param  string $flowIds (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $poolIds (optional)
     * @param  string $siteUuids (optional)
     * @param  string $siteIds (optional)
     * @param  string $entityRemoteUniqueIds (optional)
     * @param  string $entityRemoteUuids (optional)
     * @param  string $entityIds (optional)
     * @param  string $groupBy (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerListAsync($isCloning = null, $domains = null, $scopes = null, $types = null, $isRegularSyndication = null, $isUpdate = null, $statuses = null, $migrationId = null, $includeUsage = null, $sourceSyndicationId = null, $flowMachineNames = null, $flowIds = null, $poolMachineNames = null, $poolIds = null, $siteUuids = null, $siteIds = null, $entityRemoteUniqueIds = null, $entityRemoteUuids = null, $entityIds = null, $groupBy = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['syndicationControllerList'][0])
    {
        return $this->syndicationControllerListAsyncWithHttpInfo($isCloning, $domains, $scopes, $types, $isRegularSyndication, $isUpdate, $statuses, $migrationId, $includeUsage, $sourceSyndicationId, $flowMachineNames, $flowIds, $poolMachineNames, $poolIds, $siteUuids, $siteIds, $entityRemoteUniqueIds, $entityRemoteUuids, $entityIds, $groupBy, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation syndicationControllerListAsyncWithHttpInfo
     *
     * @param  string $isCloning (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $types (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $isUpdate (optional)
     * @param  string $statuses (optional)
     * @param  string $migrationId (optional)
     * @param  string $includeUsage (optional)
     * @param  string $sourceSyndicationId (optional)
     * @param  string $flowMachineNames (optional)
     * @param  string $flowIds (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $poolIds (optional)
     * @param  string $siteUuids (optional)
     * @param  string $siteIds (optional)
     * @param  string $entityRemoteUniqueIds (optional)
     * @param  string $entityRemoteUuids (optional)
     * @param  string $entityIds (optional)
     * @param  string $groupBy (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerListAsyncWithHttpInfo($isCloning = null, $domains = null, $scopes = null, $types = null, $isRegularSyndication = null, $isUpdate = null, $statuses = null, $migrationId = null, $includeUsage = null, $sourceSyndicationId = null, $flowMachineNames = null, $flowIds = null, $poolMachineNames = null, $poolIds = null, $siteUuids = null, $siteIds = null, $entityRemoteUniqueIds = null, $entityRemoteUuids = null, $entityIds = null, $groupBy = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['syndicationControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList';
        $request = $this->syndicationControllerListRequest($isCloning, $domains, $scopes, $types, $isRegularSyndication, $isUpdate, $statuses, $migrationId, $includeUsage, $sourceSyndicationId, $flowMachineNames, $flowIds, $poolMachineNames, $poolIds, $siteUuids, $siteIds, $entityRemoteUniqueIds, $entityRemoteUuids, $entityIds, $groupBy, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'syndicationControllerList'
     *
     * @param  string $isCloning (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $types (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $isUpdate (optional)
     * @param  string $statuses (optional)
     * @param  string $migrationId (optional)
     * @param  string $includeUsage (optional)
     * @param  string $sourceSyndicationId (optional)
     * @param  string $flowMachineNames (optional)
     * @param  string $flowIds (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $poolIds (optional)
     * @param  string $siteUuids (optional)
     * @param  string $siteIds (optional)
     * @param  string $entityRemoteUniqueIds (optional)
     * @param  string $entityRemoteUuids (optional)
     * @param  string $entityIds (optional)
     * @param  string $groupBy (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function syndicationControllerListRequest($isCloning = null, $domains = null, $scopes = null, $types = null, $isRegularSyndication = null, $isUpdate = null, $statuses = null, $migrationId = null, $includeUsage = null, $sourceSyndicationId = null, $flowMachineNames = null, $flowIds = null, $poolMachineNames = null, $poolIds = null, $siteUuids = null, $siteIds = null, $entityRemoteUniqueIds = null, $entityRemoteUuids = null, $entityIds = null, $groupBy = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['syndicationControllerList'][0])
    {
























        $resourcePath = '/sync-core/syndication';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $isCloning,
            'isCloning', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $domains,
            'domains', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $scopes,
            'scopes', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $types,
            'types', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $isRegularSyndication,
            'isRegularSyndication', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $isUpdate,
            'isUpdate', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $statuses,
            'statuses', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $migrationId,
            'migrationId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $includeUsage,
            'includeUsage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $sourceSyndicationId,
            'sourceSyndicationId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $flowMachineNames,
            'flowMachineNames', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $flowIds,
            'flowIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $poolMachineNames,
            'poolMachineNames', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $poolIds,
            'poolIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $siteUuids,
            'siteUuids', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $siteIds,
            'siteIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityRemoteUniqueIds,
            'entityRemoteUniqueIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityRemoteUuids,
            'entityRemoteUuids', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityIds,
            'entityIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $groupBy,
            'groupBy', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation syndicationControllerRestart
     *
     * @param  string $id id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationRetryRequest $syndicationRetryRequest syndicationRetryRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerRestart'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity
     */
    public function syndicationControllerRestart($id, $syndicationRetryRequest, string $contentType = self::contentTypes['syndicationControllerRestart'][0])
    {
        list($response) = $this->syndicationControllerRestartWithHttpInfo($id, $syndicationRetryRequest, $contentType);
        return $response;
    }

    /**
     * Operation syndicationControllerRestartWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationRetryRequest $syndicationRetryRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerRestart'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function syndicationControllerRestartWithHttpInfo($id, $syndicationRetryRequest, string $contentType = self::contentTypes['syndicationControllerRestart'][0])
    {
        $request = $this->syndicationControllerRestartRequest($id, $syndicationRetryRequest, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation syndicationControllerRestartAsync
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationRetryRequest $syndicationRetryRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerRestart'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerRestartAsync($id, $syndicationRetryRequest, string $contentType = self::contentTypes['syndicationControllerRestart'][0])
    {
        return $this->syndicationControllerRestartAsyncWithHttpInfo($id, $syndicationRetryRequest, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation syndicationControllerRestartAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationRetryRequest $syndicationRetryRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerRestart'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerRestartAsyncWithHttpInfo($id, $syndicationRetryRequest, string $contentType = self::contentTypes['syndicationControllerRestart'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity';
        $request = $this->syndicationControllerRestartRequest($id, $syndicationRetryRequest, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'syndicationControllerRestart'
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationRetryRequest $syndicationRetryRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerRestart'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function syndicationControllerRestartRequest($id, $syndicationRetryRequest, string $contentType = self::contentTypes['syndicationControllerRestart'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling syndicationControllerRestart'
            );
        }

        // verify the required parameter 'syndicationRetryRequest' is set
        if ($syndicationRetryRequest === null || (is_array($syndicationRetryRequest) && count($syndicationRetryRequest) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $syndicationRetryRequest when calling syndicationControllerRestart'
            );
        }


        $resourcePath = '/sync-core/syndication/{id}/restart';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($syndicationRetryRequest)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($syndicationRetryRequest));
            } else {
                $httpBody = $syndicationRetryRequest;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation syndicationControllerRestartOperation
     *
     * @param  string $id id (required)
     * @param  float $operationIndex operationIndex (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerRestartOperation'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity
     */
    public function syndicationControllerRestartOperation($id, $operationIndex, string $contentType = self::contentTypes['syndicationControllerRestartOperation'][0])
    {
        list($response) = $this->syndicationControllerRestartOperationWithHttpInfo($id, $operationIndex, $contentType);
        return $response;
    }

    /**
     * Operation syndicationControllerRestartOperationWithHttpInfo
     *
     * @param  string $id (required)
     * @param  float $operationIndex (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerRestartOperation'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function syndicationControllerRestartOperationWithHttpInfo($id, $operationIndex, string $contentType = self::contentTypes['syndicationControllerRestartOperation'][0])
    {
        $request = $this->syndicationControllerRestartOperationRequest($id, $operationIndex, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation syndicationControllerRestartOperationAsync
     *
     * @param  string $id (required)
     * @param  float $operationIndex (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerRestartOperation'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerRestartOperationAsync($id, $operationIndex, string $contentType = self::contentTypes['syndicationControllerRestartOperation'][0])
    {
        return $this->syndicationControllerRestartOperationAsyncWithHttpInfo($id, $operationIndex, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation syndicationControllerRestartOperationAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  float $operationIndex (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerRestartOperation'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerRestartOperationAsyncWithHttpInfo($id, $operationIndex, string $contentType = self::contentTypes['syndicationControllerRestartOperation'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity';
        $request = $this->syndicationControllerRestartOperationRequest($id, $operationIndex, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'syndicationControllerRestartOperation'
     *
     * @param  string $id (required)
     * @param  float $operationIndex (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerRestartOperation'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function syndicationControllerRestartOperationRequest($id, $operationIndex, string $contentType = self::contentTypes['syndicationControllerRestartOperation'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling syndicationControllerRestartOperation'
            );
        }

        // verify the required parameter 'operationIndex' is set
        if ($operationIndex === null || (is_array($operationIndex) && count($operationIndex) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $operationIndex when calling syndicationControllerRestartOperation'
            );
        }


        $resourcePath = '/sync-core/syndication/{id}/restart-operation/{operationIndex}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }
        // path params
        if ($operationIndex !== null) {
            $resourcePath = str_replace(
                '{' . 'operationIndex' . '}',
                ObjectSerializer::toPathValue($operationIndex),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation syndicationControllerTrace
     *
     * @param  string $id id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationTraceRequest $syndicationTraceRequest syndicationTraceRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerTrace'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function syndicationControllerTrace($id, $syndicationTraceRequest, string $contentType = self::contentTypes['syndicationControllerTrace'][0])
    {
        list($response) = $this->syndicationControllerTraceWithHttpInfo($id, $syndicationTraceRequest, $contentType);
        return $response;
    }

    /**
     * Operation syndicationControllerTraceWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationTraceRequest $syndicationTraceRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerTrace'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function syndicationControllerTraceWithHttpInfo($id, $syndicationTraceRequest, string $contentType = self::contentTypes['syndicationControllerTrace'][0])
    {
        $request = $this->syndicationControllerTraceRequest($id, $syndicationTraceRequest, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation syndicationControllerTraceAsync
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationTraceRequest $syndicationTraceRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerTrace'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerTraceAsync($id, $syndicationTraceRequest, string $contentType = self::contentTypes['syndicationControllerTrace'][0])
    {
        return $this->syndicationControllerTraceAsyncWithHttpInfo($id, $syndicationTraceRequest, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation syndicationControllerTraceAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationTraceRequest $syndicationTraceRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerTrace'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerTraceAsyncWithHttpInfo($id, $syndicationTraceRequest, string $contentType = self::contentTypes['syndicationControllerTrace'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->syndicationControllerTraceRequest($id, $syndicationTraceRequest, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'syndicationControllerTrace'
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationTraceRequest $syndicationTraceRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerTrace'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function syndicationControllerTraceRequest($id, $syndicationTraceRequest, string $contentType = self::contentTypes['syndicationControllerTrace'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling syndicationControllerTrace'
            );
        }

        // verify the required parameter 'syndicationTraceRequest' is set
        if ($syndicationTraceRequest === null || (is_array($syndicationTraceRequest) && count($syndicationTraceRequest) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $syndicationTraceRequest when calling syndicationControllerTrace'
            );
        }


        $resourcePath = '/sync-core/syndication/{id}/trace';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($syndicationTraceRequest)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($syndicationTraceRequest));
            } else {
                $httpBody = $syndicationTraceRequest;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation syndicationControllerUsageSummary
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerUsageSummary'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary
     */
    public function syndicationControllerUsageSummary($id, string $contentType = self::contentTypes['syndicationControllerUsageSummary'][0])
    {
        list($response) = $this->syndicationControllerUsageSummaryWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation syndicationControllerUsageSummaryWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerUsageSummary'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary, HTTP status code, HTTP response headers (array of strings)
     */
    public function syndicationControllerUsageSummaryWithHttpInfo($id, string $contentType = self::contentTypes['syndicationControllerUsageSummary'][0])
    {
        $request = $this->syndicationControllerUsageSummaryRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation syndicationControllerUsageSummaryAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerUsageSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerUsageSummaryAsync($id, string $contentType = self::contentTypes['syndicationControllerUsageSummary'][0])
    {
        return $this->syndicationControllerUsageSummaryAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation syndicationControllerUsageSummaryAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerUsageSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerUsageSummaryAsyncWithHttpInfo($id, string $contentType = self::contentTypes['syndicationControllerUsageSummary'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary';
        $request = $this->syndicationControllerUsageSummaryRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'syndicationControllerUsageSummary'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerUsageSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function syndicationControllerUsageSummaryRequest($id, string $contentType = self::contentTypes['syndicationControllerUsageSummary'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling syndicationControllerUsageSummary'
            );
        }


        $resourcePath = '/sync-core/syndication/usage-summary/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation syndicationControllerUsageSummaryForSite
     *
     * @param  string $siteUuid siteUuid (required)
     * @param  string $remoteUuid remoteUuid (optional)
     * @param  string $targetRemoteUuid targetRemoteUuid (optional)
     * @param  string $remoteUniqueId remoteUniqueId (optional)
     * @param  string $namespaceMachineName namespaceMachineName (optional)
     * @param  string $machineName machineName (optional)
     * @param  string $isCloning isCloning (optional)
     * @param  string $isRegularSyndication isRegularSyndication (optional)
     * @param  string $includingMigrations includingMigrations (optional)
     * @param  string $separateUntil separateUntil (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerUsageSummaryForSite'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse
     */
    public function syndicationControllerUsageSummaryForSite($siteUuid, $remoteUuid = null, $targetRemoteUuid = null, $remoteUniqueId = null, $namespaceMachineName = null, $machineName = null, $isCloning = null, $isRegularSyndication = null, $includingMigrations = null, $separateUntil = null, string $contentType = self::contentTypes['syndicationControllerUsageSummaryForSite'][0])
    {
        list($response) = $this->syndicationControllerUsageSummaryForSiteWithHttpInfo($siteUuid, $remoteUuid, $targetRemoteUuid, $remoteUniqueId, $namespaceMachineName, $machineName, $isCloning, $isRegularSyndication, $includingMigrations, $separateUntil, $contentType);
        return $response;
    }

    /**
     * Operation syndicationControllerUsageSummaryForSiteWithHttpInfo
     *
     * @param  string $siteUuid (required)
     * @param  string $remoteUuid (optional)
     * @param  string $targetRemoteUuid (optional)
     * @param  string $remoteUniqueId (optional)
     * @param  string $namespaceMachineName (optional)
     * @param  string $machineName (optional)
     * @param  string $isCloning (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $includingMigrations (optional)
     * @param  string $separateUntil (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerUsageSummaryForSite'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function syndicationControllerUsageSummaryForSiteWithHttpInfo($siteUuid, $remoteUuid = null, $targetRemoteUuid = null, $remoteUniqueId = null, $namespaceMachineName = null, $machineName = null, $isCloning = null, $isRegularSyndication = null, $includingMigrations = null, $separateUntil = null, string $contentType = self::contentTypes['syndicationControllerUsageSummaryForSite'][0])
    {
        $request = $this->syndicationControllerUsageSummaryForSiteRequest($siteUuid, $remoteUuid, $targetRemoteUuid, $remoteUniqueId, $namespaceMachineName, $machineName, $isCloning, $isRegularSyndication, $includingMigrations, $separateUntil, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation syndicationControllerUsageSummaryForSiteAsync
     *
     * @param  string $siteUuid (required)
     * @param  string $remoteUuid (optional)
     * @param  string $targetRemoteUuid (optional)
     * @param  string $remoteUniqueId (optional)
     * @param  string $namespaceMachineName (optional)
     * @param  string $machineName (optional)
     * @param  string $isCloning (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $includingMigrations (optional)
     * @param  string $separateUntil (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerUsageSummaryForSite'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerUsageSummaryForSiteAsync($siteUuid, $remoteUuid = null, $targetRemoteUuid = null, $remoteUniqueId = null, $namespaceMachineName = null, $machineName = null, $isCloning = null, $isRegularSyndication = null, $includingMigrations = null, $separateUntil = null, string $contentType = self::contentTypes['syndicationControllerUsageSummaryForSite'][0])
    {
        return $this->syndicationControllerUsageSummaryForSiteAsyncWithHttpInfo($siteUuid, $remoteUuid, $targetRemoteUuid, $remoteUniqueId, $namespaceMachineName, $machineName, $isCloning, $isRegularSyndication, $includingMigrations, $separateUntil, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation syndicationControllerUsageSummaryForSiteAsyncWithHttpInfo
     *
     * @param  string $siteUuid (required)
     * @param  string $remoteUuid (optional)
     * @param  string $targetRemoteUuid (optional)
     * @param  string $remoteUniqueId (optional)
     * @param  string $namespaceMachineName (optional)
     * @param  string $machineName (optional)
     * @param  string $isCloning (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $includingMigrations (optional)
     * @param  string $separateUntil (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerUsageSummaryForSite'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function syndicationControllerUsageSummaryForSiteAsyncWithHttpInfo($siteUuid, $remoteUuid = null, $targetRemoteUuid = null, $remoteUniqueId = null, $namespaceMachineName = null, $machineName = null, $isCloning = null, $isRegularSyndication = null, $includingMigrations = null, $separateUntil = null, string $contentType = self::contentTypes['syndicationControllerUsageSummaryForSite'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse';
        $request = $this->syndicationControllerUsageSummaryForSiteRequest($siteUuid, $remoteUuid, $targetRemoteUuid, $remoteUniqueId, $namespaceMachineName, $machineName, $isCloning, $isRegularSyndication, $includingMigrations, $separateUntil, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'syndicationControllerUsageSummaryForSite'
     *
     * @param  string $siteUuid (required)
     * @param  string $remoteUuid (optional)
     * @param  string $targetRemoteUuid (optional)
     * @param  string $remoteUniqueId (optional)
     * @param  string $namespaceMachineName (optional)
     * @param  string $machineName (optional)
     * @param  string $isCloning (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $includingMigrations (optional)
     * @param  string $separateUntil (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['syndicationControllerUsageSummaryForSite'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function syndicationControllerUsageSummaryForSiteRequest($siteUuid, $remoteUuid = null, $targetRemoteUuid = null, $remoteUniqueId = null, $namespaceMachineName = null, $machineName = null, $isCloning = null, $isRegularSyndication = null, $includingMigrations = null, $separateUntil = null, string $contentType = self::contentTypes['syndicationControllerUsageSummaryForSite'][0])
    {

        // verify the required parameter 'siteUuid' is set
        if ($siteUuid === null || (is_array($siteUuid) && count($siteUuid) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $siteUuid when calling syndicationControllerUsageSummaryForSite'
            );
        }











        $resourcePath = '/sync-core/syndication/usage-summary-for-site/{siteUuid}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $remoteUuid,
            'remoteUuid', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $targetRemoteUuid,
            'targetRemoteUuid', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $remoteUniqueId,
            'remoteUniqueId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $namespaceMachineName,
            'namespaceMachineName', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $machineName,
            'machineName', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $isCloning,
            'isCloning', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $isRegularSyndication,
            'isRegularSyndication', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $includingMigrations,
            'includingMigrations', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $separateUntil,
            'separateUntil', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($siteUuid !== null) {
            $resourcePath = str_replace(
                '{' . 'siteUuid' . '}',
                ObjectSerializer::toPathValue($siteUuid),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskDto $createTaskDto createTaskDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity
     */
    public function taskControllerCreate($createTaskDto, string $contentType = self::contentTypes['taskControllerCreate'][0])
    {
        list($response) = $this->taskControllerCreateWithHttpInfo($createTaskDto, $contentType);
        return $response;
    }

    /**
     * Operation taskControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskDto $createTaskDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taskControllerCreateWithHttpInfo($createTaskDto, string $contentType = self::contentTypes['taskControllerCreate'][0])
    {
        $request = $this->taskControllerCreateRequest($createTaskDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskDto $createTaskDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerCreateAsync($createTaskDto, string $contentType = self::contentTypes['taskControllerCreate'][0])
    {
        return $this->taskControllerCreateAsyncWithHttpInfo($createTaskDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskDto $createTaskDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerCreateAsyncWithHttpInfo($createTaskDto, string $contentType = self::contentTypes['taskControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity';
        $request = $this->taskControllerCreateRequest($createTaskDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskDto $createTaskDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskControllerCreateRequest($createTaskDto, string $contentType = self::contentTypes['taskControllerCreate'][0])
    {

        // verify the required parameter 'createTaskDto' is set
        if ($createTaskDto === null || (is_array($createTaskDto) && count($createTaskDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createTaskDto when calling taskControllerCreate'
            );
        }


        $resourcePath = '/sync-core/task';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createTaskDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createTaskDto));
            } else {
                $httpBody = $createTaskDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskControllerDelete
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationDeleteRequest $syndicationDeleteRequest syndicationDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerDelete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[]
     */
    public function taskControllerDelete($syndicationDeleteRequest, string $contentType = self::contentTypes['taskControllerDelete'][0])
    {
        list($response) = $this->taskControllerDeleteWithHttpInfo($syndicationDeleteRequest, $contentType);
        return $response;
    }

    /**
     * Operation taskControllerDeleteWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationDeleteRequest $syndicationDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerDelete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[], HTTP status code, HTTP response headers (array of strings)
     */
    public function taskControllerDeleteWithHttpInfo($syndicationDeleteRequest, string $contentType = self::contentTypes['taskControllerDelete'][0])
    {
        $request = $this->taskControllerDeleteRequest($syndicationDeleteRequest, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[]' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[]' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[]', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[]';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[]',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskControllerDeleteAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationDeleteRequest $syndicationDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerDeleteAsync($syndicationDeleteRequest, string $contentType = self::contentTypes['taskControllerDelete'][0])
    {
        return $this->taskControllerDeleteAsyncWithHttpInfo($syndicationDeleteRequest, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskControllerDeleteAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationDeleteRequest $syndicationDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerDeleteAsyncWithHttpInfo($syndicationDeleteRequest, string $contentType = self::contentTypes['taskControllerDelete'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity[]';
        $request = $this->taskControllerDeleteRequest($syndicationDeleteRequest, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskControllerDelete'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationDeleteRequest $syndicationDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskControllerDeleteRequest($syndicationDeleteRequest, string $contentType = self::contentTypes['taskControllerDelete'][0])
    {

        // verify the required parameter 'syndicationDeleteRequest' is set
        if ($syndicationDeleteRequest === null || (is_array($syndicationDeleteRequest) && count($syndicationDeleteRequest) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $syndicationDeleteRequest when calling taskControllerDelete'
            );
        }


        $resourcePath = '/sync-core/task';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($syndicationDeleteRequest)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($syndicationDeleteRequest));
            } else {
                $httpBody = $syndicationDeleteRequest;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'DELETE',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskControllerGetErrors
     *
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $page page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerGetErrors'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList
     */
    public function taskControllerGetErrors($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['taskControllerGetErrors'][0])
    {
        list($response) = $this->taskControllerGetErrorsWithHttpInfo($itemsPerPage, $page, $contentType);
        return $response;
    }

    /**
     * Operation taskControllerGetErrorsWithHttpInfo
     *
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerGetErrors'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList, HTTP status code, HTTP response headers (array of strings)
     */
    public function taskControllerGetErrorsWithHttpInfo($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['taskControllerGetErrors'][0])
    {
        $request = $this->taskControllerGetErrorsRequest($itemsPerPage, $page, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskControllerGetErrorsAsync
     *
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerGetErrors'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerGetErrorsAsync($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['taskControllerGetErrors'][0])
    {
        return $this->taskControllerGetErrorsAsyncWithHttpInfo($itemsPerPage, $page, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskControllerGetErrorsAsyncWithHttpInfo
     *
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerGetErrors'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerGetErrorsAsyncWithHttpInfo($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['taskControllerGetErrors'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationErrorList';
        $request = $this->taskControllerGetErrorsRequest($itemsPerPage, $page, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskControllerGetErrors'
     *
     * @param  string $itemsPerPage (optional)
     * @param  string $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerGetErrors'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskControllerGetErrorsRequest($itemsPerPage = null, $page = null, string $contentType = self::contentTypes['taskControllerGetErrors'][0])
    {




        $resourcePath = '/sync-core/task/errors';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskControllerItem
     *
     * @param  string $id id (required)
     * @param  string $includeUsage includeUsage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage
     */
    public function taskControllerItem($id, $includeUsage = null, string $contentType = self::contentTypes['taskControllerItem'][0])
    {
        list($response) = $this->taskControllerItemWithHttpInfo($id, $includeUsage, $contentType);
        return $response;
    }

    /**
     * Operation taskControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $includeUsage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage, HTTP status code, HTTP response headers (array of strings)
     */
    public function taskControllerItemWithHttpInfo($id, $includeUsage = null, string $contentType = self::contentTypes['taskControllerItem'][0])
    {
        $request = $this->taskControllerItemRequest($id, $includeUsage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $includeUsage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerItemAsync($id, $includeUsage = null, string $contentType = self::contentTypes['taskControllerItem'][0])
    {
        return $this->taskControllerItemAsyncWithHttpInfo($id, $includeUsage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $includeUsage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerItemAsyncWithHttpInfo($id, $includeUsage = null, string $contentType = self::contentTypes['taskControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationEntityWithUsage';
        $request = $this->taskControllerItemRequest($id, $includeUsage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskControllerItem'
     *
     * @param  string $id (required)
     * @param  string $includeUsage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskControllerItemRequest($id, $includeUsage = null, string $contentType = self::contentTypes['taskControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling taskControllerItem'
            );
        }



        $resourcePath = '/sync-core/task/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $includeUsage,
            'includeUsage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskControllerList
     *
     * @param  string $isCloning isCloning (optional)
     * @param  string $domains domains (optional)
     * @param  string $scopes scopes (optional)
     * @param  string $types types (optional)
     * @param  string $isRegularSyndication isRegularSyndication (optional)
     * @param  string $isUpdate isUpdate (optional)
     * @param  string $statuses statuses (optional)
     * @param  string $migrationId migrationId (optional)
     * @param  string $includeUsage includeUsage (optional)
     * @param  string $sourceSyndicationId sourceSyndicationId (optional)
     * @param  string $flowMachineNames flowMachineNames (optional)
     * @param  string $flowIds flowIds (optional)
     * @param  string $poolMachineNames poolMachineNames (optional)
     * @param  string $poolIds poolIds (optional)
     * @param  string $siteUuids siteUuids (optional)
     * @param  string $siteIds siteIds (optional)
     * @param  string $entityRemoteUniqueIds entityRemoteUniqueIds (optional)
     * @param  string $entityRemoteUuids entityRemoteUuids (optional)
     * @param  string $entityIds entityIds (optional)
     * @param  string $groupBy groupBy (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList
     */
    public function taskControllerList($isCloning = null, $domains = null, $scopes = null, $types = null, $isRegularSyndication = null, $isUpdate = null, $statuses = null, $migrationId = null, $includeUsage = null, $sourceSyndicationId = null, $flowMachineNames = null, $flowIds = null, $poolMachineNames = null, $poolIds = null, $siteUuids = null, $siteIds = null, $entityRemoteUniqueIds = null, $entityRemoteUuids = null, $entityIds = null, $groupBy = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taskControllerList'][0])
    {
        list($response) = $this->taskControllerListWithHttpInfo($isCloning, $domains, $scopes, $types, $isRegularSyndication, $isUpdate, $statuses, $migrationId, $includeUsage, $sourceSyndicationId, $flowMachineNames, $flowIds, $poolMachineNames, $poolIds, $siteUuids, $siteIds, $entityRemoteUniqueIds, $entityRemoteUuids, $entityIds, $groupBy, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation taskControllerListWithHttpInfo
     *
     * @param  string $isCloning (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $types (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $isUpdate (optional)
     * @param  string $statuses (optional)
     * @param  string $migrationId (optional)
     * @param  string $includeUsage (optional)
     * @param  string $sourceSyndicationId (optional)
     * @param  string $flowMachineNames (optional)
     * @param  string $flowIds (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $poolIds (optional)
     * @param  string $siteUuids (optional)
     * @param  string $siteIds (optional)
     * @param  string $entityRemoteUniqueIds (optional)
     * @param  string $entityRemoteUuids (optional)
     * @param  string $entityIds (optional)
     * @param  string $groupBy (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList, HTTP status code, HTTP response headers (array of strings)
     */
    public function taskControllerListWithHttpInfo($isCloning = null, $domains = null, $scopes = null, $types = null, $isRegularSyndication = null, $isUpdate = null, $statuses = null, $migrationId = null, $includeUsage = null, $sourceSyndicationId = null, $flowMachineNames = null, $flowIds = null, $poolMachineNames = null, $poolIds = null, $siteUuids = null, $siteIds = null, $entityRemoteUniqueIds = null, $entityRemoteUuids = null, $entityIds = null, $groupBy = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taskControllerList'][0])
    {
        $request = $this->taskControllerListRequest($isCloning, $domains, $scopes, $types, $isRegularSyndication, $isUpdate, $statuses, $migrationId, $includeUsage, $sourceSyndicationId, $flowMachineNames, $flowIds, $poolMachineNames, $poolIds, $siteUuids, $siteIds, $entityRemoteUniqueIds, $entityRemoteUuids, $entityIds, $groupBy, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskControllerListAsync
     *
     * @param  string $isCloning (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $types (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $isUpdate (optional)
     * @param  string $statuses (optional)
     * @param  string $migrationId (optional)
     * @param  string $includeUsage (optional)
     * @param  string $sourceSyndicationId (optional)
     * @param  string $flowMachineNames (optional)
     * @param  string $flowIds (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $poolIds (optional)
     * @param  string $siteUuids (optional)
     * @param  string $siteIds (optional)
     * @param  string $entityRemoteUniqueIds (optional)
     * @param  string $entityRemoteUuids (optional)
     * @param  string $entityIds (optional)
     * @param  string $groupBy (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerListAsync($isCloning = null, $domains = null, $scopes = null, $types = null, $isRegularSyndication = null, $isUpdate = null, $statuses = null, $migrationId = null, $includeUsage = null, $sourceSyndicationId = null, $flowMachineNames = null, $flowIds = null, $poolMachineNames = null, $poolIds = null, $siteUuids = null, $siteIds = null, $entityRemoteUniqueIds = null, $entityRemoteUuids = null, $entityIds = null, $groupBy = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taskControllerList'][0])
    {
        return $this->taskControllerListAsyncWithHttpInfo($isCloning, $domains, $scopes, $types, $isRegularSyndication, $isUpdate, $statuses, $migrationId, $includeUsage, $sourceSyndicationId, $flowMachineNames, $flowIds, $poolMachineNames, $poolIds, $siteUuids, $siteIds, $entityRemoteUniqueIds, $entityRemoteUuids, $entityIds, $groupBy, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskControllerListAsyncWithHttpInfo
     *
     * @param  string $isCloning (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $types (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $isUpdate (optional)
     * @param  string $statuses (optional)
     * @param  string $migrationId (optional)
     * @param  string $includeUsage (optional)
     * @param  string $sourceSyndicationId (optional)
     * @param  string $flowMachineNames (optional)
     * @param  string $flowIds (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $poolIds (optional)
     * @param  string $siteUuids (optional)
     * @param  string $siteIds (optional)
     * @param  string $entityRemoteUniqueIds (optional)
     * @param  string $entityRemoteUuids (optional)
     * @param  string $entityIds (optional)
     * @param  string $groupBy (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerListAsyncWithHttpInfo($isCloning = null, $domains = null, $scopes = null, $types = null, $isRegularSyndication = null, $isUpdate = null, $statuses = null, $migrationId = null, $includeUsage = null, $sourceSyndicationId = null, $flowMachineNames = null, $flowIds = null, $poolMachineNames = null, $poolIds = null, $siteUuids = null, $siteIds = null, $entityRemoteUniqueIds = null, $entityRemoteUuids = null, $entityIds = null, $groupBy = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taskControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedSyndicationList';
        $request = $this->taskControllerListRequest($isCloning, $domains, $scopes, $types, $isRegularSyndication, $isUpdate, $statuses, $migrationId, $includeUsage, $sourceSyndicationId, $flowMachineNames, $flowIds, $poolMachineNames, $poolIds, $siteUuids, $siteIds, $entityRemoteUniqueIds, $entityRemoteUuids, $entityIds, $groupBy, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskControllerList'
     *
     * @param  string $isCloning (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $types (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $isUpdate (optional)
     * @param  string $statuses (optional)
     * @param  string $migrationId (optional)
     * @param  string $includeUsage (optional)
     * @param  string $sourceSyndicationId (optional)
     * @param  string $flowMachineNames (optional)
     * @param  string $flowIds (optional)
     * @param  string $poolMachineNames (optional)
     * @param  string $poolIds (optional)
     * @param  string $siteUuids (optional)
     * @param  string $siteIds (optional)
     * @param  string $entityRemoteUniqueIds (optional)
     * @param  string $entityRemoteUuids (optional)
     * @param  string $entityIds (optional)
     * @param  string $groupBy (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskControllerListRequest($isCloning = null, $domains = null, $scopes = null, $types = null, $isRegularSyndication = null, $isUpdate = null, $statuses = null, $migrationId = null, $includeUsage = null, $sourceSyndicationId = null, $flowMachineNames = null, $flowIds = null, $poolMachineNames = null, $poolIds = null, $siteUuids = null, $siteIds = null, $entityRemoteUniqueIds = null, $entityRemoteUuids = null, $entityIds = null, $groupBy = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taskControllerList'][0])
    {
























        $resourcePath = '/sync-core/task';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $isCloning,
            'isCloning', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $domains,
            'domains', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $scopes,
            'scopes', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $types,
            'types', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $isRegularSyndication,
            'isRegularSyndication', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $isUpdate,
            'isUpdate', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $statuses,
            'statuses', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $migrationId,
            'migrationId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $includeUsage,
            'includeUsage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $sourceSyndicationId,
            'sourceSyndicationId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $flowMachineNames,
            'flowMachineNames', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $flowIds,
            'flowIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $poolMachineNames,
            'poolMachineNames', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $poolIds,
            'poolIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $siteUuids,
            'siteUuids', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $siteIds,
            'siteIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityRemoteUniqueIds,
            'entityRemoteUniqueIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityRemoteUuids,
            'entityRemoteUuids', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityIds,
            'entityIds', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $groupBy,
            'groupBy', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskControllerRestart
     *
     * @param  string $id id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationRetryRequest $syndicationRetryRequest syndicationRetryRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerRestart'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity
     */
    public function taskControllerRestart($id, $syndicationRetryRequest, string $contentType = self::contentTypes['taskControllerRestart'][0])
    {
        list($response) = $this->taskControllerRestartWithHttpInfo($id, $syndicationRetryRequest, $contentType);
        return $response;
    }

    /**
     * Operation taskControllerRestartWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationRetryRequest $syndicationRetryRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerRestart'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taskControllerRestartWithHttpInfo($id, $syndicationRetryRequest, string $contentType = self::contentTypes['taskControllerRestart'][0])
    {
        $request = $this->taskControllerRestartRequest($id, $syndicationRetryRequest, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskControllerRestartAsync
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationRetryRequest $syndicationRetryRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerRestart'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerRestartAsync($id, $syndicationRetryRequest, string $contentType = self::contentTypes['taskControllerRestart'][0])
    {
        return $this->taskControllerRestartAsyncWithHttpInfo($id, $syndicationRetryRequest, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskControllerRestartAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationRetryRequest $syndicationRetryRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerRestart'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerRestartAsyncWithHttpInfo($id, $syndicationRetryRequest, string $contentType = self::contentTypes['taskControllerRestart'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity';
        $request = $this->taskControllerRestartRequest($id, $syndicationRetryRequest, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskControllerRestart'
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationRetryRequest $syndicationRetryRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerRestart'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskControllerRestartRequest($id, $syndicationRetryRequest, string $contentType = self::contentTypes['taskControllerRestart'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling taskControllerRestart'
            );
        }

        // verify the required parameter 'syndicationRetryRequest' is set
        if ($syndicationRetryRequest === null || (is_array($syndicationRetryRequest) && count($syndicationRetryRequest) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $syndicationRetryRequest when calling taskControllerRestart'
            );
        }


        $resourcePath = '/sync-core/task/{id}/restart';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($syndicationRetryRequest)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($syndicationRetryRequest));
            } else {
                $httpBody = $syndicationRetryRequest;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskControllerRestartOperation
     *
     * @param  string $id id (required)
     * @param  float $operationIndex operationIndex (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerRestartOperation'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity
     */
    public function taskControllerRestartOperation($id, $operationIndex, string $contentType = self::contentTypes['taskControllerRestartOperation'][0])
    {
        list($response) = $this->taskControllerRestartOperationWithHttpInfo($id, $operationIndex, $contentType);
        return $response;
    }

    /**
     * Operation taskControllerRestartOperationWithHttpInfo
     *
     * @param  string $id (required)
     * @param  float $operationIndex (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerRestartOperation'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taskControllerRestartOperationWithHttpInfo($id, $operationIndex, string $contentType = self::contentTypes['taskControllerRestartOperation'][0])
    {
        $request = $this->taskControllerRestartOperationRequest($id, $operationIndex, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskControllerRestartOperationAsync
     *
     * @param  string $id (required)
     * @param  float $operationIndex (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerRestartOperation'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerRestartOperationAsync($id, $operationIndex, string $contentType = self::contentTypes['taskControllerRestartOperation'][0])
    {
        return $this->taskControllerRestartOperationAsyncWithHttpInfo($id, $operationIndex, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskControllerRestartOperationAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  float $operationIndex (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerRestartOperation'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerRestartOperationAsyncWithHttpInfo($id, $operationIndex, string $contentType = self::contentTypes['taskControllerRestartOperation'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskEntity';
        $request = $this->taskControllerRestartOperationRequest($id, $operationIndex, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskControllerRestartOperation'
     *
     * @param  string $id (required)
     * @param  float $operationIndex (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerRestartOperation'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskControllerRestartOperationRequest($id, $operationIndex, string $contentType = self::contentTypes['taskControllerRestartOperation'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling taskControllerRestartOperation'
            );
        }

        // verify the required parameter 'operationIndex' is set
        if ($operationIndex === null || (is_array($operationIndex) && count($operationIndex) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $operationIndex when calling taskControllerRestartOperation'
            );
        }


        $resourcePath = '/sync-core/task/{id}/restart-operation/{operationIndex}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }
        // path params
        if ($operationIndex !== null) {
            $resourcePath = str_replace(
                '{' . 'operationIndex' . '}',
                ObjectSerializer::toPathValue($operationIndex),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskControllerTrace
     *
     * @param  string $id id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationTraceRequest $syndicationTraceRequest syndicationTraceRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerTrace'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function taskControllerTrace($id, $syndicationTraceRequest, string $contentType = self::contentTypes['taskControllerTrace'][0])
    {
        list($response) = $this->taskControllerTraceWithHttpInfo($id, $syndicationTraceRequest, $contentType);
        return $response;
    }

    /**
     * Operation taskControllerTraceWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationTraceRequest $syndicationTraceRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerTrace'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function taskControllerTraceWithHttpInfo($id, $syndicationTraceRequest, string $contentType = self::contentTypes['taskControllerTrace'][0])
    {
        $request = $this->taskControllerTraceRequest($id, $syndicationTraceRequest, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskControllerTraceAsync
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationTraceRequest $syndicationTraceRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerTrace'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerTraceAsync($id, $syndicationTraceRequest, string $contentType = self::contentTypes['taskControllerTrace'][0])
    {
        return $this->taskControllerTraceAsyncWithHttpInfo($id, $syndicationTraceRequest, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskControllerTraceAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationTraceRequest $syndicationTraceRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerTrace'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerTraceAsyncWithHttpInfo($id, $syndicationTraceRequest, string $contentType = self::contentTypes['taskControllerTrace'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->taskControllerTraceRequest($id, $syndicationTraceRequest, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskControllerTrace'
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\SyndicationTraceRequest $syndicationTraceRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerTrace'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskControllerTraceRequest($id, $syndicationTraceRequest, string $contentType = self::contentTypes['taskControllerTrace'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling taskControllerTrace'
            );
        }

        // verify the required parameter 'syndicationTraceRequest' is set
        if ($syndicationTraceRequest === null || (is_array($syndicationTraceRequest) && count($syndicationTraceRequest) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $syndicationTraceRequest when calling taskControllerTrace'
            );
        }


        $resourcePath = '/sync-core/task/{id}/trace';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($syndicationTraceRequest)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($syndicationTraceRequest));
            } else {
                $httpBody = $syndicationTraceRequest;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskControllerUsageSummary
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerUsageSummary'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary
     */
    public function taskControllerUsageSummary($id, string $contentType = self::contentTypes['taskControllerUsageSummary'][0])
    {
        list($response) = $this->taskControllerUsageSummaryWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation taskControllerUsageSummaryWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerUsageSummary'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary, HTTP status code, HTTP response headers (array of strings)
     */
    public function taskControllerUsageSummaryWithHttpInfo($id, string $contentType = self::contentTypes['taskControllerUsageSummary'][0])
    {
        $request = $this->taskControllerUsageSummaryRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskControllerUsageSummaryAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerUsageSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerUsageSummaryAsync($id, string $contentType = self::contentTypes['taskControllerUsageSummary'][0])
    {
        return $this->taskControllerUsageSummaryAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskControllerUsageSummaryAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerUsageSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerUsageSummaryAsyncWithHttpInfo($id, string $contentType = self::contentTypes['taskControllerUsageSummary'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummary';
        $request = $this->taskControllerUsageSummaryRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskControllerUsageSummary'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerUsageSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskControllerUsageSummaryRequest($id, string $contentType = self::contentTypes['taskControllerUsageSummary'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling taskControllerUsageSummary'
            );
        }


        $resourcePath = '/sync-core/task/usage-summary/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskControllerUsageSummaryForSite
     *
     * @param  string $siteUuid siteUuid (required)
     * @param  string $remoteUuid remoteUuid (optional)
     * @param  string $targetRemoteUuid targetRemoteUuid (optional)
     * @param  string $remoteUniqueId remoteUniqueId (optional)
     * @param  string $namespaceMachineName namespaceMachineName (optional)
     * @param  string $machineName machineName (optional)
     * @param  string $isCloning isCloning (optional)
     * @param  string $isRegularSyndication isRegularSyndication (optional)
     * @param  string $includingMigrations includingMigrations (optional)
     * @param  string $separateUntil separateUntil (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerUsageSummaryForSite'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse
     */
    public function taskControllerUsageSummaryForSite($siteUuid, $remoteUuid = null, $targetRemoteUuid = null, $remoteUniqueId = null, $namespaceMachineName = null, $machineName = null, $isCloning = null, $isRegularSyndication = null, $includingMigrations = null, $separateUntil = null, string $contentType = self::contentTypes['taskControllerUsageSummaryForSite'][0])
    {
        list($response) = $this->taskControllerUsageSummaryForSiteWithHttpInfo($siteUuid, $remoteUuid, $targetRemoteUuid, $remoteUniqueId, $namespaceMachineName, $machineName, $isCloning, $isRegularSyndication, $includingMigrations, $separateUntil, $contentType);
        return $response;
    }

    /**
     * Operation taskControllerUsageSummaryForSiteWithHttpInfo
     *
     * @param  string $siteUuid (required)
     * @param  string $remoteUuid (optional)
     * @param  string $targetRemoteUuid (optional)
     * @param  string $remoteUniqueId (optional)
     * @param  string $namespaceMachineName (optional)
     * @param  string $machineName (optional)
     * @param  string $isCloning (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $includingMigrations (optional)
     * @param  string $separateUntil (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerUsageSummaryForSite'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function taskControllerUsageSummaryForSiteWithHttpInfo($siteUuid, $remoteUuid = null, $targetRemoteUuid = null, $remoteUniqueId = null, $namespaceMachineName = null, $machineName = null, $isCloning = null, $isRegularSyndication = null, $includingMigrations = null, $separateUntil = null, string $contentType = self::contentTypes['taskControllerUsageSummaryForSite'][0])
    {
        $request = $this->taskControllerUsageSummaryForSiteRequest($siteUuid, $remoteUuid, $targetRemoteUuid, $remoteUniqueId, $namespaceMachineName, $machineName, $isCloning, $isRegularSyndication, $includingMigrations, $separateUntil, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskControllerUsageSummaryForSiteAsync
     *
     * @param  string $siteUuid (required)
     * @param  string $remoteUuid (optional)
     * @param  string $targetRemoteUuid (optional)
     * @param  string $remoteUniqueId (optional)
     * @param  string $namespaceMachineName (optional)
     * @param  string $machineName (optional)
     * @param  string $isCloning (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $includingMigrations (optional)
     * @param  string $separateUntil (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerUsageSummaryForSite'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerUsageSummaryForSiteAsync($siteUuid, $remoteUuid = null, $targetRemoteUuid = null, $remoteUniqueId = null, $namespaceMachineName = null, $machineName = null, $isCloning = null, $isRegularSyndication = null, $includingMigrations = null, $separateUntil = null, string $contentType = self::contentTypes['taskControllerUsageSummaryForSite'][0])
    {
        return $this->taskControllerUsageSummaryForSiteAsyncWithHttpInfo($siteUuid, $remoteUuid, $targetRemoteUuid, $remoteUniqueId, $namespaceMachineName, $machineName, $isCloning, $isRegularSyndication, $includingMigrations, $separateUntil, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskControllerUsageSummaryForSiteAsyncWithHttpInfo
     *
     * @param  string $siteUuid (required)
     * @param  string $remoteUuid (optional)
     * @param  string $targetRemoteUuid (optional)
     * @param  string $remoteUniqueId (optional)
     * @param  string $namespaceMachineName (optional)
     * @param  string $machineName (optional)
     * @param  string $isCloning (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $includingMigrations (optional)
     * @param  string $separateUntil (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerUsageSummaryForSite'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskControllerUsageSummaryForSiteAsyncWithHttpInfo($siteUuid, $remoteUuid = null, $targetRemoteUuid = null, $remoteUniqueId = null, $namespaceMachineName = null, $machineName = null, $isCloning = null, $isRegularSyndication = null, $includingMigrations = null, $separateUntil = null, string $contentType = self::contentTypes['taskControllerUsageSummaryForSite'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SyndicationUsageSummaryListResponse';
        $request = $this->taskControllerUsageSummaryForSiteRequest($siteUuid, $remoteUuid, $targetRemoteUuid, $remoteUniqueId, $namespaceMachineName, $machineName, $isCloning, $isRegularSyndication, $includingMigrations, $separateUntil, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskControllerUsageSummaryForSite'
     *
     * @param  string $siteUuid (required)
     * @param  string $remoteUuid (optional)
     * @param  string $targetRemoteUuid (optional)
     * @param  string $remoteUniqueId (optional)
     * @param  string $namespaceMachineName (optional)
     * @param  string $machineName (optional)
     * @param  string $isCloning (optional)
     * @param  string $isRegularSyndication (optional)
     * @param  string $includingMigrations (optional)
     * @param  string $separateUntil (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskControllerUsageSummaryForSite'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskControllerUsageSummaryForSiteRequest($siteUuid, $remoteUuid = null, $targetRemoteUuid = null, $remoteUniqueId = null, $namespaceMachineName = null, $machineName = null, $isCloning = null, $isRegularSyndication = null, $includingMigrations = null, $separateUntil = null, string $contentType = self::contentTypes['taskControllerUsageSummaryForSite'][0])
    {

        // verify the required parameter 'siteUuid' is set
        if ($siteUuid === null || (is_array($siteUuid) && count($siteUuid) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $siteUuid when calling taskControllerUsageSummaryForSite'
            );
        }











        $resourcePath = '/sync-core/task/usage-summary-for-site/{siteUuid}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $remoteUuid,
            'remoteUuid', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $targetRemoteUuid,
            'targetRemoteUuid', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $remoteUniqueId,
            'remoteUniqueId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $namespaceMachineName,
            'namespaceMachineName', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $machineName,
            'machineName', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $isCloning,
            'isCloning', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $isRegularSyndication,
            'isRegularSyndication', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $includingMigrations,
            'includingMigrations', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $separateUntil,
            'separateUntil', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($siteUuid !== null) {
            $resourcePath = str_replace(
                '{' . 'siteUuid' . '}',
                ObjectSerializer::toPathValue($siteUuid),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskGroupControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskGroupDto $createTaskGroupDto createTaskGroupDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity
     */
    public function taskGroupControllerCreate($createTaskGroupDto, string $contentType = self::contentTypes['taskGroupControllerCreate'][0])
    {
        list($response) = $this->taskGroupControllerCreateWithHttpInfo($createTaskGroupDto, $contentType);
        return $response;
    }

    /**
     * Operation taskGroupControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskGroupDto $createTaskGroupDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taskGroupControllerCreateWithHttpInfo($createTaskGroupDto, string $contentType = self::contentTypes['taskGroupControllerCreate'][0])
    {
        $request = $this->taskGroupControllerCreateRequest($createTaskGroupDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskGroupControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskGroupDto $createTaskGroupDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskGroupControllerCreateAsync($createTaskGroupDto, string $contentType = self::contentTypes['taskGroupControllerCreate'][0])
    {
        return $this->taskGroupControllerCreateAsyncWithHttpInfo($createTaskGroupDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskGroupControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskGroupDto $createTaskGroupDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskGroupControllerCreateAsyncWithHttpInfo($createTaskGroupDto, string $contentType = self::contentTypes['taskGroupControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity';
        $request = $this->taskGroupControllerCreateRequest($createTaskGroupDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskGroupControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaskGroupDto $createTaskGroupDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskGroupControllerCreateRequest($createTaskGroupDto, string $contentType = self::contentTypes['taskGroupControllerCreate'][0])
    {

        // verify the required parameter 'createTaskGroupDto' is set
        if ($createTaskGroupDto === null || (is_array($createTaskGroupDto) && count($createTaskGroupDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createTaskGroupDto when calling taskGroupControllerCreate'
            );
        }


        $resourcePath = '/sync-core/task-group';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createTaskGroupDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createTaskGroupDto));
            } else {
                $httpBody = $createTaskGroupDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskGroupControllerDelete
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerDelete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity
     */
    public function taskGroupControllerDelete($id, string $contentType = self::contentTypes['taskGroupControllerDelete'][0])
    {
        list($response) = $this->taskGroupControllerDeleteWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation taskGroupControllerDeleteWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerDelete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taskGroupControllerDeleteWithHttpInfo($id, string $contentType = self::contentTypes['taskGroupControllerDelete'][0])
    {
        $request = $this->taskGroupControllerDeleteRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskGroupControllerDeleteAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskGroupControllerDeleteAsync($id, string $contentType = self::contentTypes['taskGroupControllerDelete'][0])
    {
        return $this->taskGroupControllerDeleteAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskGroupControllerDeleteAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskGroupControllerDeleteAsyncWithHttpInfo($id, string $contentType = self::contentTypes['taskGroupControllerDelete'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity';
        $request = $this->taskGroupControllerDeleteRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskGroupControllerDelete'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskGroupControllerDeleteRequest($id, string $contentType = self::contentTypes['taskGroupControllerDelete'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling taskGroupControllerDelete'
            );
        }


        $resourcePath = '/sync-core/task-group/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'DELETE',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskGroupControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity
     */
    public function taskGroupControllerItem($id, string $contentType = self::contentTypes['taskGroupControllerItem'][0])
    {
        list($response) = $this->taskGroupControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation taskGroupControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taskGroupControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['taskGroupControllerItem'][0])
    {
        $request = $this->taskGroupControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskGroupControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskGroupControllerItemAsync($id, string $contentType = self::contentTypes['taskGroupControllerItem'][0])
    {
        return $this->taskGroupControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskGroupControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskGroupControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['taskGroupControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaskGroupEntity';
        $request = $this->taskGroupControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskGroupControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskGroupControllerItemRequest($id, string $contentType = self::contentTypes['taskGroupControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling taskGroupControllerItem'
            );
        }


        $resourcePath = '/sync-core/task-group/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskGroupControllerList
     *
     * @param  string $groupByEntityTypeAndFlowAndSite groupByEntityTypeAndFlowAndSite (optional)
     * @param  string $entityTypeMachineName entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName entityTypeNamespaceMachineName (optional)
     * @param  string $flowMachineName flowMachineName (optional)
     * @param  string $domains domains (optional)
     * @param  string $scopes scopes (optional)
     * @param  string $statuses statuses (optional)
     * @param  string $types types (optional)
     * @param  string $siteUuid siteUuid (optional)
     * @param  string $siteId siteId (optional)
     * @param  string $initialSetup initialSetup (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList
     */
    public function taskGroupControllerList($groupByEntityTypeAndFlowAndSite = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $flowMachineName = null, $domains = null, $scopes = null, $statuses = null, $types = null, $siteUuid = null, $siteId = null, $initialSetup = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taskGroupControllerList'][0])
    {
        list($response) = $this->taskGroupControllerListWithHttpInfo($groupByEntityTypeAndFlowAndSite, $entityTypeMachineName, $entityTypeNamespaceMachineName, $flowMachineName, $domains, $scopes, $statuses, $types, $siteUuid, $siteId, $initialSetup, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation taskGroupControllerListWithHttpInfo
     *
     * @param  string $groupByEntityTypeAndFlowAndSite (optional)
     * @param  string $entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName (optional)
     * @param  string $flowMachineName (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $statuses (optional)
     * @param  string $types (optional)
     * @param  string $siteUuid (optional)
     * @param  string $siteId (optional)
     * @param  string $initialSetup (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList, HTTP status code, HTTP response headers (array of strings)
     */
    public function taskGroupControllerListWithHttpInfo($groupByEntityTypeAndFlowAndSite = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $flowMachineName = null, $domains = null, $scopes = null, $statuses = null, $types = null, $siteUuid = null, $siteId = null, $initialSetup = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taskGroupControllerList'][0])
    {
        $request = $this->taskGroupControllerListRequest($groupByEntityTypeAndFlowAndSite, $entityTypeMachineName, $entityTypeNamespaceMachineName, $flowMachineName, $domains, $scopes, $statuses, $types, $siteUuid, $siteId, $initialSetup, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskGroupControllerListAsync
     *
     * @param  string $groupByEntityTypeAndFlowAndSite (optional)
     * @param  string $entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName (optional)
     * @param  string $flowMachineName (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $statuses (optional)
     * @param  string $types (optional)
     * @param  string $siteUuid (optional)
     * @param  string $siteId (optional)
     * @param  string $initialSetup (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskGroupControllerListAsync($groupByEntityTypeAndFlowAndSite = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $flowMachineName = null, $domains = null, $scopes = null, $statuses = null, $types = null, $siteUuid = null, $siteId = null, $initialSetup = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taskGroupControllerList'][0])
    {
        return $this->taskGroupControllerListAsyncWithHttpInfo($groupByEntityTypeAndFlowAndSite, $entityTypeMachineName, $entityTypeNamespaceMachineName, $flowMachineName, $domains, $scopes, $statuses, $types, $siteUuid, $siteId, $initialSetup, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskGroupControllerListAsyncWithHttpInfo
     *
     * @param  string $groupByEntityTypeAndFlowAndSite (optional)
     * @param  string $entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName (optional)
     * @param  string $flowMachineName (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $statuses (optional)
     * @param  string $types (optional)
     * @param  string $siteUuid (optional)
     * @param  string $siteId (optional)
     * @param  string $initialSetup (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskGroupControllerListAsyncWithHttpInfo($groupByEntityTypeAndFlowAndSite = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $flowMachineName = null, $domains = null, $scopes = null, $statuses = null, $types = null, $siteUuid = null, $siteId = null, $initialSetup = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taskGroupControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedMigrationList';
        $request = $this->taskGroupControllerListRequest($groupByEntityTypeAndFlowAndSite, $entityTypeMachineName, $entityTypeNamespaceMachineName, $flowMachineName, $domains, $scopes, $statuses, $types, $siteUuid, $siteId, $initialSetup, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskGroupControllerList'
     *
     * @param  string $groupByEntityTypeAndFlowAndSite (optional)
     * @param  string $entityTypeMachineName (optional)
     * @param  string $entityTypeNamespaceMachineName (optional)
     * @param  string $flowMachineName (optional)
     * @param  string $domains (optional)
     * @param  string $scopes (optional)
     * @param  string $statuses (optional)
     * @param  string $types (optional)
     * @param  string $siteUuid (optional)
     * @param  string $siteId (optional)
     * @param  string $initialSetup (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskGroupControllerListRequest($groupByEntityTypeAndFlowAndSite = null, $entityTypeMachineName = null, $entityTypeNamespaceMachineName = null, $flowMachineName = null, $domains = null, $scopes = null, $statuses = null, $types = null, $siteUuid = null, $siteId = null, $initialSetup = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taskGroupControllerList'][0])
    {















        $resourcePath = '/sync-core/task-group';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $groupByEntityTypeAndFlowAndSite,
            'groupByEntityTypeAndFlowAndSite', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityTypeMachineName,
            'entityTypeMachineName', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $entityTypeNamespaceMachineName,
            'entityTypeNamespaceMachineName', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $flowMachineName,
            'flowMachineName', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $domains,
            'domains', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $scopes,
            'scopes', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $statuses,
            'statuses', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $types,
            'types', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $siteUuid,
            'siteUuid', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $siteId,
            'siteId', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $initialSetup,
            'initialSetup', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taskGroupControllerSummary
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerSummary'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary
     */
    public function taskGroupControllerSummary($id, string $contentType = self::contentTypes['taskGroupControllerSummary'][0])
    {
        list($response) = $this->taskGroupControllerSummaryWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation taskGroupControllerSummaryWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerSummary'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary, HTTP status code, HTTP response headers (array of strings)
     */
    public function taskGroupControllerSummaryWithHttpInfo($id, string $contentType = self::contentTypes['taskGroupControllerSummary'][0])
    {
        $request = $this->taskGroupControllerSummaryRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taskGroupControllerSummaryAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskGroupControllerSummaryAsync($id, string $contentType = self::contentTypes['taskGroupControllerSummary'][0])
    {
        return $this->taskGroupControllerSummaryAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taskGroupControllerSummaryAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taskGroupControllerSummaryAsyncWithHttpInfo($id, string $contentType = self::contentTypes['taskGroupControllerSummary'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\MigrationSummary';
        $request = $this->taskGroupControllerSummaryRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taskGroupControllerSummary'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taskGroupControllerSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taskGroupControllerSummaryRequest($id, string $contentType = self::contentTypes['taskGroupControllerSummary'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling taskGroupControllerSummary'
            );
        }


        $resourcePath = '/sync-core/task-group/{id}/summary';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taxonomyControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaxonomyDto $createTaxonomyDto createTaxonomyDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity
     */
    public function taxonomyControllerCreate($createTaxonomyDto, string $contentType = self::contentTypes['taxonomyControllerCreate'][0])
    {
        list($response) = $this->taxonomyControllerCreateWithHttpInfo($createTaxonomyDto, $contentType);
        return $response;
    }

    /**
     * Operation taxonomyControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaxonomyDto $createTaxonomyDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taxonomyControllerCreateWithHttpInfo($createTaxonomyDto, string $contentType = self::contentTypes['taxonomyControllerCreate'][0])
    {
        $request = $this->taxonomyControllerCreateRequest($createTaxonomyDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taxonomyControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaxonomyDto $createTaxonomyDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyControllerCreateAsync($createTaxonomyDto, string $contentType = self::contentTypes['taxonomyControllerCreate'][0])
    {
        return $this->taxonomyControllerCreateAsyncWithHttpInfo($createTaxonomyDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taxonomyControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaxonomyDto $createTaxonomyDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyControllerCreateAsyncWithHttpInfo($createTaxonomyDto, string $contentType = self::contentTypes['taxonomyControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity';
        $request = $this->taxonomyControllerCreateRequest($createTaxonomyDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taxonomyControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaxonomyDto $createTaxonomyDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taxonomyControllerCreateRequest($createTaxonomyDto, string $contentType = self::contentTypes['taxonomyControllerCreate'][0])
    {

        // verify the required parameter 'createTaxonomyDto' is set
        if ($createTaxonomyDto === null || (is_array($createTaxonomyDto) && count($createTaxonomyDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createTaxonomyDto when calling taxonomyControllerCreate'
            );
        }


        $resourcePath = '/sync-core/taxonomy';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createTaxonomyDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createTaxonomyDto));
            } else {
                $httpBody = $createTaxonomyDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taxonomyControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity
     */
    public function taxonomyControllerItem($id, string $contentType = self::contentTypes['taxonomyControllerItem'][0])
    {
        list($response) = $this->taxonomyControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation taxonomyControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taxonomyControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['taxonomyControllerItem'][0])
    {
        $request = $this->taxonomyControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taxonomyControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyControllerItemAsync($id, string $contentType = self::contentTypes['taxonomyControllerItem'][0])
    {
        return $this->taxonomyControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taxonomyControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['taxonomyControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity';
        $request = $this->taxonomyControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taxonomyControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taxonomyControllerItemRequest($id, string $contentType = self::contentTypes['taxonomyControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling taxonomyControllerItem'
            );
        }


        $resourcePath = '/sync-core/taxonomy/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taxonomyControllerItemByFacet
     *
     * @param  string $facet facet (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItemByFacet'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity
     */
    public function taxonomyControllerItemByFacet($facet, string $contentType = self::contentTypes['taxonomyControllerItemByFacet'][0])
    {
        list($response) = $this->taxonomyControllerItemByFacetWithHttpInfo($facet, $contentType);
        return $response;
    }

    /**
     * Operation taxonomyControllerItemByFacetWithHttpInfo
     *
     * @param  string $facet (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItemByFacet'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taxonomyControllerItemByFacetWithHttpInfo($facet, string $contentType = self::contentTypes['taxonomyControllerItemByFacet'][0])
    {
        $request = $this->taxonomyControllerItemByFacetRequest($facet, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taxonomyControllerItemByFacetAsync
     *
     * @param  string $facet (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItemByFacet'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyControllerItemByFacetAsync($facet, string $contentType = self::contentTypes['taxonomyControllerItemByFacet'][0])
    {
        return $this->taxonomyControllerItemByFacetAsyncWithHttpInfo($facet, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taxonomyControllerItemByFacetAsyncWithHttpInfo
     *
     * @param  string $facet (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItemByFacet'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyControllerItemByFacetAsyncWithHttpInfo($facet, string $contentType = self::contentTypes['taxonomyControllerItemByFacet'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity';
        $request = $this->taxonomyControllerItemByFacetRequest($facet, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taxonomyControllerItemByFacet'
     *
     * @param  string $facet (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItemByFacet'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taxonomyControllerItemByFacetRequest($facet, string $contentType = self::contentTypes['taxonomyControllerItemByFacet'][0])
    {

        // verify the required parameter 'facet' is set
        if ($facet === null || (is_array($facet) && count($facet) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $facet when calling taxonomyControllerItemByFacet'
            );
        }


        $resourcePath = '/sync-core/taxonomy/facet/{facet}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($facet !== null) {
            $resourcePath = str_replace(
                '{' . 'facet' . '}',
                ObjectSerializer::toPathValue($facet),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taxonomyControllerItemByKey
     *
     * @param  string $key key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity
     */
    public function taxonomyControllerItemByKey($key, string $contentType = self::contentTypes['taxonomyControllerItemByKey'][0])
    {
        list($response) = $this->taxonomyControllerItemByKeyWithHttpInfo($key, $contentType);
        return $response;
    }

    /**
     * Operation taxonomyControllerItemByKeyWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taxonomyControllerItemByKeyWithHttpInfo($key, string $contentType = self::contentTypes['taxonomyControllerItemByKey'][0])
    {
        $request = $this->taxonomyControllerItemByKeyRequest($key, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taxonomyControllerItemByKeyAsync
     *
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyControllerItemByKeyAsync($key, string $contentType = self::contentTypes['taxonomyControllerItemByKey'][0])
    {
        return $this->taxonomyControllerItemByKeyAsyncWithHttpInfo($key, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taxonomyControllerItemByKeyAsyncWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyControllerItemByKeyAsyncWithHttpInfo($key, string $contentType = self::contentTypes['taxonomyControllerItemByKey'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity';
        $request = $this->taxonomyControllerItemByKeyRequest($key, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taxonomyControllerItemByKey'
     *
     * @param  string $key (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taxonomyControllerItemByKeyRequest($key, string $contentType = self::contentTypes['taxonomyControllerItemByKey'][0])
    {

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling taxonomyControllerItemByKey'
            );
        }


        $resourcePath = '/sync-core/taxonomy/key/{key}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taxonomyControllerList
     *
     * @param  mixed $projectId projectId (optional)
     * @param  mixed $customerId customerId (optional)
     * @param  mixed $key key (optional)
     * @param  mixed $facet facet (optional)
     * @param  mixed $accessScope accessScope (optional)
     * @param  mixed $status status (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyListResponse
     */
    public function taxonomyControllerList($projectId = null, $customerId = null, $key = null, $facet = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taxonomyControllerList'][0])
    {
        list($response) = $this->taxonomyControllerListWithHttpInfo($projectId, $customerId, $key, $facet, $accessScope, $status, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation taxonomyControllerListWithHttpInfo
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $key (optional)
     * @param  mixed $facet (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function taxonomyControllerListWithHttpInfo($projectId = null, $customerId = null, $key = null, $facet = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taxonomyControllerList'][0])
    {
        $request = $this->taxonomyControllerListRequest($projectId, $customerId, $key, $facet, $accessScope, $status, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taxonomyControllerListAsync
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $key (optional)
     * @param  mixed $facet (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyControllerListAsync($projectId = null, $customerId = null, $key = null, $facet = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taxonomyControllerList'][0])
    {
        return $this->taxonomyControllerListAsyncWithHttpInfo($projectId, $customerId, $key, $facet, $accessScope, $status, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taxonomyControllerListAsyncWithHttpInfo
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $key (optional)
     * @param  mixed $facet (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyControllerListAsyncWithHttpInfo($projectId = null, $customerId = null, $key = null, $facet = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taxonomyControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyListResponse';
        $request = $this->taxonomyControllerListRequest($projectId, $customerId, $key, $facet, $accessScope, $status, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taxonomyControllerList'
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $key (optional)
     * @param  mixed $facet (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taxonomyControllerListRequest($projectId = null, $customerId = null, $key = null, $facet = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taxonomyControllerList'][0])
    {










        $resourcePath = '/sync-core/taxonomy';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $projectId,
            'projectId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $customerId,
            'customerId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $key,
            'key', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $facet,
            'facet', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $accessScope,
            'accessScope', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taxonomyControllerUpdate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity $taxonomyEntity taxonomyEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity
     */
    public function taxonomyControllerUpdate($taxonomyEntity, string $contentType = self::contentTypes['taxonomyControllerUpdate'][0])
    {
        list($response) = $this->taxonomyControllerUpdateWithHttpInfo($taxonomyEntity, $contentType);
        return $response;
    }

    /**
     * Operation taxonomyControllerUpdateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity $taxonomyEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taxonomyControllerUpdateWithHttpInfo($taxonomyEntity, string $contentType = self::contentTypes['taxonomyControllerUpdate'][0])
    {
        $request = $this->taxonomyControllerUpdateRequest($taxonomyEntity, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taxonomyControllerUpdateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity $taxonomyEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyControllerUpdateAsync($taxonomyEntity, string $contentType = self::contentTypes['taxonomyControllerUpdate'][0])
    {
        return $this->taxonomyControllerUpdateAsyncWithHttpInfo($taxonomyEntity, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taxonomyControllerUpdateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity $taxonomyEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyControllerUpdateAsyncWithHttpInfo($taxonomyEntity, string $contentType = self::contentTypes['taxonomyControllerUpdate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity';
        $request = $this->taxonomyControllerUpdateRequest($taxonomyEntity, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taxonomyControllerUpdate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyEntity $taxonomyEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taxonomyControllerUpdateRequest($taxonomyEntity, string $contentType = self::contentTypes['taxonomyControllerUpdate'][0])
    {

        // verify the required parameter 'taxonomyEntity' is set
        if ($taxonomyEntity === null || (is_array($taxonomyEntity) && count($taxonomyEntity) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $taxonomyEntity when calling taxonomyControllerUpdate'
            );
        }


        $resourcePath = '/sync-core/taxonomy';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($taxonomyEntity)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($taxonomyEntity));
            } else {
                $httpBody = $taxonomyEntity;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'PATCH',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taxonomyTermControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaxonomyTermDto $createTaxonomyTermDto createTaxonomyTermDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity
     */
    public function taxonomyTermControllerCreate($createTaxonomyTermDto, string $contentType = self::contentTypes['taxonomyTermControllerCreate'][0])
    {
        list($response) = $this->taxonomyTermControllerCreateWithHttpInfo($createTaxonomyTermDto, $contentType);
        return $response;
    }

    /**
     * Operation taxonomyTermControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaxonomyTermDto $createTaxonomyTermDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taxonomyTermControllerCreateWithHttpInfo($createTaxonomyTermDto, string $contentType = self::contentTypes['taxonomyTermControllerCreate'][0])
    {
        $request = $this->taxonomyTermControllerCreateRequest($createTaxonomyTermDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taxonomyTermControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaxonomyTermDto $createTaxonomyTermDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyTermControllerCreateAsync($createTaxonomyTermDto, string $contentType = self::contentTypes['taxonomyTermControllerCreate'][0])
    {
        return $this->taxonomyTermControllerCreateAsyncWithHttpInfo($createTaxonomyTermDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taxonomyTermControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaxonomyTermDto $createTaxonomyTermDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyTermControllerCreateAsyncWithHttpInfo($createTaxonomyTermDto, string $contentType = self::contentTypes['taxonomyTermControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity';
        $request = $this->taxonomyTermControllerCreateRequest($createTaxonomyTermDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taxonomyTermControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateTaxonomyTermDto $createTaxonomyTermDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taxonomyTermControllerCreateRequest($createTaxonomyTermDto, string $contentType = self::contentTypes['taxonomyTermControllerCreate'][0])
    {

        // verify the required parameter 'createTaxonomyTermDto' is set
        if ($createTaxonomyTermDto === null || (is_array($createTaxonomyTermDto) && count($createTaxonomyTermDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createTaxonomyTermDto when calling taxonomyTermControllerCreate'
            );
        }


        $resourcePath = '/sync-core/taxonomy-term';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createTaxonomyTermDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createTaxonomyTermDto));
            } else {
                $httpBody = $createTaxonomyTermDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taxonomyTermControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity
     */
    public function taxonomyTermControllerItem($id, string $contentType = self::contentTypes['taxonomyTermControllerItem'][0])
    {
        list($response) = $this->taxonomyTermControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation taxonomyTermControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taxonomyTermControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['taxonomyTermControllerItem'][0])
    {
        $request = $this->taxonomyTermControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taxonomyTermControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyTermControllerItemAsync($id, string $contentType = self::contentTypes['taxonomyTermControllerItem'][0])
    {
        return $this->taxonomyTermControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taxonomyTermControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyTermControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['taxonomyTermControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity';
        $request = $this->taxonomyTermControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taxonomyTermControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taxonomyTermControllerItemRequest($id, string $contentType = self::contentTypes['taxonomyTermControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling taxonomyTermControllerItem'
            );
        }


        $resourcePath = '/sync-core/taxonomy-term/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taxonomyTermControllerItemByKey
     *
     * @param  string $key key (required)
     * @param  string $status status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity
     */
    public function taxonomyTermControllerItemByKey($key, $status, string $contentType = self::contentTypes['taxonomyTermControllerItemByKey'][0])
    {
        list($response) = $this->taxonomyTermControllerItemByKeyWithHttpInfo($key, $status, $contentType);
        return $response;
    }

    /**
     * Operation taxonomyTermControllerItemByKeyWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taxonomyTermControllerItemByKeyWithHttpInfo($key, $status, string $contentType = self::contentTypes['taxonomyTermControllerItemByKey'][0])
    {
        $request = $this->taxonomyTermControllerItemByKeyRequest($key, $status, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taxonomyTermControllerItemByKeyAsync
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyTermControllerItemByKeyAsync($key, $status, string $contentType = self::contentTypes['taxonomyTermControllerItemByKey'][0])
    {
        return $this->taxonomyTermControllerItemByKeyAsyncWithHttpInfo($key, $status, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taxonomyTermControllerItemByKeyAsyncWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyTermControllerItemByKeyAsyncWithHttpInfo($key, $status, string $contentType = self::contentTypes['taxonomyTermControllerItemByKey'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity';
        $request = $this->taxonomyTermControllerItemByKeyRequest($key, $status, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taxonomyTermControllerItemByKey'
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerItemByKey'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taxonomyTermControllerItemByKeyRequest($key, $status, string $contentType = self::contentTypes['taxonomyTermControllerItemByKey'][0])
    {

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling taxonomyTermControllerItemByKey'
            );
        }

        // verify the required parameter 'status' is set
        if ($status === null || (is_array($status) && count($status) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $status when calling taxonomyTermControllerItemByKey'
            );
        }


        $resourcePath = '/sync-core/taxonomy-term/by-key/{key}/{status}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }
        // path params
        if ($status !== null) {
            $resourcePath = str_replace(
                '{' . 'status' . '}',
                ObjectSerializer::toPathValue($status),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taxonomyTermControllerList
     *
     * @param  mixed $projectId projectId (optional)
     * @param  mixed $customerId customerId (optional)
     * @param  mixed $taxonomyId taxonomyId (optional)
     * @param  mixed $taxonomyFacet taxonomyFacet (optional)
     * @param  mixed $taxonomyKey taxonomyKey (optional)
     * @param  mixed $accessScope accessScope (optional)
     * @param  mixed $status status (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse
     */
    public function taxonomyTermControllerList($projectId = null, $customerId = null, $taxonomyId = null, $taxonomyFacet = null, $taxonomyKey = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taxonomyTermControllerList'][0])
    {
        list($response) = $this->taxonomyTermControllerListWithHttpInfo($projectId, $customerId, $taxonomyId, $taxonomyFacet, $taxonomyKey, $accessScope, $status, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation taxonomyTermControllerListWithHttpInfo
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $taxonomyId (optional)
     * @param  mixed $taxonomyFacet (optional)
     * @param  mixed $taxonomyKey (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function taxonomyTermControllerListWithHttpInfo($projectId = null, $customerId = null, $taxonomyId = null, $taxonomyFacet = null, $taxonomyKey = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taxonomyTermControllerList'][0])
    {
        $request = $this->taxonomyTermControllerListRequest($projectId, $customerId, $taxonomyId, $taxonomyFacet, $taxonomyKey, $accessScope, $status, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taxonomyTermControllerListAsync
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $taxonomyId (optional)
     * @param  mixed $taxonomyFacet (optional)
     * @param  mixed $taxonomyKey (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyTermControllerListAsync($projectId = null, $customerId = null, $taxonomyId = null, $taxonomyFacet = null, $taxonomyKey = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taxonomyTermControllerList'][0])
    {
        return $this->taxonomyTermControllerListAsyncWithHttpInfo($projectId, $customerId, $taxonomyId, $taxonomyFacet, $taxonomyKey, $accessScope, $status, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taxonomyTermControllerListAsyncWithHttpInfo
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $taxonomyId (optional)
     * @param  mixed $taxonomyFacet (optional)
     * @param  mixed $taxonomyKey (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyTermControllerListAsyncWithHttpInfo($projectId = null, $customerId = null, $taxonomyId = null, $taxonomyFacet = null, $taxonomyKey = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taxonomyTermControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse';
        $request = $this->taxonomyTermControllerListRequest($projectId, $customerId, $taxonomyId, $taxonomyFacet, $taxonomyKey, $accessScope, $status, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taxonomyTermControllerList'
     *
     * @param  mixed $projectId (optional)
     * @param  mixed $customerId (optional)
     * @param  mixed $taxonomyId (optional)
     * @param  mixed $taxonomyFacet (optional)
     * @param  mixed $taxonomyKey (optional)
     * @param  mixed $accessScope (optional)
     * @param  mixed $status (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taxonomyTermControllerListRequest($projectId = null, $customerId = null, $taxonomyId = null, $taxonomyFacet = null, $taxonomyKey = null, $accessScope = null, $status = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['taxonomyTermControllerList'][0])
    {











        $resourcePath = '/sync-core/taxonomy-term';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $projectId,
            'projectId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $customerId,
            'customerId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taxonomyId,
            'taxonomyId', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taxonomyFacet,
            'taxonomyFacet', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $taxonomyKey,
            'taxonomyKey', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $accessScope,
            'accessScope', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $status,
            'status', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taxonomyTermControllerRevisionsByPreviousStatus
     *
     * @param  string $key key (required)
     * @param  string $status status (required)
     * @param  mixed $itemsPerPage itemsPerPage (optional)
     * @param  mixed $page page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse
     */
    public function taxonomyTermControllerRevisionsByPreviousStatus($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['taxonomyTermControllerRevisionsByPreviousStatus'][0])
    {
        list($response) = $this->taxonomyTermControllerRevisionsByPreviousStatusWithHttpInfo($key, $status, $itemsPerPage, $page, $contentType);
        return $response;
    }

    /**
     * Operation taxonomyTermControllerRevisionsByPreviousStatusWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function taxonomyTermControllerRevisionsByPreviousStatusWithHttpInfo($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['taxonomyTermControllerRevisionsByPreviousStatus'][0])
    {
        $request = $this->taxonomyTermControllerRevisionsByPreviousStatusRequest($key, $status, $itemsPerPage, $page, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taxonomyTermControllerRevisionsByPreviousStatusAsync
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyTermControllerRevisionsByPreviousStatusAsync($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['taxonomyTermControllerRevisionsByPreviousStatus'][0])
    {
        return $this->taxonomyTermControllerRevisionsByPreviousStatusAsyncWithHttpInfo($key, $status, $itemsPerPage, $page, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taxonomyTermControllerRevisionsByPreviousStatusAsyncWithHttpInfo
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyTermControllerRevisionsByPreviousStatusAsyncWithHttpInfo($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['taxonomyTermControllerRevisionsByPreviousStatus'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedTaxonomyTermListResponse';
        $request = $this->taxonomyTermControllerRevisionsByPreviousStatusRequest($key, $status, $itemsPerPage, $page, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taxonomyTermControllerRevisionsByPreviousStatus'
     *
     * @param  string $key (required)
     * @param  string $status (required)
     * @param  mixed $itemsPerPage (optional)
     * @param  mixed $page (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerRevisionsByPreviousStatus'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taxonomyTermControllerRevisionsByPreviousStatusRequest($key, $status, $itemsPerPage = null, $page = null, string $contentType = self::contentTypes['taxonomyTermControllerRevisionsByPreviousStatus'][0])
    {

        // verify the required parameter 'key' is set
        if ($key === null || (is_array($key) && count($key) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $key when calling taxonomyTermControllerRevisionsByPreviousStatus'
            );
        }

        // verify the required parameter 'status' is set
        if ($status === null || (is_array($status) && count($status) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $status when calling taxonomyTermControllerRevisionsByPreviousStatus'
            );
        }




        $resourcePath = '/sync-core/taxonomy-term/by-key/{key}/{status}/revisions';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($key !== null) {
            $resourcePath = str_replace(
                '{' . 'key' . '}',
                ObjectSerializer::toPathValue($key),
                $resourcePath
            );
        }
        // path params
        if ($status !== null) {
            $resourcePath = str_replace(
                '{' . 'status' . '}',
                ObjectSerializer::toPathValue($status),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation taxonomyTermControllerUpdate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity $taxonomyTermEntity taxonomyTermEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity
     */
    public function taxonomyTermControllerUpdate($taxonomyTermEntity, string $contentType = self::contentTypes['taxonomyTermControllerUpdate'][0])
    {
        list($response) = $this->taxonomyTermControllerUpdateWithHttpInfo($taxonomyTermEntity, $contentType);
        return $response;
    }

    /**
     * Operation taxonomyTermControllerUpdateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity $taxonomyTermEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function taxonomyTermControllerUpdateWithHttpInfo($taxonomyTermEntity, string $contentType = self::contentTypes['taxonomyTermControllerUpdate'][0])
    {
        $request = $this->taxonomyTermControllerUpdateRequest($taxonomyTermEntity, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation taxonomyTermControllerUpdateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity $taxonomyTermEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyTermControllerUpdateAsync($taxonomyTermEntity, string $contentType = self::contentTypes['taxonomyTermControllerUpdate'][0])
    {
        return $this->taxonomyTermControllerUpdateAsyncWithHttpInfo($taxonomyTermEntity, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation taxonomyTermControllerUpdateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity $taxonomyTermEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function taxonomyTermControllerUpdateAsyncWithHttpInfo($taxonomyTermEntity, string $contentType = self::contentTypes['taxonomyTermControllerUpdate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity';
        $request = $this->taxonomyTermControllerUpdateRequest($taxonomyTermEntity, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'taxonomyTermControllerUpdate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\TaxonomyTermEntity $taxonomyTermEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['taxonomyTermControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function taxonomyTermControllerUpdateRequest($taxonomyTermEntity, string $contentType = self::contentTypes['taxonomyTermControllerUpdate'][0])
    {

        // verify the required parameter 'taxonomyTermEntity' is set
        if ($taxonomyTermEntity === null || (is_array($taxonomyTermEntity) && count($taxonomyTermEntity) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $taxonomyTermEntity when calling taxonomyTermControllerUpdate'
            );
        }


        $resourcePath = '/sync-core/taxonomy-term';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($taxonomyTermEntity)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($taxonomyTermEntity));
            } else {
                $httpBody = $taxonomyTermEntity;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'PATCH',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation textProfileControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['textProfileControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\TextProfileEntity
     */
    public function textProfileControllerItem($id, string $contentType = self::contentTypes['textProfileControllerItem'][0])
    {
        list($response) = $this->textProfileControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation textProfileControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['textProfileControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\TextProfileEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function textProfileControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['textProfileControllerItem'][0])
    {
        $request = $this->textProfileControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\TextProfileEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\TextProfileEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\TextProfileEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TextProfileEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\TextProfileEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation textProfileControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['textProfileControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function textProfileControllerItemAsync($id, string $contentType = self::contentTypes['textProfileControllerItem'][0])
    {
        return $this->textProfileControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation textProfileControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['textProfileControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function textProfileControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['textProfileControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\TextProfileEntity';
        $request = $this->textProfileControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'textProfileControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['textProfileControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function textProfileControllerItemRequest($id, string $contentType = self::contentTypes['textProfileControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling textProfileControllerItem'
            );
        }


        $resourcePath = '/sync-core/text-profile/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation textProfileControllerList
     *
     * @param  mixed $fingerprint fingerprint (optional)
     * @param  mixed $appType appType (optional)
     * @param  mixed $contentType contentType (optional)
     * @param  mixed $machineName machineName (optional)
    * @param  string $contentTypeHeader The value for the Content-Type header. Check self::contentTypes['textProfileControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedTextProfileListResponse
     */
    public function textProfileControllerList($fingerprint = null, $appType = null, $contentType = null, $machineName = null, string $contentTypeHeader = self::contentTypes['textProfileControllerList'][0])
    {
        list($response) = $this->textProfileControllerListWithHttpInfo($fingerprint, $appType, $contentType, $machineName, $contentTypeHeader);
        return $response;
    }

    /**
     * Operation textProfileControllerListWithHttpInfo
     *
     * @param  mixed $fingerprint (optional)
     * @param  mixed $appType (optional)
     * @param  mixed $contentType (optional)
     * @param  mixed $machineName (optional)
    * @param  string $contentTypeHeader The value for the Content-Type header. Check self::contentTypes['textProfileControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedTextProfileListResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function textProfileControllerListWithHttpInfo($fingerprint = null, $appType = null, $contentType = null, $machineName = null, string $contentTypeHeader = self::contentTypes['textProfileControllerList'][0])
    {
        $request = $this->textProfileControllerListRequest($fingerprint, $appType, $contentType, $machineName, $contentTypeHeader);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedTextProfileListResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedTextProfileListResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedTextProfileListResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedTextProfileListResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedTextProfileListResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation textProfileControllerListAsync
     *
     * @param  mixed $fingerprint (optional)
     * @param  mixed $appType (optional)
     * @param  mixed $contentType (optional)
     * @param  mixed $machineName (optional)
    * @param  string $contentTypeHeader The value for the Content-Type header. Check self::contentTypes['textProfileControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function textProfileControllerListAsync($fingerprint = null, $appType = null, $contentType = null, $machineName = null, string $contentTypeHeader = self::contentTypes['textProfileControllerList'][0])
    {
        return $this->textProfileControllerListAsyncWithHttpInfo($fingerprint, $appType, $contentType, $machineName, $contentTypeHeader)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation textProfileControllerListAsyncWithHttpInfo
     *
     * @param  mixed $fingerprint (optional)
     * @param  mixed $appType (optional)
     * @param  mixed $contentType (optional)
     * @param  mixed $machineName (optional)
    * @param  string $contentTypeHeader The value for the Content-Type header. Check self::contentTypes['textProfileControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function textProfileControllerListAsyncWithHttpInfo($fingerprint = null, $appType = null, $contentType = null, $machineName = null, string $contentTypeHeader = self::contentTypes['textProfileControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedTextProfileListResponse';
        $request = $this->textProfileControllerListRequest($fingerprint, $appType, $contentType, $machineName, $contentTypeHeader);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'textProfileControllerList'
     *
     * @param  mixed $fingerprint (optional)
     * @param  mixed $appType (optional)
     * @param  mixed $contentType (optional)
     * @param  mixed $machineName (optional)
    * @param  string $contentTypeHeader The value for the Content-Type header. Check self::contentTypes['textProfileControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function textProfileControllerListRequest($fingerprint = null, $appType = null, $contentType = null, $machineName = null, string $contentTypeHeader = self::contentTypes['textProfileControllerList'][0])
    {






        $resourcePath = '/sync-core/text-profile';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $fingerprint,
            'fingerprint', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $appType,
            'appType', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $contentType,
            'contentType', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $machineName,
            'machineName', // param base name
            'mixed', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);




        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentTypeHeader,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation usageStatsControllerGetForPeriod
     *
     * @param  string $period period (required)
     * @param  UsageStatsType $type type (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerGetForPeriod'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\UsageStats
     */
    public function usageStatsControllerGetForPeriod($period, $type, string $contentType = self::contentTypes['usageStatsControllerGetForPeriod'][0])
    {
        list($response) = $this->usageStatsControllerGetForPeriodWithHttpInfo($period, $type, $contentType);
        return $response;
    }

    /**
     * Operation usageStatsControllerGetForPeriodWithHttpInfo
     *
     * @param  string $period (required)
     * @param  UsageStatsType $type (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerGetForPeriod'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\UsageStats, HTTP status code, HTTP response headers (array of strings)
     */
    public function usageStatsControllerGetForPeriodWithHttpInfo($period, $type, string $contentType = self::contentTypes['usageStatsControllerGetForPeriod'][0])
    {
        $request = $this->usageStatsControllerGetForPeriodRequest($period, $type, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\UsageStats' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\UsageStats' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\UsageStats', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\UsageStats';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\UsageStats',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation usageStatsControllerGetForPeriodAsync
     *
     * @param  string $period (required)
     * @param  UsageStatsType $type (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerGetForPeriod'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function usageStatsControllerGetForPeriodAsync($period, $type, string $contentType = self::contentTypes['usageStatsControllerGetForPeriod'][0])
    {
        return $this->usageStatsControllerGetForPeriodAsyncWithHttpInfo($period, $type, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation usageStatsControllerGetForPeriodAsyncWithHttpInfo
     *
     * @param  string $period (required)
     * @param  UsageStatsType $type (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerGetForPeriod'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function usageStatsControllerGetForPeriodAsyncWithHttpInfo($period, $type, string $contentType = self::contentTypes['usageStatsControllerGetForPeriod'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\UsageStats';
        $request = $this->usageStatsControllerGetForPeriodRequest($period, $type, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'usageStatsControllerGetForPeriod'
     *
     * @param  string $period (required)
     * @param  UsageStatsType $type (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerGetForPeriod'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function usageStatsControllerGetForPeriodRequest($period, $type, string $contentType = self::contentTypes['usageStatsControllerGetForPeriod'][0])
    {

        // verify the required parameter 'period' is set
        if ($period === null || (is_array($period) && count($period) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $period when calling usageStatsControllerGetForPeriod'
            );
        }

        // verify the required parameter 'type' is set
        if ($type === null || (is_array($type) && count($type) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $type when calling usageStatsControllerGetForPeriod'
            );
        }


        $resourcePath = '/sync-core/usage-stats/for-period/{type}/{period}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($period !== null) {
            $resourcePath = str_replace(
                '{' . 'period' . '}',
                ObjectSerializer::toPathValue($period),
                $resourcePath
            );
        }
        // path params
        if ($type !== null) {
            $resourcePath = str_replace(
                '{' . 'type' . '}',
                ObjectSerializer::toPathValue($type),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation usageStatsControllerGetForType
     *
     * @param  UsageStatsType $type type (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerGetForType'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\UsageStats
     */
    public function usageStatsControllerGetForType($type, string $contentType = self::contentTypes['usageStatsControllerGetForType'][0])
    {
        list($response) = $this->usageStatsControllerGetForTypeWithHttpInfo($type, $contentType);
        return $response;
    }

    /**
     * Operation usageStatsControllerGetForTypeWithHttpInfo
     *
     * @param  UsageStatsType $type (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerGetForType'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\UsageStats, HTTP status code, HTTP response headers (array of strings)
     */
    public function usageStatsControllerGetForTypeWithHttpInfo($type, string $contentType = self::contentTypes['usageStatsControllerGetForType'][0])
    {
        $request = $this->usageStatsControllerGetForTypeRequest($type, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\UsageStats' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\UsageStats' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\UsageStats', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\UsageStats';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\UsageStats',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation usageStatsControllerGetForTypeAsync
     *
     * @param  UsageStatsType $type (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerGetForType'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function usageStatsControllerGetForTypeAsync($type, string $contentType = self::contentTypes['usageStatsControllerGetForType'][0])
    {
        return $this->usageStatsControllerGetForTypeAsyncWithHttpInfo($type, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation usageStatsControllerGetForTypeAsyncWithHttpInfo
     *
     * @param  UsageStatsType $type (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerGetForType'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function usageStatsControllerGetForTypeAsyncWithHttpInfo($type, string $contentType = self::contentTypes['usageStatsControllerGetForType'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\UsageStats';
        $request = $this->usageStatsControllerGetForTypeRequest($type, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'usageStatsControllerGetForType'
     *
     * @param  UsageStatsType $type (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerGetForType'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function usageStatsControllerGetForTypeRequest($type, string $contentType = self::contentTypes['usageStatsControllerGetForType'][0])
    {

        // verify the required parameter 'type' is set
        if ($type === null || (is_array($type) && count($type) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $type when calling usageStatsControllerGetForType'
            );
        }


        $resourcePath = '/sync-core/usage-stats/for-period/{type}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($type !== null) {
            $resourcePath = str_replace(
                '{' . 'type' . '}',
                ObjectSerializer::toPathValue($type),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation usageStatsControllerSummary
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerSummary'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\UsageSummary
     */
    public function usageStatsControllerSummary(string $contentType = self::contentTypes['usageStatsControllerSummary'][0])
    {
        list($response) = $this->usageStatsControllerSummaryWithHttpInfo($contentType);
        return $response;
    }

    /**
     * Operation usageStatsControllerSummaryWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerSummary'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\UsageSummary, HTTP status code, HTTP response headers (array of strings)
     */
    public function usageStatsControllerSummaryWithHttpInfo(string $contentType = self::contentTypes['usageStatsControllerSummary'][0])
    {
        $request = $this->usageStatsControllerSummaryRequest($contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\UsageSummary' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\UsageSummary' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\UsageSummary', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\UsageSummary';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\UsageSummary',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation usageStatsControllerSummaryAsync
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function usageStatsControllerSummaryAsync(string $contentType = self::contentTypes['usageStatsControllerSummary'][0])
    {
        return $this->usageStatsControllerSummaryAsyncWithHttpInfo($contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation usageStatsControllerSummaryAsyncWithHttpInfo
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function usageStatsControllerSummaryAsyncWithHttpInfo(string $contentType = self::contentTypes['usageStatsControllerSummary'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\UsageSummary';
        $request = $this->usageStatsControllerSummaryRequest($contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'usageStatsControllerSummary'
     *
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['usageStatsControllerSummary'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function usageStatsControllerSummaryRequest(string $contentType = self::contentTypes['usageStatsControllerSummary'][0])
    {


        $resourcePath = '/sync-core/usage-stats/summary';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation webhookControllerCreate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateWebhookDto $createWebhookDto createWebhookDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity
     */
    public function webhookControllerCreate($createWebhookDto, string $contentType = self::contentTypes['webhookControllerCreate'][0])
    {
        list($response) = $this->webhookControllerCreateWithHttpInfo($createWebhookDto, $contentType);
        return $response;
    }

    /**
     * Operation webhookControllerCreateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateWebhookDto $createWebhookDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerCreate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function webhookControllerCreateWithHttpInfo($createWebhookDto, string $contentType = self::contentTypes['webhookControllerCreate'][0])
    {
        $request = $this->webhookControllerCreateRequest($createWebhookDto, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation webhookControllerCreateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateWebhookDto $createWebhookDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function webhookControllerCreateAsync($createWebhookDto, string $contentType = self::contentTypes['webhookControllerCreate'][0])
    {
        return $this->webhookControllerCreateAsyncWithHttpInfo($createWebhookDto, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation webhookControllerCreateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateWebhookDto $createWebhookDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function webhookControllerCreateAsyncWithHttpInfo($createWebhookDto, string $contentType = self::contentTypes['webhookControllerCreate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity';
        $request = $this->webhookControllerCreateRequest($createWebhookDto, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'webhookControllerCreate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\CreateWebhookDto $createWebhookDto (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerCreate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function webhookControllerCreateRequest($createWebhookDto, string $contentType = self::contentTypes['webhookControllerCreate'][0])
    {

        // verify the required parameter 'createWebhookDto' is set
        if ($createWebhookDto === null || (is_array($createWebhookDto) && count($createWebhookDto) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $createWebhookDto when calling webhookControllerCreate'
            );
        }


        $resourcePath = '/sync-core/webhook';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($createWebhookDto)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($createWebhookDto));
            } else {
                $httpBody = $createWebhookDto;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation webhookControllerDelete
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookDeleteRequest $webhookDeleteRequest webhookDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerDelete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function webhookControllerDelete($webhookDeleteRequest, string $contentType = self::contentTypes['webhookControllerDelete'][0])
    {
        list($response) = $this->webhookControllerDeleteWithHttpInfo($webhookDeleteRequest, $contentType);
        return $response;
    }

    /**
     * Operation webhookControllerDeleteWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookDeleteRequest $webhookDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerDelete'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function webhookControllerDeleteWithHttpInfo($webhookDeleteRequest, string $contentType = self::contentTypes['webhookControllerDelete'][0])
    {
        $request = $this->webhookControllerDeleteRequest($webhookDeleteRequest, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation webhookControllerDeleteAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookDeleteRequest $webhookDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function webhookControllerDeleteAsync($webhookDeleteRequest, string $contentType = self::contentTypes['webhookControllerDelete'][0])
    {
        return $this->webhookControllerDeleteAsyncWithHttpInfo($webhookDeleteRequest, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation webhookControllerDeleteAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookDeleteRequest $webhookDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function webhookControllerDeleteAsyncWithHttpInfo($webhookDeleteRequest, string $contentType = self::contentTypes['webhookControllerDelete'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->webhookControllerDeleteRequest($webhookDeleteRequest, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'webhookControllerDelete'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookDeleteRequest $webhookDeleteRequest (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerDelete'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function webhookControllerDeleteRequest($webhookDeleteRequest, string $contentType = self::contentTypes['webhookControllerDelete'][0])
    {

        // verify the required parameter 'webhookDeleteRequest' is set
        if ($webhookDeleteRequest === null || (is_array($webhookDeleteRequest) && count($webhookDeleteRequest) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $webhookDeleteRequest when calling webhookControllerDelete'
            );
        }


        $resourcePath = '/sync-core/webhook';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($webhookDeleteRequest)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($webhookDeleteRequest));
            } else {
                $httpBody = $webhookDeleteRequest;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'DELETE',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation webhookControllerItem
     *
     * @param  string $id id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity
     */
    public function webhookControllerItem($id, string $contentType = self::contentTypes['webhookControllerItem'][0])
    {
        list($response) = $this->webhookControllerItemWithHttpInfo($id, $contentType);
        return $response;
    }

    /**
     * Operation webhookControllerItemWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerItem'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function webhookControllerItemWithHttpInfo($id, string $contentType = self::contentTypes['webhookControllerItem'][0])
    {
        $request = $this->webhookControllerItemRequest($id, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation webhookControllerItemAsync
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function webhookControllerItemAsync($id, string $contentType = self::contentTypes['webhookControllerItem'][0])
    {
        return $this->webhookControllerItemAsyncWithHttpInfo($id, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation webhookControllerItemAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function webhookControllerItemAsyncWithHttpInfo($id, string $contentType = self::contentTypes['webhookControllerItem'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity';
        $request = $this->webhookControllerItemRequest($id, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'webhookControllerItem'
     *
     * @param  string $id (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerItem'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function webhookControllerItemRequest($id, string $contentType = self::contentTypes['webhookControllerItem'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling webhookControllerItem'
            );
        }


        $resourcePath = '/sync-core/webhook/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation webhookControllerList
     *
     * @param  WebhookEntityType $entityType entityType (optional)
     * @param  string $page page (optional)
     * @param  string $itemsPerPage itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\PagedWebhookList
     */
    public function webhookControllerList($entityType = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['webhookControllerList'][0])
    {
        list($response) = $this->webhookControllerListWithHttpInfo($entityType, $page, $itemsPerPage, $contentType);
        return $response;
    }

    /**
     * Operation webhookControllerListWithHttpInfo
     *
     * @param  WebhookEntityType $entityType (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerList'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\PagedWebhookList, HTTP status code, HTTP response headers (array of strings)
     */
    public function webhookControllerListWithHttpInfo($entityType = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['webhookControllerList'][0])
    {
        $request = $this->webhookControllerListRequest($entityType, $page, $itemsPerPage, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedWebhookList' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\PagedWebhookList' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\PagedWebhookList', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedWebhookList';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\PagedWebhookList',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation webhookControllerListAsync
     *
     * @param  WebhookEntityType $entityType (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function webhookControllerListAsync($entityType = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['webhookControllerList'][0])
    {
        return $this->webhookControllerListAsyncWithHttpInfo($entityType, $page, $itemsPerPage, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation webhookControllerListAsyncWithHttpInfo
     *
     * @param  WebhookEntityType $entityType (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function webhookControllerListAsyncWithHttpInfo($entityType = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['webhookControllerList'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\PagedWebhookList';
        $request = $this->webhookControllerListRequest($entityType, $page, $itemsPerPage, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'webhookControllerList'
     *
     * @param  WebhookEntityType $entityType (optional)
     * @param  string $page (optional)
     * @param  string $itemsPerPage (optional)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerList'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function webhookControllerListRequest($entityType = null, $page = null, $itemsPerPage = null, string $contentType = self::contentTypes['webhookControllerList'][0])
    {





        $resourcePath = '/sync-core/webhook';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;

        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $page,
            'page', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);
        // query params
        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
            $itemsPerPage,
            'itemsPerPage', // param base name
            'string', // openApiType
            'form', // style
            true, // explode
            false // required
        ) ?? []);


        // path params
        if ($entityType !== null) {
            $resourcePath = str_replace(
                '{' . 'entityType' . '}',
                ObjectSerializer::toPathValue($entityType),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation webhookControllerSendVerificationEmail
     *
     * @param  string $id id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookResendVerificationEmail $webhookResendVerificationEmail webhookResendVerificationEmail (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerSendVerificationEmail'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse
     */
    public function webhookControllerSendVerificationEmail($id, $webhookResendVerificationEmail, string $contentType = self::contentTypes['webhookControllerSendVerificationEmail'][0])
    {
        list($response) = $this->webhookControllerSendVerificationEmailWithHttpInfo($id, $webhookResendVerificationEmail, $contentType);
        return $response;
    }

    /**
     * Operation webhookControllerSendVerificationEmailWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookResendVerificationEmail $webhookResendVerificationEmail (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerSendVerificationEmail'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse, HTTP status code, HTTP response headers (array of strings)
     */
    public function webhookControllerSendVerificationEmailWithHttpInfo($id, $webhookResendVerificationEmail, string $contentType = self::contentTypes['webhookControllerSendVerificationEmail'][0])
    {
        $request = $this->webhookControllerSendVerificationEmailRequest($id, $webhookResendVerificationEmail, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation webhookControllerSendVerificationEmailAsync
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookResendVerificationEmail $webhookResendVerificationEmail (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerSendVerificationEmail'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function webhookControllerSendVerificationEmailAsync($id, $webhookResendVerificationEmail, string $contentType = self::contentTypes['webhookControllerSendVerificationEmail'][0])
    {
        return $this->webhookControllerSendVerificationEmailAsyncWithHttpInfo($id, $webhookResendVerificationEmail, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation webhookControllerSendVerificationEmailAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookResendVerificationEmail $webhookResendVerificationEmail (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerSendVerificationEmail'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function webhookControllerSendVerificationEmailAsyncWithHttpInfo($id, $webhookResendVerificationEmail, string $contentType = self::contentTypes['webhookControllerSendVerificationEmail'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\SuccessResponse';
        $request = $this->webhookControllerSendVerificationEmailRequest($id, $webhookResendVerificationEmail, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'webhookControllerSendVerificationEmail'
     *
     * @param  string $id (required)
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookResendVerificationEmail $webhookResendVerificationEmail (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerSendVerificationEmail'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function webhookControllerSendVerificationEmailRequest($id, $webhookResendVerificationEmail, string $contentType = self::contentTypes['webhookControllerSendVerificationEmail'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling webhookControllerSendVerificationEmail'
            );
        }

        // verify the required parameter 'webhookResendVerificationEmail' is set
        if ($webhookResendVerificationEmail === null || (is_array($webhookResendVerificationEmail) && count($webhookResendVerificationEmail) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $webhookResendVerificationEmail when calling webhookControllerSendVerificationEmail'
            );
        }


        $resourcePath = '/sync-core/webhook/{id}/verify';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($webhookResendVerificationEmail)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($webhookResendVerificationEmail));
            } else {
                $httpBody = $webhookResendVerificationEmail;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'POST',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation webhookControllerUpdate
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity $webhookEntity webhookEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return \EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity
     */
    public function webhookControllerUpdate($webhookEntity, string $contentType = self::contentTypes['webhookControllerUpdate'][0])
    {
        list($response) = $this->webhookControllerUpdateWithHttpInfo($webhookEntity, $contentType);
        return $response;
    }

    /**
     * Operation webhookControllerUpdateWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity $webhookEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerUpdate'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of \EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity, HTTP status code, HTTP response headers (array of strings)
     */
    public function webhookControllerUpdateWithHttpInfo($webhookEntity, string $contentType = self::contentTypes['webhookControllerUpdate'][0])
    {
        $request = $this->webhookControllerUpdateRequest($webhookEntity, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            switch($statusCode) {
                case 200:
                    if ('\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity' === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ('\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity' !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, '\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity', []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
            }

            $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity';
            if ($returnType === '\SplFileObject') {
                $content = $response->getBody(); //stream goes to serializer
            } else {
                $content = (string) $response->getBody();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = ObjectSerializer::deserialize(
                        $e->getResponseBody(),
                        '\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity',
                        $e->getResponseHeaders()
                    );
                    $e->setResponseObject($data);
                    break;
            }
            throw $e;
        }
    }

    /**
     * Operation webhookControllerUpdateAsync
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity $webhookEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function webhookControllerUpdateAsync($webhookEntity, string $contentType = self::contentTypes['webhookControllerUpdate'][0])
    {
        return $this->webhookControllerUpdateAsyncWithHttpInfo($webhookEntity, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation webhookControllerUpdateAsyncWithHttpInfo
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity $webhookEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function webhookControllerUpdateAsyncWithHttpInfo($webhookEntity, string $contentType = self::contentTypes['webhookControllerUpdate'][0])
    {
        $returnType = '\EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity';
        $request = $this->webhookControllerUpdateRequest($webhookEntity, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    if ($returnType === '\SplFileObject') {
                        $content = $response->getBody(); //stream goes to serializer
                    } else {
                        $content = (string) $response->getBody();
                        if ($returnType !== 'string') {
                            $content = json_decode($content);
                        }
                    }

                    return [
                        ObjectSerializer::deserialize($content, $returnType, []),
                        $response->getStatusCode(),
                        $response->getHeaders()
                    ];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'webhookControllerUpdate'
     *
     * @param  \EdgeBox\SyncCore\V2\Raw\Model\WebhookEntity $webhookEntity (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerUpdate'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function webhookControllerUpdateRequest($webhookEntity, string $contentType = self::contentTypes['webhookControllerUpdate'][0])
    {

        // verify the required parameter 'webhookEntity' is set
        if ($webhookEntity === null || (is_array($webhookEntity) && count($webhookEntity) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $webhookEntity when calling webhookControllerUpdate'
            );
        }


        $resourcePath = '/sync-core/webhook';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;





        $headers = $this->headerSelector->selectHeaders(
            ['application/json', ],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (isset($webhookEntity)) {
            if (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the body
                $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($webhookEntity));
            } else {
                $httpBody = $webhookEntity;
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }

        // this endpoint requires Bearer (JWT) authentication (access token)
        if (!empty($this->config->getAccessToken())) {
            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'PATCH',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Operation webhookControllerVerifyEmail
     *
     * @param  string $id id (required)
     * @param  string $token token (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerVerifyEmail'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return void
     */
    public function webhookControllerVerifyEmail($id, $token, string $contentType = self::contentTypes['webhookControllerVerifyEmail'][0])
    {
        $this->webhookControllerVerifyEmailWithHttpInfo($id, $token, $contentType);
    }

    /**
     * Operation webhookControllerVerifyEmailWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $token (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerVerifyEmail'] to see the possible values for this operation
     *
     * @throws \EdgeBox\SyncCore\V2\Raw\ApiException on non-2xx response
     * @throws \InvalidArgumentException
     * @return array of null, HTTP status code, HTTP response headers (array of strings)
     */
    public function webhookControllerVerifyEmailWithHttpInfo($id, $token, string $contentType = self::contentTypes['webhookControllerVerifyEmail'][0])
    {
        $request = $this->webhookControllerVerifyEmailRequest($id, $token, $contentType);

        try {
            $options = $this->createHttpClientOption();
            try {
                $response = $this->client->send($request, $options);
            } catch (RequestException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
                );
            } catch (ConnectException $e) {
                throw new ApiException(
                    "[{$e->getCode()}] {$e->getMessage()}",
                    (int) $e->getCode(),
                    null,
                    null
                );
            }

            $statusCode = $response->getStatusCode();

            if ($statusCode < 200 || $statusCode > 299) {
                throw new ApiException(
                    sprintf(
                        '[%d] Error connecting to the API (%s)',
                        $statusCode,
                        (string) $request->getUri()
                    ),
                    $statusCode,
                    $response->getHeaders(),
                    (string) $response->getBody()
                );
            }

            return [null, $statusCode, $response->getHeaders()];

        } catch (ApiException $e) {
            switch ($e->getCode()) {
            }
            throw $e;
        }
    }

    /**
     * Operation webhookControllerVerifyEmailAsync
     *
     * @param  string $id (required)
     * @param  string $token (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerVerifyEmail'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function webhookControllerVerifyEmailAsync($id, $token, string $contentType = self::contentTypes['webhookControllerVerifyEmail'][0])
    {
        return $this->webhookControllerVerifyEmailAsyncWithHttpInfo($id, $token, $contentType)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }

    /**
     * Operation webhookControllerVerifyEmailAsyncWithHttpInfo
     *
     * @param  string $id (required)
     * @param  string $token (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerVerifyEmail'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function webhookControllerVerifyEmailAsyncWithHttpInfo($id, $token, string $contentType = self::contentTypes['webhookControllerVerifyEmail'][0])
    {
        $returnType = '';
        $request = $this->webhookControllerVerifyEmailRequest($id, $token, $contentType);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        (string) $response->getBody()
                    );
                }
            );
    }

    /**
     * Create request for operation 'webhookControllerVerifyEmail'
     *
     * @param  string $id (required)
     * @param  string $token (required)
     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['webhookControllerVerifyEmail'] to see the possible values for this operation
     *
     * @throws \InvalidArgumentException
     * @return \GuzzleHttp\Psr7\Request
     */
    public function webhookControllerVerifyEmailRequest($id, $token, string $contentType = self::contentTypes['webhookControllerVerifyEmail'][0])
    {

        // verify the required parameter 'id' is set
        if ($id === null || (is_array($id) && count($id) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling webhookControllerVerifyEmail'
            );
        }

        // verify the required parameter 'token' is set
        if ($token === null || (is_array($token) && count($token) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $token when calling webhookControllerVerifyEmail'
            );
        }


        $resourcePath = '/sync-core/webhook/{id}/verify/{token}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }
        // path params
        if ($token !== null) {
            $resourcePath = str_replace(
                '{' . 'token' . '}',
                ObjectSerializer::toPathValue($token),
                $resourcePath
            );
        }


        $headers = $this->headerSelector->selectHeaders(
            [],
            $contentType,
            $multipart
        );

        // for model (json/xml)
        if (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
                    foreach ($formParamValueItems as $formParamValueItem) {
                        $multipartContents[] = [
                            'name' => $formParamName,
                            'contents' => $formParamValueItem
                        ];
                    }
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
                # if Content-Type contains "application/json", json_encode the form parameters
                $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
            } else {
                // for HTTP post (form)
                $httpBody = ObjectSerializer::buildQuery($formParams);
            }
        }


        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $operationHost = $this->config->getHost();
        $query = ObjectSerializer::buildQuery($queryParams);
        return new Request(
            'GET',
            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }

    /**
     * Create http client option
     *
     * @throws \RuntimeException on file opening failure
     * @return array of http client options
     */
    protected function createHttpClientOption()
    {
        $options = [];
        if ($this->config->getDebug()) {
            $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
            if (!$options[RequestOptions::DEBUG]) {
                throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
            }
        }

        return $options;
    }
}
