-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: provide application/json support in request body #799
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
13c00ea
fix: added support for json content type
tiwarishubham635 ec54151
chore: added static files for preview messaging
tiwarishubham635 6982897
Merge branch '8.0.0-rc' into json_ingress
tiwarishubham635 8e03df6
chore: corrected name casing
tiwarishubham635 b52e21d
chore: upgrade guide and changelog updated
tiwarishubham635 f55d5db
chore: updated rc in VersionInfo.php
tiwarishubham635 ed77032
chore: updated rc version
tiwarishubham635 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we are generating these files ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding them for the first time so that tests do not fail, similar to what we did in case of python.
Moving ahead, it will be autogenerated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suppose if a new API is added from api-definitions, Do we need to do this at that time ?