Skip to content

Commit 17e2f9b

Browse files
committed
[Librarian] Regenerated @ 05bdd0133313ac71fd55c97753894743b8f3cad9
1 parent 7ab4bbe commit 17e2f9b

15 files changed

+630
-5
lines changed

CHANGES.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
twilio-php Changelog
22
====================
33

4+
[2023-03-09] Version 7.0.0
5+
--------------------------
6+
**Note:** This release contains breaking changes, check our [upgrade guide](./UPGRADE.md#2023-03-08-6xx-to-7xx) for detailed migration notes.
7+
8+
**Library - Feature**
9+
- [PR #771](https://github.com/twilio/twilio-php/pull/771): Merge branch '7.0.0-rc' to main. Thanks to [@charan678](https://github.com/charan678)! **(breaking change)**
10+
11+
**Api**
12+
- Add new categories for whatsapp template
13+
14+
**Lookups**
15+
- Remove `validation_results` from the `default_output_properties`
16+
17+
**Supersim**
18+
- Add ESimProfile's `matching_id` and `activation_code` parameters to libraries
19+
20+
421
[2023-02-22] Version 6.44.4
522
---------------------------
623
**Api**

src/Twilio/Rest/FlexApi/V1/AssessmentsList.php

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Twilio\Exceptions\TwilioException;
2020
use Twilio\ListResource;
2121
use Twilio\Options;
22+
use Twilio\Stream;
2223
use Twilio\Values;
2324
use Twilio\Version;
2425

@@ -104,6 +105,106 @@ public function create(string $categoryId, string $categoryName, string $segment
104105
}
105106

106107

108+
/**
109+
* Reads AssessmentsInstance records from the API as a list.
110+
* Unlike stream(), this operation is eager and will load `limit` records into
111+
* memory before returning.
112+
*
113+
* @param array|Options $options Optional Arguments
114+
* @param int $limit Upper limit for the number of records to return. read()
115+
* guarantees to never return more than limit. Default is no
116+
* limit
117+
* @param mixed $pageSize Number of records to fetch per request, when not set
118+
* will use the default value of 50 records. If no
119+
* page_size is defined but a limit is defined, read()
120+
* will attempt to read the limit with the most
121+
* efficient page size, i.e. min(limit, 1000)
122+
* @return AssessmentsInstance[] Array of results
123+
*/
124+
public function read(array $options = [], int $limit = null, $pageSize = null): array
125+
{
126+
return \iterator_to_array($this->stream($options, $limit, $pageSize), false);
127+
}
128+
129+
/**
130+
* Streams AssessmentsInstance records from the API as a generator stream.
131+
* This operation lazily loads records as efficiently as possible until the
132+
* limit
133+
* is reached.
134+
* The results are returned as a generator, so this operation is memory
135+
* efficient.
136+
*
137+
* @param array|Options $options Optional Arguments
138+
* @param int $limit Upper limit for the number of records to return. stream()
139+
* guarantees to never return more than limit. Default is no
140+
* limit
141+
* @param mixed $pageSize Number of records to fetch per request, when not set
142+
* will use the default value of 50 records. If no
143+
* page_size is defined but a limit is defined, stream()
144+
* will attempt to read the limit with the most
145+
* efficient page size, i.e. min(limit, 1000)
146+
* @return Stream stream of results
147+
*/
148+
public function stream(array $options = [], int $limit = null, $pageSize = null): Stream
149+
{
150+
$limits = $this->version->readLimits($limit, $pageSize);
151+
152+
$page = $this->page($options, $limits['pageSize']);
153+
154+
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
155+
}
156+
157+
/**
158+
* Retrieve a single page of AssessmentsInstance records from the API.
159+
* Request is executed immediately
160+
*
161+
* @param mixed $pageSize Number of records to return, defaults to 50
162+
* @param string $pageToken PageToken provided by the API
163+
* @param mixed $pageNumber Page Number, this value is simply for client state
164+
* @return AssessmentsPage Page of AssessmentsInstance
165+
*/
166+
public function page(
167+
array $options = [],
168+
$pageSize = Values::NONE,
169+
string $pageToken = Values::NONE,
170+
$pageNumber = Values::NONE
171+
): AssessmentsPage
172+
{
173+
$options = new Values($options);
174+
175+
$params = Values::of([
176+
'SegmentId' =>
177+
$options['segmentId'],
178+
'Token' =>
179+
$options['token'],
180+
'PageToken' => $pageToken,
181+
'Page' => $pageNumber,
182+
'PageSize' => $pageSize,
183+
]);
184+
185+
$response = $this->version->page('GET', $this->uri, $params);
186+
187+
return new AssessmentsPage($this->version, $response, $this->solution);
188+
}
189+
190+
/**
191+
* Retrieve a specific page of AssessmentsInstance records from the API.
192+
* Request is executed immediately
193+
*
194+
* @param string $targetUrl API-generated URL for the requested results page
195+
* @return AssessmentsPage Page of AssessmentsInstance
196+
*/
197+
public function getPage(string $targetUrl): AssessmentsPage
198+
{
199+
$response = $this->version->getDomain()->getClient()->request(
200+
'GET',
201+
$targetUrl
202+
);
203+
204+
return new AssessmentsPage($this->version, $response, $this->solution);
205+
}
206+
207+
107208
/**
108209
* Constructs a AssessmentsContext
109210
*

src/Twilio/Rest/FlexApi/V1/AssessmentsOptions.php

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ public static function create(
3535
);
3636
}
3737

38+
/**
39+
* @param string $segmentId The id of the segment.
40+
* @param string $token The Token HTTP request header
41+
* @return ReadAssessmentsOptions Options builder
42+
*/
43+
public static function read(
44+
45+
string $segmentId = Values::NONE,
46+
string $token = Values::NONE
47+
48+
): ReadAssessmentsOptions
49+
{
50+
return new ReadAssessmentsOptions(
51+
$segmentId,
52+
$token
53+
);
54+
}
55+
3856
/**
3957
* @param string $token The Token HTTP request header
4058
* @return UpdateAssessmentsOptions Options builder
@@ -89,6 +107,58 @@ public function __toString(): string
89107
}
90108
}
91109

110+
class ReadAssessmentsOptions extends Options
111+
{
112+
/**
113+
* @param string $segmentId The id of the segment.
114+
* @param string $token The Token HTTP request header
115+
*/
116+
public function __construct(
117+
118+
string $segmentId = Values::NONE,
119+
string $token = Values::NONE
120+
121+
) {
122+
$this->options['segmentId'] = $segmentId;
123+
$this->options['token'] = $token;
124+
}
125+
126+
/**
127+
* The id of the segment.
128+
*
129+
* @param string $segmentId The id of the segment.
130+
* @return $this Fluent Builder
131+
*/
132+
public function setSegmentId(string $segmentId): self
133+
{
134+
$this->options['segmentId'] = $segmentId;
135+
return $this;
136+
}
137+
138+
/**
139+
* The Token HTTP request header
140+
*
141+
* @param string $token The Token HTTP request header
142+
* @return $this Fluent Builder
143+
*/
144+
public function setToken(string $token): self
145+
{
146+
$this->options['token'] = $token;
147+
return $this;
148+
}
149+
150+
/**
151+
* Provide a friendly representation
152+
*
153+
* @return string Machine friendly representation
154+
*/
155+
public function __toString(): string
156+
{
157+
$options = \http_build_query(Values::of($this->options), '', ' ');
158+
return '[Twilio.FlexApi.V1.ReadAssessmentsOptions ' . $options . ']';
159+
}
160+
}
161+
92162
class UpdateAssessmentsOptions extends Options
93163
{
94164
/**

src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionList.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,13 @@ public function __construct(
4949
*
5050
* @param string $categoryId The ID of the category
5151
* @param string $question The question.
52-
* @param string $description The description for the question.
5352
* @param string $answerSetId The answer_set for the question.
5453
* @param bool $allowNa The flag to enable for disable NA for answer.
5554
* @param array|Options $options Optional Arguments
5655
* @return InsightsQuestionnairesQuestionInstance Created InsightsQuestionnairesQuestionInstance
5756
* @throws TwilioException When an HTTP error occurs.
5857
*/
59-
public function create(string $categoryId, string $question, string $description, string $answerSetId, bool $allowNa, array $options = []): InsightsQuestionnairesQuestionInstance
58+
public function create(string $categoryId, string $question, string $answerSetId, bool $allowNa, array $options = []): InsightsQuestionnairesQuestionInstance
6059
{
6160

6261
$options = new Values($options);
@@ -66,12 +65,12 @@ public function create(string $categoryId, string $question, string $description
6665
$categoryId,
6766
'Question' =>
6867
$question,
69-
'Description' =>
70-
$description,
7168
'AnswerSetId' =>
7269
$answerSetId,
7370
'AllowNa' =>
7471
Serialize::booleanToString($allowNa),
72+
'Description' =>
73+
$options['description'],
7574
]);
7675

7776
$headers = Values::of(['Token' => $options['token']]);

src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionOptions.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,19 @@
2121
abstract class InsightsQuestionnairesQuestionOptions
2222
{
2323
/**
24+
* @param string $description The description for the question.
2425
* @param string $token The Token HTTP request header
2526
* @return CreateInsightsQuestionnairesQuestionOptions Options builder
2627
*/
2728
public static function create(
2829

30+
string $description = Values::NONE,
2931
string $token = Values::NONE
3032

3133
): CreateInsightsQuestionnairesQuestionOptions
3234
{
3335
return new CreateInsightsQuestionnairesQuestionOptions(
36+
$description,
3437
$token
3538
);
3639
}
@@ -100,16 +103,31 @@ public static function update(
100103
class CreateInsightsQuestionnairesQuestionOptions extends Options
101104
{
102105
/**
106+
* @param string $description The description for the question.
103107
* @param string $token The Token HTTP request header
104108
*/
105109
public function __construct(
106110

111+
string $description = Values::NONE,
107112
string $token = Values::NONE
108113

109114
) {
115+
$this->options['description'] = $description;
110116
$this->options['token'] = $token;
111117
}
112118

119+
/**
120+
* The description for the question.
121+
*
122+
* @param string $description The description for the question.
123+
* @return $this Fluent Builder
124+
*/
125+
public function setDescription(string $description): self
126+
{
127+
$this->options['description'] = $description;
128+
return $this;
129+
}
130+
113131
/**
114132
* The Token HTTP request header
115133
*
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?php
2+
3+
/**
4+
* This code was generated by
5+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
6+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
7+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
8+
*
9+
* Twilio - Microvisor
10+
* This is the public Twilio REST API.
11+
*
12+
* NOTE: This class is auto generated by OpenAPI Generator.
13+
* https://openapi-generator.tech
14+
* Do not edit the class manually.
15+
*/
16+
17+
18+
namespace Twilio\Rest\Microvisor\V1\App;
19+
20+
use Twilio\Exceptions\TwilioException;
21+
use Twilio\Version;
22+
use Twilio\InstanceContext;
23+
24+
25+
class AppManifestContext extends InstanceContext
26+
{
27+
/**
28+
* Initialize the AppManifestContext
29+
*
30+
* @param Version $version Version that contains the resource
31+
* @param string $appSid A 34-character string that uniquely identifies this App.
32+
*/
33+
public function __construct(
34+
Version $version,
35+
$appSid
36+
) {
37+
parent::__construct($version);
38+
39+
// Path Solution
40+
$this->solution = [
41+
'appSid' =>
42+
$appSid,
43+
];
44+
45+
$this->uri = '/Apps/' . \rawurlencode($appSid)
46+
.'/Manifest';
47+
}
48+
49+
/**
50+
* Fetch the AppManifestInstance
51+
*
52+
* @return AppManifestInstance Fetched AppManifestInstance
53+
* @throws TwilioException When an HTTP error occurs.
54+
*/
55+
public function fetch(): AppManifestInstance
56+
{
57+
58+
$payload = $this->version->fetch('GET', $this->uri);
59+
60+
return new AppManifestInstance(
61+
$this->version,
62+
$payload,
63+
$this->solution['appSid']
64+
);
65+
}
66+
67+
68+
/**
69+
* Provide a friendly representation
70+
*
71+
* @return string Machine friendly representation
72+
*/
73+
public function __toString(): string
74+
{
75+
$context = [];
76+
foreach ($this->solution as $key => $value) {
77+
$context[] = "$key=$value";
78+
}
79+
return '[Twilio.Microvisor.V1.AppManifestContext ' . \implode(' ', $context) . ']';
80+
}
81+
}

0 commit comments

Comments
 (0)