From 6f3d5df5bb24de0a8c36f81089ba0f797870266f Mon Sep 17 00:00:00 2001 From: Jacob Mulford <39915377+jmulford-bw@users.noreply.github.com> Date: Thu, 22 Jul 2021 15:27:35 -0400 Subject: [PATCH] Voice, MFA, and messaging class/method/signature renames (breaking changes) (#31) * New deploy * Re-added tests * updated integration tests for breaking changes * updated method name Co-authored-by: jmulford-bw --- .gitkeep | 1 + src/APIException.php | 2 +- src/APIHelper.php | 2 +- src/BandwidthClient.php | 16 +- src/Configuration.php | 38 +- src/Controllers/BaseController.php | 2 +- src/Environments.php | 2 +- src/Http/ApiResponse.php | 2 +- src/Http/HttpCallBack.php | 2 +- src/Http/HttpContext.php | 2 +- src/Http/HttpMethod.php | 2 +- src/Http/HttpRequest.php | 2 +- src/Http/HttpResponse.php | 2 +- src/Messaging/Controllers/APIController.php | 86 ++-- .../Exceptions/MessagingException.php | 2 +- src/Messaging/MessagingClient.php | 2 +- .../Models/BandwidthCallbackMessage.php | 2 +- src/Messaging/Models/BandwidthMessage.php | 2 +- src/Messaging/Models/BandwidthMessageItem.php | 44 +- .../Models/BandwidthMessagesList.php | 2 +- src/Messaging/Models/DeferredResult.php | 2 +- src/Messaging/Models/Media.php | 69 +-- src/Messaging/Models/MessageRequest.php | 2 +- src/Messaging/Models/PageInfo.php | 2 +- src/Messaging/Models/PriorityEnum.php | 2 +- src/Messaging/Models/Tag.php | 2 +- .../Controllers/MFAController.php | 26 +- .../Exceptions/ErrorWithRequestException.php | 4 +- .../Exceptions/ForbiddenRequestException.php | 4 +- .../UnauthorizedRequestException.php | 4 +- .../Models/TwoFactorCodeRequestSchema.php | 4 +- .../Models/TwoFactorMessagingResponse.php | 4 +- .../Models/TwoFactorVerifyCodeResponse.php | 4 +- .../Models/TwoFactorVerifyRequestSchema.php | 4 +- .../Models/TwoFactorVoiceResponse.php | 4 +- .../MultiFactorAuthClient.php} | 8 +- .../Controllers/APIController.php | 2 +- .../AccountsTnlookup400ErrorException.php | 2 +- src/PhoneNumberLookup/Models/OrderRequest.php | 2 +- .../Models/OrderResponse.php | 2 +- src/PhoneNumberLookup/Models/OrderStatus.php | 2 +- src/PhoneNumberLookup/Models/Result.php | 2 +- .../PhoneNumberLookupClient.php | 2 +- src/Servers.php | 4 +- src/Utils/DateTimeHelper.php | 2 +- src/Voice/Controllers/APIController.php | 474 ++++++++---------- ...nseException.php => ApiErrorException.php} | 4 +- src/Voice/Models/AnswerFallbackMethodEnum.php | 2 +- src/Voice/Models/AnswerMethodEnum.php | 2 +- ...Response.php => CallRecordingMetadata.php} | 10 +- ...ApiCallStateResponse.php => CallState.php} | 45 +- src/Voice/Models/CallbackMethodEnum.php | 34 +- .../Models/ConferenceEventMethodEnum.php | 34 +- ...erDetail.php => ConferenceMemberState.php} | 4 +- ...se.php => ConferenceRecordingMetadata.php} | 8 +- ...nferenceDetail.php => ConferenceState.php} | 6 +- ...eCallRequest.php => CreateCallRequest.php} | 26 +- ...allResponse.php => CreateCallResponse.php} | 4 +- src/Voice/Models/DirectionEnum.php | 2 +- src/Voice/Models/DisconnectCauseEnum.php | 74 --- src/Voice/Models/DisconnectMethodEnum.php | 2 +- src/Voice/Models/FileFormatEnum.php | 2 +- ...ate.php => ModifyCallRecordingRequest.php} | 4 +- ...yCallRequest.php => ModifyCallRequest.php} | 37 +- ...equest.php => ModifyConferenceRequest.php} | 4 +- .../Models/RedirectFallbackMethodEnum.php | 2 +- src/Voice/Models/RedirectMethodEnum.php | 2 +- src/Voice/Models/State1Enum.php | 11 +- src/Voice/Models/State2Enum.php | 29 -- src/Voice/Models/StateEnum.php | 11 +- src/Voice/Models/Status1Enum.php | 44 -- src/Voice/Models/Status3Enum.php | 49 -- src/Voice/Models/StatusEnum.php | 2 +- ...est.php => TranscribeRecordingRequest.php} | 4 +- src/Voice/Models/Transcript.php | 2 +- ...cription.php => TranscriptionMetadata.php} | 8 +- src/Voice/Models/TranscriptionResponse.php | 2 +- src/Voice/VoiceClient.php | 2 +- src/WebRtc/Controllers/APIController.php | 24 +- src/WebRtc/Exceptions/ErrorException.php | 2 +- .../Models/AccountsParticipantsResponse.php | 2 +- src/WebRtc/Models/DeviceApiVersionEnum.php | 2 +- src/WebRtc/Models/Participant.php | 2 +- src/WebRtc/Models/ParticipantSubscription.php | 2 +- src/WebRtc/Models/PublishPermissionEnum.php | 2 +- src/WebRtc/Models/Session.php | 2 +- src/WebRtc/Models/Subscriptions.php | 2 +- src/WebRtc/WebRtcClient.php | 2 +- tests/ApiTest.php | 26 +- 89 files changed, 534 insertions(+), 860 deletions(-) rename src/{TwoFactorAuth => MultiFactorAuth}/Controllers/MFAController.php (91%) rename src/{TwoFactorAuth => MultiFactorAuth}/Exceptions/ErrorWithRequestException.php (85%) rename src/{TwoFactorAuth => MultiFactorAuth}/Exceptions/ForbiddenRequestException.php (84%) rename src/{TwoFactorAuth => MultiFactorAuth}/Exceptions/UnauthorizedRequestException.php (84%) rename src/{TwoFactorAuth => MultiFactorAuth}/Models/TwoFactorCodeRequestSchema.php (95%) rename src/{TwoFactorAuth => MultiFactorAuth}/Models/TwoFactorMessagingResponse.php (84%) rename src/{TwoFactorAuth => MultiFactorAuth}/Models/TwoFactorVerifyCodeResponse.php (84%) rename src/{TwoFactorAuth => MultiFactorAuth}/Models/TwoFactorVerifyRequestSchema.php (94%) rename src/{TwoFactorAuth => MultiFactorAuth}/Models/TwoFactorVoiceResponse.php (84%) rename src/{TwoFactorAuth/TwoFactorAuthClient.php => MultiFactorAuth/MultiFactorAuthClient.php} (70%) rename src/Voice/Exceptions/{ApiErrorResponseException.php => ApiErrorException.php} (86%) rename src/Voice/Models/{RecordingMetadataResponse.php => CallRecordingMetadata.php} (91%) rename src/Voice/Models/{ApiCallStateResponse.php => CallState.php} (74%) rename src/Voice/Models/{ConferenceMemberDetail.php => ConferenceMemberState.php} (93%) rename src/Voice/Models/{ConferenceRecordingMetadataResponse.php => ConferenceRecordingMetadata.php} (89%) rename src/Voice/Models/{ConferenceDetail.php => ConferenceState.php} (92%) rename src/Voice/Models/{ApiCreateCallRequest.php => CreateCallRequest.php} (85%) rename src/Voice/Models/{ApiCallResponse.php => CreateCallResponse.php} (97%) delete mode 100644 src/Voice/Models/DisconnectCauseEnum.php rename src/Voice/Models/{ModifyCallRecordingState.php => ModifyCallRecordingRequest.php} (82%) rename src/Voice/Models/{ApiModifyCallRequest.php => ModifyCallRequest.php} (70%) rename src/Voice/Models/{ApiModifyConferenceRequest.php => ModifyConferenceRequest.php} (95%) delete mode 100644 src/Voice/Models/State2Enum.php delete mode 100644 src/Voice/Models/Status1Enum.php delete mode 100644 src/Voice/Models/Status3Enum.php rename src/Voice/Models/{ApiTranscribeRecordingRequest.php => TranscribeRecordingRequest.php} (93%) rename src/Voice/Models/{Transcription.php => TranscriptionMetadata.php} (76%) diff --git a/.gitkeep b/.gitkeep index c527f4f..3d865cb 100644 --- a/.gitkeep +++ b/.gitkeep @@ -1,3 +1,4 @@ README.md src/Voice/Bxml/* src/WebRtc/Utils/* +tests/* diff --git a/src/APIException.php b/src/APIException.php index 84e3307..cbd2462 100644 --- a/src/APIException.php +++ b/src/APIException.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib; diff --git a/src/APIHelper.php b/src/APIHelper.php index c3f875a..9093d84 100644 --- a/src/APIHelper.php +++ b/src/APIHelper.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib; diff --git a/src/BandwidthClient.php b/src/BandwidthClient.php index e350c32..8e80179 100644 --- a/src/BandwidthClient.php +++ b/src/BandwidthClient.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib; @@ -21,7 +21,7 @@ public function __construct($config) } private $messaging; - private $twoFactorAuth; + private $multiFactorAuth; private $phoneNumberLookup; private $voice; private $webRtc; @@ -39,15 +39,15 @@ public function getMessaging() } /** - * Provides access to TwoFactorAuth client - * @return TwoFactorAuth\TwoFactorAuthClient + * Provides access to MultiFactorAuth client + * @return MultiFactorAuth\MultiFactorAuthClient */ - public function getTwoFactorAuth() + public function getMultiFactorAuth() { - if ($this->twoFactorAuth == null) { - $this->twoFactorAuth = new TwoFactorAuth\TwoFactorAuthClient($this->config); + if ($this->multiFactorAuth == null) { + $this->multiFactorAuth = new MultiFactorAuth\MultiFactorAuthClient($this->config); } - return $this->twoFactorAuth; + return $this->multiFactorAuth; } /** diff --git a/src/Configuration.php b/src/Configuration.php index 267b8ad..4805805 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib; @@ -35,13 +35,13 @@ class Configuration * The username to use with basic authentication * @var string */ - private $twoFactorAuthBasicAuthUserName = 'TODO: Replace'; + private $multiFactorAuthBasicAuthUserName = 'TODO: Replace'; /** * The password to use with basic authentication * @var string */ - private $twoFactorAuthBasicAuthPassword = 'TODO: Replace'; + private $multiFactorAuthBasicAuthPassword = 'TODO: Replace'; /** * The username to use with basic authentication @@ -102,11 +102,11 @@ public function __construct($configOptions = null) if (isset($configOptions['messagingBasicAuthPassword'])) { $this->messagingBasicAuthPassword = $configOptions['messagingBasicAuthPassword']; } - if (isset($configOptions['twoFactorAuthBasicAuthUserName'])) { - $this->twoFactorAuthBasicAuthUserName = $configOptions['twoFactorAuthBasicAuthUserName']; + if (isset($configOptions['multiFactorAuthBasicAuthUserName'])) { + $this->multiFactorAuthBasicAuthUserName = $configOptions['multiFactorAuthBasicAuthUserName']; } - if (isset($configOptions['twoFactorAuthBasicAuthPassword'])) { - $this->twoFactorAuthBasicAuthPassword = $configOptions['twoFactorAuthBasicAuthPassword']; + if (isset($configOptions['multiFactorAuthBasicAuthPassword'])) { + $this->multiFactorAuthBasicAuthPassword = $configOptions['multiFactorAuthBasicAuthPassword']; } if (isset($configOptions['phoneNumberLookupBasicAuthUserName'])) { $this->phoneNumberLookupBasicAuthUserName = $configOptions['phoneNumberLookupBasicAuthUserName']; @@ -147,11 +147,11 @@ public function getConfigurationMap() if (isset($this->messagingBasicAuthPassword)) { $configMap['messagingBasicAuthPassword'] = $this->messagingBasicAuthPassword; } - if (isset($this->twoFactorAuthBasicAuthUserName)) { - $configMap['twoFactorAuthBasicAuthUserName'] = $this->twoFactorAuthBasicAuthUserName; + if (isset($this->multiFactorAuthBasicAuthUserName)) { + $configMap['multiFactorAuthBasicAuthUserName'] = $this->multiFactorAuthBasicAuthUserName; } - if (isset($this->twoFactorAuthBasicAuthPassword)) { - $configMap['twoFactorAuthBasicAuthPassword'] = $this->twoFactorAuthBasicAuthPassword; + if (isset($this->multiFactorAuthBasicAuthPassword)) { + $configMap['multiFactorAuthBasicAuthPassword'] = $this->multiFactorAuthBasicAuthPassword; } if (isset($this->phoneNumberLookupBasicAuthUserName)) { $configMap['phoneNumberLookupBasicAuthUserName'] = $this->phoneNumberLookupBasicAuthUserName; @@ -199,16 +199,16 @@ public function getMessagingBasicAuthPassword() return $this->messagingBasicAuthPassword; } - // Getter for twoFactorAuthBasicAuthUserName - public function getTwoFactorAuthBasicAuthUserName() + // Getter for multiFactorAuthBasicAuthUserName + public function getMultiFactorAuthBasicAuthUserName() { - return $this->twoFactorAuthBasicAuthUserName; + return $this->multiFactorAuthBasicAuthUserName; } - // Getter for twoFactorAuthBasicAuthPassword - public function getTwoFactorAuthBasicAuthPassword() + // Getter for multiFactorAuthBasicAuthPassword + public function getMultiFactorAuthBasicAuthPassword() { - return $this->twoFactorAuthBasicAuthPassword; + return $this->multiFactorAuthBasicAuthPassword; } // Getter for phoneNumberLookupBasicAuthUserName @@ -283,7 +283,7 @@ public function getBaseUri($server = Servers::DEFAULT_) Environments::PRODUCTION => array( Servers::DEFAULT_ => 'api.bandwidth.com', Servers::MESSAGINGDEFAULT => 'https://messaging.bandwidth.com/api/v2', - Servers::TWOFACTORAUTHDEFAULT => 'https://mfa.bandwidth.com/api/v1', + Servers::MULTIFACTORAUTHDEFAULT => 'https://mfa.bandwidth.com/api/v1', Servers::PHONENUMBERLOOKUPDEFAULT => 'https://numbers.bandwidth.com/api/v1', Servers::VOICEDEFAULT => 'https://voice.bandwidth.com', Servers::WEBRTCDEFAULT => 'https://api.webrtc.bandwidth.com/v1', @@ -291,7 +291,7 @@ public function getBaseUri($server = Servers::DEFAULT_) Environments::CUSTOM => array( Servers::DEFAULT_ => '{base_url}', Servers::MESSAGINGDEFAULT => '{base_url}', - Servers::TWOFACTORAUTHDEFAULT => '{base_url}', + Servers::MULTIFACTORAUTHDEFAULT => '{base_url}', Servers::PHONENUMBERLOOKUPDEFAULT => '{base_url}', Servers::VOICEDEFAULT => '{base_url}', Servers::WEBRTCDEFAULT => '{base_url}', diff --git a/src/Controllers/BaseController.php b/src/Controllers/BaseController.php index 678fc36..05a1cdb 100644 --- a/src/Controllers/BaseController.php +++ b/src/Controllers/BaseController.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Controllers; diff --git a/src/Environments.php b/src/Environments.php index a1dea71..418ec49 100644 --- a/src/Environments.php +++ b/src/Environments.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib; diff --git a/src/Http/ApiResponse.php b/src/Http/ApiResponse.php index 0c484a6..d564c73 100644 --- a/src/Http/ApiResponse.php +++ b/src/Http/ApiResponse.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Http; diff --git a/src/Http/HttpCallBack.php b/src/Http/HttpCallBack.php index d41f791..aa00bef 100644 --- a/src/Http/HttpCallBack.php +++ b/src/Http/HttpCallBack.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Http; diff --git a/src/Http/HttpContext.php b/src/Http/HttpContext.php index f6d2fd3..48ae7e0 100644 --- a/src/Http/HttpContext.php +++ b/src/Http/HttpContext.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Http; diff --git a/src/Http/HttpMethod.php b/src/Http/HttpMethod.php index 5597f9c..6293d93 100644 --- a/src/Http/HttpMethod.php +++ b/src/Http/HttpMethod.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Http; diff --git a/src/Http/HttpRequest.php b/src/Http/HttpRequest.php index 8394b24..4180db4 100644 --- a/src/Http/HttpRequest.php +++ b/src/Http/HttpRequest.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Http; diff --git a/src/Http/HttpResponse.php b/src/Http/HttpResponse.php index 87e0631..4ce44f9 100644 --- a/src/Http/HttpResponse.php +++ b/src/Http/HttpResponse.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Http; diff --git a/src/Messaging/Controllers/APIController.php b/src/Messaging/Controllers/APIController.php index c6f378d..a4974d4 100644 --- a/src/Messaging/Controllers/APIController.php +++ b/src/Messaging/Controllers/APIController.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Messaging\Controllers; @@ -33,22 +33,22 @@ public function __construct($config, $httpCallBack = null) /** * listMedia * - * @param string $userId User's account ID + * @param string $accountId User's account ID * @param string $continuationToken (optional) Continuation token used to retrieve subsequent media. * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ public function listMedia( - $userId, + $accountId, $continuationToken = null ) { //prepare query string for API call - $_queryBuilder = '/users/{userId}/media'; + $_queryBuilder = '/users/{accountId}/media'; //process optional query parameters $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'userId' => $userId, + 'accountId' => $accountId, )); //validate and preprocess url @@ -122,25 +122,24 @@ public function listMedia( /** * getMedia * - * @param string $userId User's account ID - * @param string $mediaId Media ID to retrieve + * @param string $accountId User's account ID + * @param string $mediaId Media ID to retrieve * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ public function getMedia( - $userId, + $accountId, $mediaId ) { //prepare query string for API call - $_queryBuilder = '/users/{userId}/media/{mediaId}'; + $_queryBuilder = '/users/{accountId}/media/{mediaId}'; //process optional query parameters $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'userId' => $userId, - 'mediaId' => $mediaId, - ), false - ); + 'accountId' => $accountId, + 'mediaId' => $mediaId, + )); //validate and preprocess url $_queryUrl = APIHelper::cleanUrl($this->config->getBaseUri(Servers::MESSAGINGDEFAULT) . $_queryBuilder); @@ -210,34 +209,31 @@ public function getMedia( /** * uploadMedia * - * @param string $userId User's account ID - * @param string $mediaId The user supplied custom media ID - * @param integer $contentLength The size of the entity-body - * @param string $body TODO: type description here - * @param string $contentType (optional) The media type of the entity-body - * @param string $cacheControl (optional) General-header field is used to specify directives that MUST be obeyed - * by all caching mechanisms along the request/response chain. + * @param string $accountId User's account ID + * @param string $mediaId The user supplied custom media ID + * @param string $body TODO: type description here + * @param string $contentType (optional) The media type of the entity-body + * @param string $cacheControl (optional) General-header field is used to specify directives that MUST be obeyed + * by all caching mechanisms along the request/response chain. * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ public function uploadMedia( - $userId, + $accountId, $mediaId, - $contentLength, $body, $contentType = 'application/octet-stream', $cacheControl = null ) { //prepare query string for API call - $_queryBuilder = '/users/{userId}/media/{mediaId}'; + $_queryBuilder = '/users/{accountId}/media/{mediaId}'; //process optional query parameters $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'userId' => $userId, - 'mediaId' => $mediaId, - ), false - ); + 'accountId' => $accountId, + 'mediaId' => $mediaId, + )); //validate and preprocess url $_queryUrl = APIHelper::cleanUrl($this->config->getBaseUri(Servers::MESSAGINGDEFAULT) . $_queryBuilder); @@ -245,7 +241,6 @@ public function uploadMedia( //prepare headers $_headers = array ( 'user-agent' => BaseController::USER_AGENT, - 'Content-Length' => $contentLength, 'Content-Type' => (null != $contentType) ? $contentType : 'application/octet-stream', 'Cache-Control' => $cacheControl ); @@ -312,25 +307,24 @@ public function uploadMedia( /** * deleteMedia * - * @param string $userId User's account ID - * @param string $mediaId The media ID to delete + * @param string $accountId User's account ID + * @param string $mediaId The media ID to delete * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ public function deleteMedia( - $userId, + $accountId, $mediaId ) { //prepare query string for API call - $_queryBuilder = '/users/{userId}/media/{mediaId}'; + $_queryBuilder = '/users/{accountId}/media/{mediaId}'; //process optional query parameters $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'userId' => $userId, - 'mediaId' => $mediaId, - ), false - ); + 'accountId' => $accountId, + 'mediaId' => $mediaId, + )); //validate and preprocess url $_queryUrl = APIHelper::cleanUrl($this->config->getBaseUri(Servers::MESSAGINGDEFAULT) . $_queryBuilder); @@ -399,13 +393,13 @@ public function deleteMedia( /** * getMessages * - * @param string $userId User's account ID + * @param string $accountId User's account ID * @param string $messageId (optional) The ID of the message to search for. Special characters need to be * encoded using URL encoding * @param string $sourceTn (optional) The phone number that sent the message * @param string $destinationTn (optional) The phone number that received the message * @param string $messageStatus (optional) The status of the message. One of RECEIVED, QUEUED, SENDING, SENT, - * FAILED, DELIVERED, DLR_EXPIRED + * FAILED, DELIVERED, ACCEPTED, UNDELIVERED * @param integer $errorCode (optional) The error code of the message * @param string $fromDateTime (optional) The start of the date range to search in ISO 8601 format. Uses the * message receive time. The date range to search in is currently 14 days. @@ -418,7 +412,7 @@ public function deleteMedia( * @throws APIException Thrown if API call fails */ public function getMessages( - $userId, + $accountId, $messageId = null, $sourceTn = null, $destinationTn = null, @@ -431,11 +425,11 @@ public function getMessages( ) { //prepare query string for API call - $_queryBuilder = '/users/{userId}/messages'; + $_queryBuilder = '/users/{accountId}/messages'; //process optional query parameters $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'userId' => $userId, + 'accountId' => $accountId, )); //process optional query parameters @@ -524,22 +518,22 @@ public function getMessages( /** * createMessage * - * @param string $userId User's account ID - * @param Models\MessageRequest $body TODO: type description here + * @param string $accountId User's account ID + * @param Models\MessageRequest $body TODO: type description here * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ public function createMessage( - $userId, + $accountId, $body ) { //prepare query string for API call - $_queryBuilder = '/users/{userId}/messages'; + $_queryBuilder = '/users/{accountId}/messages'; //process optional query parameters $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( - 'userId' => $userId, + 'accountId' => $accountId, )); //validate and preprocess url diff --git a/src/Messaging/Exceptions/MessagingException.php b/src/Messaging/Exceptions/MessagingException.php index 33c31ba..238368f 100644 --- a/src/Messaging/Exceptions/MessagingException.php +++ b/src/Messaging/Exceptions/MessagingException.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Messaging\Exceptions; diff --git a/src/Messaging/MessagingClient.php b/src/Messaging/MessagingClient.php index ab4ff66..736d81e 100644 --- a/src/Messaging/MessagingClient.php +++ b/src/Messaging/MessagingClient.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Messaging; diff --git a/src/Messaging/Models/BandwidthCallbackMessage.php b/src/Messaging/Models/BandwidthCallbackMessage.php index 73e8bdf..8f4fe13 100644 --- a/src/Messaging/Models/BandwidthCallbackMessage.php +++ b/src/Messaging/Models/BandwidthCallbackMessage.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Messaging\Models; diff --git a/src/Messaging/Models/BandwidthMessage.php b/src/Messaging/Models/BandwidthMessage.php index 2a3c86b..35ea5fe 100644 --- a/src/Messaging/Models/BandwidthMessage.php +++ b/src/Messaging/Models/BandwidthMessage.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Messaging\Models; diff --git a/src/Messaging/Models/BandwidthMessageItem.php b/src/Messaging/Models/BandwidthMessageItem.php index 4624d4b..c310763 100644 --- a/src/Messaging/Models/BandwidthMessageItem.php +++ b/src/Messaging/Models/BandwidthMessageItem.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Messaging\Models; @@ -78,12 +78,42 @@ class BandwidthMessageItem implements \JsonSerializable */ public $carrierName; + /** + * The size of the message including message content and headers + * @var integer|null $messageSize public property + */ + public $messageSize; + + /** + * The length of the message content + * @var integer|null $messageLength public property + */ + public $messageLength; + + /** + * The number of attachments the message has + * @var integer|null $attachmentCount public property + */ + public $attachmentCount; + + /** + * The number of recipients the message has + * @var integer|null $recipientCount public property + */ + public $recipientCount; + + /** + * The campaign class of the message, if it has one + * @var string|null $campaignClass public property + */ + public $campaignClass; + /** * Constructor to set initial or default values of member properties */ public function __construct() { - if (11 == func_num_args()) { + if (16 == func_num_args()) { $this->messageId = func_get_arg(0); $this->accountId = func_get_arg(1); $this->sourceTn = func_get_arg(2); @@ -95,6 +125,11 @@ public function __construct() $this->errorCode = func_get_arg(8); $this->receiveTime = func_get_arg(9); $this->carrierName = func_get_arg(10); + $this->messageSize = func_get_arg(11); + $this->messageLength = func_get_arg(12); + $this->attachmentCount = func_get_arg(13); + $this->recipientCount = func_get_arg(14); + $this->campaignClass = func_get_arg(15); } } @@ -115,6 +150,11 @@ public function jsonSerialize() $json['errorCode'] = $this->errorCode; $json['receiveTime'] = $this->receiveTime; $json['carrierName'] = $this->carrierName; + $json['messageSize'] = $this->messageSize; + $json['messageLength'] = $this->messageLength; + $json['attachmentCount'] = $this->attachmentCount; + $json['recipientCount'] = $this->recipientCount; + $json['campaignClass'] = $this->campaignClass; return array_filter($json); } diff --git a/src/Messaging/Models/BandwidthMessagesList.php b/src/Messaging/Models/BandwidthMessagesList.php index 32dadd5..75362bc 100644 --- a/src/Messaging/Models/BandwidthMessagesList.php +++ b/src/Messaging/Models/BandwidthMessagesList.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Messaging\Models; diff --git a/src/Messaging/Models/DeferredResult.php b/src/Messaging/Models/DeferredResult.php index 6d6b7cb..527c3ef 100644 --- a/src/Messaging/Models/DeferredResult.php +++ b/src/Messaging/Models/DeferredResult.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Messaging\Models; diff --git a/src/Messaging/Models/Media.php b/src/Messaging/Models/Media.php index c5eeaaa..659850f 100644 --- a/src/Messaging/Models/Media.php +++ b/src/Messaging/Models/Media.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Messaging\Models; @@ -12,12 +12,6 @@ */ class Media implements \JsonSerializable { - /** - * @todo Write general description for this property - * @var object|null $inputStream public property - */ - public $inputStream; - /** * @todo Write general description for this property * @var string|null $content public property @@ -26,68 +20,25 @@ class Media implements \JsonSerializable /** * @todo Write general description for this property - * @var string|null $url public property - */ - public $url; - - /** - * @todo Write general description for this property - * @var string|null $contentLength public property + * @var integer|null $contentLength public property */ public $contentLength; - /** - * @todo Write general description for this property - * @var string|null $contentType public property - */ - public $contentType; - - /** - * @todo Write general description for this property - * @var \BandwidthLib\Messaging\Models\Tag[]|null $tags public property - */ - public $tags; - - /** - * User's account ID - * @var string|null $userId public property - */ - public $userId; - /** * @todo Write general description for this property * @var string|null $mediaName public property */ public $mediaName; - /** - * @todo Write general description for this property - * @var string|null $mediaId public property - */ - public $mediaId; - - /** - * @todo Write general description for this property - * @var string|null $cacheControl public property - */ - public $cacheControl; - /** * Constructor to set initial or default values of member properties */ public function __construct() { - if (10 == func_num_args()) { - $this->inputStream = func_get_arg(0); - $this->content = func_get_arg(1); - $this->url = func_get_arg(2); - $this->contentLength = func_get_arg(3); - $this->contentType = func_get_arg(4); - $this->tags = func_get_arg(5); - $this->userId = func_get_arg(6); - $this->mediaName = func_get_arg(7); - $this->mediaId = func_get_arg(8); - $this->cacheControl = func_get_arg(9); + if (3 == func_num_args()) { + $this->content = func_get_arg(0); + $this->contentLength = func_get_arg(1); + $this->mediaName = func_get_arg(2); } } @@ -97,17 +48,9 @@ public function __construct() public function jsonSerialize() { $json = array(); - $json['inputStream'] = $this->inputStream; $json['content'] = $this->content; - $json['url'] = $this->url; $json['contentLength'] = $this->contentLength; - $json['contentType'] = $this->contentType; - $json['tags'] = isset($this->tags) ? - array_values($this->tags) : null; - $json['userId'] = $this->userId; $json['mediaName'] = $this->mediaName; - $json['mediaId'] = $this->mediaId; - $json['cacheControl'] = $this->cacheControl; return array_filter($json); } diff --git a/src/Messaging/Models/MessageRequest.php b/src/Messaging/Models/MessageRequest.php index 95d6b70..258fecd 100644 --- a/src/Messaging/Models/MessageRequest.php +++ b/src/Messaging/Models/MessageRequest.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Messaging\Models; diff --git a/src/Messaging/Models/PageInfo.php b/src/Messaging/Models/PageInfo.php index 7adb04e..af9587e 100644 --- a/src/Messaging/Models/PageInfo.php +++ b/src/Messaging/Models/PageInfo.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Messaging\Models; diff --git a/src/Messaging/Models/PriorityEnum.php b/src/Messaging/Models/PriorityEnum.php index cb7ce74..7215ad9 100644 --- a/src/Messaging/Models/PriorityEnum.php +++ b/src/Messaging/Models/PriorityEnum.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Messaging\Models; diff --git a/src/Messaging/Models/Tag.php b/src/Messaging/Models/Tag.php index 1cb8fe3..6c51d90 100644 --- a/src/Messaging/Models/Tag.php +++ b/src/Messaging/Models/Tag.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Messaging\Models; diff --git a/src/TwoFactorAuth/Controllers/MFAController.php b/src/MultiFactorAuth/Controllers/MFAController.php similarity index 91% rename from src/TwoFactorAuth/Controllers/MFAController.php rename to src/MultiFactorAuth/Controllers/MFAController.php index ff3136d..49d89eb 100644 --- a/src/TwoFactorAuth/Controllers/MFAController.php +++ b/src/MultiFactorAuth/Controllers/MFAController.php @@ -2,15 +2,15 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ -namespace BandwidthLib\TwoFactorAuth\Controllers; +namespace BandwidthLib\MultiFactorAuth\Controllers; use BandwidthLib\APIException; use BandwidthLib\APIHelper; -use BandwidthLib\TwoFactorAuth\Exceptions; -use BandwidthLib\TwoFactorAuth\Models; +use BandwidthLib\MultiFactorAuth\Exceptions; +use BandwidthLib\MultiFactorAuth\Models; use BandwidthLib\Controllers\BaseController; use BandwidthLib\Http\ApiResponse; use BandwidthLib\Http\HttpRequest; @@ -52,7 +52,7 @@ public function createVoiceTwoFactor( )); //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl($this->config->getBaseUri(Servers::TWOFACTORAUTHDEFAULT) . $_queryBuilder); + $_queryUrl = APIHelper::cleanUrl($this->config->getBaseUri(Servers::MULTIFACTORAUTHDEFAULT) . $_queryBuilder); //prepare headers $_headers = array ( @@ -65,7 +65,7 @@ public function createVoiceTwoFactor( $_bodyJson = Request\Body::Json($body); //set HTTP basic auth parameters - Request::auth($this->config->getTwoFactorAuthBasicAuthUserName(), $this->config->getTwoFactorAuthBasicAuthPassword()); + Request::auth($this->config->getMultiFactorAuthBasicAuthUserName(), $this->config->getMultiFactorAuthBasicAuthPassword()); $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); @@ -118,7 +118,7 @@ public function createVoiceTwoFactor( $mapper = $this->getJsonMapper(); $deserializedResponse = $mapper->mapClass( $response->body, - 'BandwidthLib\\TwoFactorAuth\\Models\\TwoFactorVoiceResponse' + 'BandwidthLib\\MultiFactorAuth\\Models\\TwoFactorVoiceResponse' ); return new ApiResponse($response->code, $response->headers, $deserializedResponse); } @@ -145,7 +145,7 @@ public function createMessagingTwoFactor( )); //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl($this->config->getBaseUri(Servers::TWOFACTORAUTHDEFAULT) . $_queryBuilder); + $_queryUrl = APIHelper::cleanUrl($this->config->getBaseUri(Servers::MULTIFACTORAUTHDEFAULT) . $_queryBuilder); //prepare headers $_headers = array ( @@ -158,7 +158,7 @@ public function createMessagingTwoFactor( $_bodyJson = Request\Body::Json($body); //set HTTP basic auth parameters - Request::auth($this->config->getTwoFactorAuthBasicAuthUserName(), $this->config->getTwoFactorAuthBasicAuthPassword()); + Request::auth($this->config->getMultiFactorAuthBasicAuthUserName(), $this->config->getMultiFactorAuthBasicAuthPassword()); $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); @@ -211,7 +211,7 @@ public function createMessagingTwoFactor( $mapper = $this->getJsonMapper(); $deserializedResponse = $mapper->mapClass( $response->body, - 'BandwidthLib\\TwoFactorAuth\\Models\\TwoFactorMessagingResponse' + 'BandwidthLib\\MultiFactorAuth\\Models\\TwoFactorMessagingResponse' ); return new ApiResponse($response->code, $response->headers, $deserializedResponse); } @@ -238,7 +238,7 @@ public function createVerifyTwoFactor( )); //validate and preprocess url - $_queryUrl = APIHelper::cleanUrl($this->config->getBaseUri(Servers::TWOFACTORAUTHDEFAULT) . $_queryBuilder); + $_queryUrl = APIHelper::cleanUrl($this->config->getBaseUri(Servers::MULTIFACTORAUTHDEFAULT) . $_queryBuilder); //prepare headers $_headers = array ( @@ -251,7 +251,7 @@ public function createVerifyTwoFactor( $_bodyJson = Request\Body::Json($body); //set HTTP basic auth parameters - Request::auth($this->config->getTwoFactorAuthBasicAuthUserName(), $this->config->getTwoFactorAuthBasicAuthPassword()); + Request::auth($this->config->getMultiFactorAuthBasicAuthUserName(), $this->config->getMultiFactorAuthBasicAuthPassword()); $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); @@ -311,7 +311,7 @@ public function createVerifyTwoFactor( $mapper = $this->getJsonMapper(); $deserializedResponse = $mapper->mapClass( $response->body, - 'BandwidthLib\\TwoFactorAuth\\Models\\TwoFactorVerifyCodeResponse' + 'BandwidthLib\\MultiFactorAuth\\Models\\TwoFactorVerifyCodeResponse' ); return new ApiResponse($response->code, $response->headers, $deserializedResponse); } diff --git a/src/TwoFactorAuth/Exceptions/ErrorWithRequestException.php b/src/MultiFactorAuth/Exceptions/ErrorWithRequestException.php similarity index 85% rename from src/TwoFactorAuth/Exceptions/ErrorWithRequestException.php rename to src/MultiFactorAuth/Exceptions/ErrorWithRequestException.php index cd59b2f..302f371 100644 --- a/src/TwoFactorAuth/Exceptions/ErrorWithRequestException.php +++ b/src/MultiFactorAuth/Exceptions/ErrorWithRequestException.php @@ -2,10 +2,10 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ -namespace BandwidthLib\TwoFactorAuth\Exceptions; +namespace BandwidthLib\MultiFactorAuth\Exceptions; use BandwidthLib\APIHelper; diff --git a/src/TwoFactorAuth/Exceptions/ForbiddenRequestException.php b/src/MultiFactorAuth/Exceptions/ForbiddenRequestException.php similarity index 84% rename from src/TwoFactorAuth/Exceptions/ForbiddenRequestException.php rename to src/MultiFactorAuth/Exceptions/ForbiddenRequestException.php index 1027f57..27b27ba 100644 --- a/src/TwoFactorAuth/Exceptions/ForbiddenRequestException.php +++ b/src/MultiFactorAuth/Exceptions/ForbiddenRequestException.php @@ -2,10 +2,10 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ -namespace BandwidthLib\TwoFactorAuth\Exceptions; +namespace BandwidthLib\MultiFactorAuth\Exceptions; use BandwidthLib\APIHelper; diff --git a/src/TwoFactorAuth/Exceptions/UnauthorizedRequestException.php b/src/MultiFactorAuth/Exceptions/UnauthorizedRequestException.php similarity index 84% rename from src/TwoFactorAuth/Exceptions/UnauthorizedRequestException.php rename to src/MultiFactorAuth/Exceptions/UnauthorizedRequestException.php index 25ee2da..ea4b111 100644 --- a/src/TwoFactorAuth/Exceptions/UnauthorizedRequestException.php +++ b/src/MultiFactorAuth/Exceptions/UnauthorizedRequestException.php @@ -2,10 +2,10 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ -namespace BandwidthLib\TwoFactorAuth\Exceptions; +namespace BandwidthLib\MultiFactorAuth\Exceptions; use BandwidthLib\APIHelper; diff --git a/src/TwoFactorAuth/Models/TwoFactorCodeRequestSchema.php b/src/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.php similarity index 95% rename from src/TwoFactorAuth/Models/TwoFactorCodeRequestSchema.php rename to src/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.php index f4332b1..1d8e0ee 100644 --- a/src/TwoFactorAuth/Models/TwoFactorCodeRequestSchema.php +++ b/src/MultiFactorAuth/Models/TwoFactorCodeRequestSchema.php @@ -2,10 +2,10 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ -namespace BandwidthLib\TwoFactorAuth\Models; +namespace BandwidthLib\MultiFactorAuth\Models; /** * @todo Write general description for this model diff --git a/src/TwoFactorAuth/Models/TwoFactorMessagingResponse.php b/src/MultiFactorAuth/Models/TwoFactorMessagingResponse.php similarity index 84% rename from src/TwoFactorAuth/Models/TwoFactorMessagingResponse.php rename to src/MultiFactorAuth/Models/TwoFactorMessagingResponse.php index 6c79721..d68e75e 100644 --- a/src/TwoFactorAuth/Models/TwoFactorMessagingResponse.php +++ b/src/MultiFactorAuth/Models/TwoFactorMessagingResponse.php @@ -2,10 +2,10 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ -namespace BandwidthLib\TwoFactorAuth\Models; +namespace BandwidthLib\MultiFactorAuth\Models; /** * @todo Write general description for this model diff --git a/src/TwoFactorAuth/Models/TwoFactorVerifyCodeResponse.php b/src/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.php similarity index 84% rename from src/TwoFactorAuth/Models/TwoFactorVerifyCodeResponse.php rename to src/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.php index e2c5e2c..d4275e6 100644 --- a/src/TwoFactorAuth/Models/TwoFactorVerifyCodeResponse.php +++ b/src/MultiFactorAuth/Models/TwoFactorVerifyCodeResponse.php @@ -2,10 +2,10 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ -namespace BandwidthLib\TwoFactorAuth\Models; +namespace BandwidthLib\MultiFactorAuth\Models; /** * @todo Write general description for this model diff --git a/src/TwoFactorAuth/Models/TwoFactorVerifyRequestSchema.php b/src/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.php similarity index 94% rename from src/TwoFactorAuth/Models/TwoFactorVerifyRequestSchema.php rename to src/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.php index 075ff3a..984a75e 100644 --- a/src/TwoFactorAuth/Models/TwoFactorVerifyRequestSchema.php +++ b/src/MultiFactorAuth/Models/TwoFactorVerifyRequestSchema.php @@ -2,10 +2,10 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ -namespace BandwidthLib\TwoFactorAuth\Models; +namespace BandwidthLib\MultiFactorAuth\Models; /** * @todo Write general description for this model diff --git a/src/TwoFactorAuth/Models/TwoFactorVoiceResponse.php b/src/MultiFactorAuth/Models/TwoFactorVoiceResponse.php similarity index 84% rename from src/TwoFactorAuth/Models/TwoFactorVoiceResponse.php rename to src/MultiFactorAuth/Models/TwoFactorVoiceResponse.php index d45cbf6..25bf261 100644 --- a/src/TwoFactorAuth/Models/TwoFactorVoiceResponse.php +++ b/src/MultiFactorAuth/Models/TwoFactorVoiceResponse.php @@ -2,10 +2,10 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ -namespace BandwidthLib\TwoFactorAuth\Models; +namespace BandwidthLib\MultiFactorAuth\Models; /** * @todo Write general description for this model diff --git a/src/TwoFactorAuth/TwoFactorAuthClient.php b/src/MultiFactorAuth/MultiFactorAuthClient.php similarity index 70% rename from src/TwoFactorAuth/TwoFactorAuthClient.php rename to src/MultiFactorAuth/MultiFactorAuthClient.php index 48d4e0e..1c63a75 100644 --- a/src/TwoFactorAuth/TwoFactorAuthClient.php +++ b/src/MultiFactorAuth/MultiFactorAuthClient.php @@ -2,17 +2,17 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ -namespace BandwidthLib\TwoFactorAuth; +namespace BandwidthLib\MultiFactorAuth; -use BandwidthLib\TwoFactorAuth\Controllers; +use BandwidthLib\MultiFactorAuth\Controllers; /** * BandwidthLib client class */ -class TwoFactorAuthClient +class MultiFactorAuthClient { private $config; public function __construct($config) diff --git a/src/PhoneNumberLookup/Controllers/APIController.php b/src/PhoneNumberLookup/Controllers/APIController.php index bc4d90d..7bebc0c 100644 --- a/src/PhoneNumberLookup/Controllers/APIController.php +++ b/src/PhoneNumberLookup/Controllers/APIController.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\PhoneNumberLookup\Controllers; diff --git a/src/PhoneNumberLookup/Exceptions/AccountsTnlookup400ErrorException.php b/src/PhoneNumberLookup/Exceptions/AccountsTnlookup400ErrorException.php index d1e5ba8..1d07d92 100644 --- a/src/PhoneNumberLookup/Exceptions/AccountsTnlookup400ErrorException.php +++ b/src/PhoneNumberLookup/Exceptions/AccountsTnlookup400ErrorException.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\PhoneNumberLookup\Exceptions; diff --git a/src/PhoneNumberLookup/Models/OrderRequest.php b/src/PhoneNumberLookup/Models/OrderRequest.php index 2ee7d41..f400a76 100644 --- a/src/PhoneNumberLookup/Models/OrderRequest.php +++ b/src/PhoneNumberLookup/Models/OrderRequest.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\PhoneNumberLookup\Models; diff --git a/src/PhoneNumberLookup/Models/OrderResponse.php b/src/PhoneNumberLookup/Models/OrderResponse.php index 7735ac6..ba2346c 100644 --- a/src/PhoneNumberLookup/Models/OrderResponse.php +++ b/src/PhoneNumberLookup/Models/OrderResponse.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\PhoneNumberLookup\Models; diff --git a/src/PhoneNumberLookup/Models/OrderStatus.php b/src/PhoneNumberLookup/Models/OrderStatus.php index 8e6bc8b..bd93e24 100644 --- a/src/PhoneNumberLookup/Models/OrderStatus.php +++ b/src/PhoneNumberLookup/Models/OrderStatus.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\PhoneNumberLookup\Models; diff --git a/src/PhoneNumberLookup/Models/Result.php b/src/PhoneNumberLookup/Models/Result.php index 43c1f9e..a278d99 100644 --- a/src/PhoneNumberLookup/Models/Result.php +++ b/src/PhoneNumberLookup/Models/Result.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\PhoneNumberLookup\Models; diff --git a/src/PhoneNumberLookup/PhoneNumberLookupClient.php b/src/PhoneNumberLookup/PhoneNumberLookupClient.php index 71c560c..5c08aaa 100644 --- a/src/PhoneNumberLookup/PhoneNumberLookupClient.php +++ b/src/PhoneNumberLookup/PhoneNumberLookupClient.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\PhoneNumberLookup; diff --git a/src/Servers.php b/src/Servers.php index 3ce0453..4c22bea 100644 --- a/src/Servers.php +++ b/src/Servers.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib; @@ -25,7 +25,7 @@ class Servers /** * TODO: Write general description for this element */ - const TWOFACTORAUTHDEFAULT = "TwoFactorAuthDefault"; + const MULTIFACTORAUTHDEFAULT = "MultiFactorAuthDefault"; /** * TODO: Write general description for this element diff --git a/src/Utils/DateTimeHelper.php b/src/Utils/DateTimeHelper.php index 40fa668..d7aa394 100644 --- a/src/Utils/DateTimeHelper.php +++ b/src/Utils/DateTimeHelper.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Utils; diff --git a/src/Voice/Controllers/APIController.php b/src/Voice/Controllers/APIController.php index 6628b82..7bab866 100644 --- a/src/Voice/Controllers/APIController.php +++ b/src/Voice/Controllers/APIController.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Controllers; @@ -31,16 +31,16 @@ public function __construct($config, $httpCallBack = null) } /** - * Creates an outbound call + * Creates an outbound call. * - * @param string $accountId TODO: type description here - * @param Models\ApiCreateCallRequest $body (optional) TODO: type description here + * @param string $accountId TODO: type description here + * @param Models\CreateCallRequest $body TODO: type description here * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ public function createCall( $accountId, - $body = null + $body ) { //prepare query string for API call @@ -89,7 +89,7 @@ public function createCall( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -104,18 +104,18 @@ public function createCall( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -123,7 +123,7 @@ public function createCall( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -131,28 +131,25 @@ public function createCall( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level $this->validateResponse($_httpResponse, $_httpContext); $mapper = $this->getJsonMapper(); - $deserializedResponse = $mapper->mapClass($response->body, 'BandwidthLib\\Voice\\Models\\ApiCallResponse'); + $deserializedResponse = $mapper->mapClass($response->body, 'BandwidthLib\\Voice\\Models\\CreateCallResponse'); return new ApiResponse($response->code, $response->headers, $deserializedResponse); } /** - * Returns near-realtime metadata about the specified call + * Returns near-realtime metadata about the specified call. * * @param string $accountId TODO: type description here * @param string $callId TODO: type description here * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ - public function getCallState( + public function getCall( $accountId, $callId ) { @@ -200,7 +197,7 @@ public function getCallState( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -215,18 +212,18 @@ public function getCallState( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -234,7 +231,7 @@ public function getCallState( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -242,32 +239,29 @@ public function getCallState( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level $this->validateResponse($_httpResponse, $_httpContext); $mapper = $this->getJsonMapper(); - $deserializedResponse = $mapper->mapClass($response->body, 'BandwidthLib\\Voice\\Models\\ApiCallStateResponse'); + $deserializedResponse = $mapper->mapClass($response->body, 'BandwidthLib\\Voice\\Models\\CallState'); return new ApiResponse($response->code, $response->headers, $deserializedResponse); } /** - * Interrupts and replaces an active call's BXML document + * Interrupts and replaces an active call's BXML document. * - * @param string $accountId TODO: type description here - * @param string $callId TODO: type description here - * @param Models\ApiModifyCallRequest $body (optional) TODO: type description here + * @param string $accountId TODO: type description here + * @param string $callId TODO: type description here + * @param Models\ModifyCallRequest $body TODO: type description here * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ public function modifyCall( $accountId, $callId, - $body = null + $body ) { //prepare query string for API call @@ -316,7 +310,7 @@ public function modifyCall( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -331,18 +325,18 @@ public function modifyCall( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -350,7 +344,7 @@ public function modifyCall( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -358,10 +352,7 @@ public function modifyCall( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -370,18 +361,18 @@ public function modifyCall( } /** - * Pauses or resumes a recording + * Pauses or resumes a recording. * - * @param string $accountId TODO: type description here - * @param string $callId TODO: type description here - * @param Models\ModifyCallRecordingState $body (optional) TODO: type description here + * @param string $accountId TODO: type description here + * @param string $callId TODO: type description here + * @param Models\ModifyCallRecordingRequest $body TODO: type description here * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ public function modifyCallRecordingState( $accountId, $callId, - $body = null + $body ) { //prepare query string for API call @@ -430,7 +421,7 @@ public function modifyCallRecordingState( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -445,18 +436,18 @@ public function modifyCallRecordingState( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -464,7 +455,7 @@ public function modifyCallRecordingState( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -472,10 +463,7 @@ public function modifyCallRecordingState( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -492,7 +480,7 @@ public function modifyCallRecordingState( * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ - public function getQueryMetadataForAccountAndCall( + public function getCallRecordings( $accountId, $callId ) { @@ -540,7 +528,7 @@ public function getQueryMetadataForAccountAndCall( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -555,18 +543,18 @@ public function getQueryMetadataForAccountAndCall( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -574,7 +562,7 @@ public function getQueryMetadataForAccountAndCall( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -582,10 +570,7 @@ public function getQueryMetadataForAccountAndCall( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -593,13 +578,13 @@ public function getQueryMetadataForAccountAndCall( $mapper = $this->getJsonMapper(); $deserializedResponse = $mapper->mapClassArray( $response->body, - 'BandwidthLib\\Voice\\Models\\RecordingMetadataResponse' + 'BandwidthLib\\Voice\\Models\\CallRecordingMetadata' ); return new ApiResponse($response->code, $response->headers, $deserializedResponse); } /** - * Returns metadata for the specified recording + * Returns metadata for the specified recording. * * @param string $accountId TODO: type description here * @param string $callId TODO: type description here @@ -607,7 +592,7 @@ public function getQueryMetadataForAccountAndCall( * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ - public function getMetadataForRecording( + public function getCallRecording( $accountId, $callId, $recordingId @@ -657,7 +642,7 @@ public function getMetadataForRecording( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -672,18 +657,18 @@ public function getMetadataForRecording( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -691,7 +676,7 @@ public function getMetadataForRecording( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -699,10 +684,7 @@ public function getMetadataForRecording( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -710,13 +692,13 @@ public function getMetadataForRecording( $mapper = $this->getJsonMapper(); $deserializedResponse = $mapper->mapClass( $response->body, - 'BandwidthLib\\Voice\\Models\\RecordingMetadataResponse' + 'BandwidthLib\\Voice\\Models\\CallRecordingMetadata' ); return new ApiResponse($response->code, $response->headers, $deserializedResponse); } /** - * Deletes the specified recording + * Deletes the specified recording. * * @param string $accountId TODO: type description here * @param string $callId TODO: type description here @@ -773,7 +755,7 @@ public function deleteRecording( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -788,18 +770,18 @@ public function deleteRecording( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -807,7 +789,7 @@ public function deleteRecording( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -815,10 +797,7 @@ public function deleteRecording( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -827,7 +806,7 @@ public function deleteRecording( } /** - * Downloads the specified recording + * Downloads the specified recording. * * @param string $accountId TODO: type description here * @param string $callId TODO: type description here @@ -835,7 +814,7 @@ public function deleteRecording( * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ - public function getStreamRecordingMedia( + public function getDownloadCallRecording( $accountId, $callId, $recordingId @@ -857,7 +836,8 @@ public function getStreamRecordingMedia( //prepare headers $_headers = array ( - 'user-agent' => BaseController::USER_AGENT + 'user-agent' => BaseController::USER_AGENT, + 'Accept' => 'application/json' ); //set HTTP basic auth parameters @@ -885,7 +865,7 @@ public function getStreamRecordingMedia( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -900,18 +880,18 @@ public function getStreamRecordingMedia( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -919,7 +899,7 @@ public function getStreamRecordingMedia( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -927,10 +907,7 @@ public function getStreamRecordingMedia( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -940,7 +917,7 @@ public function getStreamRecordingMedia( } /** - * Deletes the specified recording's media + * Deletes the specified recording's media. * * @param string $accountId TODO: type description here * @param string $callId TODO: type description here @@ -998,7 +975,7 @@ public function deleteRecordingMedia( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -1013,18 +990,18 @@ public function deleteRecordingMedia( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -1032,7 +1009,7 @@ public function deleteRecordingMedia( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -1040,10 +1017,7 @@ public function deleteRecordingMedia( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -1052,7 +1026,7 @@ public function deleteRecordingMedia( } /** - * Downloads the specified transcription + * Downloads the specified transcription. * * @param string $accountId TODO: type description here * @param string $callId TODO: type description here @@ -1060,7 +1034,7 @@ public function deleteRecordingMedia( * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ - public function getRecordingTranscription( + public function getCallTranscription( $accountId, $callId, $recordingId @@ -1111,7 +1085,7 @@ public function getRecordingTranscription( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -1126,18 +1100,18 @@ public function getRecordingTranscription( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -1145,7 +1119,7 @@ public function getRecordingTranscription( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -1153,10 +1127,7 @@ public function getRecordingTranscription( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -1170,20 +1141,20 @@ public function getRecordingTranscription( } /** - * Requests that the specified recording be transcribed + * Requests that the specified recording be transcribed. * - * @param string $accountId TODO: type description here - * @param string $callId TODO: type description here - * @param string $recordingId TODO: type description here - * @param Models\ApiTranscribeRecordingRequest $body (optional) TODO: type description here + * @param string $accountId TODO: type description here + * @param string $callId TODO: type description here + * @param string $recordingId TODO: type description here + * @param Models\TranscribeRecordingRequest $body TODO: type description here * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ - public function createTranscribeRecording( + public function createTranscribeCallRecording( $accountId, $callId, $recordingId, - $body = null + $body ) { //prepare query string for API call @@ -1234,7 +1205,7 @@ public function createTranscribeRecording( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -1249,25 +1220,25 @@ public function createTranscribeRecording( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 410) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The media for this recording has been deleted, so we can\'t transcribe it', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -1275,7 +1246,7 @@ public function createTranscribeRecording( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -1283,10 +1254,7 @@ public function createTranscribeRecording( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -1295,7 +1263,7 @@ public function createTranscribeRecording( } /** - * Deletes the specified recording's transcription + * Deletes the specified recording's transcription. * * @param string $accountId TODO: type description here * @param string $callId TODO: type description here @@ -1303,7 +1271,7 @@ public function createTranscribeRecording( * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ - public function deleteRecordingTranscription( + public function deleteCallTranscription( $accountId, $callId, $recordingId @@ -1353,7 +1321,7 @@ public function deleteRecordingTranscription( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -1368,18 +1336,18 @@ public function deleteRecordingTranscription( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -1387,7 +1355,7 @@ public function deleteRecordingTranscription( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -1395,10 +1363,7 @@ public function deleteRecordingTranscription( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -1407,24 +1372,24 @@ public function deleteRecordingTranscription( } /** - * Returns information about the conferences in the account + * Returns information about the conferences in the account. * * @param string $accountId TODO: type description here - * @param integer $pageSize (optional) Example: 1000 - * @param string $pageToken (optional) TODO: type description here * @param string $name (optional) TODO: type description here * @param string $minCreatedTime (optional) TODO: type description here * @param string $maxCreatedTime (optional) TODO: type description here + * @param integer $pageSize (optional) Example: 1000 + * @param string $pageToken (optional) TODO: type description here * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ - public function getConferencesByAccount( + public function getConferences( $accountId, - $pageSize = 1000, - $pageToken = null, $name = null, $minCreatedTime = null, - $maxCreatedTime = null + $maxCreatedTime = null, + $pageSize = 1000, + $pageToken = null ) { //prepare query string for API call @@ -1437,11 +1402,11 @@ public function getConferencesByAccount( //process optional query parameters APIHelper::appendUrlWithQueryParameters($_queryBuilder, array ( - 'pageSize' => (null != $pageSize) ? $pageSize : 1000, - 'pageToken' => $pageToken, 'name' => $name, 'minCreatedTime' => $minCreatedTime, 'maxCreatedTime' => $maxCreatedTime, + 'pageSize' => (null != $pageSize) ? $pageSize : 1000, + 'pageToken' => $pageToken, )); //validate and preprocess url @@ -1478,7 +1443,7 @@ public function getConferencesByAccount( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -1493,18 +1458,18 @@ public function getConferencesByAccount( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -1512,7 +1477,7 @@ public function getConferencesByAccount( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -1520,31 +1485,25 @@ public function getConferencesByAccount( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level $this->validateResponse($_httpResponse, $_httpContext); $mapper = $this->getJsonMapper(); - $deserializedResponse = $mapper->mapClassArray( - $response->body, - 'BandwidthLib\\Voice\\Models\\ConferenceDetail' - ); + $deserializedResponse = $mapper->mapClassArray($response->body, 'BandwidthLib\\Voice\\Models\\ConferenceState'); return new ApiResponse($response->code, $response->headers, $deserializedResponse); } /** - * Returns information about the specified conference + * Returns information about the specified conference. * * @param string $accountId TODO: type description here * @param string $conferenceId TODO: type description here * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ - public function getConferenceById( + public function getConference( $accountId, $conferenceId ) { @@ -1592,7 +1551,7 @@ public function getConferenceById( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -1607,18 +1566,18 @@ public function getConferenceById( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -1626,7 +1585,7 @@ public function getConferenceById( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -1634,32 +1593,29 @@ public function getConferenceById( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level $this->validateResponse($_httpResponse, $_httpContext); $mapper = $this->getJsonMapper(); - $deserializedResponse = $mapper->mapClass($response->body, 'BandwidthLib\\Voice\\Models\\ConferenceDetail'); + $deserializedResponse = $mapper->mapClass($response->body, 'BandwidthLib\\Voice\\Models\\ConferenceState'); return new ApiResponse($response->code, $response->headers, $deserializedResponse); } /** - * Modify the conference state + * Modify the conference state. * - * @param string $accountId TODO: type description here - * @param string $conferenceId TODO: type description here - * @param Models\ApiModifyConferenceRequest $body (optional) TODO: type description here + * @param string $accountId TODO: type description here + * @param string $conferenceId TODO: type description here + * @param Models\ModifyConferenceRequest $body TODO: type description here * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ public function modifyConference( $accountId, $conferenceId, - $body = null + $body ) { //prepare query string for API call @@ -1708,7 +1664,7 @@ public function modifyConference( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -1723,18 +1679,18 @@ public function modifyConference( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -1742,7 +1698,7 @@ public function modifyConference( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -1750,10 +1706,7 @@ public function modifyConference( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -1762,12 +1715,12 @@ public function modifyConference( } /** - * Updates settings for a particular conference member + * Updates settings for a particular conference member. * - * @param string $accountId TODO: type description here - * @param string $conferenceId TODO: type description here - * @param string $callId TODO: type description here - * @param Models\ConferenceMemberDetail $body (optional) TODO: type description here + * @param string $accountId TODO: type description here + * @param string $conferenceId TODO: type description here + * @param string $callId TODO: type description here + * @param Models\ConferenceMemberState $body TODO: type description here * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ @@ -1775,7 +1728,7 @@ public function modifyConferenceMember( $accountId, $conferenceId, $callId, - $body = null + $body ) { //prepare query string for API call @@ -1825,7 +1778,7 @@ public function modifyConferenceMember( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -1840,18 +1793,18 @@ public function modifyConferenceMember( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -1859,7 +1812,7 @@ public function modifyConferenceMember( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -1867,10 +1820,7 @@ public function modifyConferenceMember( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -1879,7 +1829,7 @@ public function modifyConferenceMember( } /** - * Returns information about the specified conference member + * Returns information about the specified conference member. * * @param string $accountId TODO: type description here * @param string $conferenceId TODO: type description here @@ -1938,7 +1888,7 @@ public function getConferenceMember( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -1953,18 +1903,18 @@ public function getConferenceMember( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -1972,7 +1922,7 @@ public function getConferenceMember( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -1980,10 +1930,7 @@ public function getConferenceMember( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -1991,7 +1938,7 @@ public function getConferenceMember( $mapper = $this->getJsonMapper(); $deserializedResponse = $mapper->mapClass( $response->body, - 'BandwidthLib\\Voice\\Models\\ConferenceMemberDetail' + 'BandwidthLib\\Voice\\Models\\ConferenceMemberState' ); return new ApiResponse($response->code, $response->headers, $deserializedResponse); } @@ -2005,7 +1952,7 @@ public function getConferenceMember( * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ - public function getQueryMetadataForAccountAndConference( + public function getConferenceRecordings( $accountId, $conferenceId ) { @@ -2053,7 +2000,7 @@ public function getQueryMetadataForAccountAndConference( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -2068,18 +2015,18 @@ public function getQueryMetadataForAccountAndConference( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -2087,7 +2034,7 @@ public function getQueryMetadataForAccountAndConference( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -2095,10 +2042,7 @@ public function getQueryMetadataForAccountAndConference( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -2106,13 +2050,13 @@ public function getQueryMetadataForAccountAndConference( $mapper = $this->getJsonMapper(); $deserializedResponse = $mapper->mapClassArray( $response->body, - 'BandwidthLib\\Voice\\Models\\ConferenceRecordingMetadataResponse' + 'BandwidthLib\\Voice\\Models\\ConferenceRecordingMetadata' ); return new ApiResponse($response->code, $response->headers, $deserializedResponse); } /** - * Returns metadata for the specified recording + * Returns metadata for the specified recording. * * @param string $accountId TODO: type description here * @param string $conferenceId TODO: type description here @@ -2120,7 +2064,7 @@ public function getQueryMetadataForAccountAndConference( * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ - public function getMetadataForConferenceRecording( + public function getConferenceRecording( $accountId, $conferenceId, $recordingId @@ -2171,7 +2115,7 @@ public function getMetadataForConferenceRecording( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -2186,18 +2130,18 @@ public function getMetadataForConferenceRecording( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -2205,7 +2149,7 @@ public function getMetadataForConferenceRecording( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -2213,10 +2157,7 @@ public function getMetadataForConferenceRecording( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -2224,13 +2165,13 @@ public function getMetadataForConferenceRecording( $mapper = $this->getJsonMapper(); $deserializedResponse = $mapper->mapClass( $response->body, - 'BandwidthLib\\Voice\\Models\\RecordingMetadataResponse' + 'BandwidthLib\\Voice\\Models\\CallRecordingMetadata' ); return new ApiResponse($response->code, $response->headers, $deserializedResponse); } /** - * Downloads the specified recording + * Downloads the specified recording. * * @param string $accountId TODO: type description here * @param string $conferenceId TODO: type description here @@ -2238,7 +2179,7 @@ public function getMetadataForConferenceRecording( * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ - public function getStreamConferenceRecordingMedia( + public function getDownloadConferenceRecording( $accountId, $conferenceId, $recordingId @@ -2260,7 +2201,8 @@ public function getStreamConferenceRecordingMedia( //prepare headers $_headers = array ( - 'user-agent' => BaseController::USER_AGENT + 'user-agent' => BaseController::USER_AGENT, + 'Accept' => 'application/json' ); //set HTTP basic auth parameters @@ -2288,7 +2230,7 @@ public function getStreamConferenceRecordingMedia( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -2303,18 +2245,18 @@ public function getStreamConferenceRecordingMedia( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -2322,7 +2264,7 @@ public function getStreamConferenceRecordingMedia( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -2330,10 +2272,7 @@ public function getStreamConferenceRecordingMedia( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -2355,7 +2294,7 @@ public function getStreamConferenceRecordingMedia( * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ - public function getQueryMetadataForAccount( + public function getQueryCallRecordings( $accountId, $from = null, $to = null, @@ -2413,7 +2352,7 @@ public function getQueryMetadataForAccount( //Error handling using HTTP status codes if ($response->code == 400) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'Something\'s not quite right... Your request is invalid. Please fix it before trying again.', $_httpContext ); @@ -2428,18 +2367,18 @@ public function getQueryMetadataForAccount( } if ($response->code == 403) { - throw new Exceptions\ApiErrorResponseException('User unauthorized to perform this action.', $_httpContext); + throw new Exceptions\ApiErrorException('User unauthorized to perform this action.', $_httpContext); } if ($response->code == 404) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'The resource specified cannot be found or does not belong to you.', $_httpContext ); } if ($response->code == 415) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'We don\'t support that media type. If a request body is required, please send it to us as ' . '`application/json`.', $_httpContext @@ -2447,7 +2386,7 @@ public function getQueryMetadataForAccount( } if ($response->code == 429) { - throw new Exceptions\ApiErrorResponseException( + throw new Exceptions\ApiErrorException( 'You\'re sending requests to this endpoint too frequently. Please slow your request rate down and ' . 'try again.', $_httpContext @@ -2455,10 +2394,7 @@ public function getQueryMetadataForAccount( } if ($response->code == 500) { - throw new Exceptions\ApiErrorResponseException( - 'Something unexpected happened. Please try again.', - $_httpContext - ); + throw new Exceptions\ApiErrorException('Something unexpected happened. Please try again.', $_httpContext); } //handle errors defined at the API level @@ -2466,7 +2402,7 @@ public function getQueryMetadataForAccount( $mapper = $this->getJsonMapper(); $deserializedResponse = $mapper->mapClassArray( $response->body, - 'BandwidthLib\\Voice\\Models\\RecordingMetadataResponse' + 'BandwidthLib\\Voice\\Models\\CallRecordingMetadata' ); return new ApiResponse($response->code, $response->headers, $deserializedResponse); } diff --git a/src/Voice/Exceptions/ApiErrorResponseException.php b/src/Voice/Exceptions/ApiErrorException.php similarity index 86% rename from src/Voice/Exceptions/ApiErrorResponseException.php rename to src/Voice/Exceptions/ApiErrorException.php index 19e48b0..a7b0b82 100644 --- a/src/Voice/Exceptions/ApiErrorResponseException.php +++ b/src/Voice/Exceptions/ApiErrorException.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Exceptions; @@ -12,7 +12,7 @@ /** * @todo Write general description for this model */ -class ApiErrorResponseException extends \BandwidthLib\APIException +class ApiErrorException extends \BandwidthLib\APIException { /** * @todo Write general description for this property diff --git a/src/Voice/Models/AnswerFallbackMethodEnum.php b/src/Voice/Models/AnswerFallbackMethodEnum.php index b7c4d5c..56d8da9 100644 --- a/src/Voice/Models/AnswerFallbackMethodEnum.php +++ b/src/Voice/Models/AnswerFallbackMethodEnum.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; diff --git a/src/Voice/Models/AnswerMethodEnum.php b/src/Voice/Models/AnswerMethodEnum.php index de099c1..e20b3cf 100644 --- a/src/Voice/Models/AnswerMethodEnum.php +++ b/src/Voice/Models/AnswerMethodEnum.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; diff --git a/src/Voice/Models/RecordingMetadataResponse.php b/src/Voice/Models/CallRecordingMetadata.php similarity index 91% rename from src/Voice/Models/RecordingMetadataResponse.php rename to src/Voice/Models/CallRecordingMetadata.php index 69126b9..139e67b 100644 --- a/src/Voice/Models/RecordingMetadataResponse.php +++ b/src/Voice/Models/CallRecordingMetadata.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; @@ -12,7 +12,7 @@ /** * @todo Write general description for this model */ -class RecordingMetadataResponse implements \JsonSerializable +class CallRecordingMetadata implements \JsonSerializable { /** * @todo Write general description for this property @@ -107,7 +107,9 @@ class RecordingMetadataResponse implements \JsonSerializable public $fileFormat; /** - * @todo Write general description for this property + * The current status of the recording. Current values are 'processing', 'partial', 'complete', + * 'deleted' and 'error'. Additional states may be added in the future, so your application must be + * tolerant of unknown values. * @var string|null $status public property */ public $status; @@ -120,7 +122,7 @@ class RecordingMetadataResponse implements \JsonSerializable /** * @todo Write general description for this property - * @var \BandwidthLib\Voice\Models\Transcription|null $transcription public property + * @var \BandwidthLib\Voice\Models\TranscriptionMetadata|null $transcription public property */ public $transcription; diff --git a/src/Voice/Models/ApiCallStateResponse.php b/src/Voice/Models/CallState.php similarity index 74% rename from src/Voice/Models/ApiCallStateResponse.php rename to src/Voice/Models/CallState.php index 4ed11c0..7894c68 100644 --- a/src/Voice/Models/ApiCallStateResponse.php +++ b/src/Voice/Models/CallState.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; @@ -12,7 +12,7 @@ /** * @todo Write general description for this model */ -class ApiCallStateResponse implements \JsonSerializable +class CallState implements \JsonSerializable { /** * @todo Write general description for this property @@ -57,11 +57,25 @@ class ApiCallStateResponse implements \JsonSerializable public $direction; /** - * @todo Write general description for this property + * The current state of the call. Current possible values are 'initiated', 'answered' and + * 'disconnected'. Additional states may be added in the future, so your application must be tolerant + * of unknown values. * @var string|null $state public property */ public $state; + /** + * @todo Write general description for this property + * @var string|null $identity public property + */ + public $identity; + + /** + * @todo Write general description for this property + * @var array|null $pai public property + */ + public $pai; + /** * @todo Write general description for this property * @factory \BandwidthLib\Utils\DateTimeHelper::fromRfc3339DateTime @@ -84,7 +98,10 @@ class ApiCallStateResponse implements \JsonSerializable public $endTime; /** - * @todo Write general description for this property + * The reason the call was disconnected, or null if the call is still active. Current values are + * 'cancel', 'timeout', 'busy', 'rejected', 'hangup', 'invalid-bxml', 'callback-error', 'application- + * error', 'error', 'account-limit', 'node-capacity-exceeded' and 'unknown'. Additional causes may be + * added in the future, so your application must be tolerant of unknown values. * @var string|null $disconnectCause public property */ public $disconnectCause; @@ -113,7 +130,7 @@ class ApiCallStateResponse implements \JsonSerializable */ public function __construct() { - if (15 == func_num_args()) { + if (17 == func_num_args()) { $this->callId = func_get_arg(0); $this->parentCallId = func_get_arg(1); $this->applicationId = func_get_arg(2); @@ -122,13 +139,15 @@ public function __construct() $this->from = func_get_arg(5); $this->direction = func_get_arg(6); $this->state = func_get_arg(7); - $this->startTime = func_get_arg(8); - $this->answerTime = func_get_arg(9); - $this->endTime = func_get_arg(10); - $this->disconnectCause = func_get_arg(11); - $this->errorMessage = func_get_arg(12); - $this->errorId = func_get_arg(13); - $this->lastUpdate = func_get_arg(14); + $this->identity = func_get_arg(8); + $this->pai = func_get_arg(9); + $this->startTime = func_get_arg(10); + $this->answerTime = func_get_arg(11); + $this->endTime = func_get_arg(12); + $this->disconnectCause = func_get_arg(13); + $this->errorMessage = func_get_arg(14); + $this->errorId = func_get_arg(15); + $this->lastUpdate = func_get_arg(16); } } @@ -146,6 +165,8 @@ public function jsonSerialize() $json['from'] = $this->from; $json['direction'] = $this->direction; $json['state'] = $this->state; + $json['identity'] = $this->identity; + $json['pai'] = $this->pai; $json['startTime'] = isset($this->startTime) ? DateTimeHelper::toRfc3339DateTime($this->startTime) : null; diff --git a/src/Voice/Models/CallbackMethodEnum.php b/src/Voice/Models/CallbackMethodEnum.php index 11743c1..add9061 100644 --- a/src/Voice/Models/CallbackMethodEnum.php +++ b/src/Voice/Models/CallbackMethodEnum.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; @@ -12,16 +12,6 @@ */ class CallbackMethodEnum { - /** - * TODO: Write general description for this element - */ - const GET = "GET"; - - /** - * TODO: Write general description for this element - */ - const HEAD = "HEAD"; - /** * TODO: Write general description for this element */ @@ -30,25 +20,5 @@ class CallbackMethodEnum /** * TODO: Write general description for this element */ - const PUT = "PUT"; - - /** - * TODO: Write general description for this element - */ - const PATCH = "PATCH"; - - /** - * TODO: Write general description for this element - */ - const DELETE = "DELETE"; - - /** - * TODO: Write general description for this element - */ - const OPTIONS = "OPTIONS"; - - /** - * TODO: Write general description for this element - */ - const TRACE = "TRACE"; + const GET = "GET"; } diff --git a/src/Voice/Models/ConferenceEventMethodEnum.php b/src/Voice/Models/ConferenceEventMethodEnum.php index 68a5e27..9ebfa9e 100644 --- a/src/Voice/Models/ConferenceEventMethodEnum.php +++ b/src/Voice/Models/ConferenceEventMethodEnum.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; @@ -12,16 +12,6 @@ */ class ConferenceEventMethodEnum { - /** - * TODO: Write general description for this element - */ - const GET = "GET"; - - /** - * TODO: Write general description for this element - */ - const HEAD = "HEAD"; - /** * TODO: Write general description for this element */ @@ -30,25 +20,5 @@ class ConferenceEventMethodEnum /** * TODO: Write general description for this element */ - const PUT = "PUT"; - - /** - * TODO: Write general description for this element - */ - const PATCH = "PATCH"; - - /** - * TODO: Write general description for this element - */ - const DELETE = "DELETE"; - - /** - * TODO: Write general description for this element - */ - const OPTIONS = "OPTIONS"; - - /** - * TODO: Write general description for this element - */ - const TRACE = "TRACE"; + const GET = "GET"; } diff --git a/src/Voice/Models/ConferenceMemberDetail.php b/src/Voice/Models/ConferenceMemberState.php similarity index 93% rename from src/Voice/Models/ConferenceMemberDetail.php rename to src/Voice/Models/ConferenceMemberState.php index a748130..406a769 100644 --- a/src/Voice/Models/ConferenceMemberDetail.php +++ b/src/Voice/Models/ConferenceMemberState.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; @@ -10,7 +10,7 @@ /** * @todo Write general description for this model */ -class ConferenceMemberDetail implements \JsonSerializable +class ConferenceMemberState implements \JsonSerializable { /** * @todo Write general description for this property diff --git a/src/Voice/Models/ConferenceRecordingMetadataResponse.php b/src/Voice/Models/ConferenceRecordingMetadata.php similarity index 89% rename from src/Voice/Models/ConferenceRecordingMetadataResponse.php rename to src/Voice/Models/ConferenceRecordingMetadata.php index c2246a7..db38412 100644 --- a/src/Voice/Models/ConferenceRecordingMetadataResponse.php +++ b/src/Voice/Models/ConferenceRecordingMetadata.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; @@ -12,7 +12,7 @@ /** * @todo Write general description for this model */ -class ConferenceRecordingMetadataResponse implements \JsonSerializable +class ConferenceRecordingMetadata implements \JsonSerializable { /** * @todo Write general description for this property @@ -71,7 +71,9 @@ class ConferenceRecordingMetadataResponse implements \JsonSerializable public $fileFormat; /** - * @todo Write general description for this property + * The current status of the recording. Current possible values are 'processing', 'partial', 'complete', + * 'deleted', and 'error'. Additional states may be added in the future, so your application must be + * tolerant of unknown values. * @var string|null $status public property */ public $status; diff --git a/src/Voice/Models/ConferenceDetail.php b/src/Voice/Models/ConferenceState.php similarity index 92% rename from src/Voice/Models/ConferenceDetail.php rename to src/Voice/Models/ConferenceState.php index edfb6f3..d204467 100644 --- a/src/Voice/Models/ConferenceDetail.php +++ b/src/Voice/Models/ConferenceState.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; @@ -12,7 +12,7 @@ /** * @todo Write general description for this model */ -class ConferenceDetail implements \JsonSerializable +class ConferenceState implements \JsonSerializable { /** * @todo Write general description for this property @@ -60,7 +60,7 @@ class ConferenceDetail implements \JsonSerializable /** * @todo Write general description for this property - * @var \BandwidthLib\Voice\Models\ConferenceMemberDetail[]|null $activeMembers public property + * @var \BandwidthLib\Voice\Models\ConferenceMemberState[]|null $activeMembers public property */ public $activeMembers; diff --git a/src/Voice/Models/ApiCreateCallRequest.php b/src/Voice/Models/CreateCallRequest.php similarity index 85% rename from src/Voice/Models/ApiCreateCallRequest.php rename to src/Voice/Models/CreateCallRequest.php index 351ebbb..668b09f 100644 --- a/src/Voice/Models/ApiCreateCallRequest.php +++ b/src/Voice/Models/CreateCallRequest.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; @@ -10,7 +10,7 @@ /** * @todo Write general description for this model */ -class ApiCreateCallRequest implements \JsonSerializable +class CreateCallRequest implements \JsonSerializable { /** * Format is E164 @@ -27,8 +27,8 @@ class ApiCreateCallRequest implements \JsonSerializable public $to; /** - * When calling a SIP URI, this will be sent as the 'User-To-User' header within the initial INVITE. An - * 'encoding' parameter must be specified as described in https://tools.ietf.org/html/rfc7433. This + * When calling a SIP URI, this will be sent as the 'User-To-User' header within the initial INVITE. It + * must end with an 'encoding' parameter as described in https://tools.ietf.org/html/rfc7433. This * header cannot exceed 256 characters, including the encoding parameter. * @var string|null $uui public property */ @@ -120,24 +120,12 @@ class ApiCreateCallRequest implements \JsonSerializable */ public $applicationId; - /** - * @todo Write general description for this property - * @var string|null $obfuscatedTo public property - */ - public $obfuscatedTo; - - /** - * @todo Write general description for this property - * @var string|null $obfuscatedFrom public property - */ - public $obfuscatedFrom; - /** * Constructor to set initial or default values of member properties */ public function __construct() { - if (19 == func_num_args()) { + if (17 == func_num_args()) { $this->from = func_get_arg(0); $this->to = func_get_arg(1); $this->uui = func_get_arg(2); @@ -155,8 +143,6 @@ public function __construct() $this->disconnectMethod = func_get_arg(14); $this->tag = func_get_arg(15); $this->applicationId = func_get_arg(16); - $this->obfuscatedTo = func_get_arg(17); - $this->obfuscatedFrom = func_get_arg(18); } } @@ -183,8 +169,6 @@ public function jsonSerialize() $json['disconnectMethod'] = $this->disconnectMethod; $json['tag'] = $this->tag; $json['applicationId'] = $this->applicationId; - $json['obfuscatedTo'] = $this->obfuscatedTo; - $json['obfuscatedFrom'] = $this->obfuscatedFrom; return array_filter($json); } diff --git a/src/Voice/Models/ApiCallResponse.php b/src/Voice/Models/CreateCallResponse.php similarity index 97% rename from src/Voice/Models/ApiCallResponse.php rename to src/Voice/Models/CreateCallResponse.php index 056419c..99d6c8d 100644 --- a/src/Voice/Models/ApiCallResponse.php +++ b/src/Voice/Models/CreateCallResponse.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; @@ -12,7 +12,7 @@ /** * @todo Write general description for this model */ -class ApiCallResponse implements \JsonSerializable +class CreateCallResponse implements \JsonSerializable { /** * @todo Write general description for this property diff --git a/src/Voice/Models/DirectionEnum.php b/src/Voice/Models/DirectionEnum.php index 0f3d66b..8cc04a2 100644 --- a/src/Voice/Models/DirectionEnum.php +++ b/src/Voice/Models/DirectionEnum.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; diff --git a/src/Voice/Models/DisconnectCauseEnum.php b/src/Voice/Models/DisconnectCauseEnum.php deleted file mode 100644 index 0397f9c..0000000 --- a/src/Voice/Models/DisconnectCauseEnum.php +++ /dev/null @@ -1,74 +0,0 @@ -state = func_get_arg(0); - $this->redirectUrl = func_get_arg(1); - $this->redirectFallbackUrl = func_get_arg(2); - $this->redirectMethod = func_get_arg(3); - $this->redirectFallbackMethod = func_get_arg(4); - $this->username = func_get_arg(5); - $this->password = func_get_arg(6); - $this->fallbackUsername = func_get_arg(7); - $this->fallbackPassword = func_get_arg(8); - $this->tag = func_get_arg(9); + switch (func_num_args()) { + case 10: + $this->state = func_get_arg(0); + $this->redirectUrl = func_get_arg(1); + $this->redirectFallbackUrl = func_get_arg(2); + $this->redirectMethod = func_get_arg(3); + $this->redirectFallbackMethod = func_get_arg(4); + $this->username = func_get_arg(5); + $this->password = func_get_arg(6); + $this->fallbackUsername = func_get_arg(7); + $this->fallbackPassword = func_get_arg(8); + $this->tag = func_get_arg(9); + break; + + default: + $this->state = StateEnum::ACTIVE; + break; } } diff --git a/src/Voice/Models/ApiModifyConferenceRequest.php b/src/Voice/Models/ModifyConferenceRequest.php similarity index 95% rename from src/Voice/Models/ApiModifyConferenceRequest.php rename to src/Voice/Models/ModifyConferenceRequest.php index 18beba6..bb5206a 100644 --- a/src/Voice/Models/ApiModifyConferenceRequest.php +++ b/src/Voice/Models/ModifyConferenceRequest.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; @@ -10,7 +10,7 @@ /** * @todo Write general description for this model */ -class ApiModifyConferenceRequest implements \JsonSerializable +class ModifyConferenceRequest implements \JsonSerializable { /** * @todo Write general description for this property diff --git a/src/Voice/Models/RedirectFallbackMethodEnum.php b/src/Voice/Models/RedirectFallbackMethodEnum.php index c90f1b9..6be172f 100644 --- a/src/Voice/Models/RedirectFallbackMethodEnum.php +++ b/src/Voice/Models/RedirectFallbackMethodEnum.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; diff --git a/src/Voice/Models/RedirectMethodEnum.php b/src/Voice/Models/RedirectMethodEnum.php index ae38146..51a4c64 100644 --- a/src/Voice/Models/RedirectMethodEnum.php +++ b/src/Voice/Models/RedirectMethodEnum.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; diff --git a/src/Voice/Models/State1Enum.php b/src/Voice/Models/State1Enum.php index ffb59dd..fec26c7 100644 --- a/src/Voice/Models/State1Enum.php +++ b/src/Voice/Models/State1Enum.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\Voice\Models; @@ -15,10 +15,15 @@ class State1Enum /** * TODO: Write general description for this element */ - const ACTIVE = "active"; + const NOT_RECORDING = "NOT_RECORDING"; /** * TODO: Write general description for this element */ - const COMPLETED = "completed"; + const PAUSED = "PAUSED"; + + /** + * TODO: Write general description for this element + */ + const RECORDING = "RECORDING"; } diff --git a/src/Voice/Models/State2Enum.php b/src/Voice/Models/State2Enum.php deleted file mode 100644 index 0cf95d3..0000000 --- a/src/Voice/Models/State2Enum.php +++ /dev/null @@ -1,29 +0,0 @@ - $accountId, - 'participantId' => $participantId, 'sessionId' => $sessionId, + 'participantId' => $participantId, )); //validate and preprocess url @@ -757,15 +757,15 @@ public function removeParticipantFromSession( * Get a participant's subscriptions * * @param string $accountId Account ID - * @param string $participantId Participant ID * @param string $sessionId Session ID + * @param string $participantId Participant ID * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ public function getParticipantSubscriptions( $accountId, - $participantId, - $sessionId + $sessionId, + $participantId ) { //prepare query string for API call @@ -775,8 +775,8 @@ public function getParticipantSubscriptions( //process optional query parameters $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( 'accountId' => $accountId, - 'participantId' => $participantId, 'sessionId' => $sessionId, + 'participantId' => $participantId, )); //validate and preprocess url @@ -844,16 +844,16 @@ public function getParticipantSubscriptions( * * * @param string $accountId Account ID - * @param string $participantId Participant ID * @param string $sessionId Session ID + * @param string $participantId Participant ID * @param Models\Subscriptions $body (optional) Initial state * @return ApiResponse response from the API call * @throws APIException Thrown if API call fails */ public function updateParticipantSubscriptions( $accountId, - $participantId, $sessionId, + $participantId, $body = null ) { @@ -864,8 +864,8 @@ public function updateParticipantSubscriptions( //process optional query parameters $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array ( 'accountId' => $accountId, - 'participantId' => $participantId, 'sessionId' => $sessionId, + 'participantId' => $participantId, )); //validate and preprocess url diff --git a/src/WebRtc/Exceptions/ErrorException.php b/src/WebRtc/Exceptions/ErrorException.php index 9a6023b..35a961f 100644 --- a/src/WebRtc/Exceptions/ErrorException.php +++ b/src/WebRtc/Exceptions/ErrorException.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\WebRtc\Exceptions; diff --git a/src/WebRtc/Models/AccountsParticipantsResponse.php b/src/WebRtc/Models/AccountsParticipantsResponse.php index 793721b..50974f1 100644 --- a/src/WebRtc/Models/AccountsParticipantsResponse.php +++ b/src/WebRtc/Models/AccountsParticipantsResponse.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\WebRtc\Models; diff --git a/src/WebRtc/Models/DeviceApiVersionEnum.php b/src/WebRtc/Models/DeviceApiVersionEnum.php index 2fa087c..725e537 100644 --- a/src/WebRtc/Models/DeviceApiVersionEnum.php +++ b/src/WebRtc/Models/DeviceApiVersionEnum.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\WebRtc\Models; diff --git a/src/WebRtc/Models/Participant.php b/src/WebRtc/Models/Participant.php index 9fa2543..81dda05 100644 --- a/src/WebRtc/Models/Participant.php +++ b/src/WebRtc/Models/Participant.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\WebRtc\Models; diff --git a/src/WebRtc/Models/ParticipantSubscription.php b/src/WebRtc/Models/ParticipantSubscription.php index 1182181..74ba85e 100644 --- a/src/WebRtc/Models/ParticipantSubscription.php +++ b/src/WebRtc/Models/ParticipantSubscription.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\WebRtc\Models; diff --git a/src/WebRtc/Models/PublishPermissionEnum.php b/src/WebRtc/Models/PublishPermissionEnum.php index ef89b82..f8f1473 100644 --- a/src/WebRtc/Models/PublishPermissionEnum.php +++ b/src/WebRtc/Models/PublishPermissionEnum.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\WebRtc\Models; diff --git a/src/WebRtc/Models/Session.php b/src/WebRtc/Models/Session.php index a6de47a..ba76c05 100644 --- a/src/WebRtc/Models/Session.php +++ b/src/WebRtc/Models/Session.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\WebRtc\Models; diff --git a/src/WebRtc/Models/Subscriptions.php b/src/WebRtc/Models/Subscriptions.php index 599e144..e57572d 100644 --- a/src/WebRtc/Models/Subscriptions.php +++ b/src/WebRtc/Models/Subscriptions.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\WebRtc\Models; diff --git a/src/WebRtc/WebRtcClient.php b/src/WebRtc/WebRtcClient.php index 8e243bf..fd40808 100644 --- a/src/WebRtc/WebRtcClient.php +++ b/src/WebRtc/WebRtcClient.php @@ -2,7 +2,7 @@ /* * BandwidthLib * - * This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ namespace BandwidthLib\WebRtc; diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 0f71fe0..54cf24f 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -21,8 +21,8 @@ protected function setUp(): void { 'messagingBasicAuthPassword' => getenv("PASSWORD"), 'voiceBasicAuthUserName' => getenv("USERNAME"), 'voiceBasicAuthPassword' => getenv("PASSWORD"), - 'twoFactorAuthBasicAuthUserName' => getenv("USERNAME"), - 'twoFactorAuthBasicAuthPassword' => getenv("PASSWORD"), + 'multiFactorAuthBasicAuthUserName' => getenv("USERNAME"), + 'multiFactorAuthBasicAuthPassword' => getenv("PASSWORD"), 'phoneNumberLookupBasicAuthUserName' => getenv("USERNAME"), 'phoneNumberLookupBasicAuthPassword' => getenv("PASSWORD") ) @@ -64,7 +64,7 @@ public function testUploadDownloadMedia() { $mediaFileName = "php_monitoring"; $mediaFile = "12345"; //todo: confirm binary string? //media upload - $this->bandwidthClient->getMessaging()->getClient()->uploadMedia(getenv("ACCOUNT_ID"), $mediaFileName, strlen($mediaFile), $mediaFile); + $this->bandwidthClient->getMessaging()->getClient()->uploadMedia(getenv("ACCOUNT_ID"), $mediaFileName, $mediaFile); //media download $downloadedMediaFile = $this->bandwidthClient->getMessaging()->getClient()->getMedia(getenv("ACCOUNT_ID"), $mediaFileName)->getResult(); @@ -74,7 +74,7 @@ public function testUploadDownloadMedia() { } public function testCreateCallAndGetCallState() { - $body = new BandwidthLib\Voice\Models\ApiCreateCallRequest(); + $body = new BandwidthLib\Voice\Models\CreateCallRequest(); $body->from = getenv("PHONE_NUMBER_INBOUND"); $body->to = getenv("PHONE_NUMBER_OUTBOUND"); $body->applicationId = getenv("VOICE_APPLICATION_ID"); @@ -84,12 +84,12 @@ public function testCreateCallAndGetCallState() { $this->assertTrue(strlen($callId) > 0); //get phone call information - $response = $this->bandwidthClient->getVoice()->getClient()->getCallState(getenv("ACCOUNT_ID"), $callId); + $response = $this->bandwidthClient->getVoice()->getClient()->getCall(getenv("ACCOUNT_ID"), $callId); $this->assertTrue(strlen($response->getResult()->state) > 0); } public function testCreateCallInvalidPhoneNumber() { - $body = new BandwidthLib\Voice\Models\ApiCreateCallRequest(); + $body = new BandwidthLib\Voice\Models\CreateCallRequest(); $body->from = getenv("PHONE_NUMBER_INBOUND"); $body->to = "+1invalid"; $body->applicationId = getenv("VOICE_APPLICATION_ID"); @@ -99,13 +99,13 @@ public function testCreateCallInvalidPhoneNumber() { $this->bandwidthClient->getVoice()->getClient()->createCall(getenv("ACCOUNT_ID"), $body); //workaround to make sure that if the above error is not raised, the build will fail $this->assertTrue(false); - } catch (BandwidthLib\Voice\Exceptions\ApiErrorResponseException $e) { + } catch (BandwidthLib\Voice\Exceptions\ApiErrorException $e) { $this->assertTrue(strlen($e->description) > 0); } } public function testMfaMessaging() { - $body = new BandwidthLib\TwoFactorAuth\Models\TwoFactorCodeRequestSchema(); + $body = new BandwidthLib\MultiFactorAuth\Models\TwoFactorCodeRequestSchema(); $body->from = getenv("PHONE_NUMBER_MFA"); $body->to = getenv("PHONE_NUMBER_INBOUND"); $body->applicationId = getenv("MFA_MESSAGING_APPLICATION_ID"); @@ -113,12 +113,12 @@ public function testMfaMessaging() { $body->digits = 6; $body->message = "Your temporary {NAME} {SCOPE} code is {CODE}"; - $response = $this->bandwidthClient->getTwoFactorAuth()->getMFA()->createMessagingTwoFactor(getenv("ACCOUNT_ID"), $body); + $response = $this->bandwidthClient->getMultiFactorAuth()->getMFA()->createMessagingTwoFactor(getenv("ACCOUNT_ID"), $body); $this->assertTrue(strlen($response->getResult()->messageId) > 0); //validate that _some_ id was returned } public function testMfaVoice() { - $body = new BandwidthLib\TwoFactorAuth\Models\TwoFactorCodeRequestSchema(); + $body = new BandwidthLib\MultiFactorAuth\Models\TwoFactorCodeRequestSchema(); $body->from = getenv("PHONE_NUMBER_MFA"); $body->to = getenv("PHONE_NUMBER_INBOUND"); $body->applicationId = getenv("MFA_VOICE_APPLICATION_ID"); @@ -126,12 +126,12 @@ public function testMfaVoice() { $body->digits = 6; $body->message = "Your temporary {NAME} {SCOPE} code is {CODE}"; - $response = $this->bandwidthClient->getTwoFactorAuth()->getMFA()->createVoiceTwoFactor(getenv("ACCOUNT_ID"), $body); + $response = $this->bandwidthClient->getMultiFactorAuth()->getMFA()->createVoiceTwoFactor(getenv("ACCOUNT_ID"), $body); $this->assertTrue(strlen($response->getResult()->callId) > 0); //validate that _some_ id was returned } public function testMfaVerify() { - $body = new BandwidthLib\TwoFactorAuth\Models\TwoFactorVerifyRequestSchema(); + $body = new BandwidthLib\MultiFactorAuth\Models\TwoFactorVerifyRequestSchema(); $body->from = getenv("PHONE_NUMBER_MFA"); $body->to = getenv("PHONE_NUMBER_INBOUND"); $body->applicationId = getenv("MFA_VOICE_APPLICATION_ID"); @@ -140,7 +140,7 @@ public function testMfaVerify() { $body->digits = 6; $body->expirationTimeInMinutes = 3; - $response = $this->bandwidthClient->getTwoFactorAuth()->getMFA()->createVerifyTwoFactor(getenv("ACCOUNT_ID"), $body); + $response = $this->bandwidthClient->getMultiFactorAuth()->getMFA()->createVerifyTwoFactor(getenv("ACCOUNT_ID"), $body); $this->assertTrue(is_bool($response->getResult()->valid)); }