Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .swagger-codegen/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.13-SNAPSHOT
2.4.21-SNAPSHOT
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
See [DocuSign Support Center](https://support.docusign.com/en/releasenotes/) for Product Release Notes.


## [v1.1.0] - Monitor API v2.0-1.1.0 - 2022-04-11
### Changed
- Added support for version v2.0-1.1.0 of the DocuSign Monitor API.
- Updated the SDK release version.

## [v1.0.0] - Monitor API v2.0-1.0.0 - 2021-06-24
### Changed
- Updated the SDK release version.
Expand Down
2 changes: 2 additions & 0 deletions linter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./vendor/bin/phpcbf -p src --extensions=php -d memory_limit=512M
./vendor/bin/phpcs src --standard=ruleset.xml
7 changes: 7 additions & 0 deletions ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<ruleset name="DocuSign">
<description>DocuSign custom coding standard.</description>
<rule ref="PEAR">
<exclude name="Generic.Files.LineLength" />
</rule>
</ruleset>
140 changes: 131 additions & 9 deletions src/Api/DataSetApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@
*
* @category Class
* @package DocuSign\Monitor
* @author Swagger Codegen team
* @author Swagger Codegen team <apihelp@docusign.com>
* @license The DocuSign PHP Client SDK is licensed under the MIT License.
* @link https://github.com/swagger-api/swagger-codegen
*/

/**
* Monitor API
*
* Use the DocuSign Monitor API to receive a data feed containing atypical security events within your DocuSign account. This data goes directly to an integrated application or website.
* An API for an integrator to access the features of DocuSign Monitor
*
* OpenAPI spec version: v2.0
* Contact: devcenter@docusign.com
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 2.4.13-SNAPSHOT
* Swagger Codegen version: 2.4.21-SNAPSHOT
*/

/**
Expand All @@ -32,6 +33,15 @@
namespace DocuSign\Monitor\Api\DataSetApi;


/**
* GetStreamOptions Class Doc Comment
*
* @category Class
* @package DocuSign\Monitor
* @author Swagger Codegen team <apihelp@docusign.com>
* @license The DocuSign PHP Client SDK is licensed under the MIT License.
* @link https://github.com/swagger-api/swagger-codegen
*/
class GetStreamOptions
{
/**
Expand All @@ -42,6 +52,7 @@ class GetStreamOptions

/**
* Gets cursor
*
* @return ?string
*/
public function getCursor(): ?string
Expand All @@ -52,6 +63,7 @@ public function getCursor(): ?string
/**
* Sets cursor
* @param ?string $cursor The cursor value to continue querying the data with. For an intial call, use empty string
*
* @return self
*/
public function setCursor(?string $cursor): self
Expand All @@ -67,6 +79,7 @@ public function setCursor(?string $cursor): self

/**
* Gets limit
*
* @return ?int
*/
public function getLimit(): ?int
Expand All @@ -77,6 +90,7 @@ public function getLimit(): ?int
/**
* Sets limit
* @param ?int $limit The maximum number of records to return, minimum of 1, maximum of 2000. Defaults to 1000 if no value is provided
*
* @return self
*/
public function setLimit(?int $limit): self
Expand All @@ -100,7 +114,8 @@ public function setLimit(?int $limit): self
*
* @category Class
* @package DocuSign\Monitor
* @author Swagger Codegen team
* @author Swagger Codegen team <apihelp@docusign.com>
* @license The DocuSign PHP Client SDK is licensed under the MIT License.
* @link https://github.com/swagger-api/swagger-codegen
*/
class DataSetApi
Expand All @@ -116,6 +131,7 @@ class DataSetApi
* Constructor
*
* @param ApiClient|null $apiClient The api client to use
*
* @return void
*/
public function __construct(ApiClient $apiClient = null)
Expand Down Expand Up @@ -149,9 +165,9 @@ public function setApiClient(ApiClient $apiClient): self
/**
* Update $resourcePath with $
*
* @param string $resourcePath
* @param string $baseName
* @param string $paramName
* @param string $resourcePath the resource path to use
* @param string $baseName the base name param
* @param string $paramName the parameter name
*
* @return string
*/
Expand All @@ -172,7 +188,8 @@ public function updateResourcePath(string $resourcePath, string $baseName, strin
*
* @param ?string $data_set_name The name of the dataset to stream
* @param ?string $version The requested API version
* @param \DocuSign\Monitor\Api\DataSetApi\GetStreamOptions for modifying the behavior of the function. (optional)
* @param \DocuSign\Monitor\Api\DataSetApi\GetStreamOptions $options for modifying the behavior of the function. (optional)
*
* @throws ApiException on non-2xx response
* @return \DocuSign\Monitor\Model\CursoredResult
*/
Expand All @@ -189,7 +206,8 @@ public function getStream($data_set_name, $version, \DocuSign\Monitor\Api\DataSe
*
* @param ?string $data_set_name The name of the dataset to stream
* @param ?string $version The requested API version
* @param \DocuSign\Monitor\Api\DataSetApi\GetStreamOptions for modifying the behavior of the function. (optional)
* @param \DocuSign\Monitor\Api\DataSetApi\GetStreamOptions $options for modifying the behavior of the function. (optional)
*
* @throws ApiException on non-2xx response
* @return array of \DocuSign\Monitor\Model\CursoredResult, HTTP status code, HTTP response headers (array of strings)
*/
Expand Down Expand Up @@ -267,4 +285,108 @@ public function getStreamWithHttpInfo($data_set_name, $version, \DocuSign\Monito
throw $e;
}
}

/**
* Operation postWebQuery
*
*
*
* @param ?string $data_set_name The name of the dataset to query
* @param ?string $version The requested API version
* @param \DocuSign\Monitor\Model\WebQuery $web_query A collection of filter clauses and aggregations scoped to one or more organizations. The fields queryScope and queryScopeId may be omitted defaulting to all applicable organizations (required)
*
* @throws ApiException on non-2xx response
* @return \DocuSign\Monitor\Model\AggregateResult
*/
public function postWebQuery($data_set_name, $version, $web_query)
{
list($response) = $this->postWebQueryWithHttpInfo($data_set_name, $version, $web_query);
return $response;
}

/**
* Operation postWebQueryWithHttpInfo
*
*
*
* @param ?string $data_set_name The name of the dataset to query
* @param ?string $version The requested API version
* @param \DocuSign\Monitor\Model\WebQuery $web_query A collection of filter clauses and aggregations scoped to one or more organizations. The fields queryScope and queryScopeId may be omitted defaulting to all applicable organizations (required)
*
* @throws ApiException on non-2xx response
* @return array of \DocuSign\Monitor\Model\AggregateResult, HTTP status code, HTTP response headers (array of strings)
*/
public function postWebQueryWithHttpInfo($data_set_name, $version, $web_query): array
{
// verify the required parameter 'data_set_name' is set
if ($data_set_name === null) {
throw new \InvalidArgumentException('Missing the required parameter $data_set_name when calling postWebQuery');
}
// verify the required parameter 'version' is set
if ($version === null) {
throw new \InvalidArgumentException('Missing the required parameter $version when calling postWebQuery');
}
// verify the required parameter 'web_query' is set
if ($web_query === null) {
throw new \InvalidArgumentException('Missing the required parameter $web_query when calling postWebQuery');
}
// parse inputs
$resourcePath = "/api/v{version}/datasets/{dataSetName}/web_query";
$httpBody = $_tempBody ?? ''; // $_tempBody is the method argument, if present
$queryParams = $headerParams = $formParams = [];
$headerParams['Accept'] ??= $this->apiClient->selectHeaderAccept(['application/json']);
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);


// path params
if ($data_set_name !== null) {
$resourcePath = self::updateResourcePath($resourcePath, "dataSetName", $data_set_name);
}
// path params
if ($version !== null) {
$resourcePath = self::updateResourcePath($resourcePath, "version", $version);
}

// default format to json
$resourcePath = str_replace("{format}", "json", $resourcePath);
// body params
$_tempBody = null;
if (isset($web_query)) {
$_tempBody = $web_query;
}

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

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

throw $e;
}
}
}
30 changes: 19 additions & 11 deletions src/HeaderSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@
*
* @category Class
* @package DocuSign\Monitor
* @author Swagger Codegen team
* @author Swagger Codegen team <apihelp@docusign.com>
* @license The DocuSign PHP Client SDK is licensed under the MIT License.
* @link https://github.com/swagger-api/swagger-codegen
*/

/**
* Monitor API
*
* Use the DocuSign Monitor API to receive a data feed containing atypical security events within your DocuSign account. This data goes directly to an integrated application or website.
* An API for an integrator to access the features of DocuSign Monitor
*
* OpenAPI spec version: v2.0
* Contact: devcenter@docusign.com
* Generated by: https://github.com/swagger-api/swagger-codegen.git
* Swagger Codegen version: 2.4.13-SNAPSHOT
* Swagger Codegen version: 2.4.21-SNAPSHOT
*/

/**
Expand All @@ -35,32 +36,39 @@
*
* @category Class
* @package DocuSign\Monitor
* @author Swagger Codegen team
* @author Swagger Codegen team <apihelp@docusign.com>
* @license The DocuSign PHP Client SDK is licensed under the MIT License.
* @link https://github.com/swagger-api/swagger-codegen
*/
class HeaderSelector
{

/**
* @param string[] $accept
* @param string[] $contentTypes
* SelectHeaders method comment
*
* @param string[] $accept list of strings
* @param string[] $contentTypes list of strings for contentTypes
*
* @return array
*/
public function selectHeaders($accept, $contentTypes)
{
$headers = [];

$accept = $this->selectAcceptHeader($accept);
$accept = $this->_selectAcceptHeader($accept);
if ($accept !== null) {
$headers['Accept'] = $accept;
}

$headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes);
$headers['Content-Type'] = $this->_selectContentTypeHeader($contentTypes);
return $headers;
}

/**
* @param string[] $accept
* SelectHeadersForMultipart method comment
*
* @param string[] $accept list of strings
*
* @return array
*/
public function selectHeadersForMultipart($accept)
Expand All @@ -78,7 +86,7 @@ public function selectHeadersForMultipart($accept)
*
* @return string Accept (e.g. application/json)
*/
private function selectAcceptHeader($accept)
private function _selectAcceptHeader($accept)
{
if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) {
return null;
Expand All @@ -96,7 +104,7 @@ private function selectAcceptHeader($accept)
*
* @return string Content-Type (e.g. application/json)
*/
private function selectContentTypeHeader($contentType)
private function _selectContentTypeHeader($contentType)
{
if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) {
return 'application/json';
Expand Down
Loading