From fc281b678a96edff4a5e29289938fcfc0ec5e2ad Mon Sep 17 00:00:00 2001 From: Dhaval Brahmbhatt <32913565+dbbrahmbhatt@users.noreply.github.com> Date: Fri, 18 Sep 2020 09:30:18 -0700 Subject: [PATCH] Version 4.6.0-rc release (#117) * Version 4.6.0-rc-v2-20.3.00 release * Reverted not required changes? * Reverted not required changes in travis? * Corrected changelog? Co-authored-by: DevCenter-DocuSign Co-authored-by: Dhaval Brahmbhatt --- .travis.yml | 5 +- CHANGELOG.md | 12 ++ src/Api/EnvelopesApi.php | 111 ++++++++++++++++++ src/Client/ApiClient.php | 7 +- src/Model/CorrectViewRequest.php | 40 ++++++- ...erAccountManagementGranularInformation.php | 60 ++++++++++ 6 files changed, 223 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 040abb84..0bdae808 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,9 +6,6 @@ language: php dist: trusty sudo: false php: - - 5.4 - - 5.5 - - 5.6 - 7.0 -before_install: "travis_wait 30 composer install --ignore-platform-reqs" +before_install: "composer install --ignore-platform-reqs" script: "cd test && phpunit UnitTests.php && phpunit OAuthTests.php" diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e22072a..0f0c3d4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [DocuSign Support Center](https://support.docusign.com/en/releasenotes/) for Product Release Notes. +## [4.6.0-rc] - eSignature API v2-20.3.00 - 2020-09-16 +### Changed + +* Added support for version v2-20.3.00 of the DocuSign eSignature API. +* Updated the SDK release version. + +### Fixed + +* Fixed APIException Serialization issue + * [#83](https://github.com/docusign/docusign-php-client/issues/83) - DCM-3466 + * [#103](https://github.com/docusign/docusign-php-client/issues/103) - DCM-4286 + ## [4.5.0] - eSignature API v2-20.2.02 - 2020-08-25 ### Changed diff --git a/src/Api/EnvelopesApi.php b/src/Api/EnvelopesApi.php index 26595d7d..16b27dc2 100644 --- a/src/Api/EnvelopesApi.php +++ b/src/Api/EnvelopesApi.php @@ -4958,6 +4958,117 @@ public function deleteEmailSettingsWithHttpInfo($account_id, $envelope_id) } } + /** + * Operation deleteEnvelopeCorrectView + * + * Revokes the correction view URL to the Envelope UI + * + * @param string $account_id The external account number (int) or account ID Guid. + * @param string $envelope_id The envelopeId Guid of the envelope being accessed. + * @param \DocuSign\eSign\Model\CorrectViewRequest $correct_view_request (optional) + * @throws \DocuSign\eSign\Client\ApiException on non-2xx response + * @return void + */ + public function deleteEnvelopeCorrectView($account_id, $envelope_id, $correct_view_request = null) + { + list($response) = $this->deleteEnvelopeCorrectViewWithHttpInfo($account_id, $envelope_id, $correct_view_request); + return $response; + } + + /** + * Operation deleteEnvelopeCorrectViewWithHttpInfo + * + * Revokes the correction view URL to the Envelope UI + * + * @param string $account_id The external account number (int) or account ID Guid. + * @param string $envelope_id The envelopeId Guid of the envelope being accessed. + * @param \DocuSign\eSign\Model\CorrectViewRequest $correct_view_request (optional) + * @throws \DocuSign\eSign\Client\ApiException on non-2xx response + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteEnvelopeCorrectViewWithHttpInfo($account_id, $envelope_id, $correct_view_request = null) + { + // verify the required parameter 'account_id' is set + if ($account_id === null) { + throw new \InvalidArgumentException('Missing the required parameter $account_id when calling deleteEnvelopeCorrectView'); + } + // verify the required parameter 'envelope_id' is set + if ($envelope_id === null) { + throw new \InvalidArgumentException('Missing the required parameter $envelope_id when calling deleteEnvelopeCorrectView'); + } + // parse inputs + $resourcePath = "/v2/accounts/{accountId}/envelopes/{envelopeId}/views/correct"; + $httpBody = ''; + $queryParams = []; + $headerParams = []; + $formParams = []; + $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType([]); + + + // path params + if ($account_id !== null) { + $resourcePath = str_replace( + "{" . "accountId" . "}", + $this->apiClient->getSerializer()->toPathValue($account_id), + $resourcePath + ); + } + // path params + if ($envelope_id !== null) { + $resourcePath = str_replace( + "{" . "envelopeId" . "}", + $this->apiClient->getSerializer()->toPathValue($envelope_id), + $resourcePath + ); + } + // default format to json + $resourcePath = str_replace("{format}", "json", $resourcePath); + + // body params + $_tempBody = null; + if (isset($correct_view_request)) { + $_tempBody = $correct_view_request; + } + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // this endpoint requires OAuth (access token) + if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { + $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, + 'DELETE', + $queryParams, + $httpBody, + $headerParams, + null, + '/v2/accounts/{accountId}/envelopes/{envelopeId}/views/correct' + ); + + return [null, $statusCode, $httpHeader]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\DocuSign\eSign\Model\ErrorDetails', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; + } + + throw $e; + } + } + /** * Operation deleteLock * diff --git a/src/Client/ApiClient.php b/src/Client/ApiClient.php index bc97b1f3..a2a6f897 100644 --- a/src/Client/ApiClient.php +++ b/src/Client/ApiClient.php @@ -320,15 +320,16 @@ public function callApi($resourcePath, $method, $queryParams, $postData, $header } } else { $data = json_decode($http_body); + $serializedData = $data; if (json_last_error() > 0) { // if response is a string $data = $http_body; } - if(is_object($data)){ - $data = serialize($data); + if(is_object($serializedData)){ + $serializedData = serialize($serializedData); } throw new ApiException( - "Error while requesting server, received a non successful HTTP code [".$response_info['http_code']."] with response Body: $data", + "Error while requesting server, received a non successful HTTP code [".$response_info['http_code']."] with response Body: $serializedData", $response_info['http_code'], $http_header, $data diff --git a/src/Model/CorrectViewRequest.php b/src/Model/CorrectViewRequest.php index 1821d63e..ad9e0dc4 100644 --- a/src/Model/CorrectViewRequest.php +++ b/src/Model/CorrectViewRequest.php @@ -58,7 +58,8 @@ class CorrectViewRequest implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'return_url' => 'string', - 'suppress_navigation' => 'string' + 'suppress_navigation' => 'string', + 'view_url' => 'string' ]; /** @@ -68,7 +69,8 @@ class CorrectViewRequest implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'return_url' => null, - 'suppress_navigation' => null + 'suppress_navigation' => null, + 'view_url' => null ]; /** @@ -99,7 +101,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'return_url' => 'returnUrl', - 'suppress_navigation' => 'suppressNavigation' + 'suppress_navigation' => 'suppressNavigation', + 'view_url' => 'viewUrl' ]; /** @@ -109,7 +112,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'return_url' => 'setReturnUrl', - 'suppress_navigation' => 'setSuppressNavigation' + 'suppress_navigation' => 'setSuppressNavigation', + 'view_url' => 'setViewUrl' ]; /** @@ -119,7 +123,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'return_url' => 'getReturnUrl', - 'suppress_navigation' => 'getSuppressNavigation' + 'suppress_navigation' => 'getSuppressNavigation', + 'view_url' => 'getViewUrl' ]; /** @@ -184,6 +189,7 @@ public function __construct(array $data = null) { $this->container['return_url'] = isset($data['return_url']) ? $data['return_url'] : null; $this->container['suppress_navigation'] = isset($data['suppress_navigation']) ? $data['suppress_navigation'] : null; + $this->container['view_url'] = isset($data['view_url']) ? $data['view_url'] : null; } /** @@ -257,6 +263,30 @@ public function setSuppressNavigation($suppress_navigation) return $this; } + + /** + * Gets view_url + * + * @return string + */ + public function getViewUrl() + { + return $this->container['view_url']; + } + + /** + * Sets view_url + * + * @param string $view_url + * + * @return $this + */ + public function setViewUrl($view_url) + { + $this->container['view_url'] = $view_url; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/UserAccountManagementGranularInformation.php b/src/Model/UserAccountManagementGranularInformation.php index 80af0bd7..ff1b7c51 100644 --- a/src/Model/UserAccountManagementGranularInformation.php +++ b/src/Model/UserAccountManagementGranularInformation.php @@ -63,6 +63,8 @@ class UserAccountManagementGranularInformation implements ModelInterface, ArrayA 'can_manage_account_settings_metadata' => '\DocuSign\eSign\Model\SettingsMetadata', 'can_manage_admins' => 'string', 'can_manage_admins_metadata' => '\DocuSign\eSign\Model\SettingsMetadata', + 'can_manage_envelope_transfer' => 'string', + 'can_manage_envelope_transfer_metadata' => '\DocuSign\eSign\Model\SettingsMetadata', 'can_manage_groups' => 'string', 'can_manage_groups_metadata' => '\DocuSign\eSign\Model\SettingsMetadata', 'can_manage_reporting' => 'string', @@ -89,6 +91,8 @@ class UserAccountManagementGranularInformation implements ModelInterface, ArrayA 'can_manage_account_settings_metadata' => null, 'can_manage_admins' => null, 'can_manage_admins_metadata' => null, + 'can_manage_envelope_transfer' => null, + 'can_manage_envelope_transfer_metadata' => null, 'can_manage_groups' => null, 'can_manage_groups_metadata' => null, 'can_manage_reporting' => null, @@ -136,6 +140,8 @@ public static function swaggerFormats() 'can_manage_account_settings_metadata' => 'canManageAccountSettingsMetadata', 'can_manage_admins' => 'canManageAdmins', 'can_manage_admins_metadata' => 'canManageAdminsMetadata', + 'can_manage_envelope_transfer' => 'canManageEnvelopeTransfer', + 'can_manage_envelope_transfer_metadata' => 'canManageEnvelopeTransferMetadata', 'can_manage_groups' => 'canManageGroups', 'can_manage_groups_metadata' => 'canManageGroupsMetadata', 'can_manage_reporting' => 'canManageReporting', @@ -162,6 +168,8 @@ public static function swaggerFormats() 'can_manage_account_settings_metadata' => 'setCanManageAccountSettingsMetadata', 'can_manage_admins' => 'setCanManageAdmins', 'can_manage_admins_metadata' => 'setCanManageAdminsMetadata', + 'can_manage_envelope_transfer' => 'setCanManageEnvelopeTransfer', + 'can_manage_envelope_transfer_metadata' => 'setCanManageEnvelopeTransferMetadata', 'can_manage_groups' => 'setCanManageGroups', 'can_manage_groups_metadata' => 'setCanManageGroupsMetadata', 'can_manage_reporting' => 'setCanManageReporting', @@ -188,6 +196,8 @@ public static function swaggerFormats() 'can_manage_account_settings_metadata' => 'getCanManageAccountSettingsMetadata', 'can_manage_admins' => 'getCanManageAdmins', 'can_manage_admins_metadata' => 'getCanManageAdminsMetadata', + 'can_manage_envelope_transfer' => 'getCanManageEnvelopeTransfer', + 'can_manage_envelope_transfer_metadata' => 'getCanManageEnvelopeTransferMetadata', 'can_manage_groups' => 'getCanManageGroups', 'can_manage_groups_metadata' => 'getCanManageGroupsMetadata', 'can_manage_reporting' => 'getCanManageReporting', @@ -268,6 +278,8 @@ public function __construct(array $data = null) $this->container['can_manage_account_settings_metadata'] = isset($data['can_manage_account_settings_metadata']) ? $data['can_manage_account_settings_metadata'] : null; $this->container['can_manage_admins'] = isset($data['can_manage_admins']) ? $data['can_manage_admins'] : null; $this->container['can_manage_admins_metadata'] = isset($data['can_manage_admins_metadata']) ? $data['can_manage_admins_metadata'] : null; + $this->container['can_manage_envelope_transfer'] = isset($data['can_manage_envelope_transfer']) ? $data['can_manage_envelope_transfer'] : null; + $this->container['can_manage_envelope_transfer_metadata'] = isset($data['can_manage_envelope_transfer_metadata']) ? $data['can_manage_envelope_transfer_metadata'] : null; $this->container['can_manage_groups'] = isset($data['can_manage_groups']) ? $data['can_manage_groups'] : null; $this->container['can_manage_groups_metadata'] = isset($data['can_manage_groups_metadata']) ? $data['can_manage_groups_metadata'] : null; $this->container['can_manage_reporting'] = isset($data['can_manage_reporting']) ? $data['can_manage_reporting'] : null; @@ -450,6 +462,54 @@ public function setCanManageAdminsMetadata($can_manage_admins_metadata) return $this; } + /** + * Gets can_manage_envelope_transfer + * + * @return string + */ + public function getCanManageEnvelopeTransfer() + { + return $this->container['can_manage_envelope_transfer']; + } + + /** + * Sets can_manage_envelope_transfer + * + * @param string $can_manage_envelope_transfer + * + * @return $this + */ + public function setCanManageEnvelopeTransfer($can_manage_envelope_transfer) + { + $this->container['can_manage_envelope_transfer'] = $can_manage_envelope_transfer; + + return $this; + } + + /** + * Gets can_manage_envelope_transfer_metadata + * + * @return \DocuSign\eSign\Model\SettingsMetadata + */ + public function getCanManageEnvelopeTransferMetadata() + { + return $this->container['can_manage_envelope_transfer_metadata']; + } + + /** + * Sets can_manage_envelope_transfer_metadata + * + * @param \DocuSign\eSign\Model\SettingsMetadata $can_manage_envelope_transfer_metadata can_manage_envelope_transfer_metadata + * + * @return $this + */ + public function setCanManageEnvelopeTransferMetadata($can_manage_envelope_transfer_metadata) + { + $this->container['can_manage_envelope_transfer_metadata'] = $can_manage_envelope_transfer_metadata; + + return $this; + } + /** * Gets can_manage_groups *