-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: provide application/json support in request body (#799)
* fix: added support for json content type * chore: added static files for preview messaging * chore: corrected name casing * chore: upgrade guide and changelog updated * chore: updated rc in VersionInfo.php * chore: updated rc version
- Loading branch information
1 parent
f97c450
commit 3ac1dab
Showing
16 changed files
with
969 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Twilio\Rest; | ||
|
||
use Twilio\Rest\PreviewMessaging\V1; | ||
|
||
class PreviewMessaging extends PreviewMessagingBase { | ||
/** | ||
* @deprecated Use v1->oauth instead. | ||
*/ | ||
protected function getMessages(): \Twilio\Rest\PreviewMessaging\V1\MessageList { | ||
return $this->v1->messages; | ||
} | ||
|
||
/** | ||
* @deprecated Use v1->oauth() instead. | ||
*/ | ||
protected function getBroadcasts(): \Twilio\Rest\PreviewMessaging\V1\BroadcastList { | ||
return $this->v1->broadcasts; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?php | ||
/** | ||
* This code was generated by | ||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ | ||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ | ||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ | ||
* | ||
* Bulk Messaging and Broadcast | ||
* Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator. | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
namespace Twilio\Rest\PreviewMessaging; | ||
|
||
use Twilio\Domain; | ||
use Twilio\Exceptions\TwilioException; | ||
use Twilio\InstanceContext; | ||
use Twilio\Rest\PreviewMessaging\V1\BroadcastList; | ||
use Twilio\Rest\PreviewMessaging\V1\MessageList; | ||
use Twilio\Version; | ||
|
||
/** | ||
* @property BroadcastList $broadcasts | ||
* @property MessageList $messages | ||
*/ | ||
class V1 extends Version | ||
{ | ||
protected $_broadcasts; | ||
protected $_messages; | ||
|
||
/** | ||
* Construct the V1 version of PreviewMessaging | ||
* | ||
* @param Domain $domain Domain that contains the version | ||
*/ | ||
public function __construct(Domain $domain) | ||
{ | ||
parent::__construct($domain); | ||
$this->version = 'v1'; | ||
} | ||
|
||
protected function getBroadcasts(): BroadcastList | ||
{ | ||
if (!$this->_broadcasts) { | ||
$this->_broadcasts = new BroadcastList($this); | ||
} | ||
return $this->_broadcasts; | ||
} | ||
|
||
protected function getMessages(): MessageList | ||
{ | ||
if (!$this->_messages) { | ||
$this->_messages = new MessageList($this); | ||
} | ||
return $this->_messages; | ||
} | ||
|
||
/** | ||
* Magic getter to lazy load root resources | ||
* | ||
* @param string $name Resource to return | ||
* @return \Twilio\ListResource The requested resource | ||
* @throws TwilioException For unknown resource | ||
*/ | ||
public function __get(string $name) | ||
{ | ||
$method = 'get' . \ucfirst($name); | ||
if (\method_exists($this, $method)) { | ||
return $this->$method(); | ||
} | ||
|
||
throw new TwilioException('Unknown resource ' . $name); | ||
} | ||
|
||
/** | ||
* Magic caller to get resource contexts | ||
* | ||
* @param string $name Resource to return | ||
* @param array $arguments Context parameters | ||
* @return InstanceContext The requested resource context | ||
* @throws TwilioException For unknown resource | ||
*/ | ||
public function __call(string $name, array $arguments): InstanceContext | ||
{ | ||
$property = $this->$name; | ||
if (\method_exists($property, 'getContext')) { | ||
return \call_user_func_array(array($property, 'getContext'), $arguments); | ||
} | ||
|
||
throw new TwilioException('Resource does not have a context'); | ||
} | ||
|
||
/** | ||
* Provide a friendly representation | ||
* | ||
* @return string Machine friendly representation | ||
*/ | ||
public function __toString(): string | ||
{ | ||
return '[Twilio.PreviewMessaging.V1]'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<?php | ||
|
||
/** | ||
* This code was generated by | ||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ | ||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ | ||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ | ||
* | ||
* Bulk Messaging and Broadcast | ||
* Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator. | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
namespace Twilio\Rest\PreviewMessaging\V1; | ||
|
||
use Twilio\Exceptions\TwilioException; | ||
use Twilio\ListResource; | ||
use Twilio\InstanceResource; | ||
use Twilio\Options; | ||
use Twilio\Stream; | ||
use Twilio\Values; | ||
use Twilio\Version; | ||
use Twilio\InstanceContext; | ||
use Twilio\Deserialize; | ||
use Twilio\Serialize; | ||
use Twilio\Base\PhoneNumberCapabilities; | ||
|
||
|
||
/** | ||
* @property string $broadcastSid | ||
* @property \DateTime $createdDate | ||
* @property \DateTime $updatedDate | ||
* @property string $broadcastStatus | ||
* @property string $executionDetails | ||
* @property string $resultsFile | ||
*/ | ||
class BroadcastInstance extends InstanceResource | ||
{ | ||
/** | ||
* Initialize the BroadcastInstance | ||
* | ||
* @param Version $version Version that contains the resource | ||
* @param mixed[] $payload The response payload | ||
*/ | ||
public function __construct(Version $version, array $payload) | ||
{ | ||
parent::__construct($version); | ||
|
||
// Marshaled Properties | ||
$this->properties = [ | ||
'broadcastSid' => Values::array_get($payload, 'broadcast_sid'), | ||
'createdDate' => Deserialize::dateTime(Values::array_get($payload, 'created_date')), | ||
'updatedDate' => Deserialize::dateTime(Values::array_get($payload, 'updated_date')), | ||
'broadcastStatus' => Values::array_get($payload, 'broadcast_status'), | ||
'executionDetails' => Values::array_get($payload, 'execution_details'), | ||
'resultsFile' => Values::array_get($payload, 'results_file'), | ||
]; | ||
|
||
$this->solution = []; | ||
} | ||
|
||
/** | ||
* Magic getter to access properties | ||
* | ||
* @param string $name Property to access | ||
* @return mixed The requested property | ||
* @throws TwilioException For unknown properties | ||
*/ | ||
public function __get(string $name) | ||
{ | ||
if (\array_key_exists($name, $this->properties)) { | ||
return $this->properties[$name]; | ||
} | ||
|
||
if (\property_exists($this, '_' . $name)) { | ||
$method = 'get' . \ucfirst($name); | ||
return $this->$method(); | ||
} | ||
|
||
throw new TwilioException('Unknown property: ' . $name); | ||
} | ||
|
||
/** | ||
* Provide a friendly representation | ||
* | ||
* @return string Machine friendly representation | ||
*/ | ||
public function __toString(): string | ||
{ | ||
return '[Twilio.PreviewMessaging.V1.BroadcastInstance]'; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
|
||
/** | ||
* This code was generated by | ||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ | ||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ | ||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ | ||
* | ||
* Bulk Messaging and Broadcast | ||
* Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator. | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
namespace Twilio\Rest\PreviewMessaging\V1; | ||
|
||
use Twilio\Exceptions\TwilioException; | ||
use Twilio\ListResource; | ||
use Twilio\InstanceResource; | ||
use Twilio\Options; | ||
use Twilio\Stream; | ||
use Twilio\Values; | ||
use Twilio\Version; | ||
use Twilio\InstanceContext; | ||
use Twilio\Deserialize; | ||
use Twilio\Serialize; | ||
use Twilio\Base\PhoneNumberCapabilities; | ||
|
||
|
||
class BroadcastList extends ListResource | ||
{ | ||
/** | ||
* Construct the BroadcastList | ||
* | ||
* @param Version $version Version that contains the resource | ||
*/ | ||
public function __construct( | ||
Version $version | ||
) { | ||
parent::__construct($version); | ||
|
||
// Path Solution | ||
$this->solution = [ | ||
]; | ||
|
||
$this->uri = '/Broadcasts'; | ||
} | ||
|
||
/** | ||
* Create the BroadcastInstance | ||
* | ||
* @param array|Options $options Optional Arguments | ||
* @return BroadcastInstance Created BroadcastInstance | ||
* @throws TwilioException When an HTTP error occurs. | ||
*/ | ||
public function create(array $options = []): BroadcastInstance | ||
{ | ||
|
||
$options = new Values($options); | ||
|
||
$headers = Values::of(['X-Twilio-Request-Key' => $options['xTwilioRequestKey']]); | ||
|
||
$payload = $this->version->create('POST', $this->uri, [], [], $headers); | ||
|
||
return new BroadcastInstance( | ||
$this->version, | ||
$payload | ||
); | ||
} | ||
|
||
|
||
/** | ||
* Provide a friendly representation | ||
* | ||
* @return string Machine friendly representation | ||
*/ | ||
public function __toString(): string | ||
{ | ||
return '[Twilio.PreviewMessaging.V1.BroadcastList]'; | ||
} | ||
} |
Oops, something went wrong.