├── test ├── Docs │ ├── private.pem │ ├── SignTest1.docx │ └── SignTest1.pdf ├── bootstrap.php ├── phpunit.xml ├── UnitTests.php ├── TestConfig.php-sample └── TestConfig.php ├── .swagger-codegen └── VERSION ├── .gitignore ├── linter.sh ├── .travis.yml ├── ruleset.xml ├── .php_cs ├── LICENSE ├── composer.json ├── autoload.php ├── .swagger-codegen-ignore ├── CHANGELOG.md ├── src ├── Model │ ├── ModelInterface.php │ ├── Filter.php │ ├── Aggregation.php │ ├── AggregateResult.php │ ├── AggregateResultResult.php │ ├── CursoredResult.php │ ├── DataSet.php │ ├── RawRequest.php │ └── WebQuery.php ├── Client │ ├── Auth │ │ ├── OAuth.php │ │ ├── Link.php │ │ ├── Organization.php │ │ ├── Account.php │ │ ├── OAuthToken.php │ │ └── UserInfo.php │ └── ApiException.php ├── HeaderSelector.php ├── Api │ └── DataSetApi.php ├── ObjectSerializer.php └── Configuration.php └── README.md /test/Docs/private.pem: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.swagger-codegen/VERSION: -------------------------------------------------------------------------------- 1 | 2.4.21 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | composer.lock 2 | vendor 3 | .DS_Store 4 | .idea 5 | .phpunit.result.cache -------------------------------------------------------------------------------- /test/Docs/SignTest1.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/docusign-monitor-php-client/master/test/Docs/SignTest1.docx -------------------------------------------------------------------------------- /test/Docs/SignTest1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/docusign-monitor-php-client/master/test/Docs/SignTest1.pdf -------------------------------------------------------------------------------- /linter.sh: -------------------------------------------------------------------------------- 1 | ./vendor/bin/phpcbf -p src --extensions=php -d memory_limit=512M 2 | ./vendor/bin/phpcs src --standard=ruleset.xml -------------------------------------------------------------------------------- /test/bootstrap.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docusign custom coding standard. 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.php_cs: -------------------------------------------------------------------------------- 1 | level(Symfony\CS\FixerInterface::PSR2_LEVEL) 5 | ->setUsingCache(true) 6 | ->fixers( 7 | [ 8 | 'ordered_use', 9 | 'phpdoc_order', 10 | 'short_array_syntax', 11 | 'strict', 12 | 'strict_param' 13 | ] 14 | ) 15 | ->finder( 16 | Symfony\CS\Finder\DefaultFinder::create() 17 | ->in(__DIR__) 18 | ); 19 | -------------------------------------------------------------------------------- /test/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | ./ 11 | 12 | 13 | 14 | 15 | 16 | ./src/Api 17 | ./src/Client 18 | ./src/Model 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2016- DocuSign, Inc. (https://www.docusign.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docusign/monitor-client", 3 | "description": "The Docusign package makes integrating Docusign into your apps and websites a super fast and painless process. The library is open sourced on GitHub, look for the docusign-monitor-php-client repository.", 4 | "keywords": [ 5 | "Docusign", 6 | "Monitor", 7 | "php", 8 | "sdk", 9 | "api" 10 | ], 11 | "homepage": "https://developers.docusign.com", 12 | "license": "MIT", 13 | "authors": [ 14 | { 15 | "name": "DocuSign", 16 | "homepage": "https://developers.docusign.com" 17 | } 18 | ], 19 | "require": { 20 | "php": ">=7.4", 21 | "ext-curl": "*", 22 | "ext-json": "*", 23 | "ext-mbstring": "*", 24 | "firebase/php-jwt": "^6.0" 25 | }, 26 | "require-dev": { 27 | "phpunit/phpunit": "~4.8", 28 | "satooshi/php-coveralls": "~1.0", 29 | "squizlabs/php_codesniffer": "~2.6", 30 | "friendsofphp/php-cs-fixer": "*" 31 | }, 32 | "autoload": { 33 | "psr-4": { "DocuSign\\Monitor\\" : "src/" } 34 | }, 35 | "autoload-dev": { 36 | "psr-4": { "DocuSign\\Monitor\\" : "test/" } 37 | } 38 | } -------------------------------------------------------------------------------- /autoload.php: -------------------------------------------------------------------------------- 1 | setHost($testConfig->getHost()); 22 | 23 | $testConfig->setApiClient(new DocuSign\Monitor\Client\ApiClient($config)); 24 | $testConfig->getApiClient()->getOAuth()->setBasePath($testConfig->getHost()); 25 | 26 | $scope = ["signature"]; 27 | 28 | $token = $testConfig->getApiClient()->requestJWTUserToken($testConfig->getIntegratorKey(),$testConfig->getUserId(), $testConfig->getClientKey(), $scope); 29 | 30 | $this->assertInstanceOf('DocuSign\Monitor\Client\Auth\OAuthToken', $token[0]); 31 | $this->assertArrayHasKey('access_token', $token[0]); 32 | 33 | $user = $testConfig->getApiClient()->getUserInfo($token[0]['access_token']); 34 | 35 | $this->assertNotEmpty($user); 36 | $this->assertEquals($user[1], 200); 37 | 38 | $this->assertInstanceOf('DocuSign\Monitor\Client\Auth\UserInfo', $user[0]); 39 | $this->assertNotEmpty($user[0]); 40 | 41 | $this->assertArrayHasKey('accounts', $user[0]); 42 | $loginAccount = $user[0]['accounts'][0]; 43 | $accountId = $loginAccount->getAccountId(); 44 | 45 | $this->assertNotEmpty($accountId); 46 | 47 | $testConfig->setAccountId($accountId); 48 | 49 | return $testConfig; 50 | } 51 | 52 | /** 53 | * @depends testLogin 54 | */ 55 | public function testMonitor($testConfig) 56 | { 57 | $monitorApi = new DocuSign\Monitor\Api\DataSetApi($testConfig->getApiClient()); 58 | $data_set_name = 'monitor'; 59 | $version = '2.0'; 60 | $dataset_stream = $monitorApi->getStream($data_set_name, $version); 61 | $this->assertNotEmpty($dataset_stream); 62 | 63 | } 64 | } 65 | 66 | ?> 67 | -------------------------------------------------------------------------------- /src/Model/ModelInterface.php: -------------------------------------------------------------------------------- 1 | 10 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 11 | * @link https://github.com/swagger-api/swagger-codegen 12 | */ 13 | 14 | /** 15 | * Monitor API 16 | * 17 | * An API for an integrator to access the features of DocuSign Monitor 18 | * 19 | * OpenAPI spec version: v2.0 20 | * Contact: devcenter@docusign.com 21 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 22 | * Swagger Codegen version: 2.4.21 23 | */ 24 | 25 | /** 26 | * NOTE: This class is auto generated by the swagger code generator program. 27 | * https://github.com/swagger-api/swagger-codegen 28 | * Do not edit the class manually. 29 | */ 30 | 31 | namespace DocuSign\Monitor\Model; 32 | 33 | /** 34 | * Interface abstracting model access. 35 | * 36 | * @category Interface 37 | * @package DocuSign\Monitor\Model 38 | * @author Swagger Codegen team 39 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 40 | * @link https://github.com/swagger-api/swagger-codegen 41 | */ 42 | interface ModelInterface 43 | { 44 | /** 45 | * The original name of the model. 46 | * 47 | * @return string 48 | */ 49 | public function getModelName(); 50 | 51 | /** 52 | * Array of property to type mappings. Used for (de)serialization 53 | * 54 | * @return array 55 | */ 56 | public static function swaggerTypes(); 57 | 58 | /** 59 | * Array of property to format mappings. Used for (de)serialization 60 | * 61 | * @return array 62 | */ 63 | public static function swaggerFormats(); 64 | 65 | /** 66 | * Array of attributes where the key is the local name, and the value is the original name 67 | * 68 | * @return array 69 | */ 70 | public static function attributeMap(); 71 | 72 | /** 73 | * Array of attributes to setter functions (for deserialization of responses) 74 | * 75 | * @return array 76 | */ 77 | public static function setters(); 78 | 79 | /** 80 | * Array of attributes to getter functions (for serialization of requests) 81 | * 82 | * @return array 83 | */ 84 | public static function getters(); 85 | 86 | /** 87 | * Show all the invalid properties with reasons. 88 | * 89 | * @return array 90 | */ 91 | public function listInvalidProperties(); 92 | 93 | /** 94 | * Validate all the properties in the model 95 | * return true if all passed 96 | * 97 | * @return bool 98 | */ 99 | public function valid(); 100 | } 101 | -------------------------------------------------------------------------------- /src/Client/Auth/OAuth.php: -------------------------------------------------------------------------------- 1 | oAuthBasePath = $oAuthBasePath; 65 | return $this; 66 | } 67 | 68 | //Derive OAuth Base Path if not given. 69 | if (substr($this->getBasePath(), 0, 14) === "https://lens-d" 70 | || substr($this->getBasePath(), 0, 13) === "http://lens-d" 71 | ) { 72 | $this->oAuthBasePath = self::$DEMO_OAUTH_BASE_PATH; 73 | } elseif (substr($this->getBasePath(), 0, 14) === "https://lens-s" 74 | || substr($this->getBasePath(), 0, 13) === "http://lens-s" 75 | ) { 76 | $this->oAuthBasePath = self::$STAGE_OAUTH_BASE_PATH; 77 | } else { 78 | $this->oAuthBasePath = self::$PRODUCTION_OAUTH_BASE_PATH; 79 | } 80 | 81 | return $this; 82 | } 83 | 84 | /** 85 | * Gets the OAuth base Path 86 | * @return string 87 | */ 88 | public function getOAuthBasePath() 89 | { 90 | if (!$this->oAuthBasePath) { 91 | $this->setOAuthBasePath(); 92 | } 93 | return $this->oAuthBasePath; 94 | } 95 | 96 | /** 97 | * Sets the Rest API base Path 98 | * 99 | * @param string $basePath base path for oAuth 100 | * 101 | * @return OAuth 102 | */ 103 | public function setBasePath($basePath = null) 104 | { 105 | $this->basePath = $basePath; 106 | return $this; 107 | } 108 | 109 | /** 110 | * Returns the Rest API Base path 111 | * 112 | * @return string 113 | */ 114 | public function getBasePath() 115 | { 116 | return $this->basePath; 117 | } 118 | 119 | } 120 | -------------------------------------------------------------------------------- /src/Client/ApiException.php: -------------------------------------------------------------------------------- 1 | responseHeaders = $responseHeaders; 77 | $this->responseBody = $responseBody; 78 | } 79 | 80 | /** 81 | * Gets the HTTP response header 82 | * 83 | * @return string HTTP response header 84 | */ 85 | public function getResponseHeaders() 86 | { 87 | return $this->responseHeaders; 88 | } 89 | 90 | /** 91 | * Gets the HTTP body of the server response either as Json or string 92 | * 93 | * @return mixed HTTP body of the server response either as Json or string 94 | */ 95 | public function getResponseBody() 96 | { 97 | return $this->responseBody; 98 | } 99 | 100 | /** 101 | * Sets the deseralized response object (during deserialization) 102 | * 103 | * @param mixed $obj Deserialized response object 104 | * 105 | * @return void 106 | */ 107 | public function setResponseObject($obj) 108 | { 109 | $this->responseObject = $obj; 110 | } 111 | 112 | /** 113 | * Gets the deseralized response object (during deserialization) 114 | * 115 | * @return mixed the deserialized response object 116 | */ 117 | public function getResponseObject() 118 | { 119 | return $this->responseObject; 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /src/HeaderSelector.php: -------------------------------------------------------------------------------- 1 | 9 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 10 | * @link https://github.com/swagger-api/swagger-codegen 11 | */ 12 | 13 | /** 14 | * Monitor API 15 | * 16 | * An API for an integrator to access the features of DocuSign Monitor 17 | * 18 | * OpenAPI spec version: v2.0 19 | * Contact: devcenter@docusign.com 20 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 21 | * Swagger Codegen version: 2.4.21 22 | */ 23 | 24 | /** 25 | * NOTE: This class is auto generated by the swagger code generator program. 26 | * https://github.com/swagger-api/swagger-codegen 27 | * Do not edit the class manually. 28 | */ 29 | 30 | namespace DocuSign\Monitor; 31 | 32 | use \Exception; 33 | 34 | /** 35 | * ApiException Class Doc Comment 36 | * 37 | * @category Class 38 | * @package DocuSign\Monitor 39 | * @author Swagger Codegen team 40 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 41 | * @link https://github.com/swagger-api/swagger-codegen 42 | */ 43 | class HeaderSelector 44 | { 45 | 46 | /** 47 | * SelectHeaders method comment 48 | * 49 | * @param string[] $accept list of strings 50 | * @param string[] $contentTypes list of strings for contentTypes 51 | * 52 | * @return array 53 | */ 54 | public function selectHeaders($accept, $contentTypes) 55 | { 56 | $headers = []; 57 | 58 | $accept = $this->_selectAcceptHeader($accept); 59 | if ($accept !== null) { 60 | $headers['Accept'] = $accept; 61 | } 62 | 63 | $headers['Content-Type'] = $this->_selectContentTypeHeader($contentTypes); 64 | return $headers; 65 | } 66 | 67 | /** 68 | * SelectHeadersForMultipart method comment 69 | * 70 | * @param string[] $accept list of strings 71 | * 72 | * @return array 73 | */ 74 | public function selectHeadersForMultipart($accept) 75 | { 76 | $headers = $this->selectHeaders($accept, []); 77 | 78 | unset($headers['Content-Type']); 79 | return $headers; 80 | } 81 | 82 | /** 83 | * Return the header 'Accept' based on an array of Accept provided 84 | * 85 | * @param string[] $accept Array of header 86 | * 87 | * @return string Accept (e.g. application/json) 88 | */ 89 | private function _selectAcceptHeader($accept) 90 | { 91 | if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { 92 | return null; 93 | } elseif (preg_grep("/application\/json/i", $accept)) { 94 | return 'application/json'; 95 | } else { 96 | return implode(',', $accept); 97 | } 98 | } 99 | 100 | /** 101 | * Return the content type based on an array of content-type provided 102 | * 103 | * @param string[] $contentType Array fo content-type 104 | * 105 | * @return string Content-Type (e.g. application/json) 106 | */ 107 | private function _selectContentTypeHeader($contentType) 108 | { 109 | if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { 110 | return 'application/json'; 111 | } elseif (preg_grep("/application\/json/i", $contentType)) { 112 | return 'application/json'; 113 | } else { 114 | return implode(',', $contentType); 115 | } 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Official DocuSign Monitor PHP Client SDK 2 | 3 | [![Build status][travis-image]][travis-url] 4 | 5 | ## Requirements 6 | 7 | - PHP 7.4+ 8 | - Free [Developer Sandbox](https://go.docusign.com/sandbox/productshot/?elqCampaignId=16531) 9 | 10 | ## Compatibility 11 | 12 | - PHP 7.4+ 13 | 14 | ## Note 15 | 16 | This open-source SDK is provided for cases where you would like to make additional changes that the SDK does not provide out-of-the-box. If you simply want to use the SDK with any of the examples shown in the [Developer Center](https://developers.docusign.com/monitor-rest-api/code-examples), follow the installation instructions below. 17 | 18 | ## Installation 19 | 20 | ### Composer: 21 | 22 | 1. In your **PHP console** , type: 23 | **Composer require docusign/monitor-client;** 24 | 2. To use the package automatically, add to Composer's **Autoload** file: 25 | **require_once('vendor/autoload.php');** 26 | 27 | ### Manual install: 28 | 29 |
    30 |
  1. Download or clone this repository.
  2. 31 |
  3. Bind the PHP SDK to your server or place it in a static location. 32 |
      33 |
    1. To bind to your server, edit the init.php file. Add:
      34 | require_once('/path/to/docusign-monitor-client/autoload.php');
    2. 35 |
    3. To bind to single pages: In your PHP file that will utilize the PHP SDK, add:
      36 | `require_once('/path/to/docusign-monitor-client/autoload.php');
    4. 37 |
    38 |
  4. 39 |
40 | 41 | ## Dependencies 42 | 43 | This client has the following external dependencies: 44 | 45 | - [PHP cURL extension](https://www.php.net/manual/en/intro.curl.php) 46 | - [PHP JSON extension](https://php.net/manual/en/book.json.php) 47 | 48 | ## Code Examples 49 | 50 | ### Launchers 51 | 52 | DocuSign provides a sample application referred to as a [Launcher](https://github.com/docusign/eg-03-php-auth-code-grant). The Launcher contains a set of 18 common use cases and associated source files. These examples use DocuSign's [Authorization Code Grant](https://developers.docusign.com/monitor-rest-api/guides/authentication/oauth2-code-grant) flow. 53 | 54 | ## Proof-of-concept applications 55 | 56 | If your goal is to create a proof-of-concept application, DocuSign provides a set of [Quick Start](https://github.com/docusign/qs-php) examples. The Quick Startexamples are meant to be used with DocuSign's [OAuth Token Generator](https://developers.docusign.com/oauth-token-generator), which will allow you to generate tokens for the Demo/Sandbox environment only. These tokens last for eight hours and will enable you to build your proof-of-concept application without the need to fully implement an OAuth solution. 57 | 58 | ## OAuth Implementations 59 | 60 | For details regarding which type of OAuth grant will work best for your DocuSign integration, see the [REST API Authentication Overview](https://developers.docusign.com/monitor-rest-api/guides/authentication) guide located on the [DocuSign Developer Center](https://developers.docusign.com/monitor-rest-api/guides/authentication). 61 | 62 | For security purposes, DocuSign recommends using the [Authorization Code Grant](https://developers.docusign.com/monitor-rest-api/guides/authentication/oauth2-code-grant) flow. 63 | 64 | There are other use-case scenarios, such as **single-page applications** (SPA) that use **Cross-Origin Resource Sharing** (CORS), or where there may not be a user to interact with your Service Account. For these use cases, DocuSign also supports [JWT](https://developers.docusign.com/monitor-rest-api/guides/authentication/oauth2-jsonwebtoken) and [Implicit](https://developers.docusign.com/monitor-rest-api/guides/authentication/oauth2-implicit) grants. For code examples, see the links below: 65 | 66 | - [JWT (JSON Web Token)](https://github.com/docusign/eg-03-php-auth-code-grant) 67 | - Implicit Grant (coming soon) 68 | 69 | ## Support 70 | 71 | Log issues against this client through GitHub. We also have an [active developer community on Stack Overflow](https://stackoverflow.com/questions/tagged/docusignapi). 72 | 73 | ## License 74 | 75 | The DocuSign Monitor PHP Client is licensed under the [MIT License](https://github.com/docusign/docusign-monitor-php-client/blob/master/LICENSE). 76 | 77 | [travis-image]: https://img.shields.io/travis/docusign/docusign-monitor-php-client.svg?style=flat 78 | [travis-url]: https://travis-ci.org/docusign/docusign-monitor-php-client 79 | -------------------------------------------------------------------------------- /src/Client/Auth/Link.php: -------------------------------------------------------------------------------- 1 | 'string', 53 | 'href' => 'string', 54 | ]; 55 | 56 | public static function swaggerTypes() 57 | { 58 | return self::$swaggerTypes; 59 | } 60 | 61 | /** 62 | * Array of attributes where the key is the local name, and the value is the original name 63 | * @var string[] 64 | */ 65 | protected static $attributeMap = [ 66 | 'rel' => 'rel', 67 | 'href' => 'href', 68 | ]; 69 | 70 | /** 71 | * Array of attributes to setter functions (for deserialization of responses) 72 | * @var string[] 73 | */ 74 | protected static $setters = [ 75 | 'rel' => 'setRel', 76 | 'href' => 'setHref', 77 | ]; 78 | 79 | 80 | /** 81 | * Array of attributes to getter functions (for serialization of requests) 82 | * @var string[] 83 | */ 84 | protected static $getters = [ 85 | 'rel' => 'getRel', 86 | 'href' => 'getHref', 87 | ]; 88 | 89 | public static function attributeMap() 90 | { 91 | return self::$attributeMap; 92 | } 93 | 94 | public static function setters() 95 | { 96 | return self::$setters; 97 | } 98 | 99 | public static function getters() 100 | { 101 | return self::$getters; 102 | } 103 | 104 | /** 105 | * Associative array for storing property values 106 | * @var mixed[] 107 | */ 108 | protected $container = []; 109 | 110 | /** 111 | * Constructor 112 | * @param mixed[] $data Associated array of property values initializing the model 113 | */ 114 | public function __construct(array $data = null) 115 | { 116 | $this->container['rel'] = isset($data['rel']) ? $data['rel'] : null; 117 | $this->container['href'] = isset($data['href']) ? $data['href'] : null; 118 | } 119 | 120 | /** 121 | * show all the invalid properties with reasons. 122 | * 123 | * @return array invalid properties with reasons 124 | */ 125 | public function listInvalidProperties() 126 | { 127 | $invalid_properties = []; 128 | return $invalid_properties; 129 | } 130 | 131 | /** 132 | * validate all the properties in the model 133 | * return true if all passed 134 | * 135 | * @return bool True if all properteis are valid 136 | */ 137 | public function valid() 138 | { 139 | return true; 140 | } 141 | 142 | 143 | /** 144 | * Gets rel 145 | * @return string 146 | */ 147 | public function getRel() 148 | { 149 | return $this->container['rel']; 150 | } 151 | 152 | /** 153 | * Sets rel 154 | * @param string $rel 155 | * @return $this 156 | */ 157 | public function setRel($rel) 158 | { 159 | $this->container['rel'] = $rel; 160 | 161 | return $this; 162 | } 163 | 164 | /** 165 | * Gets href 166 | * @return string 167 | */ 168 | public function getHref() 169 | { 170 | return $this->container['href']; 171 | } 172 | 173 | /** 174 | * Sets href 175 | * @param string $href 176 | * @return $this 177 | */ 178 | public function setHref($href) 179 | { 180 | $this->container['href'] = $href; 181 | 182 | return $this; 183 | } 184 | 185 | /** 186 | * Returns true if offset exists. False otherwise. 187 | * @param integer $offset Offset 188 | * @return boolean 189 | */ 190 | public function offsetExists($offset) 191 | { 192 | return isset($this->container[$offset]); 193 | } 194 | 195 | /** 196 | * Gets offset. 197 | * @param integer $offset Offset 198 | * @return mixed 199 | */ 200 | public function offsetGet($offset) 201 | { 202 | return isset($this->container[$offset]) ? $this->container[$offset] : null; 203 | } 204 | 205 | /** 206 | * Sets value based on offset. 207 | * @param integer $offset Offset 208 | * @param mixed $value Value to be set 209 | * @return void 210 | */ 211 | public function offsetSet($offset, $value) 212 | { 213 | if (is_null($offset)) { 214 | $this->container[] = $value; 215 | } else { 216 | $this->container[$offset] = $value; 217 | } 218 | } 219 | 220 | /** 221 | * Unsets offset. 222 | * @param integer $offset Offset 223 | * @return void 224 | */ 225 | public function offsetUnset($offset) 226 | { 227 | unset($this->container[$offset]); 228 | } 229 | 230 | /** 231 | * Gets the string presentation of the object 232 | * @return string 233 | */ 234 | public function __toString() 235 | { 236 | if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print 237 | return json_encode(\DocuSign\Monitor\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); 238 | } 239 | 240 | return json_encode(\DocuSign\Monitor\ObjectSerializer::sanitizeForSerialization($this)); 241 | } 242 | } 243 | 244 | 245 | -------------------------------------------------------------------------------- /src/Client/Auth/Organization.php: -------------------------------------------------------------------------------- 1 | 'string', 53 | 'links' => '\DocuSign\Monitor\Client\Auth\Link[]', 54 | ]; 55 | 56 | public static function swaggerTypes() 57 | { 58 | return self::$swaggerTypes; 59 | } 60 | 61 | /** 62 | * Array of attributes where the key is the local name, and the value is the original name 63 | * @var string[] 64 | */ 65 | protected static $attributeMap = [ 66 | 'organization_id' => 'organization_id', 67 | 'links' => 'links', 68 | ]; 69 | 70 | /** 71 | * Array of attributes to setter functions (for deserialization of responses) 72 | * @var string[] 73 | */ 74 | protected static $setters = [ 75 | 'organization_id' => 'setOrganizationId', 76 | 'links' => 'setLinks', 77 | ]; 78 | 79 | 80 | /** 81 | * Array of attributes to getter functions (for serialization of requests) 82 | * @var string[] 83 | */ 84 | protected static $getters = [ 85 | 'organization_id' => 'getOrganizationId', 86 | 'links' => 'getLinks', 87 | ]; 88 | 89 | public static function attributeMap() 90 | { 91 | return self::$attributeMap; 92 | } 93 | 94 | public static function setters() 95 | { 96 | return self::$setters; 97 | } 98 | 99 | public static function getters() 100 | { 101 | return self::$getters; 102 | } 103 | 104 | /** 105 | * Associative array for storing property values 106 | * @var mixed[] 107 | */ 108 | protected $container = []; 109 | 110 | /** 111 | * Constructor 112 | * @param mixed[] $data Associated array of property values initializing the model 113 | */ 114 | public function __construct(array $data = null) 115 | { 116 | $this->container['organization_id'] = isset($data['organization_id']) ? $data['organization_id'] : null; 117 | $this->container['links'] = isset($data['links']) ? $data['links'] : null; 118 | } 119 | 120 | /** 121 | * show all the invalid properties with reasons. 122 | * 123 | * @return array invalid properties with reasons 124 | */ 125 | public function listInvalidProperties() 126 | { 127 | $invalid_properties = []; 128 | return $invalid_properties; 129 | } 130 | 131 | /** 132 | * validate all the properties in the model 133 | * return true if all passed 134 | * 135 | * @return bool True if all properteis are valid 136 | */ 137 | public function valid() 138 | { 139 | return true; 140 | } 141 | 142 | 143 | /** 144 | * Gets organization_id 145 | * @return string 146 | */ 147 | public function getOrganizationId() 148 | { 149 | return $this->container['organization_id']; 150 | } 151 | 152 | /** 153 | * Sets organization_id 154 | * @param string $organization_id 155 | * @return $this 156 | */ 157 | public function setOrganizationId($organization_id) 158 | { 159 | $this->container['organization_id'] = $organization_id; 160 | 161 | return $this; 162 | } 163 | 164 | /** 165 | * Gets links 166 | * @return string 167 | */ 168 | public function getLinks() 169 | { 170 | return $this->container['links']; 171 | } 172 | 173 | /** 174 | * Sets links 175 | * @param string $links 176 | * @return $this 177 | */ 178 | public function setLinks($links) 179 | { 180 | $this->container['links'] = $links; 181 | 182 | return $this; 183 | } 184 | 185 | /** 186 | * Sets links 187 | * @param string $links 188 | * @return $this 189 | */ 190 | public function setHref($links) 191 | { 192 | $this->container['links'] = $links; 193 | 194 | return $this; 195 | } 196 | 197 | /** 198 | * Returns true if offset exists. False otherwise. 199 | * @param integer $offset Offset 200 | * @return boolean 201 | */ 202 | public function offsetExists($offset) 203 | { 204 | return isset($this->container[$offset]); 205 | } 206 | 207 | /** 208 | * Gets offset. 209 | * @param integer $offset Offset 210 | * @return mixed 211 | */ 212 | public function offsetGet($offset) 213 | { 214 | return isset($this->container[$offset]) ? $this->container[$offset] : null; 215 | } 216 | 217 | /** 218 | * Sets value based on offset. 219 | * @param integer $offset Offset 220 | * @param mixed $value Value to be set 221 | * @return void 222 | */ 223 | public function offsetSet($offset, $value) 224 | { 225 | if (is_null($offset)) { 226 | $this->container[] = $value; 227 | } else { 228 | $this->container[$offset] = $value; 229 | } 230 | } 231 | 232 | /** 233 | * Unsets offset. 234 | * @param integer $offset Offset 235 | * @return void 236 | */ 237 | public function offsetUnset($offset) 238 | { 239 | unset($this->container[$offset]); 240 | } 241 | 242 | /** 243 | * Gets the string presentation of the object 244 | * @return string 245 | */ 246 | public function __toString() 247 | { 248 | if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print 249 | return json_encode(\DocuSign\Monitor\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); 250 | } 251 | 252 | return json_encode(\DocuSign\Monitor\ObjectSerializer::sanitizeForSerialization($this)); 253 | } 254 | } 255 | 256 | 257 | -------------------------------------------------------------------------------- /src/Model/Filter.php: -------------------------------------------------------------------------------- 1 | 'string' 61 | ]; 62 | 63 | /** 64 | * Array of property to format mappings. Used for (de)serialization 65 | * 66 | * @var string[] 67 | */ 68 | protected static $swaggerFormats = [ 69 | 'filter_name' => null 70 | ]; 71 | 72 | /** 73 | * Array of property to type mappings. Used for (de)serialization 74 | * 75 | * @return array 76 | */ 77 | public static function swaggerTypes() 78 | { 79 | return self::$swaggerTypes; 80 | } 81 | 82 | /** 83 | * Array of property to format mappings. Used for (de)serialization 84 | * 85 | * @return array 86 | */ 87 | public static function swaggerFormats() 88 | { 89 | return self::$swaggerFormats; 90 | } 91 | 92 | /** 93 | * Array of attributes where the key is the local name, 94 | * and the value is the original name 95 | * 96 | * @var string[] 97 | */ 98 | protected static $attributeMap = [ 99 | 'filter_name' => 'filterName' 100 | ]; 101 | 102 | /** 103 | * Array of attributes to setter functions (for deserialization of responses) 104 | * 105 | * @var string[] 106 | */ 107 | protected static $setters = [ 108 | 'filter_name' => 'setFilterName' 109 | ]; 110 | 111 | /** 112 | * Array of attributes to getter functions (for serialization of requests) 113 | * 114 | * @var string[] 115 | */ 116 | protected static $getters = [ 117 | 'filter_name' => 'getFilterName' 118 | ]; 119 | 120 | /** 121 | * Array of attributes where the key is the local name, 122 | * and the value is the original name 123 | * 124 | * @return array 125 | */ 126 | public static function attributeMap() 127 | { 128 | return self::$attributeMap; 129 | } 130 | 131 | /** 132 | * Array of attributes to setter functions (for deserialization of responses) 133 | * 134 | * @return array 135 | */ 136 | public static function setters() 137 | { 138 | return self::$setters; 139 | } 140 | 141 | /** 142 | * Array of attributes to getter functions (for serialization of requests) 143 | * 144 | * @return array 145 | */ 146 | public static function getters() 147 | { 148 | return self::$getters; 149 | } 150 | 151 | /** 152 | * The original name of the model. 153 | * 154 | * @return string 155 | */ 156 | public function getModelName() 157 | { 158 | return self::$swaggerModelName; 159 | } 160 | 161 | 162 | 163 | 164 | 165 | /** 166 | * Associative array for storing property values 167 | * 168 | * @var mixed[] 169 | */ 170 | protected $container = []; 171 | 172 | /** 173 | * Constructor 174 | * 175 | * @param mixed[] $data Associated array of property values 176 | * initializing the model 177 | */ 178 | public function __construct(array $data = null) 179 | { 180 | $this->container['filter_name'] = isset($data['filter_name']) ? $data['filter_name'] : null; 181 | } 182 | 183 | /** 184 | * Show all the invalid properties with reasons. 185 | * 186 | * @return array invalid properties with reasons 187 | */ 188 | public function listInvalidProperties() 189 | { 190 | $invalidProperties = []; 191 | 192 | return $invalidProperties; 193 | } 194 | 195 | /** 196 | * Validate all the properties in the model 197 | * return true if all passed 198 | * 199 | * @return bool True if all properties are valid 200 | */ 201 | public function valid() 202 | { 203 | return count($this->listInvalidProperties()) === 0; 204 | } 205 | 206 | 207 | /** 208 | * Gets filter_name 209 | * 210 | * @return string 211 | */ 212 | public function getFilterName() 213 | { 214 | return $this->container['filter_name']; 215 | } 216 | 217 | /** 218 | * Sets filter_name 219 | * 220 | * @param string $filter_name filter_name 221 | * 222 | * @return $this 223 | */ 224 | public function setFilterName($filter_name) 225 | { 226 | $this->container['filter_name'] = $filter_name; 227 | 228 | return $this; 229 | } 230 | /** 231 | * Returns true if offset exists. False otherwise. 232 | * 233 | * @param integer $offset Offset 234 | * 235 | * @return boolean 236 | */ 237 | public function offsetExists($offset) 238 | { 239 | return isset($this->container[$offset]); 240 | } 241 | 242 | /** 243 | * Gets offset. 244 | * 245 | * @param integer $offset Offset 246 | * 247 | * @return mixed 248 | */ 249 | public function offsetGet($offset) 250 | { 251 | return isset($this->container[$offset]) ? $this->container[$offset] : null; 252 | } 253 | 254 | /** 255 | * Sets value based on offset. 256 | * 257 | * @param integer $offset Offset 258 | * @param mixed $value Value to be set 259 | * 260 | * @return void 261 | */ 262 | public function offsetSet($offset, $value) 263 | { 264 | if (is_null($offset)) { 265 | $this->container[] = $value; 266 | } else { 267 | $this->container[$offset] = $value; 268 | } 269 | } 270 | 271 | /** 272 | * Unsets offset. 273 | * 274 | * @param integer $offset Offset 275 | * 276 | * @return void 277 | */ 278 | public function offsetUnset($offset) 279 | { 280 | unset($this->container[$offset]); 281 | } 282 | 283 | /** 284 | * Gets the string presentation of the object 285 | * 286 | * @return string 287 | */ 288 | public function __toString() 289 | { 290 | if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print 291 | return json_encode( 292 | ObjectSerializer::sanitizeForSerialization($this), 293 | JSON_PRETTY_PRINT 294 | ); 295 | } 296 | 297 | return json_encode(ObjectSerializer::sanitizeForSerialization($this)); 298 | } 299 | } 300 | 301 | -------------------------------------------------------------------------------- /src/Model/Aggregation.php: -------------------------------------------------------------------------------- 1 | 'string' 61 | ]; 62 | 63 | /** 64 | * Array of property to format mappings. Used for (de)serialization 65 | * 66 | * @var string[] 67 | */ 68 | protected static $swaggerFormats = [ 69 | 'aggregation_name' => null 70 | ]; 71 | 72 | /** 73 | * Array of property to type mappings. Used for (de)serialization 74 | * 75 | * @return array 76 | */ 77 | public static function swaggerTypes() 78 | { 79 | return self::$swaggerTypes; 80 | } 81 | 82 | /** 83 | * Array of property to format mappings. Used for (de)serialization 84 | * 85 | * @return array 86 | */ 87 | public static function swaggerFormats() 88 | { 89 | return self::$swaggerFormats; 90 | } 91 | 92 | /** 93 | * Array of attributes where the key is the local name, 94 | * and the value is the original name 95 | * 96 | * @var string[] 97 | */ 98 | protected static $attributeMap = [ 99 | 'aggregation_name' => 'aggregationName' 100 | ]; 101 | 102 | /** 103 | * Array of attributes to setter functions (for deserialization of responses) 104 | * 105 | * @var string[] 106 | */ 107 | protected static $setters = [ 108 | 'aggregation_name' => 'setAggregationName' 109 | ]; 110 | 111 | /** 112 | * Array of attributes to getter functions (for serialization of requests) 113 | * 114 | * @var string[] 115 | */ 116 | protected static $getters = [ 117 | 'aggregation_name' => 'getAggregationName' 118 | ]; 119 | 120 | /** 121 | * Array of attributes where the key is the local name, 122 | * and the value is the original name 123 | * 124 | * @return array 125 | */ 126 | public static function attributeMap() 127 | { 128 | return self::$attributeMap; 129 | } 130 | 131 | /** 132 | * Array of attributes to setter functions (for deserialization of responses) 133 | * 134 | * @return array 135 | */ 136 | public static function setters() 137 | { 138 | return self::$setters; 139 | } 140 | 141 | /** 142 | * Array of attributes to getter functions (for serialization of requests) 143 | * 144 | * @return array 145 | */ 146 | public static function getters() 147 | { 148 | return self::$getters; 149 | } 150 | 151 | /** 152 | * The original name of the model. 153 | * 154 | * @return string 155 | */ 156 | public function getModelName() 157 | { 158 | return self::$swaggerModelName; 159 | } 160 | 161 | 162 | 163 | 164 | 165 | /** 166 | * Associative array for storing property values 167 | * 168 | * @var mixed[] 169 | */ 170 | protected $container = []; 171 | 172 | /** 173 | * Constructor 174 | * 175 | * @param mixed[] $data Associated array of property values 176 | * initializing the model 177 | */ 178 | public function __construct(array $data = null) 179 | { 180 | $this->container['aggregation_name'] = isset($data['aggregation_name']) ? $data['aggregation_name'] : null; 181 | } 182 | 183 | /** 184 | * Show all the invalid properties with reasons. 185 | * 186 | * @return array invalid properties with reasons 187 | */ 188 | public function listInvalidProperties() 189 | { 190 | $invalidProperties = []; 191 | 192 | return $invalidProperties; 193 | } 194 | 195 | /** 196 | * Validate all the properties in the model 197 | * return true if all passed 198 | * 199 | * @return bool True if all properties are valid 200 | */ 201 | public function valid() 202 | { 203 | return count($this->listInvalidProperties()) === 0; 204 | } 205 | 206 | 207 | /** 208 | * Gets aggregation_name 209 | * 210 | * @return string 211 | */ 212 | public function getAggregationName() 213 | { 214 | return $this->container['aggregation_name']; 215 | } 216 | 217 | /** 218 | * Sets aggregation_name 219 | * 220 | * @param string $aggregation_name aggregation_name 221 | * 222 | * @return $this 223 | */ 224 | public function setAggregationName($aggregation_name) 225 | { 226 | $this->container['aggregation_name'] = $aggregation_name; 227 | 228 | return $this; 229 | } 230 | /** 231 | * Returns true if offset exists. False otherwise. 232 | * 233 | * @param integer $offset Offset 234 | * 235 | * @return boolean 236 | */ 237 | public function offsetExists($offset) 238 | { 239 | return isset($this->container[$offset]); 240 | } 241 | 242 | /** 243 | * Gets offset. 244 | * 245 | * @param integer $offset Offset 246 | * 247 | * @return mixed 248 | */ 249 | public function offsetGet($offset) 250 | { 251 | return isset($this->container[$offset]) ? $this->container[$offset] : null; 252 | } 253 | 254 | /** 255 | * Sets value based on offset. 256 | * 257 | * @param integer $offset Offset 258 | * @param mixed $value Value to be set 259 | * 260 | * @return void 261 | */ 262 | public function offsetSet($offset, $value) 263 | { 264 | if (is_null($offset)) { 265 | $this->container[] = $value; 266 | } else { 267 | $this->container[$offset] = $value; 268 | } 269 | } 270 | 271 | /** 272 | * Unsets offset. 273 | * 274 | * @param integer $offset Offset 275 | * 276 | * @return void 277 | */ 278 | public function offsetUnset($offset) 279 | { 280 | unset($this->container[$offset]); 281 | } 282 | 283 | /** 284 | * Gets the string presentation of the object 285 | * 286 | * @return string 287 | */ 288 | public function __toString() 289 | { 290 | if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print 291 | return json_encode( 292 | ObjectSerializer::sanitizeForSerialization($this), 293 | JSON_PRETTY_PRINT 294 | ); 295 | } 296 | 297 | return json_encode(ObjectSerializer::sanitizeForSerialization($this)); 298 | } 299 | } 300 | 301 | -------------------------------------------------------------------------------- /src/Model/AggregateResult.php: -------------------------------------------------------------------------------- 1 | 10 | * @license The DocuSign PHP Client SDK is licensed under the MIT License. 11 | * @link https://github.com/swagger-api/swagger-codegen 12 | */ 13 | 14 | /** 15 | * Monitor API 16 | * 17 | * An API for an integrator to access the features of DocuSign Monitor 18 | * 19 | * OpenAPI spec version: v2.0 20 | * Contact: devcenter@docusign.com 21 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 22 | * Swagger Codegen version: 2.4.21-SNAPSHOT 23 | */ 24 | 25 | /** 26 | * NOTE: This class is auto generated by the swagger code generator program. 27 | * https://github.com/swagger-api/swagger-codegen 28 | * Do not edit the class manually. 29 | */ 30 | 31 | namespace DocuSign\Monitor\Model; 32 | 33 | use \ArrayAccess; 34 | use DocuSign\Monitor\ObjectSerializer; 35 | 36 | /** 37 | * AggregateResult Class Doc Comment 38 | * 39 | * @category Class 40 | * @package DocuSign\Monitor 41 | * @author Swagger Codegen team 42 | * @license The DocuSign PHP Client SDK is licensed under the MIT License. 43 | * @link https://github.com/swagger-api/swagger-codegen 44 | */ 45 | class AggregateResult implements ModelInterface, ArrayAccess 46 | { 47 | const DISCRIMINATOR = null; 48 | 49 | /** 50 | * The original name of the model. 51 | * 52 | * @var string 53 | */ 54 | protected static $swaggerModelName = 'AggregateResult'; 55 | 56 | /** 57 | * Array of property to type mappings. Used for (de)serialization 58 | * 59 | * @var string[] 60 | */ 61 | protected static $swaggerTypes = [ 62 | 'result' => '\DocuSign\Monitor\Model\AggregateResultResult[]' 63 | ]; 64 | 65 | /** 66 | * Array of property to format mappings. Used for (de)serialization 67 | * 68 | * @var string[] 69 | */ 70 | protected static $swaggerFormats = [ 71 | 'result' => null 72 | ]; 73 | 74 | /** 75 | * Array of property to type mappings. Used for (de)serialization 76 | * 77 | * @return array 78 | */ 79 | public static function swaggerTypes() 80 | { 81 | return self::$swaggerTypes; 82 | } 83 | 84 | /** 85 | * Array of property to format mappings. Used for (de)serialization 86 | * 87 | * @return array 88 | */ 89 | public static function swaggerFormats() 90 | { 91 | return self::$swaggerFormats; 92 | } 93 | 94 | /** 95 | * Array of attributes where the key is the local name, 96 | * and the value is the original name 97 | * 98 | * @var string[] 99 | */ 100 | protected static $attributeMap = [ 101 | 'result' => 'result' 102 | ]; 103 | 104 | /** 105 | * Array of attributes to setter functions (for deserialization of responses) 106 | * 107 | * @var string[] 108 | */ 109 | protected static $setters = [ 110 | 'result' => 'setResult' 111 | ]; 112 | 113 | /** 114 | * Array of attributes to getter functions (for serialization of requests) 115 | * 116 | * @var string[] 117 | */ 118 | protected static $getters = [ 119 | 'result' => 'getResult' 120 | ]; 121 | 122 | /** 123 | * Array of attributes where the key is the local name, 124 | * and the value is the original name 125 | * 126 | * @return array 127 | */ 128 | public static function attributeMap() 129 | { 130 | return self::$attributeMap; 131 | } 132 | 133 | /** 134 | * Array of attributes to setter functions (for deserialization of responses) 135 | * 136 | * @return array 137 | */ 138 | public static function setters() 139 | { 140 | return self::$setters; 141 | } 142 | 143 | /** 144 | * Array of attributes to getter functions (for serialization of requests) 145 | * 146 | * @return array 147 | */ 148 | public static function getters() 149 | { 150 | return self::$getters; 151 | } 152 | 153 | /** 154 | * The original name of the model. 155 | * 156 | * @return string 157 | */ 158 | public function getModelName() 159 | { 160 | return self::$swaggerModelName; 161 | } 162 | 163 | 164 | 165 | 166 | 167 | /** 168 | * Associative array for storing property values 169 | * 170 | * @var mixed[] 171 | */ 172 | protected $container = []; 173 | 174 | /** 175 | * Constructor 176 | * 177 | * @param mixed[] $data Associated array of property values 178 | * initializing the model 179 | */ 180 | public function __construct(array $data = null) 181 | { 182 | $this->container['result'] = isset($data['result']) ? $data['result'] : null; 183 | } 184 | 185 | /** 186 | * Show all the invalid properties with reasons. 187 | * 188 | * @return array invalid properties with reasons 189 | */ 190 | public function listInvalidProperties() 191 | { 192 | $invalidProperties = []; 193 | 194 | return $invalidProperties; 195 | } 196 | 197 | /** 198 | * Validate all the properties in the model 199 | * return true if all passed 200 | * 201 | * @return bool True if all properties are valid 202 | */ 203 | public function valid() 204 | { 205 | return count($this->listInvalidProperties()) === 0; 206 | } 207 | 208 | 209 | /** 210 | * Gets result 211 | * 212 | * @return \DocuSign\Monitor\Model\AggregateResultResult[] 213 | */ 214 | public function getResult() 215 | { 216 | return $this->container['result']; 217 | } 218 | 219 | /** 220 | * Sets result 221 | * 222 | * @param \DocuSign\Monitor\Model\AggregateResultResult[] $result result 223 | * 224 | * @return $this 225 | */ 226 | public function setResult($result) 227 | { 228 | $this->container['result'] = $result; 229 | 230 | return $this; 231 | } 232 | /** 233 | * Returns true if offset exists. False otherwise. 234 | * 235 | * @param integer $offset Offset 236 | * 237 | * @return boolean 238 | */ 239 | #[\ReturnTypeWillChange] 240 | public function offsetExists($offset) 241 | { 242 | return isset($this->container[$offset]); 243 | } 244 | 245 | /** 246 | * Gets offset. 247 | * 248 | * @param integer $offset Offset 249 | * 250 | * @return mixed 251 | */ 252 | #[\ReturnTypeWillChange] 253 | public function offsetGet($offset) 254 | { 255 | return isset($this->container[$offset]) ? $this->container[$offset] : null; 256 | } 257 | 258 | /** 259 | * Sets value based on offset. 260 | * 261 | * @param integer $offset Offset 262 | * @param mixed $value Value to be set 263 | * 264 | * @return void 265 | */ 266 | #[\ReturnTypeWillChange] 267 | public function offsetSet($offset, $value) 268 | { 269 | if (is_null($offset)) { 270 | $this->container[] = $value; 271 | } else { 272 | $this->container[$offset] = $value; 273 | } 274 | } 275 | 276 | /** 277 | * Unsets offset. 278 | * 279 | * @param integer $offset Offset 280 | * 281 | * @return void 282 | */ 283 | #[\ReturnTypeWillChange] 284 | public function offsetUnset($offset) 285 | { 286 | unset($this->container[$offset]); 287 | } 288 | 289 | /** 290 | * Gets the string presentation of the object 291 | * 292 | * @return string 293 | */ 294 | public function __toString() 295 | { 296 | if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print 297 | return json_encode( 298 | ObjectSerializer::sanitizeForSerialization($this), 299 | JSON_PRETTY_PRINT 300 | ); 301 | } 302 | 303 | return json_encode(ObjectSerializer::sanitizeForSerialization($this)); 304 | } 305 | } 306 | 307 | -------------------------------------------------------------------------------- /src/Model/AggregateResultResult.php: -------------------------------------------------------------------------------- 1 | 10 | * @license The DocuSign PHP Client SDK is licensed under the MIT License. 11 | * @link https://github.com/swagger-api/swagger-codegen 12 | */ 13 | 14 | /** 15 | * Monitor API 16 | * 17 | * An API for an integrator to access the features of DocuSign Monitor 18 | * 19 | * OpenAPI spec version: v2.0 20 | * Contact: devcenter@docusign.com 21 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 22 | * Swagger Codegen version: 2.4.21-SNAPSHOT 23 | */ 24 | 25 | /** 26 | * NOTE: This class is auto generated by the swagger code generator program. 27 | * https://github.com/swagger-api/swagger-codegen 28 | * Do not edit the class manually. 29 | */ 30 | 31 | namespace DocuSign\Monitor\Model; 32 | 33 | use \ArrayAccess; 34 | use DocuSign\Monitor\ObjectSerializer; 35 | 36 | /** 37 | * AggregateResultResult Class Doc Comment 38 | * 39 | * @category Class 40 | * @package DocuSign\Monitor 41 | * @author Swagger Codegen team 42 | * @license The DocuSign PHP Client SDK is licensed under the MIT License. 43 | * @link https://github.com/swagger-api/swagger-codegen 44 | */ 45 | class AggregateResultResult implements ModelInterface, ArrayAccess 46 | { 47 | const DISCRIMINATOR = null; 48 | 49 | /** 50 | * The original name of the model. 51 | * 52 | * @var string 53 | */ 54 | protected static $swaggerModelName = 'AggregateResult_result'; 55 | 56 | /** 57 | * Array of property to type mappings. Used for (de)serialization 58 | * 59 | * @var string[] 60 | */ 61 | protected static $swaggerTypes = [ 62 | 'name' => '?string', 63 | 'data' => 'object[]' 64 | ]; 65 | 66 | /** 67 | * Array of property to format mappings. Used for (de)serialization 68 | * 69 | * @var string[] 70 | */ 71 | protected static $swaggerFormats = [ 72 | 'name' => null, 73 | 'data' => null 74 | ]; 75 | 76 | /** 77 | * Array of property to type mappings. Used for (de)serialization 78 | * 79 | * @return array 80 | */ 81 | public static function swaggerTypes() 82 | { 83 | return self::$swaggerTypes; 84 | } 85 | 86 | /** 87 | * Array of property to format mappings. Used for (de)serialization 88 | * 89 | * @return array 90 | */ 91 | public static function swaggerFormats() 92 | { 93 | return self::$swaggerFormats; 94 | } 95 | 96 | /** 97 | * Array of attributes where the key is the local name, 98 | * and the value is the original name 99 | * 100 | * @var string[] 101 | */ 102 | protected static $attributeMap = [ 103 | 'name' => 'name', 104 | 'data' => 'data' 105 | ]; 106 | 107 | /** 108 | * Array of attributes to setter functions (for deserialization of responses) 109 | * 110 | * @var string[] 111 | */ 112 | protected static $setters = [ 113 | 'name' => 'setName', 114 | 'data' => 'setData' 115 | ]; 116 | 117 | /** 118 | * Array of attributes to getter functions (for serialization of requests) 119 | * 120 | * @var string[] 121 | */ 122 | protected static $getters = [ 123 | 'name' => 'getName', 124 | 'data' => 'getData' 125 | ]; 126 | 127 | /** 128 | * Array of attributes where the key is the local name, 129 | * and the value is the original name 130 | * 131 | * @return array 132 | */ 133 | public static function attributeMap() 134 | { 135 | return self::$attributeMap; 136 | } 137 | 138 | /** 139 | * Array of attributes to setter functions (for deserialization of responses) 140 | * 141 | * @return array 142 | */ 143 | public static function setters() 144 | { 145 | return self::$setters; 146 | } 147 | 148 | /** 149 | * Array of attributes to getter functions (for serialization of requests) 150 | * 151 | * @return array 152 | */ 153 | public static function getters() 154 | { 155 | return self::$getters; 156 | } 157 | 158 | /** 159 | * The original name of the model. 160 | * 161 | * @return string 162 | */ 163 | public function getModelName() 164 | { 165 | return self::$swaggerModelName; 166 | } 167 | 168 | 169 | 170 | 171 | 172 | /** 173 | * Associative array for storing property values 174 | * 175 | * @var mixed[] 176 | */ 177 | protected $container = []; 178 | 179 | /** 180 | * Constructor 181 | * 182 | * @param mixed[] $data Associated array of property values 183 | * initializing the model 184 | */ 185 | public function __construct(array $data = null) 186 | { 187 | $this->container['name'] = isset($data['name']) ? $data['name'] : null; 188 | $this->container['data'] = isset($data['data']) ? $data['data'] : null; 189 | } 190 | 191 | /** 192 | * Show all the invalid properties with reasons. 193 | * 194 | * @return array invalid properties with reasons 195 | */ 196 | public function listInvalidProperties() 197 | { 198 | $invalidProperties = []; 199 | 200 | return $invalidProperties; 201 | } 202 | 203 | /** 204 | * Validate all the properties in the model 205 | * return true if all passed 206 | * 207 | * @return bool True if all properties are valid 208 | */ 209 | public function valid() 210 | { 211 | return count($this->listInvalidProperties()) === 0; 212 | } 213 | 214 | 215 | /** 216 | * Gets name 217 | * 218 | * @return ?string 219 | */ 220 | public function getName() 221 | { 222 | return $this->container['name']; 223 | } 224 | 225 | /** 226 | * Sets name 227 | * 228 | * @param ?string $name name 229 | * 230 | * @return $this 231 | */ 232 | public function setName($name) 233 | { 234 | $this->container['name'] = $name; 235 | 236 | return $this; 237 | } 238 | 239 | /** 240 | * Gets data 241 | * 242 | * @return object[] 243 | */ 244 | public function getData() 245 | { 246 | return $this->container['data']; 247 | } 248 | 249 | /** 250 | * Sets data 251 | * 252 | * @param object[] $data data 253 | * 254 | * @return $this 255 | */ 256 | public function setData($data) 257 | { 258 | $this->container['data'] = $data; 259 | 260 | return $this; 261 | } 262 | /** 263 | * Returns true if offset exists. False otherwise. 264 | * 265 | * @param integer $offset Offset 266 | * 267 | * @return boolean 268 | */ 269 | #[\ReturnTypeWillChange] 270 | public function offsetExists($offset) 271 | { 272 | return isset($this->container[$offset]); 273 | } 274 | 275 | /** 276 | * Gets offset. 277 | * 278 | * @param integer $offset Offset 279 | * 280 | * @return mixed 281 | */ 282 | #[\ReturnTypeWillChange] 283 | public function offsetGet($offset) 284 | { 285 | return isset($this->container[$offset]) ? $this->container[$offset] : null; 286 | } 287 | 288 | /** 289 | * Sets value based on offset. 290 | * 291 | * @param integer $offset Offset 292 | * @param mixed $value Value to be set 293 | * 294 | * @return void 295 | */ 296 | #[\ReturnTypeWillChange] 297 | public function offsetSet($offset, $value) 298 | { 299 | if (is_null($offset)) { 300 | $this->container[] = $value; 301 | } else { 302 | $this->container[$offset] = $value; 303 | } 304 | } 305 | 306 | /** 307 | * Unsets offset. 308 | * 309 | * @param integer $offset Offset 310 | * 311 | * @return void 312 | */ 313 | #[\ReturnTypeWillChange] 314 | public function offsetUnset($offset) 315 | { 316 | unset($this->container[$offset]); 317 | } 318 | 319 | /** 320 | * Gets the string presentation of the object 321 | * 322 | * @return string 323 | */ 324 | public function __toString() 325 | { 326 | if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print 327 | return json_encode( 328 | ObjectSerializer::sanitizeForSerialization($this), 329 | JSON_PRETTY_PRINT 330 | ); 331 | } 332 | 333 | return json_encode(ObjectSerializer::sanitizeForSerialization($this)); 334 | } 335 | } 336 | 337 | -------------------------------------------------------------------------------- /src/Model/CursoredResult.php: -------------------------------------------------------------------------------- 1 | 10 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 11 | * @link https://github.com/swagger-api/swagger-codegen 12 | */ 13 | 14 | /** 15 | * Monitor API 16 | * 17 | * An API for an integrator to access the features of DocuSign Monitor 18 | * 19 | * OpenAPI spec version: v2.0 20 | * Contact: devcenter@docusign.com 21 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 22 | * Swagger Codegen version: 2.4.21 23 | */ 24 | 25 | /** 26 | * NOTE: This class is auto generated by the swagger code generator program. 27 | * https://github.com/swagger-api/swagger-codegen 28 | * Do not edit the class manually. 29 | */ 30 | 31 | namespace DocuSign\Monitor\Model; 32 | 33 | use \ArrayAccess; 34 | use DocuSign\Monitor\ObjectSerializer; 35 | 36 | /** 37 | * CursoredResult Class Doc Comment 38 | * 39 | * @category Class 40 | * @description 41 | * @package DocuSign\Monitor 42 | * @author Swagger Codegen team 43 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 44 | * @link https://github.com/swagger-api/swagger-codegen 45 | */ 46 | class CursoredResult implements ModelInterface, ArrayAccess 47 | { 48 | const DISCRIMINATOR = null; 49 | 50 | /** 51 | * The original name of the model. 52 | * 53 | * @var string 54 | */ 55 | protected static $swaggerModelName = 'CursoredResult'; 56 | 57 | /** 58 | * Array of property to type mappings. Used for (de)serialization 59 | * 60 | * @var string[] 61 | */ 62 | protected static $swaggerTypes = [ 63 | 'end_cursor' => '?string', 64 | 'data' => 'object[]' 65 | ]; 66 | 67 | /** 68 | * Array of property to format mappings. Used for (de)serialization 69 | * 70 | * @var string[] 71 | */ 72 | protected static $swaggerFormats = [ 73 | 'end_cursor' => null, 74 | 'data' => null 75 | ]; 76 | 77 | /** 78 | * Array of property to type mappings. Used for (de)serialization 79 | * 80 | * @return array 81 | */ 82 | public static function swaggerTypes() 83 | { 84 | return self::$swaggerTypes; 85 | } 86 | 87 | /** 88 | * Array of property to format mappings. Used for (de)serialization 89 | * 90 | * @return array 91 | */ 92 | public static function swaggerFormats() 93 | { 94 | return self::$swaggerFormats; 95 | } 96 | 97 | /** 98 | * Array of attributes where the key is the local name, 99 | * and the value is the original name 100 | * 101 | * @var string[] 102 | */ 103 | protected static $attributeMap = [ 104 | 'end_cursor' => 'endCursor', 105 | 'data' => 'data' 106 | ]; 107 | 108 | /** 109 | * Array of attributes to setter functions (for deserialization of responses) 110 | * 111 | * @var string[] 112 | */ 113 | protected static $setters = [ 114 | 'end_cursor' => 'setEndCursor', 115 | 'data' => 'setData' 116 | ]; 117 | 118 | /** 119 | * Array of attributes to getter functions (for serialization of requests) 120 | * 121 | * @var string[] 122 | */ 123 | protected static $getters = [ 124 | 'end_cursor' => 'getEndCursor', 125 | 'data' => 'getData' 126 | ]; 127 | 128 | /** 129 | * Array of attributes where the key is the local name, 130 | * and the value is the original name 131 | * 132 | * @return array 133 | */ 134 | public static function attributeMap() 135 | { 136 | return self::$attributeMap; 137 | } 138 | 139 | /** 140 | * Array of attributes to setter functions (for deserialization of responses) 141 | * 142 | * @return array 143 | */ 144 | public static function setters() 145 | { 146 | return self::$setters; 147 | } 148 | 149 | /** 150 | * Array of attributes to getter functions (for serialization of requests) 151 | * 152 | * @return array 153 | */ 154 | public static function getters() 155 | { 156 | return self::$getters; 157 | } 158 | 159 | /** 160 | * The original name of the model. 161 | * 162 | * @return string 163 | */ 164 | public function getModelName() 165 | { 166 | return self::$swaggerModelName; 167 | } 168 | 169 | 170 | 171 | 172 | 173 | /** 174 | * Associative array for storing property values 175 | * 176 | * @var mixed[] 177 | */ 178 | protected $container = []; 179 | 180 | /** 181 | * Constructor 182 | * 183 | * @param mixed[] $data Associated array of property values 184 | * initializing the model 185 | */ 186 | public function __construct(?array $data = null) 187 | { 188 | $this->container['end_cursor'] = isset($data['end_cursor']) ? $data['end_cursor'] : null; 189 | $this->container['data'] = isset($data['data']) ? $data['data'] : null; 190 | } 191 | 192 | /** 193 | * Show all the invalid properties with reasons. 194 | * 195 | * @return array invalid properties with reasons 196 | */ 197 | public function listInvalidProperties() 198 | { 199 | $invalidProperties = []; 200 | 201 | return $invalidProperties; 202 | } 203 | 204 | /** 205 | * Validate all the properties in the model 206 | * return true if all passed 207 | * 208 | * @return bool True if all properties are valid 209 | */ 210 | public function valid() 211 | { 212 | return count($this->listInvalidProperties()) === 0; 213 | } 214 | 215 | 216 | /** 217 | * Gets end_cursor 218 | * 219 | * @return ?string 220 | */ 221 | public function getEndCursor() 222 | { 223 | return $this->container['end_cursor']; 224 | } 225 | 226 | /** 227 | * Sets end_cursor 228 | * 229 | * @param ?string $end_cursor 230 | * 231 | * @return $this 232 | */ 233 | public function setEndCursor($end_cursor) 234 | { 235 | $this->container['end_cursor'] = $end_cursor; 236 | 237 | return $this; 238 | } 239 | 240 | /** 241 | * Gets data 242 | * 243 | * @return object[] 244 | */ 245 | public function getData() 246 | { 247 | return $this->container['data']; 248 | } 249 | 250 | /** 251 | * Sets data 252 | * 253 | * @param object[] $data 254 | * 255 | * @return $this 256 | */ 257 | public function setData($data) 258 | { 259 | $this->container['data'] = $data; 260 | 261 | return $this; 262 | } 263 | /** 264 | * Returns true if offset exists. False otherwise. 265 | * 266 | * @param integer $offset Offset 267 | * 268 | * @return boolean 269 | */ 270 | #[\ReturnTypeWillChange] 271 | public function offsetExists($offset) 272 | { 273 | return isset($this->container[$offset]); 274 | } 275 | 276 | /** 277 | * Gets offset. 278 | * 279 | * @param integer $offset Offset 280 | * 281 | * @return mixed 282 | */ 283 | #[\ReturnTypeWillChange] 284 | public function offsetGet($offset) 285 | { 286 | return isset($this->container[$offset]) ? $this->container[$offset] : null; 287 | } 288 | 289 | /** 290 | * Sets value based on offset. 291 | * 292 | * @param integer $offset Offset 293 | * @param mixed $value Value to be set 294 | * 295 | * @return void 296 | */ 297 | #[\ReturnTypeWillChange] 298 | public function offsetSet($offset, $value) 299 | { 300 | if (is_null($offset)) { 301 | $this->container[] = $value; 302 | } else { 303 | $this->container[$offset] = $value; 304 | } 305 | } 306 | 307 | /** 308 | * Unsets offset. 309 | * 310 | * @param integer $offset Offset 311 | * 312 | * @return void 313 | */ 314 | #[\ReturnTypeWillChange] 315 | public function offsetUnset($offset) 316 | { 317 | unset($this->container[$offset]); 318 | } 319 | 320 | /** 321 | * Gets the string presentation of the object 322 | * 323 | * @return string 324 | */ 325 | public function __toString() 326 | { 327 | if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print 328 | return json_encode( 329 | ObjectSerializer::sanitizeForSerialization($this), 330 | JSON_PRETTY_PRINT 331 | ); 332 | } 333 | 334 | return json_encode(ObjectSerializer::sanitizeForSerialization($this)); 335 | } 336 | } 337 | 338 | -------------------------------------------------------------------------------- /src/Model/DataSet.php: -------------------------------------------------------------------------------- 1 | 10 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 11 | * @link https://github.com/swagger-api/swagger-codegen 12 | */ 13 | 14 | /** 15 | * Monitor API 16 | * 17 | * An API for an integrator to access the features of DocuSign Monitor 18 | * 19 | * OpenAPI spec version: v2.0 20 | * Contact: devcenter@docusign.com 21 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 22 | * Swagger Codegen version: 2.4.21 23 | */ 24 | 25 | /** 26 | * NOTE: This class is auto generated by the swagger code generator program. 27 | * https://github.com/swagger-api/swagger-codegen 28 | * Do not edit the class manually. 29 | */ 30 | 31 | namespace DocuSign\Monitor\Model; 32 | 33 | use \ArrayAccess; 34 | use DocuSign\Monitor\ObjectSerializer; 35 | 36 | /** 37 | * DataSet Class Doc Comment 38 | * 39 | * @category Class 40 | * @description Methods to fetch organization event data. 41 | * @package DocuSign\Monitor 42 | * @author Swagger Codegen team 43 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 44 | * @link https://github.com/swagger-api/swagger-codegen 45 | */ 46 | class DataSet implements ModelInterface, ArrayAccess 47 | { 48 | const DISCRIMINATOR = null; 49 | 50 | /** 51 | * The original name of the model. 52 | * 53 | * @var string 54 | */ 55 | protected static $swaggerModelName = 'DataSet'; 56 | 57 | /** 58 | * Array of property to type mappings. Used for (de)serialization 59 | * 60 | * @var string[] 61 | */ 62 | protected static $swaggerTypes = [ 63 | 'end_cursor' => '?string', 64 | 'data' => 'object[]' 65 | ]; 66 | 67 | /** 68 | * Array of property to format mappings. Used for (de)serialization 69 | * 70 | * @var string[] 71 | */ 72 | protected static $swaggerFormats = [ 73 | 'end_cursor' => null, 74 | 'data' => null 75 | ]; 76 | 77 | /** 78 | * Array of property to type mappings. Used for (de)serialization 79 | * 80 | * @return array 81 | */ 82 | public static function swaggerTypes() 83 | { 84 | return self::$swaggerTypes; 85 | } 86 | 87 | /** 88 | * Array of property to format mappings. Used for (de)serialization 89 | * 90 | * @return array 91 | */ 92 | public static function swaggerFormats() 93 | { 94 | return self::$swaggerFormats; 95 | } 96 | 97 | /** 98 | * Array of attributes where the key is the local name, 99 | * and the value is the original name 100 | * 101 | * @var string[] 102 | */ 103 | protected static $attributeMap = [ 104 | 'end_cursor' => 'endCursor', 105 | 'data' => 'data' 106 | ]; 107 | 108 | /** 109 | * Array of attributes to setter functions (for deserialization of responses) 110 | * 111 | * @var string[] 112 | */ 113 | protected static $setters = [ 114 | 'end_cursor' => 'setEndCursor', 115 | 'data' => 'setData' 116 | ]; 117 | 118 | /** 119 | * Array of attributes to getter functions (for serialization of requests) 120 | * 121 | * @var string[] 122 | */ 123 | protected static $getters = [ 124 | 'end_cursor' => 'getEndCursor', 125 | 'data' => 'getData' 126 | ]; 127 | 128 | /** 129 | * Array of attributes where the key is the local name, 130 | * and the value is the original name 131 | * 132 | * @return array 133 | */ 134 | public static function attributeMap() 135 | { 136 | return self::$attributeMap; 137 | } 138 | 139 | /** 140 | * Array of attributes to setter functions (for deserialization of responses) 141 | * 142 | * @return array 143 | */ 144 | public static function setters() 145 | { 146 | return self::$setters; 147 | } 148 | 149 | /** 150 | * Array of attributes to getter functions (for serialization of requests) 151 | * 152 | * @return array 153 | */ 154 | public static function getters() 155 | { 156 | return self::$getters; 157 | } 158 | 159 | /** 160 | * The original name of the model. 161 | * 162 | * @return string 163 | */ 164 | public function getModelName() 165 | { 166 | return self::$swaggerModelName; 167 | } 168 | 169 | 170 | 171 | 172 | 173 | /** 174 | * Associative array for storing property values 175 | * 176 | * @var mixed[] 177 | */ 178 | protected $container = []; 179 | 180 | /** 181 | * Constructor 182 | * 183 | * @param mixed[] $data Associated array of property values 184 | * initializing the model 185 | */ 186 | public function __construct(?array $data = null) 187 | { 188 | $this->container['end_cursor'] = isset($data['end_cursor']) ? $data['end_cursor'] : null; 189 | $this->container['data'] = isset($data['data']) ? $data['data'] : null; 190 | } 191 | 192 | /** 193 | * Show all the invalid properties with reasons. 194 | * 195 | * @return array invalid properties with reasons 196 | */ 197 | public function listInvalidProperties() 198 | { 199 | $invalidProperties = []; 200 | 201 | return $invalidProperties; 202 | } 203 | 204 | /** 205 | * Validate all the properties in the model 206 | * return true if all passed 207 | * 208 | * @return bool True if all properties are valid 209 | */ 210 | public function valid() 211 | { 212 | return count($this->listInvalidProperties()) === 0; 213 | } 214 | 215 | 216 | /** 217 | * Gets end_cursor 218 | * 219 | * @return ?string 220 | */ 221 | public function getEndCursor() 222 | { 223 | return $this->container['end_cursor']; 224 | } 225 | 226 | /** 227 | * Sets end_cursor 228 | * 229 | * @param ?string $end_cursor 230 | * 231 | * @return $this 232 | */ 233 | public function setEndCursor($end_cursor) 234 | { 235 | $this->container['end_cursor'] = $end_cursor; 236 | 237 | return $this; 238 | } 239 | 240 | /** 241 | * Gets data 242 | * 243 | * @return object[] 244 | */ 245 | public function getData() 246 | { 247 | return $this->container['data']; 248 | } 249 | 250 | /** 251 | * Sets data 252 | * 253 | * @param object[] $data 254 | * 255 | * @return $this 256 | */ 257 | public function setData($data) 258 | { 259 | $this->container['data'] = $data; 260 | 261 | return $this; 262 | } 263 | /** 264 | * Returns true if offset exists. False otherwise. 265 | * 266 | * @param integer $offset Offset 267 | * 268 | * @return boolean 269 | */ 270 | #[\ReturnTypeWillChange] 271 | public function offsetExists($offset) 272 | { 273 | return isset($this->container[$offset]); 274 | } 275 | 276 | /** 277 | * Gets offset. 278 | * 279 | * @param integer $offset Offset 280 | * 281 | * @return mixed 282 | */ 283 | #[\ReturnTypeWillChange] 284 | public function offsetGet($offset) 285 | { 286 | return isset($this->container[$offset]) ? $this->container[$offset] : null; 287 | } 288 | 289 | /** 290 | * Sets value based on offset. 291 | * 292 | * @param integer $offset Offset 293 | * @param mixed $value Value to be set 294 | * 295 | * @return void 296 | */ 297 | #[\ReturnTypeWillChange] 298 | public function offsetSet($offset, $value) 299 | { 300 | if (is_null($offset)) { 301 | $this->container[] = $value; 302 | } else { 303 | $this->container[$offset] = $value; 304 | } 305 | } 306 | 307 | /** 308 | * Unsets offset. 309 | * 310 | * @param integer $offset Offset 311 | * 312 | * @return void 313 | */ 314 | #[\ReturnTypeWillChange] 315 | public function offsetUnset($offset) 316 | { 317 | unset($this->container[$offset]); 318 | } 319 | 320 | /** 321 | * Gets the string presentation of the object 322 | * 323 | * @return string 324 | */ 325 | public function __toString() 326 | { 327 | if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print 328 | return json_encode( 329 | ObjectSerializer::sanitizeForSerialization($this), 330 | JSON_PRETTY_PRINT 331 | ); 332 | } 333 | 334 | return json_encode(ObjectSerializer::sanitizeForSerialization($this)); 335 | } 336 | } 337 | 338 | -------------------------------------------------------------------------------- /src/Client/Auth/Account.php: -------------------------------------------------------------------------------- 1 | 'string', 53 | 'is_default' => 'string', 54 | 'account_name' => 'string', 55 | 'base_uri' => 'string', 56 | 'organization' => '\DocuSign\Monitor\Client\Auth\Organization', 57 | ]; 58 | 59 | public static function swaggerTypes() 60 | { 61 | return self::$swaggerTypes; 62 | } 63 | 64 | /** 65 | * Array of attributes where the key is the local name, and the value is the original name 66 | * @var string[] 67 | */ 68 | protected static $attributeMap = [ 69 | 'account_id' => 'account_id', 70 | 'is_default' => 'is_default', 71 | 'account_name' => 'account_name', 72 | 'base_uri' => 'base_uri', 73 | 'organization' => 'organization' 74 | ]; 75 | 76 | /** 77 | * Array of attributes to setter functions (for deserialization of responses) 78 | * @var string[] 79 | */ 80 | protected static $setters = [ 81 | 'account_id' => 'setAccountId', 82 | 'is_default' => 'setIsDefault', 83 | 'account_name' => 'setAccountName', 84 | 'base_uri' => 'setBaseUri', 85 | 'organization' => 'setOrganization', 86 | ]; 87 | 88 | 89 | /** 90 | * Array of attributes to getter functions (for serialization of requests) 91 | * @var string[] 92 | */ 93 | protected static $getters = [ 94 | 'account_id' => 'getAccountId', 95 | 'is_default' => 'getIsDefault', 96 | 'account_name' => 'getAccountName', 97 | 'base_uri' => 'getBaseUri', 98 | 'organization' => 'getOrganization', 99 | ]; 100 | 101 | public static function attributeMap() 102 | { 103 | return self::$attributeMap; 104 | } 105 | 106 | public static function setters() 107 | { 108 | return self::$setters; 109 | } 110 | 111 | public static function getters() 112 | { 113 | return self::$getters; 114 | } 115 | 116 | /** 117 | * Associative array for storing property values 118 | * @var mixed[] 119 | */ 120 | protected $container = []; 121 | 122 | /** 123 | * Constructor 124 | * @param mixed[] $data Associated array of property values initializing the model 125 | */ 126 | public function __construct(array $data = null) 127 | { 128 | $this->container['account_id'] = isset($data['account_id']) ? $data['account_id'] : null; 129 | $this->container['is_default'] = isset($data['is_default']) ? $data['is_default'] : null; 130 | $this->container['account_name'] = isset($data['account_name']) ? $data['account_name'] : null; 131 | $this->container['base_uri'] = isset($data['base_uri']) ? $data['base_uri'] : null; 132 | $this->container['organization'] = isset($data['organization']) ? $data['organization'] : null; 133 | } 134 | 135 | /** 136 | * show all the invalid properties with reasons. 137 | * 138 | * @return array invalid properties with reasons 139 | */ 140 | public function listInvalidProperties() 141 | { 142 | $invalid_properties = []; 143 | return $invalid_properties; 144 | } 145 | 146 | /** 147 | * validate all the properties in the model 148 | * return true if all passed 149 | * 150 | * @return bool True if all properteis are valid 151 | */ 152 | public function valid() 153 | { 154 | return true; 155 | } 156 | 157 | 158 | /** 159 | * Gets account_id 160 | * @return string 161 | */ 162 | public function getAccountId() 163 | { 164 | return $this->container['account_id']; 165 | } 166 | 167 | /** 168 | * Sets account_id 169 | * @param string $account_id The account ID. 170 | * @return $this 171 | */ 172 | public function setAccountId($account_id) 173 | { 174 | $this->container['account_id'] = $account_id; 175 | 176 | return $this; 177 | } 178 | 179 | /** 180 | * Gets account_name 181 | * @return string 182 | */ 183 | public function getAccountName() 184 | { 185 | return $this->container['account_name']; 186 | } 187 | 188 | /** 189 | * Sets account_name 190 | * @param string $account_name The name of the current account. 191 | * @return $this 192 | */ 193 | public function setAccountName($account_name) 194 | { 195 | $this->container['account_name'] = $account_name; 196 | 197 | return $this; 198 | } 199 | 200 | /** 201 | * Gets is_default 202 | * @return string 203 | */ 204 | public function getIsDefault() 205 | { 206 | return $this->container['is_default']; 207 | } 208 | 209 | /** 210 | * Sets is_default 211 | * @param string $is_default 212 | * @return $this 213 | */ 214 | public function setIsDefault($is_default) 215 | { 216 | $this->container['is_default'] = $is_default; 217 | 218 | return $this; 219 | } 220 | 221 | /** 222 | * Gets base_uri 223 | * @return string 224 | */ 225 | public function getBaseUri() 226 | { 227 | return $this->container['base_uri']; 228 | } 229 | 230 | /** 231 | * Sets base_uri 232 | * @param string $base_uri 233 | * @return $this 234 | */ 235 | public function setBaseUri($base_uri) 236 | { 237 | $this->container['base_uri'] = $base_uri; 238 | 239 | return $this; 240 | } 241 | 242 | /** 243 | * Gets organization 244 | * @return string 245 | */ 246 | public function getOrganization() 247 | { 248 | return $this->container['organization']; 249 | } 250 | 251 | /** 252 | * Sets organization 253 | * @param string $organization 254 | * @return $this 255 | */ 256 | public function setOrganization($organization) 257 | { 258 | $this->container['organization'] = $organization; 259 | 260 | return $this; 261 | } 262 | 263 | /** 264 | * Returns true if offset exists. False otherwise. 265 | * @param integer $offset Offset 266 | * @return boolean 267 | */ 268 | public function offsetExists($offset) 269 | { 270 | return isset($this->container[$offset]); 271 | } 272 | 273 | /** 274 | * Gets offset. 275 | * @param integer $offset Offset 276 | * @return mixed 277 | */ 278 | public function offsetGet($offset) 279 | { 280 | return isset($this->container[$offset]) ? $this->container[$offset] : null; 281 | } 282 | 283 | /** 284 | * Sets value based on offset. 285 | * @param integer $offset Offset 286 | * @param mixed $value Value to be set 287 | * @return void 288 | */ 289 | public function offsetSet($offset, $value) 290 | { 291 | if (is_null($offset)) { 292 | $this->container[] = $value; 293 | } else { 294 | $this->container[$offset] = $value; 295 | } 296 | } 297 | 298 | /** 299 | * Unsets offset. 300 | * @param integer $offset Offset 301 | * @return void 302 | */ 303 | public function offsetUnset($offset) 304 | { 305 | unset($this->container[$offset]); 306 | } 307 | 308 | /** 309 | * Gets the string presentation of the object 310 | * @return string 311 | */ 312 | public function __toString() 313 | { 314 | if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print 315 | return json_encode(\DocuSign\Monitor\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); 316 | } 317 | 318 | return json_encode(\DocuSign\Monitor\ObjectSerializer::sanitizeForSerialization($this)); 319 | } 320 | } 321 | 322 | 323 | -------------------------------------------------------------------------------- /src/Client/Auth/OAuthToken.php: -------------------------------------------------------------------------------- 1 | 'string', 36 | 'data' => '\DocuSign\Monitor\Model\NameValue[]', 37 | 'expires_in' => 'string', 38 | 'refresh_token' => 'string', 39 | 'scope' => 'string', 40 | 'token_type' => 'string' 41 | ]; 42 | 43 | public static function swaggerTypes() 44 | { 45 | return self::$swaggerTypes; 46 | } 47 | 48 | /** 49 | * Array of attributes where the key is the local name, and the value is the original name 50 | * @var string[] 51 | */ 52 | protected static $attributeMap = [ 53 | 'access_token' => 'access_token', 54 | 'data' => 'data', 55 | 'expires_in' => 'expires_in', 56 | 'refresh_token' => 'refresh_token', 57 | 'scope' => 'scope', 58 | 'token_type' => 'token_type' 59 | ]; 60 | 61 | 62 | /** 63 | * Array of attributes to setter functions (for deserialization of responses) 64 | * @var string[] 65 | */ 66 | protected static $setters = [ 67 | 'access_token' => 'setAccessToken', 68 | 'data' => 'setData', 69 | 'expires_in' => 'setExpiresIn', 70 | 'refresh_token' => 'setRefreshToken', 71 | 'scope' => 'setScope', 72 | 'token_type' => 'setTokenType' 73 | ]; 74 | 75 | 76 | /** 77 | * Array of attributes to getter functions (for serialization of requests) 78 | * @var string[] 79 | */ 80 | protected static $getters = [ 81 | 'access_token' => 'getAccessToken', 82 | 'data' => 'getData', 83 | 'expires_in' => 'getExpiresIn', 84 | 'refresh_token' => 'getRefreshToken', 85 | 'scope' => 'getScope', 86 | 'token_type' => 'getTokenType' 87 | ]; 88 | 89 | public static function attributeMap() 90 | { 91 | return self::$attributeMap; 92 | } 93 | 94 | public static function setters() 95 | { 96 | return self::$setters; 97 | } 98 | 99 | public static function getters() 100 | { 101 | return self::$getters; 102 | } 103 | 104 | 105 | 106 | 107 | 108 | /** 109 | * Associative array for storing property values 110 | * @var mixed[] 111 | */ 112 | protected $container = []; 113 | 114 | /** 115 | * Constructor 116 | * @param mixed[] $data Associated array of property values initializing the model 117 | */ 118 | public function __construct(array $data = null) 119 | { 120 | $this->container['access_token'] = isset($data['access_token']) ? $data['access_token'] : null; 121 | $this->container['data'] = isset($data['data']) ? $data['data'] : null; 122 | $this->container['expires_in'] = isset($data['expires_in']) ? $data['expires_in'] : null; 123 | $this->container['refresh_token'] = isset($data['refresh_token']) ? $data['refresh_token'] : null; 124 | $this->container['scope'] = isset($data['scope']) ? $data['scope'] : null; 125 | $this->container['token_type'] = isset($data['token_type']) ? $data['token_type'] : null; 126 | } 127 | 128 | /** 129 | * show all the invalid properties with reasons. 130 | * 131 | * @return array invalid properties with reasons 132 | */ 133 | public function listInvalidProperties() 134 | { 135 | $invalid_properties = []; 136 | return $invalid_properties; 137 | } 138 | 139 | /** 140 | * validate all the properties in the model 141 | * return true if all passed 142 | * 143 | * @return bool True if all properteis are valid 144 | */ 145 | public function valid() 146 | { 147 | return true; 148 | } 149 | 150 | 151 | /** 152 | * Gets access_token 153 | * @return string 154 | */ 155 | public function getAccessToken() 156 | { 157 | return $this->container['access_token']; 158 | } 159 | 160 | /** 161 | * Sets access_token 162 | * @param string $access_token Access token information. 163 | * @return $this 164 | */ 165 | public function setAccessToken($access_token) 166 | { 167 | $this->container['access_token'] = $access_token; 168 | 169 | return $this; 170 | } 171 | 172 | /** 173 | * Gets data 174 | * @return \DocuSign\Monitor\Model\NameValue[] 175 | */ 176 | public function getData() 177 | { 178 | return $this->container['data']; 179 | } 180 | 181 | /** 182 | * Sets data 183 | * @param \DocuSign\Monitor\Model\NameValue[] $data 184 | * @return $this 185 | */ 186 | public function setData($data) 187 | { 188 | $this->container['data'] = $data; 189 | 190 | return $this; 191 | } 192 | 193 | /** 194 | * Gets expires_in 195 | * @return string 196 | */ 197 | public function getExpiresIn() 198 | { 199 | return $this->container['expires_in']; 200 | } 201 | 202 | /** 203 | * Sets expires_in 204 | * @param string $expires_in 205 | * @return $this 206 | */ 207 | public function setExpiresIn($expires_in) 208 | { 209 | $this->container['expires_in'] = $expires_in; 210 | 211 | return $this; 212 | } 213 | 214 | /** 215 | * Gets refresh_token 216 | * @return string 217 | */ 218 | public function getRefreshToken() 219 | { 220 | return $this->container['refresh_token']; 221 | } 222 | 223 | /** 224 | * Sets refresh_token 225 | * @param string $refresh_token 226 | * @return $this 227 | */ 228 | public function setRefreshToken($refresh_token) 229 | { 230 | $this->container['refresh_token'] = $refresh_token; 231 | 232 | return $this; 233 | } 234 | 235 | /** 236 | * Gets scope 237 | * @return string 238 | */ 239 | public function getScope() 240 | { 241 | return $this->container['scope']; 242 | } 243 | 244 | /** 245 | * Sets scope 246 | * @param string $scope Must be set to \"api\". 247 | * @return $this 248 | */ 249 | public function setScope($scope) 250 | { 251 | $this->container['scope'] = $scope; 252 | 253 | return $this; 254 | } 255 | 256 | /** 257 | * Gets token_type 258 | * @return string 259 | */ 260 | public function getTokenType() 261 | { 262 | return $this->container['token_type']; 263 | } 264 | 265 | /** 266 | * Sets token_type 267 | * @param string $token_type 268 | * @return $this 269 | */ 270 | public function setTokenType($token_type) 271 | { 272 | $this->container['token_type'] = $token_type; 273 | 274 | return $this; 275 | } 276 | /** 277 | * Returns true if offset exists. False otherwise. 278 | * @param integer $offset Offset 279 | * @return boolean 280 | */ 281 | public function offsetExists($offset) 282 | { 283 | return isset($this->container[$offset]); 284 | } 285 | 286 | /** 287 | * Gets offset. 288 | * @param integer $offset Offset 289 | * @return mixed 290 | */ 291 | public function offsetGet($offset) 292 | { 293 | return isset($this->container[$offset]) ? $this->container[$offset] : null; 294 | } 295 | 296 | /** 297 | * Sets value based on offset. 298 | * @param integer $offset Offset 299 | * @param mixed $value Value to be set 300 | * @return void 301 | */ 302 | public function offsetSet($offset, $value) 303 | { 304 | if (is_null($offset)) { 305 | $this->container[] = $value; 306 | } else { 307 | $this->container[$offset] = $value; 308 | } 309 | } 310 | 311 | /** 312 | * Unsets offset. 313 | * @param integer $offset Offset 314 | * @return void 315 | */ 316 | public function offsetUnset($offset) 317 | { 318 | unset($this->container[$offset]); 319 | } 320 | 321 | /** 322 | * Gets the string presentation of the object 323 | * @return string 324 | */ 325 | public function __toString() 326 | { 327 | if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print 328 | return json_encode(\DocuSign\Monitor\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); 329 | } 330 | 331 | return json_encode(\DocuSign\Monitor\ObjectSerializer::sanitizeForSerialization($this)); 332 | } 333 | } 334 | 335 | 336 | -------------------------------------------------------------------------------- /test/TestConfig.php-sample: -------------------------------------------------------------------------------- 1 | host = !empty($host) ? $host : "https://demo.docusign.net/restapi"; 92 | $this->username = !empty($username) ? $username : 'REQUIRED'; 93 | $this->password = !empty($password) ? $password : 'REQUIRED'; 94 | $this->integratorKey = !empty($integratorKey) ? $integratorKey : 'REQUIRED'; 95 | 96 | $this->recipientEmail = !empty($recipientEmail) ? $recipientEmail : 'REQUIRED'; 97 | $this->recipientName = !empty($recipientName) ? $recipientName : 'REQUIRED'; 98 | 99 | $this->templateRoleName = !empty($templateRoleName) ? $templateRoleName : 'Manager'; 100 | $this->templateId = !empty($templateId) ? $templateId : 'REQUIRED'; 101 | 102 | $this->returnUrl = !empty($returnUrl) ? $returnUrl : 'https://www.docusign.com/devcenter'; 103 | 104 | $this->clientUserId = "1234"; 105 | } 106 | 107 | /** 108 | * Gets username 109 | * @return string 110 | */ 111 | public function getUsername() 112 | { 113 | return $this->username; 114 | } 115 | 116 | /** 117 | * Sets username 118 | * @param string $username 119 | * @return $this 120 | */ 121 | public function setUsername($username) 122 | { 123 | $this->username = $username; 124 | return $this; 125 | } 126 | 127 | /** 128 | * Gets password 129 | * @return string 130 | */ 131 | public function getPassword() 132 | { 133 | return $this->password; 134 | } 135 | 136 | /** 137 | * Sets password 138 | * @param string $password 139 | * @return $this 140 | */ 141 | public function setPassword($password) 142 | { 143 | $this->password = $password; 144 | return $this; 145 | } 146 | 147 | /** 148 | * Gets integratorKey 149 | * @return string 150 | */ 151 | public function getIntegratorKey() 152 | { 153 | return $this->integratorKey; 154 | } 155 | 156 | /** 157 | * Sets integratorKey 158 | * @param string $integratorKey 159 | * @return $this 160 | */ 161 | public function setIntegratorKey($integratorKey) 162 | { 163 | $this->integratorKey = $integratorKey; 164 | return $this; 165 | } 166 | 167 | /** 168 | * Gets host 169 | * @return string 170 | */ 171 | public function getHost() 172 | { 173 | return $this->host; 174 | } 175 | 176 | /** 177 | * Sets host 178 | * @param string $host 179 | * @return $this 180 | */ 181 | public function setHost($host) 182 | { 183 | $this->host = $host; 184 | return $this; 185 | } 186 | 187 | /** 188 | * Gets apiClient 189 | * @return DocuSign\Monitor\Client\ApiClient 190 | */ 191 | public function getApiClient() 192 | { 193 | return $this->apiClient; 194 | } 195 | 196 | /** 197 | * Sets apiClient 198 | * @param DocuSign\Monitor\Client\ApiClient $apiClient 199 | * @return $this 200 | */ 201 | public function setApiClient($apiClient) 202 | { 203 | $this->apiClient = $apiClient; 204 | return $this; 205 | } 206 | 207 | /** 208 | * Gets accountId 209 | * @return string 210 | */ 211 | public function getAccountId() 212 | { 213 | return $this->accountId; 214 | } 215 | 216 | /** 217 | * Sets accountId 218 | * @param string $accountId 219 | * @return $this 220 | */ 221 | public function setAccountId($accountId) 222 | { 223 | $this->accountId = $accountId; 224 | return $this; 225 | } 226 | 227 | /** 228 | * Gets recipientEmail 229 | * @return string 230 | */ 231 | public function getRecipientEmail() 232 | { 233 | return $this->recipientEmail; 234 | } 235 | 236 | /** 237 | * Sets recipientEmail 238 | * @param string $recipientEmail 239 | * @return $this 240 | */ 241 | public function setRecipientEmail($recipientEmail) 242 | { 243 | $this->recipientEmail = $recipientEmail; 244 | return $this; 245 | } 246 | 247 | /** 248 | * Gets recipientName 249 | * @return string 250 | */ 251 | public function getRecipientName() 252 | { 253 | return $this->recipientName; 254 | } 255 | 256 | /** 257 | * Sets recipientName 258 | * @param string $recipientName 259 | * @return $this 260 | */ 261 | public function setRecipientName($recipientName) 262 | { 263 | $this->recipientName = $recipientName; 264 | return $this; 265 | } 266 | 267 | /** 268 | * Gets templateRoleName 269 | * @return string 270 | */ 271 | public function getTemplateRoleName() 272 | { 273 | return $this->templateRoleName; 274 | } 275 | 276 | /** 277 | * Sets templateRoleName 278 | * @param string $templateRoleName 279 | * @return $this 280 | */ 281 | public function setTemplateRoleName($templateRoleName) 282 | { 283 | $this->templateRoleName = $templateRoleName; 284 | return $this; 285 | } 286 | 287 | /** 288 | * Gets templateId 289 | * @return string 290 | */ 291 | public function getTemplateId() 292 | { 293 | return $this->templateId; 294 | } 295 | 296 | /** 297 | * Sets templateId 298 | * @param string $templateId 299 | * @return $this 300 | */ 301 | public function setTemplateId($templateId) 302 | { 303 | $this->templateId = $templateId; 304 | return $this; 305 | } 306 | 307 | /** 308 | * Gets envelopeId 309 | * @return string 310 | */ 311 | public function getEnvelopeId() 312 | { 313 | return $this->envelopeId; 314 | } 315 | 316 | /** 317 | * Sets envelopeId 318 | * @param string $envelopeId 319 | * @return $this 320 | */ 321 | public function setEnvelopeId($envelopeId) 322 | { 323 | $this->envelopeId = $envelopeId; 324 | return $this; 325 | } 326 | 327 | /** 328 | * Gets createdEnvelopeId 329 | * @return string 330 | */ 331 | public function getCreatedEnvelopeId() 332 | { 333 | return $this->createdEnvelopId; 334 | } 335 | 336 | /** 337 | * Sets createdEnvelopeId 338 | * @param string $createdEnvelopeId 339 | * @return $this 340 | */ 341 | public function setCreatedEnvelopeId($envelopeId) 342 | { 343 | $this->createdEnvelopId = $envelopeId; 344 | return $this; 345 | } 346 | 347 | /** 348 | * Gets returnUrl 349 | * @return string 350 | */ 351 | public function getReturnUrl() 352 | { 353 | return $this->returnUrl; 354 | } 355 | 356 | /** 357 | * Sets returnUrl 358 | * @param string $returnUrl 359 | * @return $this 360 | */ 361 | public function setReturnUrl($returnUrl) 362 | { 363 | $this->returnUrl = $returnUrl; 364 | return $this; 365 | } 366 | 367 | /** 368 | * Gets clientUserId 369 | * @return string 370 | */ 371 | public function getClientUserId() 372 | { 373 | return $this->clientUserId; 374 | } 375 | 376 | /** 377 | * Sets clientUserId 378 | * @param string $clientUserId 379 | * @return $this 380 | */ 381 | public function setClientUserId($clientUserId) 382 | { 383 | $this->clientUserId = $clientUserId; 384 | return $this; 385 | } 386 | } 387 | 388 | ?> -------------------------------------------------------------------------------- /test/TestConfig.php: -------------------------------------------------------------------------------- 1 | host = !empty($host) ? $host : 'https://lens-d.docusign.net'; 100 | $this->integratorKey = !empty($integratorKey) ? $integratorKey : getenv('INTEGRATOR_KEY_JWT'); 101 | $this->clientSecret = !empty($secret) ? $secret : getenv('CLIENT_SECRET'); 102 | $this->clientKey = !empty($key) ? $key : 'Docs/private.pem'; 103 | $this->privateKeyB64 = !empty($privateKey) ? $privateKey : getenv('PRIVATE_KEY'); 104 | 105 | $this->recipientEmail = !empty($recipientEmail) ? $recipientEmail : getenv('RECIPIENT_EMAIL'); 106 | $this->recipientName = !empty($recipientName) ? $recipientName : 'PHP SDK'; 107 | 108 | $this->templateRoleName = !empty($templateRoleName) ? $templateRoleName : 'Manager'; 109 | $this->templateId = !empty($templateId) ? $templateId : getenv('TEMPLATE_ID'); 110 | 111 | $this->returnUrl = !empty($returnUrl) ? $returnUrl : getenv('REDIRECT_URI'); 112 | 113 | $this->envelopeId = !empty($envelopeId) ? $envelopeId : ''; 114 | $this->userId = !empty($userId) ? $userId : getenv('USER_ID'); //can be taken from generateAccessToken returned result 115 | 116 | $this->clientUserId = "1234"; 117 | 118 | $decodedKey = base64_decode($this->privateKeyB64); 119 | file_put_contents($this->clientKey, $decodedKey); 120 | } 121 | 122 | /** 123 | * Gets integratorKey 124 | * @return string 125 | */ 126 | public function getIntegratorKey() 127 | { 128 | return $this->integratorKey; 129 | } 130 | 131 | /** 132 | * Sets integratorKey 133 | * @param string $integratorKey 134 | * @return $this 135 | */ 136 | public function setIntegratorKey($integratorKey) 137 | { 138 | $this->integratorKey = $integratorKey; 139 | return $this; 140 | } 141 | 142 | /** 143 | * Gets host 144 | * @return string 145 | */ 146 | public function getHost() 147 | { 148 | return $this->host; 149 | } 150 | 151 | /** 152 | * Sets host 153 | * @param string $host 154 | * @return $this 155 | */ 156 | public function setHost($host) 157 | { 158 | $this->host = $host; 159 | return $this; 160 | } 161 | 162 | /** 163 | * Gets apiClient 164 | * @return DocuSign\Monitor\Client\ApiClient 165 | */ 166 | public function getApiClient() 167 | { 168 | return $this->apiClient; 169 | } 170 | 171 | /** 172 | * Sets apiClient 173 | * @param DocuSign\Monitor\Client\ApiClient $apiClient 174 | * @return $this 175 | */ 176 | public function setApiClient($apiClient) 177 | { 178 | $this->apiClient = $apiClient; 179 | return $this; 180 | } 181 | 182 | /** 183 | * Gets accountId 184 | * @return string 185 | */ 186 | public function getAccountId() 187 | { 188 | return $this->accountId; 189 | } 190 | 191 | /** 192 | * Sets accountId 193 | * @param string $accountId 194 | * @return $this 195 | */ 196 | public function setAccountId($accountId) 197 | { 198 | $this->accountId = $accountId; 199 | return $this; 200 | } 201 | 202 | /** 203 | * Gets recipientEmail 204 | * @return string 205 | */ 206 | public function getRecipientEmail() 207 | { 208 | return $this->recipientEmail; 209 | } 210 | 211 | /** 212 | * Sets recipientEmail 213 | * @param string $recipientEmail 214 | * @return $this 215 | */ 216 | public function setRecipientEmail($recipientEmail) 217 | { 218 | $this->recipientEmail = $recipientEmail; 219 | return $this; 220 | } 221 | 222 | /** 223 | * Gets recipientName 224 | * @return string 225 | */ 226 | public function getRecipientName() 227 | { 228 | return $this->recipientName; 229 | } 230 | 231 | /** 232 | * Sets recipientName 233 | * @param string $recipientName 234 | * @return $this 235 | */ 236 | public function setRecipientName($recipientName) 237 | { 238 | $this->recipientName = $recipientName; 239 | return $this; 240 | } 241 | 242 | /** 243 | * Gets templateRoleName 244 | * @return string 245 | */ 246 | public function getTemplateRoleName() 247 | { 248 | return $this->templateRoleName; 249 | } 250 | 251 | /** 252 | * Sets templateRoleName 253 | * @param string $templateRoleName 254 | * @return $this 255 | */ 256 | public function setTemplateRoleName($templateRoleName) 257 | { 258 | $this->templateRoleName = $templateRoleName; 259 | return $this; 260 | } 261 | 262 | /** 263 | * Gets templateId 264 | * @return string 265 | */ 266 | public function getTemplateId() 267 | { 268 | return $this->templateId; 269 | } 270 | 271 | /** 272 | * Sets templateId 273 | * @param string $templateId 274 | * @return $this 275 | */ 276 | public function setTemplateId($templateId) 277 | { 278 | $this->templateId = $templateId; 279 | return $this; 280 | } 281 | 282 | /** 283 | * Gets envelopeId 284 | * @return string 285 | */ 286 | public function getEnvelopeId() 287 | { 288 | return $this->envelopeId; 289 | } 290 | 291 | /** 292 | * Sets envelopeId 293 | * @param string $envelopeId 294 | * @return $this 295 | */ 296 | public function setEnvelopeId($envelopeId) 297 | { 298 | $this->envelopeId = $envelopeId; 299 | return $this; 300 | } 301 | 302 | /** 303 | * Gets createdEnvelopeId 304 | * @return string 305 | */ 306 | public function getCreatedEnvelopeId() 307 | { 308 | return $this->createdEnvelopId; 309 | } 310 | 311 | /** 312 | * Sets createdEnvelopeId 313 | * @param string $createdEnvelopeId 314 | * @return $this 315 | */ 316 | public function setCreatedEnvelopeId($envelopeId) 317 | { 318 | $this->createdEnvelopId = $envelopeId; 319 | return $this; 320 | } 321 | 322 | /** 323 | * Gets returnUrl 324 | * @return string 325 | */ 326 | public function getReturnUrl() 327 | { 328 | return $this->returnUrl; 329 | } 330 | 331 | /** 332 | * Sets returnUrl 333 | * @param string $returnUrl 334 | * @return $this 335 | */ 336 | public function setReturnUrl($returnUrl) 337 | { 338 | $this->returnUrl = $returnUrl; 339 | return $this; 340 | } 341 | 342 | /** 343 | * Gets clientUserId 344 | * @return string 345 | */ 346 | public function getClientUserId() 347 | { 348 | return $this->clientUserId; 349 | } 350 | 351 | /** 352 | * Sets clientUserId 353 | * @param string $clientUserId 354 | * @return $this 355 | */ 356 | public function setClientUserId($clientUserId) 357 | { 358 | $this->clientUserId = $clientUserId; 359 | return $this; 360 | } 361 | 362 | /** 363 | * Gets client secret 364 | * @return string 365 | */ 366 | public function getClientSecret() 367 | { 368 | return $this->clientSecret; 369 | } 370 | 371 | /** 372 | * Sets client secret 373 | * @param string $clientSecret 374 | * @return $this 375 | */ 376 | public function setClientSecret($clientSecret) 377 | { 378 | $this->clientSecret = $clientSecret; 379 | return $this; 380 | } 381 | 382 | /** 383 | * Gets client key 384 | * @return string 385 | */ 386 | public function getClientKey() 387 | { 388 | return file_get_contents($this->clientKey); 389 | } 390 | 391 | /** 392 | * Sets client key 393 | * @param string $clientKey 394 | * @return $this 395 | */ 396 | public function setClientKey($clientKey) 397 | { 398 | $this->clientKey = $clientKey; 399 | return $this; 400 | } 401 | 402 | /** 403 | * @return string 404 | */ 405 | public function getPrivateKeyB64() 406 | { 407 | return $this->privateKeyB64; 408 | } 409 | 410 | /** 411 | * @param string $privateKeyB64 412 | */ 413 | public function setPrivateKeyB64($privateKeyB64) 414 | { 415 | $this->privateKeyB64 = $privateKeyB64; 416 | } 417 | /** 418 | * Gets client key 419 | * @return string 420 | */ 421 | public function getUserId() 422 | { 423 | return $this->userId; 424 | } 425 | 426 | /** 427 | * UserId 428 | * @param string $userId 429 | * @return $this 430 | */ 431 | public function setUserId($userId) 432 | { 433 | $this->userId = $userId; 434 | return $this; 435 | } 436 | } 437 | 438 | ?> 439 | -------------------------------------------------------------------------------- /src/Model/RawRequest.php: -------------------------------------------------------------------------------- 1 | 'string', 61 | 'query_scope_id' => 'string', 62 | 'query' => 'string' 63 | ]; 64 | 65 | /** 66 | * Array of property to format mappings. Used for (de)serialization 67 | * 68 | * @var string[] 69 | */ 70 | protected static $swaggerFormats = [ 71 | 'query_scope' => null, 72 | 'query_scope_id' => 'uuid', 73 | 'query' => null 74 | ]; 75 | 76 | /** 77 | * Array of property to type mappings. Used for (de)serialization 78 | * 79 | * @return array 80 | */ 81 | public static function swaggerTypes() 82 | { 83 | return self::$swaggerTypes; 84 | } 85 | 86 | /** 87 | * Array of property to format mappings. Used for (de)serialization 88 | * 89 | * @return array 90 | */ 91 | public static function swaggerFormats() 92 | { 93 | return self::$swaggerFormats; 94 | } 95 | 96 | /** 97 | * Array of attributes where the key is the local name, 98 | * and the value is the original name 99 | * 100 | * @var string[] 101 | */ 102 | protected static $attributeMap = [ 103 | 'query_scope' => 'queryScope', 104 | 'query_scope_id' => 'queryScopeId', 105 | 'query' => 'query' 106 | ]; 107 | 108 | /** 109 | * Array of attributes to setter functions (for deserialization of responses) 110 | * 111 | * @var string[] 112 | */ 113 | protected static $setters = [ 114 | 'query_scope' => 'setQueryScope', 115 | 'query_scope_id' => 'setQueryScopeId', 116 | 'query' => 'setQuery' 117 | ]; 118 | 119 | /** 120 | * Array of attributes to getter functions (for serialization of requests) 121 | * 122 | * @var string[] 123 | */ 124 | protected static $getters = [ 125 | 'query_scope' => 'getQueryScope', 126 | 'query_scope_id' => 'getQueryScopeId', 127 | 'query' => 'getQuery' 128 | ]; 129 | 130 | /** 131 | * Array of attributes where the key is the local name, 132 | * and the value is the original name 133 | * 134 | * @return array 135 | */ 136 | public static function attributeMap() 137 | { 138 | return self::$attributeMap; 139 | } 140 | 141 | /** 142 | * Array of attributes to setter functions (for deserialization of responses) 143 | * 144 | * @return array 145 | */ 146 | public static function setters() 147 | { 148 | return self::$setters; 149 | } 150 | 151 | /** 152 | * Array of attributes to getter functions (for serialization of requests) 153 | * 154 | * @return array 155 | */ 156 | public static function getters() 157 | { 158 | return self::$getters; 159 | } 160 | 161 | /** 162 | * The original name of the model. 163 | * 164 | * @return string 165 | */ 166 | public function getModelName() 167 | { 168 | return self::$swaggerModelName; 169 | } 170 | 171 | const QUERY_SCOPE_ACCOUNT_ID = 'AccountId'; 172 | const QUERY_SCOPE_ORGANIZATION_ID = 'OrganizationId'; 173 | const QUERY_SCOPE_NONE = 'None'; 174 | 175 | 176 | 177 | /** 178 | * Gets allowable values of the enum 179 | * 180 | * @return string[] 181 | */ 182 | public function getQueryScopeAllowableValues() 183 | { 184 | return [ 185 | self::QUERY_SCOPE_ACCOUNT_ID, 186 | self::QUERY_SCOPE_ORGANIZATION_ID, 187 | self::QUERY_SCOPE_NONE, 188 | ]; 189 | } 190 | 191 | 192 | /** 193 | * Associative array for storing property values 194 | * 195 | * @var mixed[] 196 | */ 197 | protected $container = []; 198 | 199 | /** 200 | * Constructor 201 | * 202 | * @param mixed[] $data Associated array of property values 203 | * initializing the model 204 | */ 205 | public function __construct(array $data = null) 206 | { 207 | $this->container['query_scope'] = isset($data['query_scope']) ? $data['query_scope'] : null; 208 | $this->container['query_scope_id'] = isset($data['query_scope_id']) ? $data['query_scope_id'] : null; 209 | $this->container['query'] = isset($data['query']) ? $data['query'] : null; 210 | } 211 | 212 | /** 213 | * Show all the invalid properties with reasons. 214 | * 215 | * @return array invalid properties with reasons 216 | */ 217 | public function listInvalidProperties() 218 | { 219 | $invalidProperties = []; 220 | 221 | $allowedValues = $this->getQueryScopeAllowableValues(); 222 | if (!is_null($this->container['query_scope']) && !in_array($this->container['query_scope'], $allowedValues, true)) { 223 | $invalidProperties[] = sprintf( 224 | "invalid value for 'query_scope', must be one of '%s'", 225 | implode("', '", $allowedValues) 226 | ); 227 | } 228 | 229 | return $invalidProperties; 230 | } 231 | 232 | /** 233 | * Validate all the properties in the model 234 | * return true if all passed 235 | * 236 | * @return bool True if all properties are valid 237 | */ 238 | public function valid() 239 | { 240 | return count($this->listInvalidProperties()) === 0; 241 | } 242 | 243 | 244 | /** 245 | * Gets query_scope 246 | * 247 | * @return string 248 | */ 249 | public function getQueryScope() 250 | { 251 | return $this->container['query_scope']; 252 | } 253 | 254 | /** 255 | * Sets query_scope 256 | * 257 | * @param string $query_scope query_scope 258 | * 259 | * @return $this 260 | */ 261 | public function setQueryScope($query_scope) 262 | { 263 | $allowedValues = $this->getQueryScopeAllowableValues(); 264 | if (!is_null($query_scope) && !in_array($query_scope, $allowedValues, true)) { 265 | throw new \InvalidArgumentException( 266 | sprintf( 267 | "Invalid value for 'query_scope', must be one of '%s'", 268 | implode("', '", $allowedValues) 269 | ) 270 | ); 271 | } 272 | $this->container['query_scope'] = $query_scope; 273 | 274 | return $this; 275 | } 276 | 277 | /** 278 | * Gets query_scope_id 279 | * 280 | * @return string 281 | */ 282 | public function getQueryScopeId() 283 | { 284 | return $this->container['query_scope_id']; 285 | } 286 | 287 | /** 288 | * Sets query_scope_id 289 | * 290 | * @param string $query_scope_id query_scope_id 291 | * 292 | * @return $this 293 | */ 294 | public function setQueryScopeId($query_scope_id) 295 | { 296 | $this->container['query_scope_id'] = $query_scope_id; 297 | 298 | return $this; 299 | } 300 | 301 | /** 302 | * Gets query 303 | * 304 | * @return string 305 | */ 306 | public function getQuery() 307 | { 308 | return $this->container['query']; 309 | } 310 | 311 | /** 312 | * Sets query 313 | * 314 | * @param string $query query 315 | * 316 | * @return $this 317 | */ 318 | public function setQuery($query) 319 | { 320 | $this->container['query'] = $query; 321 | 322 | return $this; 323 | } 324 | /** 325 | * Returns true if offset exists. False otherwise. 326 | * 327 | * @param integer $offset Offset 328 | * 329 | * @return boolean 330 | */ 331 | public function offsetExists($offset) 332 | { 333 | return isset($this->container[$offset]); 334 | } 335 | 336 | /** 337 | * Gets offset. 338 | * 339 | * @param integer $offset Offset 340 | * 341 | * @return mixed 342 | */ 343 | public function offsetGet($offset) 344 | { 345 | return isset($this->container[$offset]) ? $this->container[$offset] : null; 346 | } 347 | 348 | /** 349 | * Sets value based on offset. 350 | * 351 | * @param integer $offset Offset 352 | * @param mixed $value Value to be set 353 | * 354 | * @return void 355 | */ 356 | public function offsetSet($offset, $value) 357 | { 358 | if (is_null($offset)) { 359 | $this->container[] = $value; 360 | } else { 361 | $this->container[$offset] = $value; 362 | } 363 | } 364 | 365 | /** 366 | * Unsets offset. 367 | * 368 | * @param integer $offset Offset 369 | * 370 | * @return void 371 | */ 372 | public function offsetUnset($offset) 373 | { 374 | unset($this->container[$offset]); 375 | } 376 | 377 | /** 378 | * Gets the string presentation of the object 379 | * 380 | * @return string 381 | */ 382 | public function __toString() 383 | { 384 | if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print 385 | return json_encode( 386 | ObjectSerializer::sanitizeForSerialization($this), 387 | JSON_PRETTY_PRINT 388 | ); 389 | } 390 | 391 | return json_encode(ObjectSerializer::sanitizeForSerialization($this)); 392 | } 393 | } 394 | 395 | -------------------------------------------------------------------------------- /src/Client/Auth/UserInfo.php: -------------------------------------------------------------------------------- 1 | 'string', 53 | 'email' => 'string', 54 | 'error_details' => '\DocuSign\Monitor\Model\ErrorDetails', 55 | 'accounts' => '\DocuSign\Monitor\Client\Auth\Account[]', 56 | 'name' => 'string', 57 | 'given_name' => 'string', 58 | 'family_name' => 'string', 59 | 'created' => 'string', 60 | ]; 61 | 62 | public static function swaggerTypes() 63 | { 64 | return self::$swaggerTypes; 65 | } 66 | 67 | /** 68 | * Array of attributes where the key is the local name, and the value is the original name 69 | * @var string[] 70 | */ 71 | protected static $attributeMap = [ 72 | 'sub' => 'sub', 73 | 'email' => 'email', 74 | 'error_details' => 'error_details', 75 | 'accounts' => 'accounts', 76 | 'name' => 'name', 77 | 'given_name' => 'given_name', 78 | 'family_name' => 'family_name', 79 | 'created' => 'created' 80 | ]; 81 | 82 | 83 | /** 84 | * Array of attributes to setter functions (for deserialization of responses) 85 | * @var string[] 86 | */ 87 | protected static $setters = [ 88 | 'sub' => 'setSub', 89 | 'email' => 'setEmail', 90 | 'error_details' => 'setErrorDetails', 91 | 'accounts' => 'setAccounts', 92 | 'name' => 'setName', 93 | 'given_name' => 'setGivenName', 94 | 'family_name' => 'setFamilyName', 95 | 'created' => 'setCreated' 96 | ]; 97 | 98 | 99 | /** 100 | * Array of attributes to getter functions (for serialization of requests) 101 | * @var string[] 102 | */ 103 | protected static $getters = [ 104 | 'sub' => 'getSub', 105 | 'email' => 'getEmail', 106 | 'error_details' => 'getErrorDetails', 107 | 'accounts' => 'getAccounts', 108 | 'name' => 'getName', 109 | 'given_name' => 'getGivenName', 110 | 'family_name' => 'getFamilyName', 111 | 'created' => 'getCreated' 112 | ]; 113 | 114 | public static function attributeMap() 115 | { 116 | return self::$attributeMap; 117 | } 118 | 119 | public static function setters() 120 | { 121 | return self::$setters; 122 | } 123 | 124 | public static function getters() 125 | { 126 | return self::$getters; 127 | } 128 | 129 | /** 130 | * Associative array for storing property values 131 | * @var mixed[] 132 | */ 133 | protected $container = []; 134 | 135 | /** 136 | * Constructor 137 | * @param mixed[] $data Associated array of property values initializing the model 138 | */ 139 | public function __construct(array $data = null) 140 | { 141 | $this->container['sub'] = isset($data['sub']) ? $data['sub'] : null; 142 | $this->container['email'] = isset($data['email']) ? $data['email'] : null; 143 | $this->container['error_details'] = isset($data['error_details']) ? $data['error_details'] : null; 144 | $this->container['accounts'] = isset($data['accounts']) ? $data['accounts'] : null; 145 | $this->container['given_name'] = isset($data['given_name']) ? $data['given_name'] : null; 146 | $this->container['name'] = isset($data['name']) ? $data['name'] : null; 147 | $this->container['family_name'] = isset($data['family_name']) ? $data['family_name'] : null; 148 | $this->container['created'] = isset($data['created']) ? $data['created'] : null; 149 | } 150 | 151 | /** 152 | * show all the invalid properties with reasons. 153 | * 154 | * @return array invalid properties with reasons 155 | */ 156 | public function listInvalidProperties() 157 | { 158 | $invalid_properties = []; 159 | return $invalid_properties; 160 | } 161 | 162 | /** 163 | * validate all the properties in the model 164 | * return true if all passed 165 | * 166 | * @return bool True if all properteis are valid 167 | */ 168 | public function valid() 169 | { 170 | return true; 171 | } 172 | 173 | 174 | /** 175 | * Gets sub 176 | * @return string 177 | */ 178 | public function getSub() 179 | { 180 | return $this->container['sub']; 181 | } 182 | 183 | /** 184 | * Sets sub 185 | * @param string $sub 186 | * @return $this 187 | */ 188 | public function setSub($sub) 189 | { 190 | $this->container['sub'] = $sub; 191 | 192 | return $this; 193 | } 194 | 195 | /** 196 | * Gets email 197 | * @return string 198 | */ 199 | public function getEmail() 200 | { 201 | return $this->container['email']; 202 | } 203 | 204 | /** 205 | * Sets email 206 | * @param string $email 207 | * @return $this 208 | */ 209 | public function setEmail($email) 210 | { 211 | $this->container['email'] = $email; 212 | 213 | return $this; 214 | } 215 | 216 | /** 217 | * Gets error_details 218 | * @return \DocuSign\Monitor\Model\ErrorDetails 219 | */ 220 | public function getErrorDetails() 221 | { 222 | return $this->container['error_details']; 223 | } 224 | 225 | /** 226 | * Sets error_details 227 | * @param \DocuSign\Monitor\Model\ErrorDetails $error_details 228 | * @return $this 229 | */ 230 | public function setErrorDetails($error_details) 231 | { 232 | $this->container['error_details'] = $error_details; 233 | 234 | return $this; 235 | } 236 | 237 | /** 238 | * Gets accounts 239 | * @return \DocuSign\Monitor\Client\Accounts 240 | */ 241 | public function getAccounts() 242 | { 243 | return $this->container['accounts']; 244 | } 245 | 246 | /** 247 | * Sets accounts 248 | * @param \DocuSign\Monitor\Client\Accounts $accounts 249 | * @return $this 250 | */ 251 | public function setAccounts($accounts) 252 | { 253 | $this->container['accounts'] = $accounts; 254 | 255 | return $this; 256 | } 257 | 258 | /** 259 | * Gets name 260 | * @return string 261 | */ 262 | public function getName() 263 | { 264 | return $this->container['name']; 265 | } 266 | 267 | /** 268 | * Sets name 269 | * @param string $name 270 | * @return $this 271 | */ 272 | public function setName($name) 273 | { 274 | $this->container['name'] = $name; 275 | 276 | return $this; 277 | } 278 | 279 | /** 280 | * Gets send_activation_email 281 | * @return string 282 | */ 283 | public function getGivenName() 284 | { 285 | return $this->container['given_name']; 286 | } 287 | 288 | /** 289 | * Sets given_name 290 | * @param string $given_name 291 | * @return $this 292 | */ 293 | public function setGivenName($given_name) 294 | { 295 | $this->container['given_name'] = $given_name; 296 | 297 | return $this; 298 | } 299 | 300 | /** 301 | * Gets family_name 302 | * @return string 303 | */ 304 | public function getFamilyName() 305 | { 306 | return $this->container['family_name']; 307 | } 308 | 309 | /** 310 | * Sets family_name 311 | * @param string $family_name 312 | * @return $this 313 | */ 314 | public function setFamilyName($family_name) 315 | { 316 | $this->container['family_name'] = $family_name; 317 | 318 | return $this; 319 | } 320 | 321 | /** 322 | * Gets created 323 | * @return string 324 | */ 325 | public function getCreated() 326 | { 327 | return $this->container['created']; 328 | } 329 | 330 | /** 331 | * Sets created 332 | * @param string $created 333 | * @return $this 334 | */ 335 | public function setCreated($created) 336 | { 337 | $this->container['created'] = $created; 338 | 339 | return $this; 340 | } 341 | 342 | /** 343 | * Returns true if offset exists. False otherwise. 344 | * @param integer $offset Offset 345 | * @return boolean 346 | */ 347 | public function offsetExists($offset) 348 | { 349 | return isset($this->container[$offset]); 350 | } 351 | 352 | /** 353 | * Gets offset. 354 | * @param integer $offset Offset 355 | * @return mixed 356 | */ 357 | public function offsetGet($offset) 358 | { 359 | return isset($this->container[$offset]) ? $this->container[$offset] : null; 360 | } 361 | 362 | /** 363 | * Sets value based on offset. 364 | * @param integer $offset Offset 365 | * @param mixed $value Value to be set 366 | * @return void 367 | */ 368 | public function offsetSet($offset, $value) 369 | { 370 | if (is_null($offset)) { 371 | $this->container[] = $value; 372 | } else { 373 | $this->container[$offset] = $value; 374 | } 375 | } 376 | 377 | /** 378 | * Unsets offset. 379 | * @param integer $offset Offset 380 | * @return void 381 | */ 382 | public function offsetUnset($offset) 383 | { 384 | unset($this->container[$offset]); 385 | } 386 | 387 | /** 388 | * Gets the string presentation of the object 389 | * @return string 390 | */ 391 | public function __toString() 392 | { 393 | if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print 394 | return json_encode(\DocuSign\Monitor\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); 395 | } 396 | 397 | return json_encode(\DocuSign\Monitor\ObjectSerializer::sanitizeForSerialization($this)); 398 | } 399 | } 400 | 401 | 402 | -------------------------------------------------------------------------------- /src/Api/DataSetApi.php: -------------------------------------------------------------------------------- 1 | 12 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 13 | * @link https://github.com/swagger-api/swagger-codegen 14 | */ 15 | 16 | /** 17 | * Monitor API 18 | * 19 | * An API for an integrator to access the features of DocuSign Monitor 20 | * 21 | * OpenAPI spec version: v2.0 22 | * Contact: devcenter@docusign.com 23 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 24 | * Swagger Codegen version: 2.4.21 25 | */ 26 | 27 | /** 28 | * NOTE: This class is auto generated by the swagger code generator program. 29 | * https://github.com/swagger-api/swagger-codegen 30 | * Do not edit the class manually. 31 | */ 32 | 33 | namespace DocuSign\Monitor\Api\DataSetApi; 34 | 35 | 36 | /** 37 | * GetStreamOptions Class Doc Comment 38 | * 39 | * @category Class 40 | * @package DocuSign\Monitor 41 | * @author Swagger Codegen team 42 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 43 | * @link https://github.com/swagger-api/swagger-codegen 44 | */ 45 | class GetStreamOptions 46 | { 47 | /** 48 | * $cursor Specifies a pointer into the dataset where your query will begin. You can either provide an ISO DateTime or a string cursor (from the `endCursor` value in the response). If no value is provided, the query begins from seven days ago. For example, to fetch event data beginning from January 1, 2022, set this value to `2022-01-01T00:00:00Z`. The response will include data about events starting from that date in chronological order. The response also includes an `endCursor` property. To fetch the next page of event data, call this endpoint again with `cursor` set to the previous `endCursor` value. 49 | * @var ?string 50 | */ 51 | protected ?string $cursor = null; 52 | 53 | /** 54 | * Gets cursor 55 | * 56 | * @return ?string 57 | */ 58 | public function getCursor(): ?string 59 | { 60 | return $this->cursor; 61 | } 62 | 63 | /** 64 | * Sets cursor 65 | * @param ?string $cursor Specifies a pointer into the dataset where your query will begin. You can either provide an ISO DateTime or a string cursor (from the `endCursor` value in the response). If no value is provided, the query begins from seven days ago. For example, to fetch event data beginning from January 1, 2022, set this value to `2022-01-01T00:00:00Z`. The response will include data about events starting from that date in chronological order. The response also includes an `endCursor` property. To fetch the next page of event data, call this endpoint again with `cursor` set to the previous `endCursor` value. 66 | * 67 | * @return self 68 | */ 69 | public function setCursor(?string $cursor): self 70 | { 71 | $this->cursor = $cursor; 72 | return $this; 73 | } 74 | /** 75 | * $limit The maximum number of records to return. The default value is 1000. 76 | * @var ?int 77 | */ 78 | protected ?int $limit = null; 79 | 80 | /** 81 | * Gets limit 82 | * 83 | * @return ?int 84 | */ 85 | public function getLimit(): ?int 86 | { 87 | return $this->limit; 88 | } 89 | 90 | /** 91 | * Sets limit 92 | * @param ?int $limit The maximum number of records to return. The default value is 1000. 93 | * 94 | * @return self 95 | */ 96 | public function setLimit(?int $limit): self 97 | { 98 | $this->limit = $limit; 99 | return $this; 100 | } 101 | } 102 | 103 | 104 | 105 | namespace DocuSign\Monitor\Api; 106 | 107 | use DocuSign\Monitor\Client\ApiClient; 108 | use DocuSign\Monitor\Client\ApiException; 109 | use DocuSign\Monitor\Configuration; 110 | use DocuSign\Monitor\ObjectSerializer; 111 | 112 | /** 113 | * DataSetApi Class Doc Comment 114 | * 115 | * @category Class 116 | * @package DocuSign\Monitor 117 | * @author Swagger Codegen team 118 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 119 | * @link https://github.com/swagger-api/swagger-codegen 120 | */ 121 | class DataSetApi 122 | { 123 | /** 124 | * API Client 125 | * 126 | * @var ApiClient instance of the ApiClient 127 | */ 128 | protected ApiClient $apiClient; 129 | 130 | /** 131 | * Constructor 132 | * 133 | * @param ApiClient|null $apiClient The api client to use 134 | * 135 | * @return void 136 | */ 137 | public function __construct(?ApiClient $apiClient = null) 138 | { 139 | $this->apiClient = $apiClient ?? new ApiClient(); 140 | } 141 | 142 | /** 143 | * Get API client 144 | * 145 | * @return ApiClient get the API client 146 | */ 147 | public function getApiClient(): ApiClient 148 | { 149 | return $this->apiClient; 150 | } 151 | 152 | /** 153 | * Set the API client 154 | * 155 | * @param ApiClient $apiClient set the API client 156 | * 157 | * @return self 158 | */ 159 | public function setApiClient(ApiClient $apiClient): self 160 | { 161 | $this->apiClient = $apiClient; 162 | return $this; 163 | } 164 | 165 | /** 166 | * Update $resourcePath with $ 167 | * 168 | * @param string $resourcePath the resource path to use 169 | * @param string $baseName the base name param 170 | * @param string $paramName the parameter name 171 | * 172 | * @return string 173 | */ 174 | public function updateResourcePath(string $resourcePath, string $baseName, string $paramName): string 175 | { 176 | return str_replace( 177 | "{" . $baseName . "}", 178 | $this->apiClient->getSerializer()->toPathValue($paramName), 179 | $resourcePath 180 | ); 181 | } 182 | 183 | 184 | /** 185 | * Operation getStream 186 | * 187 | * Gets customer event data for an organization. 188 | * 189 | * @param ?string $data_set_name Must be `monitor`. 190 | * @param ?string $version Must be `2`. 191 | * @param \DocuSign\Monitor\Api\DataSetApi\GetStreamOptions $options for modifying the behavior of the function. (optional) 192 | * 193 | * @throws ApiException on non-2xx response 194 | * @return \DocuSign\Monitor\Model\CursoredResult 195 | */ 196 | public function getStream($data_set_name, $version, ?\DocuSign\Monitor\Api\DataSetApi\GetStreamOptions $options = null) 197 | { 198 | list($response) = $this->getStreamWithHttpInfo($data_set_name, $version, $options); 199 | return $response; 200 | } 201 | 202 | /** 203 | * Operation getStreamWithHttpInfo 204 | * 205 | * Gets customer event data for an organization. 206 | * 207 | * @param ?string $data_set_name Must be `monitor`. 208 | * @param ?string $version Must be `2`. 209 | * @param \DocuSign\Monitor\Api\DataSetApi\GetStreamOptions $options for modifying the behavior of the function. (optional) 210 | * 211 | * @throws ApiException on non-2xx response 212 | * @return array of \DocuSign\Monitor\Model\CursoredResult, HTTP status code, HTTP response headers (array of strings) 213 | */ 214 | public function getStreamWithHttpInfo($data_set_name, $version, ?\DocuSign\Monitor\Api\DataSetApi\GetStreamOptions $options = null): array 215 | { 216 | // verify the required parameter 'data_set_name' is set 217 | if ($data_set_name === null) { 218 | throw new \InvalidArgumentException('Missing the required parameter $data_set_name when calling getStream'); 219 | } 220 | // verify the required parameter 'version' is set 221 | if ($version === null) { 222 | throw new \InvalidArgumentException('Missing the required parameter $version when calling getStream'); 223 | } 224 | // parse inputs 225 | $resourcePath = "/api/v{version}/datasets/{dataSetName}/stream"; 226 | $httpBody = $_tempBody ?? ''; // $_tempBody is the method argument, if present 227 | $queryParams = $headerParams = $formParams = []; 228 | $headerParams['Accept'] ??= $this->apiClient->selectHeaderAccept(['application/json']); 229 | $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']); 230 | 231 | if ($options != null) 232 | { 233 | // query params 234 | if ($options->getCursor() != 'null') { 235 | $queryParams['cursor'] = $this->apiClient->getSerializer()->toQueryValue($options->getCursor()); 236 | } 237 | if ($options->getLimit() != 'null') { 238 | $queryParams['limit'] = $this->apiClient->getSerializer()->toQueryValue($options->getLimit()); 239 | } 240 | } 241 | 242 | // path params 243 | if ($data_set_name !== null) { 244 | $resourcePath = self::updateResourcePath($resourcePath, "dataSetName", $data_set_name); 245 | } 246 | // path params 247 | if ($version !== null) { 248 | $resourcePath = self::updateResourcePath($resourcePath, "version", $version); 249 | } 250 | 251 | // default format to json 252 | $resourcePath = str_replace("{format}", "json", $resourcePath); 253 | 254 | // for model (json/xml) 255 | if (isset($_tempBody)) { 256 | $httpBody = $_tempBody; // $_tempBody is the method argument, if present 257 | } elseif (count($formParams) > 0) { 258 | $httpBody = $formParams; // for HTTP post (form) 259 | } 260 | // this endpoint requires OAuth (access token) 261 | if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { 262 | $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); 263 | } 264 | // make the API Call 265 | try { 266 | list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( 267 | $resourcePath, 268 | 'GET', 269 | $queryParams, 270 | $httpBody, 271 | $headerParams, 272 | '\DocuSign\Monitor\Model\CursoredResult', 273 | '/api/v{version}/datasets/{dataSetName}/stream' 274 | ); 275 | 276 | return [$this->apiClient->getSerializer()->deserialize($response, '\DocuSign\Monitor\Model\CursoredResult', $httpHeader), $statusCode, $httpHeader]; 277 | } catch (ApiException $e) { 278 | switch ($e->getCode()) { 279 | case 200: 280 | $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\DocuSign\Monitor\Model\CursoredResult', $e->getResponseHeaders()); 281 | $e->setResponseObject($data); 282 | break; 283 | } 284 | 285 | throw $e; 286 | } 287 | } 288 | } 289 | -------------------------------------------------------------------------------- /src/Model/WebQuery.php: -------------------------------------------------------------------------------- 1 | 10 | * @license The DocuSign PHP Client SDK is licensed under the MIT License. 11 | * @link https://github.com/swagger-api/swagger-codegen 12 | */ 13 | 14 | /** 15 | * Monitor API 16 | * 17 | * An API for an integrator to access the features of DocuSign Monitor 18 | * 19 | * OpenAPI spec version: v2.0 20 | * Contact: devcenter@docusign.com 21 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 22 | * Swagger Codegen version: 2.4.21-SNAPSHOT 23 | */ 24 | 25 | /** 26 | * NOTE: This class is auto generated by the swagger code generator program. 27 | * https://github.com/swagger-api/swagger-codegen 28 | * Do not edit the class manually. 29 | */ 30 | 31 | namespace DocuSign\Monitor\Model; 32 | 33 | use \ArrayAccess; 34 | use DocuSign\Monitor\ObjectSerializer; 35 | 36 | /** 37 | * WebQuery Class Doc Comment 38 | * 39 | * @category Class 40 | * @package DocuSign\Monitor 41 | * @author Swagger Codegen team 42 | * @license The DocuSign PHP Client SDK is licensed under the MIT License. 43 | * @link https://github.com/swagger-api/swagger-codegen 44 | */ 45 | class WebQuery implements ModelInterface, ArrayAccess 46 | { 47 | const DISCRIMINATOR = null; 48 | 49 | /** 50 | * The original name of the model. 51 | * 52 | * @var string 53 | */ 54 | protected static $swaggerModelName = 'webQuery'; 55 | 56 | /** 57 | * Array of property to type mappings. Used for (de)serialization 58 | * 59 | * @var string[] 60 | */ 61 | protected static $swaggerTypes = [ 62 | 'filters' => 'object[]', 63 | 'aggregations' => 'object[]', 64 | 'query_scope' => '?string', 65 | 'query_scope_id' => '?string' 66 | ]; 67 | 68 | /** 69 | * Array of property to format mappings. Used for (de)serialization 70 | * 71 | * @var string[] 72 | */ 73 | protected static $swaggerFormats = [ 74 | 'filters' => null, 75 | 'aggregations' => null, 76 | 'query_scope' => null, 77 | 'query_scope_id' => null 78 | ]; 79 | 80 | /** 81 | * Array of property to type mappings. Used for (de)serialization 82 | * 83 | * @return array 84 | */ 85 | public static function swaggerTypes() 86 | { 87 | return self::$swaggerTypes; 88 | } 89 | 90 | /** 91 | * Array of property to format mappings. Used for (de)serialization 92 | * 93 | * @return array 94 | */ 95 | public static function swaggerFormats() 96 | { 97 | return self::$swaggerFormats; 98 | } 99 | 100 | /** 101 | * Array of attributes where the key is the local name, 102 | * and the value is the original name 103 | * 104 | * @var string[] 105 | */ 106 | protected static $attributeMap = [ 107 | 'filters' => 'filters', 108 | 'aggregations' => 'aggregations', 109 | 'query_scope' => 'queryScope', 110 | 'query_scope_id' => 'queryScopeId' 111 | ]; 112 | 113 | /** 114 | * Array of attributes to setter functions (for deserialization of responses) 115 | * 116 | * @var string[] 117 | */ 118 | protected static $setters = [ 119 | 'filters' => 'setFilters', 120 | 'aggregations' => 'setAggregations', 121 | 'query_scope' => 'setQueryScope', 122 | 'query_scope_id' => 'setQueryScopeId' 123 | ]; 124 | 125 | /** 126 | * Array of attributes to getter functions (for serialization of requests) 127 | * 128 | * @var string[] 129 | */ 130 | protected static $getters = [ 131 | 'filters' => 'getFilters', 132 | 'aggregations' => 'getAggregations', 133 | 'query_scope' => 'getQueryScope', 134 | 'query_scope_id' => 'getQueryScopeId' 135 | ]; 136 | 137 | /** 138 | * Array of attributes where the key is the local name, 139 | * and the value is the original name 140 | * 141 | * @return array 142 | */ 143 | public static function attributeMap() 144 | { 145 | return self::$attributeMap; 146 | } 147 | 148 | /** 149 | * Array of attributes to setter functions (for deserialization of responses) 150 | * 151 | * @return array 152 | */ 153 | public static function setters() 154 | { 155 | return self::$setters; 156 | } 157 | 158 | /** 159 | * Array of attributes to getter functions (for serialization of requests) 160 | * 161 | * @return array 162 | */ 163 | public static function getters() 164 | { 165 | return self::$getters; 166 | } 167 | 168 | /** 169 | * The original name of the model. 170 | * 171 | * @return string 172 | */ 173 | public function getModelName() 174 | { 175 | return self::$swaggerModelName; 176 | } 177 | 178 | const QUERY_SCOPE_ORGANIZATION_ID = 'OrganizationId'; 179 | 180 | 181 | 182 | /** 183 | * Gets allowable values of the enum 184 | * 185 | * @return string[] 186 | */ 187 | public function getQueryScopeAllowableValues() 188 | { 189 | return [ 190 | self::QUERY_SCOPE_ORGANIZATION_ID, 191 | ]; 192 | } 193 | 194 | 195 | /** 196 | * Associative array for storing property values 197 | * 198 | * @var mixed[] 199 | */ 200 | protected $container = []; 201 | 202 | /** 203 | * Constructor 204 | * 205 | * @param mixed[] $data Associated array of property values 206 | * initializing the model 207 | */ 208 | public function __construct(array $data = null) 209 | { 210 | $this->container['filters'] = isset($data['filters']) ? $data['filters'] : null; 211 | $this->container['aggregations'] = isset($data['aggregations']) ? $data['aggregations'] : null; 212 | $this->container['query_scope'] = isset($data['query_scope']) ? $data['query_scope'] : null; 213 | $this->container['query_scope_id'] = isset($data['query_scope_id']) ? $data['query_scope_id'] : null; 214 | } 215 | 216 | /** 217 | * Show all the invalid properties with reasons. 218 | * 219 | * @return array invalid properties with reasons 220 | */ 221 | public function listInvalidProperties() 222 | { 223 | $invalidProperties = []; 224 | 225 | $allowedValues = $this->getQueryScopeAllowableValues(); 226 | if (!is_null($this->container['query_scope']) && !in_array($this->container['query_scope'], $allowedValues, true)) { 227 | $invalidProperties[] = sprintf( 228 | "invalid value for 'query_scope', must be one of '%s'", 229 | implode("', '", $allowedValues) 230 | ); 231 | } 232 | 233 | return $invalidProperties; 234 | } 235 | 236 | /** 237 | * Validate all the properties in the model 238 | * return true if all passed 239 | * 240 | * @return bool True if all properties are valid 241 | */ 242 | public function valid() 243 | { 244 | return count($this->listInvalidProperties()) === 0; 245 | } 246 | 247 | 248 | /** 249 | * Gets filters 250 | * 251 | * @return object[] 252 | */ 253 | public function getFilters() 254 | { 255 | return $this->container['filters']; 256 | } 257 | 258 | /** 259 | * Sets filters 260 | * 261 | * @param object[] $filters filters 262 | * 263 | * @return $this 264 | */ 265 | public function setFilters($filters) 266 | { 267 | $this->container['filters'] = $filters; 268 | 269 | return $this; 270 | } 271 | 272 | /** 273 | * Gets aggregations 274 | * 275 | * @return object[] 276 | */ 277 | public function getAggregations() 278 | { 279 | return $this->container['aggregations']; 280 | } 281 | 282 | /** 283 | * Sets aggregations 284 | * 285 | * @param object[] $aggregations aggregations 286 | * 287 | * @return $this 288 | */ 289 | public function setAggregations($aggregations) 290 | { 291 | $this->container['aggregations'] = $aggregations; 292 | 293 | return $this; 294 | } 295 | 296 | /** 297 | * Gets query_scope 298 | * 299 | * @return ?string 300 | */ 301 | public function getQueryScope() 302 | { 303 | return $this->container['query_scope']; 304 | } 305 | 306 | /** 307 | * Sets query_scope 308 | * 309 | * @param ?string $query_scope query_scope 310 | * 311 | * @return $this 312 | */ 313 | public function setQueryScope($query_scope) 314 | { 315 | $allowedValues = $this->getQueryScopeAllowableValues(); 316 | if (!is_null($query_scope) && !in_array($query_scope, $allowedValues, true)) { 317 | throw new \InvalidArgumentException( 318 | sprintf( 319 | "Invalid value for 'query_scope', must be one of '%s'", 320 | implode("', '", $allowedValues) 321 | ) 322 | ); 323 | } 324 | $this->container['query_scope'] = $query_scope; 325 | 326 | return $this; 327 | } 328 | 329 | /** 330 | * Gets query_scope_id 331 | * 332 | * @return ?string 333 | */ 334 | public function getQueryScopeId() 335 | { 336 | return $this->container['query_scope_id']; 337 | } 338 | 339 | /** 340 | * Sets query_scope_id 341 | * 342 | * @param ?string $query_scope_id query_scope_id 343 | * 344 | * @return $this 345 | */ 346 | public function setQueryScopeId($query_scope_id) 347 | { 348 | $this->container['query_scope_id'] = $query_scope_id; 349 | 350 | return $this; 351 | } 352 | /** 353 | * Returns true if offset exists. False otherwise. 354 | * 355 | * @param integer $offset Offset 356 | * 357 | * @return boolean 358 | */ 359 | #[\ReturnTypeWillChange] 360 | public function offsetExists($offset) 361 | { 362 | return isset($this->container[$offset]); 363 | } 364 | 365 | /** 366 | * Gets offset. 367 | * 368 | * @param integer $offset Offset 369 | * 370 | * @return mixed 371 | */ 372 | #[\ReturnTypeWillChange] 373 | public function offsetGet($offset) 374 | { 375 | return isset($this->container[$offset]) ? $this->container[$offset] : null; 376 | } 377 | 378 | /** 379 | * Sets value based on offset. 380 | * 381 | * @param integer $offset Offset 382 | * @param mixed $value Value to be set 383 | * 384 | * @return void 385 | */ 386 | #[\ReturnTypeWillChange] 387 | public function offsetSet($offset, $value) 388 | { 389 | if (is_null($offset)) { 390 | $this->container[] = $value; 391 | } else { 392 | $this->container[$offset] = $value; 393 | } 394 | } 395 | 396 | /** 397 | * Unsets offset. 398 | * 399 | * @param integer $offset Offset 400 | * 401 | * @return void 402 | */ 403 | #[\ReturnTypeWillChange] 404 | public function offsetUnset($offset) 405 | { 406 | unset($this->container[$offset]); 407 | } 408 | 409 | /** 410 | * Gets the string presentation of the object 411 | * 412 | * @return string 413 | */ 414 | public function __toString() 415 | { 416 | if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print 417 | return json_encode( 418 | ObjectSerializer::sanitizeForSerialization($this), 419 | JSON_PRETTY_PRINT 420 | ); 421 | } 422 | 423 | return json_encode(ObjectSerializer::sanitizeForSerialization($this)); 424 | } 425 | } 426 | 427 | -------------------------------------------------------------------------------- /src/ObjectSerializer.php: -------------------------------------------------------------------------------- 1 | 10 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 11 | * @link https://github.com/swagger-api/swagger-codegen 12 | */ 13 | 14 | /** 15 | * Monitor API 16 | * 17 | * An API for an integrator to access the features of DocuSign Monitor 18 | * 19 | * OpenAPI spec version: v2.0 20 | * Contact: devcenter@docusign.com 21 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 22 | * Swagger Codegen version: 2.4.21 23 | */ 24 | 25 | /** 26 | * NOTE: This class is auto generated by the swagger code generator program. 27 | * https://github.com/swagger-api/swagger-codegen 28 | * Do not edit the class manually. 29 | */ 30 | 31 | namespace DocuSign\Monitor; 32 | 33 | /** 34 | * ObjectSerializer Class Doc Comment 35 | * 36 | * @category Class 37 | * @package DocuSign\Monitor 38 | * @author Swagger Codegen team 39 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 40 | * @link https://github.com/swagger-api/swagger-codegen 41 | */ 42 | class ObjectSerializer 43 | { 44 | /** 45 | * Serialize data 46 | * 47 | * @param mixed $data the data to serialize 48 | * @param string $type the SwaggerType of the data 49 | * @param string $format the format of the Swagger type of the data 50 | * 51 | * @return mixed serialized form of $data 52 | */ 53 | public static function sanitizeForSerialization($data, ?string $type = null, ?string $format = null) 54 | { 55 | if (!isset($data) || is_scalar($data) || $data instanceof \CURLFile) { 56 | return $data; 57 | } elseif ($data instanceof \DateTime) { 58 | return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); 59 | } elseif (is_array($data)) { 60 | foreach ($data as $property => $value) { 61 | $data[$property] = self::sanitizeForSerialization($value); 62 | } 63 | return $data; 64 | } elseif ($data instanceof \stdClass) { 65 | foreach ($data as $property => $value) { 66 | $data->$property = self::sanitizeForSerialization($value); 67 | } 68 | return $data; 69 | } elseif (is_object($data)) { 70 | $values = []; 71 | $formats = $data::swaggerFormats(); 72 | foreach ($data::swaggerTypes() as $property => $swaggerType) { 73 | $getter = $data::getters()[$property]; 74 | $value = $data->$getter(); 75 | if ($value !== null 76 | && !in_array($swaggerType, ['?bool', '?int', '?string', 'DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) 77 | && method_exists($swaggerType, 'getAllowableEnumValues') 78 | && !in_array($value, $swaggerType::getAllowableEnumValues(), true)) { 79 | $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); 80 | throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); 81 | } 82 | if ($value !== null) { 83 | $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $swaggerType, $formats[$property]); 84 | } 85 | } 86 | return (object)$values; 87 | } else { 88 | return (string)$data; 89 | } 90 | } 91 | 92 | /** 93 | * Sanitize filename by removing path. 94 | * e.g. ../../sun.gif becomes sun.gif 95 | * 96 | * @param string $filename filename to be sanitized 97 | * 98 | * @return string the sanitized filename 99 | */ 100 | public static function sanitizeFilename(string $filename): ?string 101 | { 102 | if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { 103 | return $match[1]; 104 | } else { 105 | return $filename; 106 | } 107 | } 108 | 109 | /** 110 | * Take value and turn it into a string suitable for inclusion in 111 | * the path, by url-encoding. 112 | * 113 | * @param string $value a string which will be part of the path 114 | * 115 | * @return string the serialized object 116 | */ 117 | public static function toPathValue(string $value): ?string 118 | { 119 | return rawurlencode(self::toString($value)); 120 | } 121 | 122 | /** 123 | * Take value and turn it into a string suitable for inclusion in 124 | * the query, by imploding comma-separated if it's an object. 125 | * If it's a string, pass through unchanged. It will be url-encoded 126 | * later. 127 | * 128 | * @param array|string|\DateTime $object an object to be serialized to a string 129 | * 130 | * @return string the serialized object 131 | */ 132 | public static function toQueryValue($object): ?string 133 | { 134 | if (is_array($object)) { 135 | return implode(',', $object); 136 | } else { 137 | return self::toString($object); 138 | } 139 | } 140 | 141 | /** 142 | * Take value and turn it into a string suitable for inclusion in 143 | * the header. If it's a string, pass through unchanged 144 | * If it's a datetime object, format it in ISO8601 145 | * 146 | * @param string $value a string which will be part of the header 147 | * 148 | * @return string the header string 149 | */ 150 | public static function toHeaderValue(string $value): ?string 151 | { 152 | return self::toString($value); 153 | } 154 | 155 | /** 156 | * Take value and turn it into a string suitable for inclusion in 157 | * the http body (form parameter). If it's a string, pass through unchanged 158 | * If it's a datetime object, format it in ISO8601 159 | * 160 | * @param string|\SplFileObject $value the value of the form parameter 161 | * 162 | * @return string the form string 163 | */ 164 | public static function toFormValue($value): ?string 165 | { 166 | if ($value instanceof \SplFileObject) { 167 | return $value->getRealPath(); 168 | } else { 169 | return self::toString($value); 170 | } 171 | } 172 | 173 | /** 174 | * Take value and turn it into a string suitable for inclusion in 175 | * the parameter. If it's a string, pass through unchanged 176 | * If it's a datetime object, format it in ISO8601 177 | * 178 | * @param string|\DateTime $value the value of the parameter 179 | * 180 | * @return string the header string 181 | */ 182 | public static function toString($value): ?string 183 | { 184 | if ($value instanceof \DateTime) { // datetime in ISO8601 format 185 | return $value->format(\DateTime::ATOM); 186 | } else { 187 | return $value; 188 | } 189 | } 190 | 191 | /** 192 | * Serialize an array to a string. 193 | * 194 | * @param array $collection collection to serialize to a string 195 | * @param string $collectionFormat the format use for serialization (csv, 196 | * ssv, tsv, pipes, multi) 197 | * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array 198 | * 199 | * @return string 200 | */ 201 | public static function serializeCollection( 202 | array $collection, 203 | string $collectionFormat, 204 | bool $allowCollectionFormatMulti = false): ?string 205 | { 206 | if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { 207 | // http_build_query() almost does the job for us. We just 208 | // need to fix the result of multidimensional arrays. 209 | return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); 210 | } 211 | switch ($collectionFormat) { 212 | case 'pipes': 213 | return implode('|', $collection); 214 | 215 | case 'tsv': 216 | return implode("\t", $collection); 217 | 218 | case 'ssv': 219 | return implode(' ', $collection); 220 | 221 | case 'csv': 222 | // Deliberate fall through. CSV is default format. 223 | default: 224 | return implode(',', $collection); 225 | } 226 | } 227 | 228 | /** 229 | * Deserialize a JSON string into an object 230 | * 231 | * @param mixed $data object or primitive to be deserialized 232 | * @param string $class class name is passed as a string 233 | * @param array $httpHeaders HTTP headers 234 | * 235 | * @return object|array|null an single or an array of $class instances 236 | */ 237 | public static function deserialize($data, string $class, ?array $httpHeaders = null) 238 | { 239 | if (null === $data) { 240 | return null; 241 | } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] 242 | $inner = substr($class, 4, -1); 243 | $deserialized = []; 244 | if (strrpos($inner, ",") !== false) { 245 | $subClass_array = explode(',', $inner, 2); 246 | $subClass = $subClass_array[1]; 247 | foreach ($data as $key => $value) { 248 | $deserialized[$key] = self::deserialize($value, $subClass, null); 249 | } 250 | } 251 | return $deserialized; 252 | } elseif (strcasecmp(substr($class, -2), '[]') === 0) { 253 | $subClass = substr($class, 0, -2); 254 | $values = []; 255 | foreach ($data as $key => $value) { 256 | $values[] = self::deserialize($value, $subClass, null); 257 | } 258 | return $values; 259 | } elseif ($class === 'object') { 260 | settype($data, 'array'); 261 | return $data; 262 | } elseif ($class === '\DateTime') { 263 | // Some API's return an invalid, empty string as a 264 | // date-time property. DateTime::__construct() will return 265 | // the current time for empty input which is probably not 266 | // what is meant. The invalid empty string is probably to 267 | // be interpreted as a missing field/value. Let's handle 268 | // this graceful. 269 | if (!empty($data)) { 270 | return new \DateTime($data); 271 | } else { 272 | return null; 273 | } 274 | } elseif (in_array($class, ['?bool', '?int', '?string', 'DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { 275 | $class=trim($class,"?"); 276 | settype($data, $class); 277 | return $data; 278 | } elseif ($class === '\SplFileObject') { 279 | /** Description @var \Psr\Http\Message\StreamInterface $data **/ 280 | 281 | // determine file name 282 | if (array_key_exists('Content-Disposition', $httpHeaders) && 283 | preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { 284 | $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); 285 | } else { 286 | $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); 287 | } 288 | 289 | $file = fopen($filename, 'w'); 290 | if (is_string($data)){ 291 | fwrite($file, $data); 292 | } else { 293 | while ($chunk = $data->read(200)) { 294 | fwrite($file, $chunk); 295 | } 296 | } 297 | fclose($file); 298 | 299 | return new \SplFileObject($filename, 'r'); 300 | } elseif (method_exists($class, 'getAllowableEnumValues')) { 301 | if (!in_array($data, $class::getAllowableEnumValues(), true)) { 302 | $imploded = implode("', '", $class::getAllowableEnumValues()); 303 | throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); 304 | } 305 | return $data; 306 | } else { 307 | // If a discriminator is defined and points to a valid subclass, use it. 308 | $discriminator = $class::DISCRIMINATOR; 309 | if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { 310 | $subclass = 'DocuSign\Monitor\Model\\' . $data->{$discriminator}; 311 | if (is_subclass_of($subclass, $class)) { 312 | $class = $subclass; 313 | } 314 | } 315 | $instance = new $class(); 316 | foreach ($instance::swaggerTypes() as $property => $type) { 317 | $propertySetter = $instance::setters()[$property]; 318 | 319 | if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { 320 | continue; 321 | } 322 | 323 | $propertyValue = $data->{$instance::attributeMap()[$property]}; 324 | if (isset($propertyValue)) { 325 | $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); 326 | } 327 | } 328 | return $instance; 329 | } 330 | } 331 | } 332 | -------------------------------------------------------------------------------- /src/Configuration.php: -------------------------------------------------------------------------------- 1 | 9 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 10 | * @link https://github.com/swagger-api/swagger-codegen 11 | */ 12 | 13 | /** 14 | * Monitor API 15 | * 16 | * An API for an integrator to access the features of DocuSign Monitor 17 | * 18 | * OpenAPI spec version: v2.0 19 | * Contact: devcenter@docusign.com 20 | * Generated by: https://github.com/swagger-api/swagger-codegen.git 21 | * Swagger Codegen version: 2.4.21 22 | */ 23 | 24 | /** 25 | * NOTE: This class is auto generated by the swagger code generator program. 26 | * https://github.com/swagger-api/swagger-codegen 27 | * Do not edit the class manually. 28 | */ 29 | 30 | namespace DocuSign\Monitor; 31 | 32 | /** 33 | * Configuration Class Doc Comment 34 | * PHP version 5 35 | * 36 | * @category Class 37 | * @package DocuSign\Monitor 38 | * @author Swagger Codegen team 39 | * @license The Docusign PHP Client SDK is licensed under the MIT License. 40 | * @link https://github.com/swagger-api/swagger-codegen 41 | */ 42 | class Configuration 43 | { 44 | private static $defaultConfiguration = null; 45 | 46 | /** 47 | * Associate array to store API key(s) 48 | * 49 | * @var string[] 50 | */ 51 | protected $apiKeys = []; 52 | 53 | /** 54 | * Associate array to store API prefix (e.g. Bearer) 55 | * 56 | * @var string[] 57 | */ 58 | protected $apiKeyPrefixes = []; 59 | 60 | /** 61 | * Access token for OAuth 62 | * 63 | * @var string 64 | */ 65 | protected $accessToken = ''; 66 | 67 | /** 68 | * Username for HTTP basic authentication 69 | * 70 | * @var string 71 | */ 72 | protected $username = ''; 73 | 74 | /** 75 | * Password for HTTP basic authentication 76 | * 77 | * @var string 78 | */ 79 | protected $password = ''; 80 | 81 | /** 82 | * The default header(s) 83 | * 84 | * @var array 85 | */ 86 | protected $defaultHeaders = []; 87 | 88 | /** 89 | * The host 90 | * 91 | * @var string 92 | */ 93 | protected $host = 'https://lens.docusign.net'; 94 | 95 | /** 96 | * Timeout (second) of the HTTP request, by default set to 0, no timeout 97 | * 98 | * @var string 99 | */ 100 | protected $curlTimeout = 0; 101 | 102 | /** 103 | * Timeout (second) of the HTTP connection, by default set to 0, no timeout 104 | * 105 | * @var string 106 | */ 107 | protected $curlConnectTimeout = 0; 108 | 109 | /** 110 | * User agent of the HTTP request, set to "PHP-Swagger" by default 111 | * 112 | * @var string 113 | */ 114 | protected $userAgent = 'Swagger-Codegen/v2.0/1.2.2/php/' . PHP_VERSION; 115 | 116 | /** 117 | * Debug switch (default set to false) 118 | * 119 | * @var bool 120 | */ 121 | protected $debug = false; 122 | 123 | /** 124 | * Debug file location (log to STDOUT by default) 125 | * 126 | * @var string 127 | */ 128 | protected $debugFile = 'php://output'; 129 | 130 | /** 131 | * Debug file location (log to STDOUT by default) 132 | * 133 | * @var string 134 | */ 135 | protected $tempFolderPath; 136 | 137 | /** 138 | * Indicates if SSL verification should be enabled or disabled. 139 | * 140 | * This is useful if the host uses a self-signed SSL certificate. 141 | * 142 | * @var boolean True if the certificate should be validated, false otherwise. 143 | */ 144 | protected $sslVerification = true; 145 | 146 | /** 147 | * Curl proxy host 148 | * 149 | * @var string 150 | */ 151 | protected $proxyHost; 152 | 153 | /** 154 | * Curl proxy port 155 | * 156 | * @var integer 157 | */ 158 | protected $proxyPort; 159 | 160 | /** 161 | * Curl proxy type, e.g. CURLPROXY_HTTP or CURLPROXY_SOCKS5 162 | * 163 | * @see https://secure.php.net/manual/en/function.curl-setopt.php 164 | * @var integer 165 | */ 166 | protected $proxyType; 167 | 168 | /** 169 | * Curl proxy username 170 | * 171 | * @var string 172 | */ 173 | protected $proxyUser; 174 | 175 | /** 176 | * Curl proxy password 177 | * 178 | * @var string 179 | */ 180 | protected $proxyPassword; 181 | 182 | /** 183 | * Constructor 184 | */ 185 | public function __construct(?array $data = null) 186 | { 187 | $this->tempFolderPath = sys_get_temp_dir(); 188 | if(isset($data["apiKeys"])) 189 | { 190 | $this->apiKeys = $data["apiKeys"]; 191 | } 192 | if(isset($data["apiKeyPrefixes"])) 193 | { 194 | $this->apiKeyPrefixes = $data["apiKeyPrefixes"]; 195 | } 196 | if(isset($data["accessToken"])) 197 | { 198 | $this->accessToken = $data["accessToken"]; 199 | } 200 | if(isset($data["username"])) 201 | { 202 | $this->username = $data["username"]; 203 | } 204 | if(isset($data["password"])) 205 | { 206 | $this->password = $data["password"]; 207 | } 208 | if(isset($data["defaultHeaders"])) 209 | { 210 | $this->defaultHeaders = $data["defaultHeaders"]; 211 | } 212 | if(isset($data["host"])) 213 | { 214 | $this->host = $data["host"]; 215 | } 216 | if(isset($data["curlTimeout"])) 217 | { 218 | $this->curlTimeout = $data["curlTimeout"]; 219 | } 220 | if(isset($data["curlConnectTimeout"])) 221 | { 222 | $this->curlConnectTimeout = $data["curlConnectTimeout"]; 223 | } 224 | if(isset($data["userAgent"])) 225 | { 226 | $this->userAgent = $data["userAgent"]; 227 | } 228 | if(isset($data["debug"])) 229 | { 230 | $this->debug = $data["debug"]; 231 | } 232 | if(isset($data["debugFile"])) 233 | { 234 | $this->debugFile = $data["debugFile"]; 235 | } 236 | if(isset($data["tempFolderPath"])) 237 | { 238 | $this->tempFolderPath = $data["tempFolderPath"]; 239 | } 240 | if(isset($data["sslVerification"])) 241 | { 242 | $this->sslVerification = $data["sslVerification"]; 243 | } 244 | if(isset($data["proxyHost"])) 245 | { 246 | $this->proxyHost = $data["proxyHost"]; 247 | } 248 | if(isset($data["proxyPort"])) 249 | { 250 | $this->proxyPort = $data["proxyPort"]; 251 | } 252 | if(isset($data["proxyType"])) 253 | { 254 | $this->proxyType = $data["proxyType"]; 255 | } 256 | if(isset($data["proxyUser"])) 257 | { 258 | $this->proxyUser = $data["proxyUser"]; 259 | } 260 | if(isset($data["proxyPassword"])) 261 | { 262 | $this->proxyPassword = $data["proxyPassword"]; 263 | } 264 | } 265 | 266 | /** 267 | * Sets API key 268 | * 269 | * @param string $apiKeyIdentifier API key identifier (authentication scheme) 270 | * @param string $key API key or token 271 | * 272 | * @return Configuration 273 | */ 274 | public function setApiKey($apiKeyIdentifier, $key) 275 | { 276 | $this->apiKeys[$apiKeyIdentifier] = $key; 277 | return $this; 278 | } 279 | 280 | /** 281 | * Gets API key 282 | * 283 | * @param string $apiKeyIdentifier API key identifier (authentication scheme) 284 | * 285 | * @return string API key or token 286 | */ 287 | public function getApiKey($apiKeyIdentifier) 288 | { 289 | return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; 290 | } 291 | 292 | /** 293 | * Sets the prefix for API key (e.g. Bearer) 294 | * 295 | * @param string $apiKeyIdentifier API key identifier (authentication scheme) 296 | * @param string $prefix API key prefix, e.g. Bearer 297 | * 298 | * @return Configuration 299 | */ 300 | public function setApiKeyPrefix($apiKeyIdentifier, $prefix) 301 | { 302 | $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; 303 | return $this; 304 | } 305 | 306 | /** 307 | * Gets API key prefix 308 | * 309 | * @param string $apiKeyIdentifier API key identifier (authentication scheme) 310 | * 311 | * @return string 312 | */ 313 | public function getApiKeyPrefix($apiKeyIdentifier) 314 | { 315 | return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; 316 | } 317 | 318 | /** 319 | * Sets the access token for OAuth 320 | * 321 | * @param string $accessToken Token for OAuth 322 | * 323 | * @return Configuration 324 | */ 325 | public function setAccessToken($accessToken) 326 | { 327 | $this->accessToken = $accessToken; 328 | return $this; 329 | } 330 | 331 | /** 332 | * Gets the access token for OAuth 333 | * 334 | * @return string Access token for OAuth 335 | */ 336 | public function getAccessToken() 337 | { 338 | return $this->accessToken; 339 | } 340 | 341 | /** 342 | * Sets the username for HTTP basic authentication 343 | * 344 | * @param string $username Username for HTTP basic authentication 345 | * 346 | * @return Configuration 347 | */ 348 | public function setUsername($username) 349 | { 350 | $this->username = $username; 351 | return $this; 352 | } 353 | 354 | /** 355 | * Gets the username for HTTP basic authentication 356 | * 357 | * @return string Username for HTTP basic authentication 358 | */ 359 | public function getUsername() 360 | { 361 | return $this->username; 362 | } 363 | 364 | /** 365 | * Sets the password for HTTP basic authentication 366 | * 367 | * @param string $password Password for HTTP basic authentication 368 | * 369 | * @return Configuration 370 | */ 371 | public function setPassword($password) 372 | { 373 | $this->password = $password; 374 | return $this; 375 | } 376 | 377 | /** 378 | * Gets the password for HTTP basic authentication 379 | * 380 | * @return string Password for HTTP basic authentication 381 | */ 382 | public function getPassword() 383 | { 384 | return $this->password; 385 | } 386 | 387 | /** 388 | * Adds a default header 389 | * 390 | * @param string $headerName header name (e.g. Token) 391 | * @param string $headerValue header value (e.g. 1z8wp3) 392 | * 393 | * @return Configuration 394 | */ 395 | public function addDefaultHeader($headerName, $headerValue) 396 | { 397 | if (!is_string($headerName)) { 398 | throw new \InvalidArgumentException('Header name must be a string.'); 399 | } 400 | 401 | $this->defaultHeaders[$headerName] = $headerValue; 402 | return $this; 403 | } 404 | 405 | /** 406 | * Gets the default header 407 | * 408 | * @return array An array of default header(s) 409 | */ 410 | public function getDefaultHeaders() 411 | { 412 | return $this->defaultHeaders; 413 | } 414 | 415 | /** 416 | * Deletes a default header 417 | * 418 | * @param string $headerName the header to delete 419 | * 420 | * @return Configuration 421 | */ 422 | public function deleteDefaultHeader($headerName) 423 | { 424 | unset($this->defaultHeaders[$headerName]); 425 | } 426 | 427 | /** 428 | * Sets the host 429 | * 430 | * @param string $host Host 431 | * 432 | * @return Configuration 433 | */ 434 | public function setHost($host) 435 | { 436 | $this->host = $host; 437 | return $this; 438 | } 439 | 440 | /** 441 | * Gets the host 442 | * 443 | * @return string Host 444 | */ 445 | public function getHost() 446 | { 447 | return $this->host; 448 | } 449 | 450 | /** 451 | * Sets the user agent of the api client 452 | * 453 | * @param string $userAgent the user agent of the api client 454 | * 455 | * @throws \InvalidArgumentException 456 | * @return Configuration 457 | */ 458 | public function setUserAgent($userAgent) 459 | { 460 | if (!is_string($userAgent)) { 461 | throw new \InvalidArgumentException('User-agent must be a string.'); 462 | } 463 | 464 | $this->userAgent = $userAgent; 465 | return $this; 466 | } 467 | 468 | /** 469 | * Gets the user agent of the api client 470 | * 471 | * @return string user agent 472 | */ 473 | public function getUserAgent() 474 | { 475 | return $this->userAgent; 476 | } 477 | 478 | /** 479 | * Sets the HTTP timeout value 480 | * 481 | * @param integer $seconds Number of seconds before timing out [set to 0 for no timeout] 482 | * 483 | * @return Configuration 484 | */ 485 | public function setCurlTimeout($seconds) 486 | { 487 | if (!is_numeric($seconds) || $seconds < 0) { 488 | throw new \InvalidArgumentException('Timeout value must be numeric and a non-negative number.'); 489 | } 490 | 491 | $this->curlTimeout = $seconds; 492 | return $this; 493 | } 494 | 495 | /** 496 | * Gets the HTTP timeout value 497 | * 498 | * @return string HTTP timeout value 499 | */ 500 | public function getCurlTimeout() 501 | { 502 | return $this->curlTimeout; 503 | } 504 | 505 | /** 506 | * Sets the HTTP connect timeout value 507 | * 508 | * @param integer $seconds Number of seconds before connection times out [set to 0 for no timeout] 509 | * 510 | * @return Configuration 511 | */ 512 | public function setCurlConnectTimeout($seconds) 513 | { 514 | if (!is_numeric($seconds) || $seconds < 0) { 515 | throw new \InvalidArgumentException('Connect timeout value must be numeric and a non-negative number.'); 516 | } 517 | 518 | $this->curlConnectTimeout = $seconds; 519 | return $this; 520 | } 521 | 522 | /** 523 | * Gets the HTTP connect timeout value 524 | * 525 | * @return string HTTP connect timeout value 526 | */ 527 | public function getCurlConnectTimeout() 528 | { 529 | return $this->curlConnectTimeout; 530 | } 531 | 532 | 533 | /** 534 | * Sets the HTTP Proxy Host 535 | * 536 | * @param string $proxyHost HTTP Proxy URL 537 | * 538 | * @return ApiClient 539 | */ 540 | public function setCurlProxyHost($proxyHost) 541 | { 542 | $this->proxyHost = $proxyHost; 543 | return $this; 544 | } 545 | 546 | /** 547 | * Gets the HTTP Proxy Host 548 | * 549 | * @return string 550 | */ 551 | public function getCurlProxyHost() 552 | { 553 | return $this->proxyHost; 554 | } 555 | 556 | /** 557 | * Sets the HTTP Proxy Port 558 | * 559 | * @param integer $proxyPort HTTP Proxy Port 560 | * 561 | * @return ApiClient 562 | */ 563 | public function setCurlProxyPort($proxyPort) 564 | { 565 | $this->proxyPort = $proxyPort; 566 | return $this; 567 | } 568 | 569 | /** 570 | * Gets the HTTP Proxy Port 571 | * 572 | * @return integer 573 | */ 574 | public function getCurlProxyPort() 575 | { 576 | return $this->proxyPort; 577 | } 578 | 579 | /** 580 | * Sets the HTTP Proxy Type 581 | * 582 | * @param integer $proxyType HTTP Proxy Type 583 | * 584 | * @return ApiClient 585 | */ 586 | public function setCurlProxyType($proxyType) 587 | { 588 | $this->proxyType = $proxyType; 589 | return $this; 590 | } 591 | 592 | /** 593 | * Gets the HTTP Proxy Type 594 | * 595 | * @return integer 596 | */ 597 | public function getCurlProxyType() 598 | { 599 | return $this->proxyType; 600 | } 601 | 602 | /** 603 | * Sets the HTTP Proxy User 604 | * 605 | * @param string $proxyUser HTTP Proxy User 606 | * 607 | * @return ApiClient 608 | */ 609 | public function setCurlProxyUser($proxyUser) 610 | { 611 | $this->proxyUser = $proxyUser; 612 | return $this; 613 | } 614 | 615 | /** 616 | * Gets the HTTP Proxy User 617 | * 618 | * @return string 619 | */ 620 | public function getCurlProxyUser() 621 | { 622 | return $this->proxyUser; 623 | } 624 | 625 | /** 626 | * Sets the HTTP Proxy Password 627 | * 628 | * @param string $proxyPassword HTTP Proxy Password 629 | * 630 | * @return ApiClient 631 | */ 632 | public function setCurlProxyPassword($proxyPassword) 633 | { 634 | $this->proxyPassword = $proxyPassword; 635 | return $this; 636 | } 637 | 638 | /** 639 | * Gets the HTTP Proxy Password 640 | * 641 | * @return string 642 | */ 643 | public function getCurlProxyPassword() 644 | { 645 | return $this->proxyPassword; 646 | } 647 | 648 | /** 649 | * Sets debug flag 650 | * 651 | * @param bool $debug Debug flag 652 | * 653 | * @return Configuration 654 | */ 655 | public function setDebug($debug) 656 | { 657 | $this->debug = $debug; 658 | return $this; 659 | } 660 | 661 | /** 662 | * Gets the debug flag 663 | * 664 | * @return bool 665 | */ 666 | public function getDebug() 667 | { 668 | return $this->debug; 669 | } 670 | 671 | /** 672 | * Sets the debug file 673 | * 674 | * @param string $debugFile Debug file 675 | * 676 | * @return Configuration 677 | */ 678 | public function setDebugFile($debugFile) 679 | { 680 | $this->debugFile = $debugFile; 681 | return $this; 682 | } 683 | 684 | /** 685 | * Gets the debug file 686 | * 687 | * @return string 688 | */ 689 | public function getDebugFile() 690 | { 691 | return $this->debugFile; 692 | } 693 | 694 | /** 695 | * Sets the temp folder path 696 | * 697 | * @param string $tempFolderPath Temp folder path 698 | * 699 | * @return Configuration 700 | */ 701 | public function setTempFolderPath($tempFolderPath) 702 | { 703 | $this->tempFolderPath = $tempFolderPath; 704 | return $this; 705 | } 706 | 707 | /** 708 | * Gets the temp folder path 709 | * 710 | * @return string Temp folder path 711 | */ 712 | public function getTempFolderPath() 713 | { 714 | return $this->tempFolderPath; 715 | } 716 | 717 | /** 718 | * Sets if SSL verification should be enabled or disabled 719 | * 720 | * @param boolean $sslVerification True if the certificate should be validated, false otherwise 721 | * 722 | * @return Configuration 723 | */ 724 | public function setSSLVerification($sslVerification) 725 | { 726 | $this->sslVerification = $sslVerification; 727 | return $this; 728 | } 729 | 730 | /** 731 | * Gets if SSL verification should be enabled or disabled 732 | * 733 | * @return boolean True if the certificate should be validated, false otherwise 734 | */ 735 | public function getSSLVerification() 736 | { 737 | return $this->sslVerification; 738 | } 739 | 740 | /** 741 | * Gets the default configuration instance 742 | * 743 | * @return Configuration 744 | */ 745 | public static function getDefaultConfiguration() 746 | { 747 | if (self::$defaultConfiguration === null) { 748 | self::$defaultConfiguration = new Configuration(); 749 | } 750 | 751 | return self::$defaultConfiguration; 752 | } 753 | 754 | /** 755 | * Sets the detault configuration instance 756 | * 757 | * @param Configuration $config An instance of the Configuration Object 758 | * 759 | * @return void 760 | */ 761 | public static function setDefaultConfiguration(Configuration $config) 762 | { 763 | self::$defaultConfiguration = $config; 764 | } 765 | 766 | /** 767 | * Gets the essential information for debugging 768 | * 769 | * @return string The report for debugging 770 | */ 771 | public static function toDebugReport() 772 | { 773 | $report = 'PHP SDK (DocuSign\Monitor) Debug Report:' . PHP_EOL; 774 | $report .= ' OS: ' . php_uname() . PHP_EOL; 775 | $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; 776 | $report .= ' OpenAPI Spec Version: v2.0' . PHP_EOL; 777 | $report .= ' SDK Package Version: 1.2.2' . PHP_EOL; 778 | $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; 779 | 780 | return $report; 781 | } 782 | } 783 | --------------------------------------------------------------------------------