text:
from linux import LinuxDevice

#TODO: obviously this is just thrown together

# class Device(BaseSystem):
#     def __init__(self, hostname):
#         super(Service, self).__init__(hostname)
#         self.hostname = hostname


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
    android:id="@+id/drawer_layout"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/fragmentContainer">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="80dp"
                    android:background="@color/app_green"
                    android:gravity="center_vertical"
                    android:orientation="horizontal">

                    <ImageView
                        android:id="@+id/my_farm_menu"
                        android:layout_width="40dp"
                        android:layout_height="30dp"
                        android:layout_weight="1"
                        android:src="@drawable/ic_action_left_menu" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="80dp"
                        android:layout_weight="4"
                        android:gravity="center"
                        android:text="MY FARM"
                        android:textColor="#ffffff"
                        android:textSize="16dp" />

                    <ImageView
                        android:layout_width="40dp"
                        android:layout_height="30dp"
                        android:layout_weight="1" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal">
                    <android.support.v7.widget.RecyclerView
                        xmlns:android="http://schemas.android.com/apk/res/android"
                        android:id="@+id/my_farm_recycler_view"
                        android:layout_weight="1"
                        android:layout_width="0dp"
                        android:layout_height="match_parent"
                        android:scaleType="fitXY"
                        android:background="#e0e0e0">

                    </android.support.v7.widget.RecyclerView>

                    <!--<FrameLayout-->
                        <!--android:id="@+id/fragment_container"-->
                        <!--android:layout_weight="2"-->
                        <!--android:layout_width="0dp"-->
                        <!--android:layout_height="match_parent">-->

                    <!--</FrameLayout>-->
                </LinearLayout>

            </LinearLayout>

        </FrameLayout>

    <LinearLayout
        android:id="@+id/nav_drawer_linear_layout"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_gravity="start"
        android:background="@color/white"
        android:gravity="center_horizontal"
        >

        <ImageView
            android:id="@+id/nav_drawer_image_view"
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:src="@drawable/landing"
            android:layout_marginTop="20dp"
            android:layout_marginBottom="20dp" />

        <ListView
            android:id="@+id/nav_drawer"
            android:layout_width="@dimen/navdrawer_width"
            android:layout_height="match_parent"
            android:choiceMode="singleChoice"
            android:divider="@android:color/transparent"
            android:dividerHeight="0dp"
            android:drawSelectorOnTop="false" />
    </LinearLayout>

</android.support.v4.widget.DrawerLayout>

redpajama_set_name: RedPajamaGithub


text:
/*
 * Metadatas for arbitraty models
 *
 * Metadata model can be defined here, and export them by adding to the hash
 * assigned to module.exports .
 */
(function (module) {

  "use strict";

  var mongoose = require('mongoose');
  var Schema = mongoose.Schema;

  var LabelMetadataSchema = new Schema({
    order: {type: Number, required: true, unique: true},
    title: {type: String, default: '' },
    color: {type: String, required: true, unique: true}
  });

  module.exports = {
    LabelMetadata: mongoose.model('LabelMetadata', LabelMetadataSchema)
  };

}(module));


text:
<?php
/**
 * CouponApi
 * PHP version 5
 *
 * @category Class
 * @package  Swagger\Client
 * @author   http://github.com/swagger-api/swagger-codegen
 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * Coupons Api
 *
 * TrustAndUse coupons api in the swagger-2.0 specification
 *
 * OpenAPI spec version: 1.0.0
 * Contact: sp@7indigo.com
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

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

namespace Swagger\Client\Api;

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

/**
 * CouponApi Class Doc Comment
 *
 * @category Class
 * @package  Swagger\Client
 * @author   http://github.com/swagger-api/swagger-codegen
 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class CouponApi
{

    /**
     * API Client
     *
     * @var \Swagger\Client\ApiClient instance of the ApiClient
     */
    protected $apiClient;

    /**
     * Constructor
     *
     * @param \Swagger\Client\ApiClient|null $apiClient The api client to use
     */
    public function __construct(\Swagger\Client\ApiClient $apiClient = null)
    {
        if ($apiClient == null) {
            $apiClient = new ApiClient();
            $apiClient->getConfig()->setHost('http://api.trustanduse.com/v1.0');
        }

        $this->apiClient = $apiClient;
    }

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

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

    /**
     * Operation addUserCoupon
     *
     *
     *
     * @param string $id ID for the Coupon (required)
     * @param \Swagger\Client\Model\CreateCouponUserRole $createCouponUserRole Coupon's User Priveleges Parameters for the couponID and UserID. (required)
     * @return \Swagger\Client\Model\UserID
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function addUserCoupon($id, $createCouponUserRole)
    {
        list($response) = $this->addUserCouponWithHttpInfo($id, $createCouponUserRole);
        return $response;
    }

    /**
     * Operation addUserCouponWithHttpInfo
     *
     *
     *
     * @param string $id ID for the Coupon (required)
     * @param \Swagger\Client\Model\CreateCouponUserRole $createCouponUserRole Coupon's User Priveleges Parameters for the couponID and UserID. (required)
     * @return Array of \Swagger\Client\Model\UserID, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function addUserCouponWithHttpInfo($id, $createCouponUserRole)
    {
        // verify the required parameter 'id' is set
        if ($id === null) {
            throw new \InvalidArgumentException('Missing the required parameter $id when calling addUserCoupon');
        }
        // verify the required parameter 'createCouponUserRole' is set
        if ($createCouponUserRole === null) {
            throw new \InvalidArgumentException('Missing the required parameter $createCouponUserRole when calling addUserCoupon');
        }
        // parse inputs
        $resourcePath = "/coupon/{id}/user";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

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

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

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'POST',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\UserID',
                '/coupon/{id}/user'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\UserID', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\UserID', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation allCouponCategories
     *
     *
     *
     * @param string $name Optional filter parameter to search for Coupon Categories with a name that contains value of parameter name. (optional)
     * @param string $description Optional filter parameter to search for Coupon Categories with description that contains value of parameter description. (optional)
     * @return \Swagger\Client\Model\CouponCategoriesArray
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function allCouponCategories($name = null, $description = null)
    {
        list($response) = $this->allCouponCategoriesWithHttpInfo($name, $description);
        return $response;
    }

    /**
     * Operation allCouponCategoriesWithHttpInfo
     *
     *
     *
     * @param string $name Optional filter parameter to search for Coupon Categories with a name that contains value of parameter name. (optional)
     * @param string $description Optional filter parameter to search for Coupon Categories with description that contains value of parameter description. (optional)
     * @return Array of \Swagger\Client\Model\CouponCategoriesArray, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function allCouponCategoriesWithHttpInfo($name = null, $description = null)
    {
        // parse inputs
        $resourcePath = "/coupon/categories";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

        // query params
        if ($name !== null) {
            $queryParams['name'] = $this->apiClient->getSerializer()->toQueryValue($name);
        }
        // query params
        if ($description !== null) {
            $queryParams['description'] = $this->apiClient->getSerializer()->toQueryValue($description);
        }
        // default format to json
        $resourcePath = str_replace("{format}", "json", $resourcePath);

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'GET',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\CouponCategoriesArray',
                '/coupon/categories'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\CouponCategoriesArray', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\CouponCategoriesArray', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation allCouponPrimitives
     *
     *
     *
     * @param string $name Optional filter parameter to search for Coupon Primitive with a name that contains value of parameter name. (optional)
     * @param string $description Optional filter parameter to search for Coupon Primitive with description that contains value of parameter description. (optional)
     * @return \Swagger\Client\Model\CouponPrimitivesArray
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function allCouponPrimitives($name = null, $description = null)
    {
        list($response) = $this->allCouponPrimitivesWithHttpInfo($name, $description);
        return $response;
    }

    /**
     * Operation allCouponPrimitivesWithHttpInfo
     *
     *
     *
     * @param string $name Optional filter parameter to search for Coupon Primitive with a name that contains value of parameter name. (optional)
     * @param string $description Optional filter parameter to search for Coupon Primitive with description that contains value of parameter description. (optional)
     * @return Array of \Swagger\Client\Model\CouponPrimitivesArray, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function allCouponPrimitivesWithHttpInfo($name = null, $description = null)
    {
        // parse inputs
        $resourcePath = "/coupon/primitive/all";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

        // query params
        if ($name !== null) {
            $queryParams['name'] = $this->apiClient->getSerializer()->toQueryValue($name);
        }
        // query params
        if ($description !== null) {
            $queryParams['description'] = $this->apiClient->getSerializer()->toQueryValue($description);
        }
        // default format to json
        $resourcePath = str_replace("{format}", "json", $resourcePath);

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'GET',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\CouponPrimitivesArray',
                '/coupon/primitive/all'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\CouponPrimitivesArray', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\CouponPrimitivesArray', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation allCoupons
     *
     *
     *
     * @param string $name Optional filter parameter to search for Coupons with a name that contains value of parameter name. (optional)
     * @param string $description Optional filter parameter to search for Coupons with description that contains value of parameter description. (optional)
     * @param string $kind Optional filter parameter to search for Coupons with kind that contains value of parameter kind. (optional)
     * @return \Swagger\Client\Model\CouponsArray
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function allCoupons($name = null, $description = null, $kind = null)
    {
        list($response) = $this->allCouponsWithHttpInfo($name, $description, $kind);
        return $response;
    }

    /**
     * Operation allCouponsWithHttpInfo
     *
     *
     *
     * @param string $name Optional filter parameter to search for Coupons with a name that contains value of parameter name. (optional)
     * @param string $description Optional filter parameter to search for Coupons with description that contains value of parameter description. (optional)
     * @param string $kind Optional filter parameter to search for Coupons with kind that contains value of parameter kind. (optional)
     * @return Array of \Swagger\Client\Model\CouponsArray, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function allCouponsWithHttpInfo($name = null, $description = null, $kind = null)
    {
        // parse inputs
        $resourcePath = "/coupon/all";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

        // query params
        if ($name !== null) {
            $queryParams['name'] = $this->apiClient->getSerializer()->toQueryValue($name);
        }
        // query params
        if ($description !== null) {
            $queryParams['description'] = $this->apiClient->getSerializer()->toQueryValue($description);
        }
        // query params
        if ($kind !== null) {
            $queryParams['kind'] = $this->apiClient->getSerializer()->toQueryValue($kind);
        }
        // default format to json
        $resourcePath = str_replace("{format}", "json", $resourcePath);

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'GET',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\CouponsArray',
                '/coupon/all'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\CouponsArray', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\CouponsArray', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation couponCategoryCreate
     *
     *
     *
     * @param \Swagger\Client\Model\CreateCouponCategoryParameters $createCouponCategoryParameters CouponCategory parameters for creating new category consisting of category name and description. Optionally free-form parameter in userDefinedObject and parent Coupon Category ID. (required)
     * @return \Swagger\Client\Model\CouponCategory
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function couponCategoryCreate($createCouponCategoryParameters)
    {
        list($response) = $this->couponCategoryCreateWithHttpInfo($createCouponCategoryParameters);
        return $response;
    }

    /**
     * Operation couponCategoryCreateWithHttpInfo
     *
     *
     *
     * @param \Swagger\Client\Model\CreateCouponCategoryParameters $createCouponCategoryParameters CouponCategory parameters for creating new category consisting of category name and description. Optionally free-form parameter in userDefinedObject and parent Coupon Category ID. (required)
     * @return Array of \Swagger\Client\Model\CouponCategory, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function couponCategoryCreateWithHttpInfo($createCouponCategoryParameters)
    {
        // verify the required parameter 'createCouponCategoryParameters' is set
        if ($createCouponCategoryParameters === null) {
            throw new \InvalidArgumentException('Missing the required parameter $createCouponCategoryParameters when calling couponCategoryCreate');
        }
        // parse inputs
        $resourcePath = "/coupon/category/create";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

        // default format to json
        $resourcePath = str_replace("{format}", "json", $resourcePath);

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

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'POST',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\CouponCategory',
                '/coupon/category/create'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\CouponCategory', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\CouponCategory', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation couponCategoryDelete
     *
     *
     *
     * @param string $id ID for the Coupon category to be deleted. (required)
     * @return \Swagger\Client\Model\Success
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function couponCategoryDelete($id)
    {
        list($response) = $this->couponCategoryDeleteWithHttpInfo($id);
        return $response;
    }

    /**
     * Operation couponCategoryDeleteWithHttpInfo
     *
     *
     *
     * @param string $id ID for the Coupon category to be deleted. (required)
     * @return Array of \Swagger\Client\Model\Success, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function couponCategoryDeleteWithHttpInfo($id)
    {
        // verify the required parameter 'id' is set
        if ($id === null) {
            throw new \InvalidArgumentException('Missing the required parameter $id when calling couponCategoryDelete');
        }
        // parse inputs
        $resourcePath = "/coupon/category/{id}/delete";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

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

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'DELETE',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\Success',
                '/coupon/category/{id}/delete'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Success', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Success', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation couponDelete
     *
     *
     *
     * @param string $id ID for the coupon being searched for. (required)
     * @param string $companyID Company ID Parameter for the company that the Coupon is connected to. Required only if the Coupon is connected with a company. (optional)
     * @param string $brandID Brand ID Parameter for the Brand that the Coupon is connected to. Required only if the Coupon is connected with a Brand. (optional)
     * @param string $storeID Store ID Parameter for the Store that the Coupon is connected to. Required only if the Coupon is connected with a Store. (optional)
     * @param string $merchantID Merchant ID Parameter for the Merchant that the Coupon is connected to. Required only if the Coupon is connected with a Merchant. (optional)
     * @param string $productID Product ID Parameter for the Product that the Coupon is connected to. Required only if the Coupon is connected with a Product. (optional)
     * @return \Swagger\Client\Model\Success
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function couponDelete($id, $companyID = null, $brandID = null, $storeID = null, $merchantID = null, $productID = null)
    {
        list($response) = $this->couponDeleteWithHttpInfo($id, $companyID, $brandID, $storeID, $merchantID, $productID);
        return $response;
    }

    /**
     * Operation couponDeleteWithHttpInfo
     *
     *
     *
     * @param string $id ID for the coupon being searched for. (required)
     * @param string $companyID Company ID Parameter for the company that the Coupon is connected to. Required only if the Coupon is connected with a company. (optional)
     * @param string $brandID Brand ID Parameter for the Brand that the Coupon is connected to. Required only if the Coupon is connected with a Brand. (optional)
     * @param string $storeID Store ID Parameter for the Store that the Coupon is connected to. Required only if the Coupon is connected with a Store. (optional)
     * @param string $merchantID Merchant ID Parameter for the Merchant that the Coupon is connected to. Required only if the Coupon is connected with a Merchant. (optional)
     * @param string $productID Product ID Parameter for the Product that the Coupon is connected to. Required only if the Coupon is connected with a Product. (optional)
     * @return Array of \Swagger\Client\Model\Success, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function couponDeleteWithHttpInfo($id, $companyID = null, $brandID = null, $storeID = null, $merchantID = null, $productID = null)
    {
        // verify the required parameter 'id' is set
        if ($id === null) {
            throw new \InvalidArgumentException('Missing the required parameter $id when calling couponDelete');
        }
        // parse inputs
        $resourcePath = "/coupon/{id}/delete";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

        // query params
        if ($companyID !== null) {
            $queryParams['companyID'] = $this->apiClient->getSerializer()->toQueryValue($companyID);
        }
        // query params
        if ($brandID !== null) {
            $queryParams['brandID'] = $this->apiClient->getSerializer()->toQueryValue($brandID);
        }
        // query params
        if ($storeID !== null) {
            $queryParams['storeID'] = $this->apiClient->getSerializer()->toQueryValue($storeID);
        }
        // query params
        if ($merchantID !== null) {
            $queryParams['merchantID'] = $this->apiClient->getSerializer()->toQueryValue($merchantID);
        }
        // query params
        if ($productID !== null) {
            $queryParams['productID'] = $this->apiClient->getSerializer()->toQueryValue($productID);
        }
        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                "{" . "id" . "}",
                $this->apiClient->getSerializer()->toPathValue($id),
                $resourcePath
            );
        }
        // default format to json
        $resourcePath = str_replace("{format}", "json", $resourcePath);

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'DELETE',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\Success',
                '/coupon/{id}/delete'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Success', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Success', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation couponPrimitiveDelete
     *
     *
     *
     * @param string $id ID for the Coupon primitive to be deleted. (required)
     * @return \Swagger\Client\Model\Success
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function couponPrimitiveDelete($id)
    {
        list($response) = $this->couponPrimitiveDeleteWithHttpInfo($id);
        return $response;
    }

    /**
     * Operation couponPrimitiveDeleteWithHttpInfo
     *
     *
     *
     * @param string $id ID for the Coupon primitive to be deleted. (required)
     * @return Array of \Swagger\Client\Model\Success, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function couponPrimitiveDeleteWithHttpInfo($id)
    {
        // verify the required parameter 'id' is set
        if ($id === null) {
            throw new \InvalidArgumentException('Missing the required parameter $id when calling couponPrimitiveDelete');
        }
        // parse inputs
        $resourcePath = "/coupon/primitive/{id}/delete";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

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

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'DELETE',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\Success',
                '/coupon/primitive/{id}/delete'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Success', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Success', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation createCoupon
     *
     *
     *
     * @param \Swagger\Client\Model\CreateCouponParameters $createCouponParameters Coupon Parameters (optional)
     * @return \Swagger\Client\Model\Coupon
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function createCoupon($createCouponParameters = null)
    {
        list($response) = $this->createCouponWithHttpInfo($createCouponParameters);
        return $response;
    }

    /**
     * Operation createCouponWithHttpInfo
     *
     *
     *
     * @param \Swagger\Client\Model\CreateCouponParameters $createCouponParameters Coupon Parameters (optional)
     * @return Array of \Swagger\Client\Model\Coupon, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function createCouponWithHttpInfo($createCouponParameters = null)
    {
        // parse inputs
        $resourcePath = "/coupon/create";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

        // default format to json
        $resourcePath = str_replace("{format}", "json", $resourcePath);

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

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'POST',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\Coupon',
                '/coupon/create'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Coupon', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 201:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Coupon', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation createCouponPrimitive
     *
     *
     *
     * @param \Swagger\Client\Model\CreatePrimitiveParameters $createPrimitiveParameters Coupon Primitive parameters including primitive name, description and primitive validator URL, validator inputs and validator outputs. (required)
     * @return \Swagger\Client\Model\CouponPrimitive
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function createCouponPrimitive($createPrimitiveParameters)
    {
        list($response) = $this->createCouponPrimitiveWithHttpInfo($createPrimitiveParameters);
        return $response;
    }

    /**
     * Operation createCouponPrimitiveWithHttpInfo
     *
     *
     *
     * @param \Swagger\Client\Model\CreatePrimitiveParameters $createPrimitiveParameters Coupon Primitive parameters including primitive name, description and primitive validator URL, validator inputs and validator outputs. (required)
     * @return Array of \Swagger\Client\Model\CouponPrimitive, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function createCouponPrimitiveWithHttpInfo($createPrimitiveParameters)
    {
        // verify the required parameter 'createPrimitiveParameters' is set
        if ($createPrimitiveParameters === null) {
            throw new \InvalidArgumentException('Missing the required parameter $createPrimitiveParameters when calling createCouponPrimitive');
        }
        // parse inputs
        $resourcePath = "/coupon/primitive/create";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

        // default format to json
        $resourcePath = str_replace("{format}", "json", $resourcePath);

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

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'POST',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\CouponPrimitive',
                '/coupon/primitive/create'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\CouponPrimitive', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\CouponPrimitive', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation getCouponCategoryDetails
     *
     *
     *
     * @param string $couponCategoryID ID for the Coupon Category being searched for. (required)
     * @return \Swagger\Client\Model\CouponCategory
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function getCouponCategoryDetails($couponCategoryID)
    {
        list($response) = $this->getCouponCategoryDetailsWithHttpInfo($couponCategoryID);
        return $response;
    }

    /**
     * Operation getCouponCategoryDetailsWithHttpInfo
     *
     *
     *
     * @param string $couponCategoryID ID for the Coupon Category being searched for. (required)
     * @return Array of \Swagger\Client\Model\CouponCategory, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function getCouponCategoryDetailsWithHttpInfo($couponCategoryID)
    {
        // verify the required parameter 'couponCategoryID' is set
        if ($couponCategoryID === null) {
            throw new \InvalidArgumentException('Missing the required parameter $couponCategoryID when calling getCouponCategoryDetails');
        }
        // parse inputs
        $resourcePath = "/coupon/category/{couponCategoryID}";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

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

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'GET',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\CouponCategory',
                '/coupon/category/{couponCategoryID}'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\CouponCategory', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\CouponCategory', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation getCouponDetails
     *
     *
     *
     * @param string $id ID for the coupon being searched for. (required)
     * @param string $companyID Company ID Parameter for the company that the Coupon is connected to. Required only if the Coupon is connected with a company. (optional)
     * @param string $brandID Brand ID Parameter for the Brand that the Coupon is connected to. Required only if the Coupon is connected with a Brand. (optional)
     * @param string $storeID Store ID Parameter for the Store that the Coupon is connected to. Required only if the Coupon is connected with a Store. (optional)
     * @param string $merchantID Merchant ID Parameter for the Merchant that the Coupon is connected to. Required only if the Coupon is connected with a Merchant. (optional)
     * @param string $productID Product ID Parameter for the Product that the Coupon is connected to. Required only if the Coupon is connected with a Product. (optional)
     * @return \Swagger\Client\Model\Coupon
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function getCouponDetails($id, $companyID = null, $brandID = null, $storeID = null, $merchantID = null, $productID = null)
    {
        list($response) = $this->getCouponDetailsWithHttpInfo($id, $companyID, $brandID, $storeID, $merchantID, $productID);
        return $response;
    }

    /**
     * Operation getCouponDetailsWithHttpInfo
     *
     *
     *
     * @param string $id ID for the coupon being searched for. (required)
     * @param string $companyID Company ID Parameter for the company that the Coupon is connected to. Required only if the Coupon is connected with a company. (optional)
     * @param string $brandID Brand ID Parameter for the Brand that the Coupon is connected to. Required only if the Coupon is connected with a Brand. (optional)
     * @param string $storeID Store ID Parameter for the Store that the Coupon is connected to. Required only if the Coupon is connected with a Store. (optional)
     * @param string $merchantID Merchant ID Parameter for the Merchant that the Coupon is connected to. Required only if the Coupon is connected with a Merchant. (optional)
     * @param string $productID Product ID Parameter for the Product that the Coupon is connected to. Required only if the Coupon is connected with a Product. (optional)
     * @return Array of \Swagger\Client\Model\Coupon, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function getCouponDetailsWithHttpInfo($id, $companyID = null, $brandID = null, $storeID = null, $merchantID = null, $productID = null)
    {
        // verify the required parameter 'id' is set
        if ($id === null) {
            throw new \InvalidArgumentException('Missing the required parameter $id when calling getCouponDetails');
        }
        // parse inputs
        $resourcePath = "/coupon/{id}/details";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

        // query params
        if ($companyID !== null) {
            $queryParams['companyID'] = $this->apiClient->getSerializer()->toQueryValue($companyID);
        }
        // query params
        if ($brandID !== null) {
            $queryParams['brandID'] = $this->apiClient->getSerializer()->toQueryValue($brandID);
        }
        // query params
        if ($storeID !== null) {
            $queryParams['storeID'] = $this->apiClient->getSerializer()->toQueryValue($storeID);
        }
        // query params
        if ($merchantID !== null) {
            $queryParams['merchantID'] = $this->apiClient->getSerializer()->toQueryValue($merchantID);
        }
        // query params
        if ($productID !== null) {
            $queryParams['productID'] = $this->apiClient->getSerializer()->toQueryValue($productID);
        }
        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                "{" . "id" . "}",
                $this->apiClient->getSerializer()->toPathValue($id),
                $resourcePath
            );
        }
        // default format to json
        $resourcePath = str_replace("{format}", "json", $resourcePath);

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'GET',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\Coupon',
                '/coupon/{id}/details'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Coupon', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Coupon', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation getCouponPrimitiveDetails
     *
     *
     *
     * @param string $primitiveID ID for the Coupon Primitive being searched for. (required)
     * @return \Swagger\Client\Model\CouponPrimitive
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function getCouponPrimitiveDetails($primitiveID)
    {
        list($response) = $this->getCouponPrimitiveDetailsWithHttpInfo($primitiveID);
        return $response;
    }

    /**
     * Operation getCouponPrimitiveDetailsWithHttpInfo
     *
     *
     *
     * @param string $primitiveID ID for the Coupon Primitive being searched for. (required)
     * @return Array of \Swagger\Client\Model\CouponPrimitive, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function getCouponPrimitiveDetailsWithHttpInfo($primitiveID)
    {
        // verify the required parameter 'primitiveID' is set
        if ($primitiveID === null) {
            throw new \InvalidArgumentException('Missing the required parameter $primitiveID when calling getCouponPrimitiveDetails');
        }
        // parse inputs
        $resourcePath = "/coupon/primitive/{primitiveID}/details";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

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

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'GET',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\CouponPrimitive',
                '/coupon/primitive/{primitiveID}/details'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\CouponPrimitive', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\CouponPrimitive', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation removeUserCoupon
     *
     *
     *
     * @param string $id ID for the Coupon (required)
     * @param \Swagger\Client\Model\DeleteCouponUserRole $deleteCouponUserRole Coupons User ID and Role to be removed  for the coupon ID. (required)
     * @return \Swagger\Client\Model\UserID
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function removeUserCoupon($id, $deleteCouponUserRole)
    {
        list($response) = $this->removeUserCouponWithHttpInfo($id, $deleteCouponUserRole);
        return $response;
    }

    /**
     * Operation removeUserCouponWithHttpInfo
     *
     *
     *
     * @param string $id ID for the Coupon (required)
     * @param \Swagger\Client\Model\DeleteCouponUserRole $deleteCouponUserRole Coupons User ID and Role to be removed  for the coupon ID. (required)
     * @return Array of \Swagger\Client\Model\UserID, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function removeUserCouponWithHttpInfo($id, $deleteCouponUserRole)
    {
        // verify the required parameter 'id' is set
        if ($id === null) {
            throw new \InvalidArgumentException('Missing the required parameter $id when calling removeUserCoupon');
        }
        // verify the required parameter 'deleteCouponUserRole' is set
        if ($deleteCouponUserRole === null) {
            throw new \InvalidArgumentException('Missing the required parameter $deleteCouponUserRole when calling removeUserCoupon');
        }
        // parse inputs
        $resourcePath = "/coupon/{id}/user";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

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

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

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'DELETE',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\UserID',
                '/coupon/{id}/user'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\UserID', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\UserID', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation updateCoupon
     *
     *
     *
     * @param string $id ID for the coupon to be updated. (required)
     * @param \Swagger\Client\Model\UpdateCouponParameters $updateCouponParameters Coupon Parameters consisting of name, description, kind, products ids, categories ids, subcategories ids, primitives ids and optionally store ids. (required)
     * @param string $companyID Company ID Parameter for the company that the Coupon is connected to. Required only if the Coupon is connected with a company. (optional)
     * @param string $brandID Brand ID Parameter for the Brand that the Coupon is connected to. Required only if the Coupon is connected with a Brand. (optional)
     * @param string $storeID Store ID Parameter for the Store that the Coupon is connected to. Required only if the Coupon is connected with a Store. (optional)
     * @param string $merchantID Merchant ID Parameter for the Merchant that the Coupon is connected to. Required only if the Coupon is connected with a Merchant. (optional)
     * @param string $productID Product ID Parameter for the Product that the Coupon is connected to. Required only if the Coupon is connected with a Product. (optional)
     * @return \Swagger\Client\Model\CouponID
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function updateCoupon($id, $updateCouponParameters, $companyID = null, $brandID = null, $storeID = null, $merchantID = null, $productID = null)
    {
        list($response) = $this->updateCouponWithHttpInfo($id, $updateCouponParameters, $companyID, $brandID, $storeID, $merchantID, $productID);
        return $response;
    }

    /**
     * Operation updateCouponWithHttpInfo
     *
     *
     *
     * @param string $id ID for the coupon to be updated. (required)
     * @param \Swagger\Client\Model\UpdateCouponParameters $updateCouponParameters Coupon Parameters consisting of name, description, kind, products ids, categories ids, subcategories ids, primitives ids and optionally store ids. (required)
     * @param string $companyID Company ID Parameter for the company that the Coupon is connected to. Required only if the Coupon is connected with a company. (optional)
     * @param string $brandID Brand ID Parameter for the Brand that the Coupon is connected to. Required only if the Coupon is connected with a Brand. (optional)
     * @param string $storeID Store ID Parameter for the Store that the Coupon is connected to. Required only if the Coupon is connected with a Store. (optional)
     * @param string $merchantID Merchant ID Parameter for the Merchant that the Coupon is connected to. Required only if the Coupon is connected with a Merchant. (optional)
     * @param string $productID Product ID Parameter for the Product that the Coupon is connected to. Required only if the Coupon is connected with a Product. (optional)
     * @return Array of \Swagger\Client\Model\CouponID, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function updateCouponWithHttpInfo($id, $updateCouponParameters, $companyID = null, $brandID = null, $storeID = null, $merchantID = null, $productID = null)
    {
        // verify the required parameter 'id' is set
        if ($id === null) {
            throw new \InvalidArgumentException('Missing the required parameter $id when calling updateCoupon');
        }
        // verify the required parameter 'updateCouponParameters' is set
        if ($updateCouponParameters === null) {
            throw new \InvalidArgumentException('Missing the required parameter $updateCouponParameters when calling updateCoupon');
        }
        // parse inputs
        $resourcePath = "/coupon/{id}/details";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

        // query params
        if ($companyID !== null) {
            $queryParams['companyID'] = $this->apiClient->getSerializer()->toQueryValue($companyID);
        }
        // query params
        if ($brandID !== null) {
            $queryParams['brandID'] = $this->apiClient->getSerializer()->toQueryValue($brandID);
        }
        // query params
        if ($storeID !== null) {
            $queryParams['storeID'] = $this->apiClient->getSerializer()->toQueryValue($storeID);
        }
        // query params
        if ($merchantID !== null) {
            $queryParams['merchantID'] = $this->apiClient->getSerializer()->toQueryValue($merchantID);
        }
        // query params
        if ($productID !== null) {
            $queryParams['productID'] = $this->apiClient->getSerializer()->toQueryValue($productID);
        }
        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                "{" . "id" . "}",
                $this->apiClient->getSerializer()->toPathValue($id),
                $resourcePath
            );
        }
        // default format to json
        $resourcePath = str_replace("{format}", "json", $resourcePath);

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

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'PUT',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\CouponID',
                '/coupon/{id}/details'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\CouponID', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\CouponID', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation updateCouponCategory
     *
     *
     *
     * @param string $couponCategoryID ID for the Coupon Category to be updated. (required)
     * @param \Swagger\Client\Model\UpdateCouponCategoryParameters $updateCouponCategoryParameters Coupon Category parameters (required)
     * @return \Swagger\Client\Model\CouponCategoryID
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function updateCouponCategory($couponCategoryID, $updateCouponCategoryParameters)
    {
        list($response) = $this->updateCouponCategoryWithHttpInfo($couponCategoryID, $updateCouponCategoryParameters);
        return $response;
    }

    /**
     * Operation updateCouponCategoryWithHttpInfo
     *
     *
     *
     * @param string $couponCategoryID ID for the Coupon Category to be updated. (required)
     * @param \Swagger\Client\Model\UpdateCouponCategoryParameters $updateCouponCategoryParameters Coupon Category parameters (required)
     * @return Array of \Swagger\Client\Model\CouponCategoryID, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function updateCouponCategoryWithHttpInfo($couponCategoryID, $updateCouponCategoryParameters)
    {
        // verify the required parameter 'couponCategoryID' is set
        if ($couponCategoryID === null) {
            throw new \InvalidArgumentException('Missing the required parameter $couponCategoryID when calling updateCouponCategory');
        }
        // verify the required parameter 'updateCouponCategoryParameters' is set
        if ($updateCouponCategoryParameters === null) {
            throw new \InvalidArgumentException('Missing the required parameter $updateCouponCategoryParameters when calling updateCouponCategory');
        }
        // parse inputs
        $resourcePath = "/coupon/category/{couponCategoryID}";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

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

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

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'PUT',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\CouponCategoryID',
                '/coupon/category/{couponCategoryID}'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\CouponCategoryID', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\CouponCategoryID', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation updateCouponPrimitive
     *
     *
     *
     * @param string $primitiveID ID for the Coupon Primitive to be updated. (required)
     * @param \Swagger\Client\Model\UpdateCouponPrimitiveParameters $updateCouponPrimitiveParameters Coupon Primitive parameters includingprimitive name, description, validator URL, validator inputs and validator outputs. (required)
     * @return \Swagger\Client\Model\CouponPrimitiveID
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function updateCouponPrimitive($primitiveID, $updateCouponPrimitiveParameters)
    {
        list($response) = $this->updateCouponPrimitiveWithHttpInfo($primitiveID, $updateCouponPrimitiveParameters);
        return $response;
    }

    /**
     * Operation updateCouponPrimitiveWithHttpInfo
     *
     *
     *
     * @param string $primitiveID ID for the Coupon Primitive to be updated. (required)
     * @param \Swagger\Client\Model\UpdateCouponPrimitiveParameters $updateCouponPrimitiveParameters Coupon Primitive parameters includingprimitive name, description, validator URL, validator inputs and validator outputs. (required)
     * @return Array of \Swagger\Client\Model\CouponPrimitiveID, HTTP status code, HTTP response headers (array of strings)
     * @throws \Swagger\Client\ApiException on non-2xx response
     */
    public function updateCouponPrimitiveWithHttpInfo($primitiveID, $updateCouponPrimitiveParameters)
    {
        // verify the required parameter 'primitiveID' is set
        if ($primitiveID === null) {
            throw new \InvalidArgumentException('Missing the required parameter $primitiveID when calling updateCouponPrimitive');
        }
        // verify the required parameter 'updateCouponPrimitiveParameters' is set
        if ($updateCouponPrimitiveParameters === null) {
            throw new \InvalidArgumentException('Missing the required parameter $updateCouponPrimitiveParameters when calling updateCouponPrimitive');
        }
        // parse inputs
        $resourcePath = "/coupon/primitive/{primitiveID}/details";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));

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

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

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires OAuth (access token)
        if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
            $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'PUT',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Swagger\Client\Model\CouponPrimitiveID',
                '/coupon/primitive/{primitiveID}/details'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\CouponPrimitiveID', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\CouponPrimitiveID', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
                default:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Error', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

}