diff --git a/CHANGES.md b/CHANGES.md index 7c1b568d3c..22c24c02af 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,18 @@ twilio-php Changelog ==================== +[2025-01-09] Version 8.3.10 +--------------------------- +**Library - Fix** +- [PR #834](https://github.com/twilio/twilio-php/pull/834): avoid deprecation messages for PHP 8.4. Thanks to [@phpfui](https://github.com/phpfui)! + +**Library - Chore** +- [PR #837](https://github.com/twilio/twilio-php/pull/837): revert 'fix: avoid deprecation messages for PHP 8.4'. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Numbers** +- Change beta feature flag to use v2/BulkHostedNumberOrders + + [2024-12-05] Version 8.3.9 -------------------------- **Api** diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionOptions.php b/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionOptions.php index 322ba7da29..f58a909a54 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionOptions.php +++ b/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionOptions.php @@ -34,7 +34,7 @@ abstract class TranscriptionOptions * @param string $speechModel Recognition model used by the transcription engine, among those supported by the provider * @param string $hints A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. * @param bool $enableAutomaticPunctuation The provider will add punctuation to recognition result - * @param string $intelligenceService The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. + * @param string $intelligenceService The SID or the unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. * @return CreateTranscriptionOptions Options builder */ public static function create( @@ -93,7 +93,7 @@ class CreateTranscriptionOptions extends Options * @param string $speechModel Recognition model used by the transcription engine, among those supported by the provider * @param string $hints A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. * @param bool $enableAutomaticPunctuation The provider will add punctuation to recognition result - * @param string $intelligenceService The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. + * @param string $intelligenceService The SID or the unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. */ public function __construct( @@ -284,9 +284,9 @@ public function setEnableAutomaticPunctuation(bool $enableAutomaticPunctuation): } /** - * The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. + * The SID or the unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. * - * @param string $intelligenceService The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. + * @param string $intelligenceService The SID or the unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. * @return $this Fluent Builder */ public function setIntelligenceService(string $intelligenceService): self diff --git a/src/Twilio/Rest/Assistants/V1/Assistant/AssistantsKnowledgeInstance.php b/src/Twilio/Rest/Assistants/V1/Assistant/AssistantsKnowledgeInstance.php index 43a26c746d..61d0c83be2 100644 --- a/src/Twilio/Rest/Assistants/V1/Assistant/AssistantsKnowledgeInstance.php +++ b/src/Twilio/Rest/Assistants/V1/Assistant/AssistantsKnowledgeInstance.php @@ -33,6 +33,7 @@ * @property string $status * @property string $type * @property string $url + * @property string $embeddingModel * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ @@ -60,6 +61,7 @@ public function __construct(Version $version, array $payload, string $assistantI 'status' => Values::array_get($payload, 'status'), 'type' => Values::array_get($payload, 'type'), 'url' => Values::array_get($payload, 'url'), + 'embeddingModel' => Values::array_get($payload, 'embedding_model'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; diff --git a/src/Twilio/Rest/Assistants/V1/Assistant/FeedbackModels.php b/src/Twilio/Rest/Assistants/V1/Assistant/FeedbackModels.php index 4da9c289bb..75afd229de 100644 --- a/src/Twilio/Rest/Assistants/V1/Assistant/FeedbackModels.php +++ b/src/Twilio/Rest/Assistants/V1/Assistant/FeedbackModels.php @@ -44,9 +44,9 @@ class AssistantsV1ServiceCreateFeedbackRequest implements \JsonSerializable protected $sessionId; protected $text; public function __construct(array $payload = []) { - $this->messageId = Values::array_get($payload, 'messageId'); + $this->messageId = Values::array_get($payload, 'message_id'); $this->score = Values::array_get($payload, 'score'); - $this->sessionId = Values::array_get($payload, 'sessionId'); + $this->sessionId = Values::array_get($payload, 'session_id'); $this->text = Values::array_get($payload, 'text'); } diff --git a/src/Twilio/Rest/Assistants/V1/Assistant/MessageModels.php b/src/Twilio/Rest/Assistants/V1/Assistant/MessageModels.php index 55c8f494aa..bfcffdb69b 100644 --- a/src/Twilio/Rest/Assistants/V1/Assistant/MessageModels.php +++ b/src/Twilio/Rest/Assistants/V1/Assistant/MessageModels.php @@ -48,7 +48,7 @@ class AssistantsV1ServiceAssistantSendMessageRequest implements \JsonSerializabl protected $mode; public function __construct(array $payload = []) { $this->identity = Values::array_get($payload, 'identity'); - $this->sessionId = Values::array_get($payload, 'sessionId'); + $this->sessionId = Values::array_get($payload, 'session_id'); $this->body = Values::array_get($payload, 'body'); $this->webhook = Values::array_get($payload, 'webhook'); $this->mode = Values::array_get($payload, 'mode'); diff --git a/src/Twilio/Rest/Assistants/V1/AssistantModels.php b/src/Twilio/Rest/Assistants/V1/AssistantModels.php index 680a1808f5..40e34b0344 100644 --- a/src/Twilio/Rest/Assistants/V1/AssistantModels.php +++ b/src/Twilio/Rest/Assistants/V1/AssistantModels.php @@ -72,8 +72,8 @@ class AssistantsV1ServiceCustomerAi implements \JsonSerializable protected $perceptionEngineEnabled; protected $personalizationEngineEnabled; public function __construct(array $payload = []) { - $this->perceptionEngineEnabled = Values::array_get($payload, 'perceptionEngineEnabled'); - $this->personalizationEngineEnabled = Values::array_get($payload, 'personalizationEngineEnabled'); + $this->perceptionEngineEnabled = Values::array_get($payload, 'perception_engine_enabled'); + $this->personalizationEngineEnabled = Values::array_get($payload, 'personalization_engine_enabled'); } public function toArray(): array @@ -101,9 +101,9 @@ class AssistantsV1ServiceSegmentCredential implements \JsonSerializable protected $spaceId; protected $writeKey; public function __construct(array $payload = []) { - $this->profileApiKey = Values::array_get($payload, 'profileApiKey'); - $this->spaceId = Values::array_get($payload, 'spaceId'); - $this->writeKey = Values::array_get($payload, 'writeKey'); + $this->profileApiKey = Values::array_get($payload, 'profile_api_key'); + $this->spaceId = Values::array_get($payload, 'space_id'); + $this->writeKey = Values::array_get($payload, 'write_key'); } public function toArray(): array @@ -136,11 +136,11 @@ class AssistantsV1ServiceCreateAssistantRequest implements \JsonSerializable protected $personalityPrompt; protected $segmentCredential; public function __construct(array $payload = []) { - $this->customerAi = Values::array_get($payload, 'customerAi'); + $this->customerAi = Values::array_get($payload, 'customer_ai'); $this->name = Values::array_get($payload, 'name'); $this->owner = Values::array_get($payload, 'owner'); - $this->personalityPrompt = Values::array_get($payload, 'personalityPrompt'); - $this->segmentCredential = Values::array_get($payload, 'segmentCredential'); + $this->personalityPrompt = Values::array_get($payload, 'personality_prompt'); + $this->segmentCredential = Values::array_get($payload, 'segment_credential'); } public function toArray(): array @@ -175,11 +175,11 @@ class AssistantsV1ServiceUpdateAssistantRequest implements \JsonSerializable protected $personalityPrompt; protected $segmentCredential; public function __construct(array $payload = []) { - $this->customerAi = Values::array_get($payload, 'customerAi'); + $this->customerAi = Values::array_get($payload, 'customer_ai'); $this->name = Values::array_get($payload, 'name'); $this->owner = Values::array_get($payload, 'owner'); - $this->personalityPrompt = Values::array_get($payload, 'personalityPrompt'); - $this->segmentCredential = Values::array_get($payload, 'segmentCredential'); + $this->personalityPrompt = Values::array_get($payload, 'personality_prompt'); + $this->segmentCredential = Values::array_get($payload, 'segment_credential'); } public function toArray(): array diff --git a/src/Twilio/Rest/Assistants/V1/KnowledgeInstance.php b/src/Twilio/Rest/Assistants/V1/KnowledgeInstance.php index eff29c7d48..aec6204573 100644 --- a/src/Twilio/Rest/Assistants/V1/KnowledgeInstance.php +++ b/src/Twilio/Rest/Assistants/V1/KnowledgeInstance.php @@ -35,6 +35,7 @@ * @property string $status * @property string $type * @property string $url + * @property string $embeddingModel * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ @@ -64,6 +65,7 @@ public function __construct(Version $version, array $payload, string $id = null) 'status' => Values::array_get($payload, 'status'), 'type' => Values::array_get($payload, 'type'), 'url' => Values::array_get($payload, 'url'), + 'embeddingModel' => Values::array_get($payload, 'embedding_model'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; diff --git a/src/Twilio/Rest/Assistants/V1/KnowledgeModels.php b/src/Twilio/Rest/Assistants/V1/KnowledgeModels.php index a8ef8581a8..a15958c553 100644 --- a/src/Twilio/Rest/Assistants/V1/KnowledgeModels.php +++ b/src/Twilio/Rest/Assistants/V1/KnowledgeModels.php @@ -37,6 +37,7 @@ public static function createAssistantsV1ServiceCreatePolicyRequest(array $paylo * @property string $name The name of the tool. * @property AssistantsV1ServiceCreatePolicyRequest $policy * @property string $type The type of the knowledge source. + * @property string $embeddingModel The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. */ public static function createAssistantsV1ServiceCreateKnowledgeRequest(array $payload = []): AssistantsV1ServiceCreateKnowledgeRequest { @@ -49,6 +50,7 @@ public static function createAssistantsV1ServiceCreateKnowledgeRequest(array $pa * @property string $name The name of the knowledge source. * @property AssistantsV1ServiceCreatePolicyRequest $policy * @property string $type The description of the knowledge source. + * @property string $embeddingModel The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. */ public static function createAssistantsV1ServiceUpdateKnowledgeRequest(array $payload = []): AssistantsV1ServiceUpdateKnowledgeRequest { @@ -75,7 +77,7 @@ public function __construct(array $payload = []) { $this->description = Values::array_get($payload, 'description'); $this->id = Values::array_get($payload, 'id'); $this->name = Values::array_get($payload, 'name'); - $this->policyDetails = Values::array_get($payload, 'policyDetails'); + $this->policyDetails = Values::array_get($payload, 'policy_details'); $this->type = Values::array_get($payload, 'type'); } @@ -105,6 +107,7 @@ class AssistantsV1ServiceCreateKnowledgeRequest implements \JsonSerializable * @property string $name The name of the tool. * @property AssistantsV1ServiceCreatePolicyRequest $policy * @property string $type The type of the knowledge source. + * @property string $embeddingModel The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. */ protected $assistantId; protected $description; @@ -112,13 +115,15 @@ class AssistantsV1ServiceCreateKnowledgeRequest implements \JsonSerializable protected $name; protected $policy; protected $type; + protected $embeddingModel; public function __construct(array $payload = []) { - $this->assistantId = Values::array_get($payload, 'assistantId'); + $this->assistantId = Values::array_get($payload, 'assistant_id'); $this->description = Values::array_get($payload, 'description'); - $this->knowledgeSourceDetails = Values::array_get($payload, 'knowledgeSourceDetails'); + $this->knowledgeSourceDetails = Values::array_get($payload, 'knowledge_source_details'); $this->name = Values::array_get($payload, 'name'); $this->policy = Values::array_get($payload, 'policy'); $this->type = Values::array_get($payload, 'type'); + $this->embeddingModel = Values::array_get($payload, 'embedding_model'); } public function toArray(): array @@ -134,7 +139,8 @@ public function jsonSerialize(): array 'knowledgeSourceDetails' => $this->knowledgeSourceDetails, 'name' => $this->name, 'policy' => $this->policy, - 'type' => $this->type + 'type' => $this->type, + 'embeddingModel' => $this->embeddingModel ]; } } @@ -147,18 +153,21 @@ class AssistantsV1ServiceUpdateKnowledgeRequest implements \JsonSerializable * @property string $name The name of the knowledge source. * @property AssistantsV1ServiceCreatePolicyRequest $policy * @property string $type The description of the knowledge source. + * @property string $embeddingModel The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. */ protected $description; protected $knowledgeSourceDetails; protected $name; protected $policy; protected $type; + protected $embeddingModel; public function __construct(array $payload = []) { $this->description = Values::array_get($payload, 'description'); - $this->knowledgeSourceDetails = Values::array_get($payload, 'knowledgeSourceDetails'); + $this->knowledgeSourceDetails = Values::array_get($payload, 'knowledge_source_details'); $this->name = Values::array_get($payload, 'name'); $this->policy = Values::array_get($payload, 'policy'); $this->type = Values::array_get($payload, 'type'); + $this->embeddingModel = Values::array_get($payload, 'embedding_model'); } public function toArray(): array @@ -173,7 +182,8 @@ public function jsonSerialize(): array 'knowledgeSourceDetails' => $this->knowledgeSourceDetails, 'name' => $this->name, 'policy' => $this->policy, - 'type' => $this->type + 'type' => $this->type, + 'embeddingModel' => $this->embeddingModel ]; } } diff --git a/src/Twilio/Rest/Assistants/V1/ToolModels.php b/src/Twilio/Rest/Assistants/V1/ToolModels.php index 3ea0bd056a..7fb3e1aba4 100644 --- a/src/Twilio/Rest/Assistants/V1/ToolModels.php +++ b/src/Twilio/Rest/Assistants/V1/ToolModels.php @@ -78,7 +78,7 @@ public function __construct(array $payload = []) { $this->description = Values::array_get($payload, 'description'); $this->id = Values::array_get($payload, 'id'); $this->name = Values::array_get($payload, 'name'); - $this->policyDetails = Values::array_get($payload, 'policyDetails'); + $this->policyDetails = Values::array_get($payload, 'policy_details'); $this->type = Values::array_get($payload, 'type'); } @@ -118,7 +118,7 @@ class AssistantsV1ServiceCreateToolRequest implements \JsonSerializable protected $policy; protected $type; public function __construct(array $payload = []) { - $this->assistantId = Values::array_get($payload, 'assistantId'); + $this->assistantId = Values::array_get($payload, 'assistant_id'); $this->description = Values::array_get($payload, 'description'); $this->enabled = Values::array_get($payload, 'enabled'); $this->meta = Values::array_get($payload, 'meta'); @@ -165,7 +165,7 @@ class AssistantsV1ServiceUpdateToolRequest implements \JsonSerializable protected $policy; protected $type; public function __construct(array $payload = []) { - $this->assistantId = Values::array_get($payload, 'assistantId'); + $this->assistantId = Values::array_get($payload, 'assistant_id'); $this->description = Values::array_get($payload, 'description'); $this->enabled = Values::array_get($payload, 'enabled'); $this->meta = Values::array_get($payload, 'meta'); diff --git a/src/Twilio/Rest/Content/V1/ContentModels.php b/src/Twilio/Rest/Content/V1/ContentModels.php index 0b076c91b8..5801df2d52 100644 --- a/src/Twilio/Rest/Content/V1/ContentModels.php +++ b/src/Twilio/Rest/Content/V1/ContentModels.php @@ -187,20 +187,9 @@ public static function createTwilioCarousel(array $payload = []): TwilioCarousel return new TwilioCarousel($payload); } - /** - * @property string $id - * @property string $title - */ - public static function createFlowsPageComponentSelectItem(array $payload = []): FlowsPageComponentSelectItem - { - return new FlowsPageComponentSelectItem($payload); - } - /** * @property string $label * @property string $type - * @property string $text - * @property FlowsPageComponentSelectItem[] $options */ public static function createFlowsPageComponent(array $payload = []): FlowsPageComponent { @@ -658,9 +647,9 @@ class CatalogItem implements \JsonSerializable protected $description; public function __construct(array $payload = []) { $this->id = Values::array_get($payload, 'id'); - $this->sectionTitle = Values::array_get($payload, 'sectionTitle'); + $this->sectionTitle = Values::array_get($payload, 'section_title'); $this->name = Values::array_get($payload, 'name'); - $this->mediaUrl = Values::array_get($payload, 'mediaUrl'); + $this->mediaUrl = Values::array_get($payload, 'media_url'); $this->price = Values::array_get($payload, 'price'); $this->description = Values::array_get($payload, 'description'); } @@ -705,7 +694,7 @@ public function __construct(array $payload = []) { $this->subtitle = Values::array_get($payload, 'subtitle'); $this->id = Values::array_get($payload, 'id'); $this->items = Values::array_get($payload, 'items'); - $this->dynamicItems = Values::array_get($payload, 'dynamicItems'); + $this->dynamicItems = Values::array_get($payload, 'dynamic_items'); } public function toArray(): array @@ -827,50 +816,17 @@ public function jsonSerialize(): array } } -class FlowsPageComponentSelectItem implements \JsonSerializable -{ - /** - * @property string $id - * @property string $title - */ - protected $id; - protected $title; - public function __construct(array $payload = []) { - $this->id = Values::array_get($payload, 'id'); - $this->title = Values::array_get($payload, 'title'); - } - - public function toArray(): array - { - return $this->jsonSerialize(); - } - - public function jsonSerialize(): array - { - return [ - 'id' => $this->id, - 'title' => $this->title - ]; - } -} - class FlowsPageComponent implements \JsonSerializable { /** * @property string $label * @property string $type - * @property string $text - * @property FlowsPageComponentSelectItem[] $options */ protected $label; protected $type; - protected $text; - protected $options; public function __construct(array $payload = []) { $this->label = Values::array_get($payload, 'label'); $this->type = Values::array_get($payload, 'type'); - $this->text = Values::array_get($payload, 'text'); - $this->options = Values::array_get($payload, 'options'); } public function toArray(): array @@ -882,9 +838,7 @@ public function jsonSerialize(): array { return [ 'label' => $this->label, - 'type' => $this->type, - 'text' => $this->text, - 'options' => $this->options + 'type' => $this->type ]; } } @@ -905,7 +859,7 @@ class FlowsPage implements \JsonSerializable protected $layout; public function __construct(array $payload = []) { $this->id = Values::array_get($payload, 'id'); - $this->nextPageId = Values::array_get($payload, 'nextPageId'); + $this->nextPageId = Values::array_get($payload, 'next_page_id'); $this->title = Values::array_get($payload, 'title'); $this->subtitle = Values::array_get($payload, 'subtitle'); $this->layout = Values::array_get($payload, 'layout'); @@ -946,9 +900,9 @@ class TwilioFlows implements \JsonSerializable protected $type; public function __construct(array $payload = []) { $this->body = Values::array_get($payload, 'body'); - $this->buttonText = Values::array_get($payload, 'buttonText'); + $this->buttonText = Values::array_get($payload, 'button_text'); $this->subtitle = Values::array_get($payload, 'subtitle'); - $this->mediaUrl = Values::array_get($payload, 'mediaUrl'); + $this->mediaUrl = Values::array_get($payload, 'media_url'); $this->pages = Values::array_get($payload, 'pages'); $this->type = Values::array_get($payload, 'type'); } @@ -989,7 +943,7 @@ public function __construct(array $payload = []) { $this->body = Values::array_get($payload, 'body'); $this->footer = Values::array_get($payload, 'footer'); $this->media = Values::array_get($payload, 'media'); - $this->headerText = Values::array_get($payload, 'headerText'); + $this->headerText = Values::array_get($payload, 'header_text'); $this->actions = Values::array_get($payload, 'actions'); } @@ -1020,7 +974,7 @@ class AuthenticationAction implements \JsonSerializable protected $copyCodeText; public function __construct(array $payload = []) { $this->type = Values::array_get($payload, 'type'); - $this->copyCodeText = Values::array_get($payload, 'copyCodeText'); + $this->copyCodeText = Values::array_get($payload, 'copy_code_text'); } public function toArray(): array @@ -1048,8 +1002,8 @@ class WhatsappAuthentication implements \JsonSerializable protected $codeExpirationMinutes; protected $actions; public function __construct(array $payload = []) { - $this->addSecurityRecommendation = Values::array_get($payload, 'addSecurityRecommendation'); - $this->codeExpirationMinutes = Values::array_get($payload, 'codeExpirationMinutes'); + $this->addSecurityRecommendation = Values::array_get($payload, 'add_security_recommendation'); + $this->codeExpirationMinutes = Values::array_get($payload, 'code_expiration_minutes'); $this->actions = Values::array_get($payload, 'actions'); } @@ -1097,18 +1051,18 @@ class Types implements \JsonSerializable protected $whatsappCard; protected $whatsappAuthentication; public function __construct(array $payload = []) { - $this->twilioText = Values::array_get($payload, 'twilioText'); - $this->twilioMedia = Values::array_get($payload, 'twilioMedia'); - $this->twilioLocation = Values::array_get($payload, 'twilioLocation'); - $this->twilioListPicker = Values::array_get($payload, 'twilioListPicker'); - $this->twilioCallToAction = Values::array_get($payload, 'twilioCallToAction'); - $this->twilioQuickReply = Values::array_get($payload, 'twilioQuickReply'); - $this->twilioCard = Values::array_get($payload, 'twilioCard'); - $this->twilioCatalog = Values::array_get($payload, 'twilioCatalog'); - $this->twilioCarousel = Values::array_get($payload, 'twilioCarousel'); - $this->twilioFlows = Values::array_get($payload, 'twilioFlows'); - $this->whatsappCard = Values::array_get($payload, 'whatsappCard'); - $this->whatsappAuthentication = Values::array_get($payload, 'whatsappAuthentication'); + $this->twilioText = Values::array_get($payload, 'twilio_text'); + $this->twilioMedia = Values::array_get($payload, 'twilio_media'); + $this->twilioLocation = Values::array_get($payload, 'twilio_location'); + $this->twilioListPicker = Values::array_get($payload, 'twilio_list_picker'); + $this->twilioCallToAction = Values::array_get($payload, 'twilio_call_to_action'); + $this->twilioQuickReply = Values::array_get($payload, 'twilio_quick_reply'); + $this->twilioCard = Values::array_get($payload, 'twilio_card'); + $this->twilioCatalog = Values::array_get($payload, 'twilio_catalog'); + $this->twilioCarousel = Values::array_get($payload, 'twilio_carousel'); + $this->twilioFlows = Values::array_get($payload, 'twilio_flows'); + $this->whatsappCard = Values::array_get($payload, 'whatsapp_card'); + $this->whatsappAuthentication = Values::array_get($payload, 'whatsapp_authentication'); } public function toArray(): array @@ -1148,7 +1102,7 @@ class ContentCreateRequest implements \JsonSerializable protected $language; protected $types; public function __construct(array $payload = []) { - $this->friendlyName = Values::array_get($payload, 'friendlyName'); + $this->friendlyName = Values::array_get($payload, 'friendly_name'); $this->variables = Values::array_get($payload, 'variables'); $this->language = Values::array_get($payload, 'language'); $this->types = Values::array_get($payload, 'types'); diff --git a/src/Twilio/Rest/Iam/V1.php b/src/Twilio/Rest/Iam/V1.php index 023a1de4ab..e57490c85b 100644 --- a/src/Twilio/Rest/Iam/V1.php +++ b/src/Twilio/Rest/Iam/V1.php @@ -20,20 +20,20 @@ use Twilio\InstanceContext; use Twilio\Rest\Iam\V1\ApiKeyList; use Twilio\Rest\Iam\V1\GetApiKeysList; -use Twilio\Rest\Iam\V1\KeyList; +use Twilio\Rest\Iam\V1\NewApiKeyList; use Twilio\Version; /** * @property ApiKeyList $apiKey * @property GetApiKeysList $getApiKeys - * @property KeyList $keys + * @property NewApiKeyList $newApiKey * @method \Twilio\Rest\Iam\V1\ApiKeyContext apiKey(string $sid) */ class V1 extends Version { protected $_apiKey; protected $_getApiKeys; - protected $_keys; + protected $_newApiKey; /** * Construct the V1 version of Iam @@ -62,12 +62,12 @@ protected function getGetApiKeys(): GetApiKeysList return $this->_getApiKeys; } - protected function getKeys(): KeyList + protected function getNewApiKey(): NewApiKeyList { - if (!$this->_keys) { - $this->_keys = new KeyList($this); + if (!$this->_newApiKey) { + $this->_newApiKey = new NewApiKeyList($this); } - return $this->_keys; + return $this->_newApiKey; } /** diff --git a/src/Twilio/Rest/Iam/V1/KeyInstance.php b/src/Twilio/Rest/Iam/V1/NewApiKeyInstance.php similarity index 94% rename from src/Twilio/Rest/Iam/V1/KeyInstance.php rename to src/Twilio/Rest/Iam/V1/NewApiKeyInstance.php index 1e97362512..d98719ff23 100644 --- a/src/Twilio/Rest/Iam/V1/KeyInstance.php +++ b/src/Twilio/Rest/Iam/V1/NewApiKeyInstance.php @@ -32,10 +32,10 @@ * @property string|null $secret * @property array|null $policy */ -class KeyInstance extends InstanceResource +class NewApiKeyInstance extends InstanceResource { /** - * Initialize the KeyInstance + * Initialize the NewApiKeyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload @@ -85,7 +85,7 @@ public function __get(string $name) */ public function __toString(): string { - return '[Twilio.Iam.V1.KeyInstance]'; + return '[Twilio.Iam.V1.NewApiKeyInstance]'; } } diff --git a/src/Twilio/Rest/Iam/V1/KeyList.php b/src/Twilio/Rest/Iam/V1/NewApiKeyList.php similarity index 88% rename from src/Twilio/Rest/Iam/V1/KeyList.php rename to src/Twilio/Rest/Iam/V1/NewApiKeyList.php index 02cc14132c..272b727c33 100644 --- a/src/Twilio/Rest/Iam/V1/KeyList.php +++ b/src/Twilio/Rest/Iam/V1/NewApiKeyList.php @@ -24,10 +24,10 @@ use Twilio\Serialize; -class KeyList extends ListResource +class NewApiKeyList extends ListResource { /** - * Construct the KeyList + * Construct the NewApiKeyList * * @param Version $version Version that contains the resource */ @@ -44,14 +44,14 @@ public function __construct( } /** - * Create the KeyInstance + * Create the NewApiKeyInstance * * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. * @param array|Options $options Optional Arguments - * @return KeyInstance Created KeyInstance + * @return NewApiKeyInstance Created NewApiKeyInstance * @throws TwilioException When an HTTP error occurs. */ - public function create(string $accountSid, array $options = []): KeyInstance + public function create(string $accountSid, array $options = []): NewApiKeyInstance { $options = new Values($options); @@ -70,7 +70,7 @@ public function create(string $accountSid, array $options = []): KeyInstance $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); - return new KeyInstance( + return new NewApiKeyInstance( $this->version, $payload ); @@ -84,6 +84,6 @@ public function create(string $accountSid, array $options = []): KeyInstance */ public function __toString(): string { - return '[Twilio.Iam.V1.KeyList]'; + return '[Twilio.Iam.V1.NewApiKeyList]'; } } diff --git a/src/Twilio/Rest/Iam/V1/KeyOptions.php b/src/Twilio/Rest/Iam/V1/NewApiKeyOptions.php similarity index 93% rename from src/Twilio/Rest/Iam/V1/KeyOptions.php rename to src/Twilio/Rest/Iam/V1/NewApiKeyOptions.php index adb2e35fa3..4d096cffce 100644 --- a/src/Twilio/Rest/Iam/V1/KeyOptions.php +++ b/src/Twilio/Rest/Iam/V1/NewApiKeyOptions.php @@ -18,13 +18,13 @@ use Twilio\Options; use Twilio\Values; -abstract class KeyOptions +abstract class NewApiKeyOptions { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $keyType * @param array $policy The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). - * @return CreateKeyOptions Options builder + * @return CreateNewApiKeyOptions Options builder */ public static function create( @@ -32,9 +32,9 @@ public static function create( string $keyType = Values::NONE, array $policy = Values::ARRAY_NONE - ): CreateKeyOptions + ): CreateNewApiKeyOptions { - return new CreateKeyOptions( + return new CreateNewApiKeyOptions( $friendlyName, $keyType, $policy @@ -43,7 +43,7 @@ public static function create( } -class CreateKeyOptions extends Options +class CreateNewApiKeyOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. @@ -104,7 +104,7 @@ public function setPolicy(array $policy): self public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); - return '[Twilio.Iam.V1.CreateKeyOptions ' . $options . ']'; + return '[Twilio.Iam.V1.CreateNewApiKeyOptions ' . $options . ']'; } } diff --git a/src/Twilio/Rest/Iam/V1/KeyPage.php b/src/Twilio/Rest/Iam/V1/NewApiKeyPage.php similarity index 81% rename from src/Twilio/Rest/Iam/V1/KeyPage.php rename to src/Twilio/Rest/Iam/V1/NewApiKeyPage.php index e9cd620d51..2bfeefe95c 100644 --- a/src/Twilio/Rest/Iam/V1/KeyPage.php +++ b/src/Twilio/Rest/Iam/V1/NewApiKeyPage.php @@ -19,7 +19,7 @@ use Twilio\Page; use Twilio\Version; -class KeyPage extends Page +class NewApiKeyPage extends Page { /** * @param Version $version Version that contains the resource @@ -36,11 +36,11 @@ public function __construct(Version $version, Response $response, array $solutio /** * @param array $payload Payload response from the API - * @return KeyInstance \Twilio\Rest\Iam\V1\KeyInstance + * @return NewApiKeyInstance \Twilio\Rest\Iam\V1\NewApiKeyInstance */ - public function buildInstance(array $payload): KeyInstance + public function buildInstance(array $payload): NewApiKeyInstance { - return new KeyInstance($this->version, $payload); + return new NewApiKeyInstance($this->version, $payload); } /** @@ -50,6 +50,6 @@ public function buildInstance(array $payload): KeyInstance */ public function __toString(): string { - return '[Twilio.Iam.V1.KeyPage]'; + return '[Twilio.Iam.V1.NewApiKeyPage]'; } } diff --git a/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageModels.php b/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageModels.php index 42e302eb3f..7209a53139 100644 --- a/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageModels.php +++ b/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageModels.php @@ -79,8 +79,8 @@ class MarketplaceV1InstalledAddOnInstalledAddOnUsage implements \JsonSerializabl protected $totalSubmitted; protected $billableItems; public function __construct(array $payload = []) { - $this->totalSubmitted = Values::array_get($payload, 'totalSubmitted'); - $this->billableItems = Values::array_get($payload, 'billableItems'); + $this->totalSubmitted = Values::array_get($payload, 'total_submitted'); + $this->billableItems = Values::array_get($payload, 'billable_items'); } public function toArray(): array diff --git a/src/Twilio/Rest/Marketplace/V1/ReferralConversionModels.php b/src/Twilio/Rest/Marketplace/V1/ReferralConversionModels.php index ef4d75997f..73cdda0120 100644 --- a/src/Twilio/Rest/Marketplace/V1/ReferralConversionModels.php +++ b/src/Twilio/Rest/Marketplace/V1/ReferralConversionModels.php @@ -35,7 +35,7 @@ class CreateReferralConversionRequest implements \JsonSerializable */ protected $referralAccountSid; public function __construct(array $payload = []) { - $this->referralAccountSid = Values::array_get($payload, 'referralAccountSid'); + $this->referralAccountSid = Values::array_get($payload, 'referral_account_sid'); } public function toArray(): array