Skip to content

Commit f934012

Browse files
committed
Bulk Regex Add of CancellationToken Parameters
1 parent 68278b7 commit f934012

30 files changed

+375
-343
lines changed

src/Twilio/Rest/Assistants/V1/Assistant/AssistantsKnowledgeResource.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ public static AssistantsKnowledgeResource Create(CreateAssistantsKnowledgeOption
7070
/// <param name="options"> Create AssistantsKnowledge parameters </param>
7171
/// <param name="client"> Client to make requests to Twilio </param>
7272
/// <returns> Task that resolves to A single instance of AssistantsKnowledge </returns>
73-
public static async System.Threading.Tasks.Task<AssistantsKnowledgeResource> CreateAsync(CreateAssistantsKnowledgeOptions options, ITwilioRestClient client = null)
73+
public static async System.Threading.Tasks.Task<AssistantsKnowledgeResource> CreateAsync(CreateAssistantsKnowledgeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
7474
{
7575
client = client ?? TwilioClient.GetRestClient();
76-
var response = await client.RequestAsync(BuildCreateRequest(options, client));
76+
var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
7777
return FromJson(response.Content);
7878
}
7979
#endif
@@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task<AssistantsKnowledgeResource> Cre
104104
ITwilioRestClient client = null)
105105
{
106106
var options = new CreateAssistantsKnowledgeOptions(pathAssistantId, pathId){ };
107-
return await CreateAsync(options, client);
107+
return await CreateAsync(options, client, cancellationToken);
108108
}
109109
#endif
110110

@@ -147,11 +147,12 @@ public static bool Delete(DeleteAssistantsKnowledgeOptions options, ITwilioRestC
147147
/// <param name="options"> Delete AssistantsKnowledge parameters </param>
148148
/// <param name="client"> Client to make requests to Twilio </param>
149149
/// <returns> Task that resolves to A single instance of AssistantsKnowledge </returns>
150-
public static async System.Threading.Tasks.Task<bool> DeleteAsync(DeleteAssistantsKnowledgeOptions options,
151-
ITwilioRestClient client = null)
150+
public static async System.Threading.Tasks.Task<bool> DeleteAsync(DeleteAssistantsKnowledgeOptions options,
151+
ITwilioRestClient client = null,
152+
CancellationToken cancellationToken = default)
152153
{
153154
client = client ?? TwilioClient.GetRestClient();
154-
var response = await client.RequestAsync(BuildDeleteRequest(options, client));
155+
var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken);
155156
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
156157
}
157158
#endif
@@ -176,7 +177,7 @@ public static bool Delete(string pathAssistantId, string pathId, ITwilioRestClie
176177
public static async System.Threading.Tasks.Task<bool> DeleteAsync(string pathAssistantId, string pathId, ITwilioRestClient client = null)
177178
{
178179
var options = new DeleteAssistantsKnowledgeOptions(pathAssistantId, pathId) ;
179-
return await DeleteAsync(options, client);
180+
return await DeleteAsync(options, client, cancellationToken);
180181
}
181182
#endif
182183

@@ -213,10 +214,10 @@ public static ResourceSet<AssistantsKnowledgeResource> Read(ReadAssistantsKnowle
213214
/// <param name="options"> Read AssistantsKnowledge parameters </param>
214215
/// <param name="client"> Client to make requests to Twilio </param>
215216
/// <returns> Task that resolves to A single instance of AssistantsKnowledge </returns>
216-
public static async System.Threading.Tasks.Task<ResourceSet<AssistantsKnowledgeResource>> ReadAsync(ReadAssistantsKnowledgeOptions options, ITwilioRestClient client = null)
217+
public static async System.Threading.Tasks.Task<ResourceSet<AssistantsKnowledgeResource>> ReadAsync(ReadAssistantsKnowledgeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
217218
{
218219
client = client ?? TwilioClient.GetRestClient();
219-
var response = await client.RequestAsync(BuildReadRequest(options, client));
220+
var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
220221

221222
var page = Page<AssistantsKnowledgeResource>.FromJson("knowledge", response.Content);
222223
return new ResourceSet<AssistantsKnowledgeResource>(page, options, client);
@@ -252,7 +253,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<AssistantsKnowledgeR
252253
ITwilioRestClient client = null)
253254
{
254255
var options = new ReadAssistantsKnowledgeOptions(pathAssistantId){ PageSize = pageSize, Limit = limit};
255-
return await ReadAsync(options, client);
256+
return await ReadAsync(options, client, cancellationToken);
256257
}
257258
#endif
258259

src/Twilio/Rest/Assistants/V1/Assistant/AssistantsToolResource.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ public static AssistantsToolResource Create(CreateAssistantsToolOptions options,
7070
/// <param name="options"> Create AssistantsTool parameters </param>
7171
/// <param name="client"> Client to make requests to Twilio </param>
7272
/// <returns> Task that resolves to A single instance of AssistantsTool </returns>
73-
public static async System.Threading.Tasks.Task<AssistantsToolResource> CreateAsync(CreateAssistantsToolOptions options, ITwilioRestClient client = null)
73+
public static async System.Threading.Tasks.Task<AssistantsToolResource> CreateAsync(CreateAssistantsToolOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
7474
{
7575
client = client ?? TwilioClient.GetRestClient();
76-
var response = await client.RequestAsync(BuildCreateRequest(options, client));
76+
var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
7777
return FromJson(response.Content);
7878
}
7979
#endif
@@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task<AssistantsToolResource> CreateAs
104104
ITwilioRestClient client = null)
105105
{
106106
var options = new CreateAssistantsToolOptions(pathAssistantId, pathId){ };
107-
return await CreateAsync(options, client);
107+
return await CreateAsync(options, client, cancellationToken);
108108
}
109109
#endif
110110

@@ -147,11 +147,12 @@ public static bool Delete(DeleteAssistantsToolOptions options, ITwilioRestClient
147147
/// <param name="options"> Delete AssistantsTool parameters </param>
148148
/// <param name="client"> Client to make requests to Twilio </param>
149149
/// <returns> Task that resolves to A single instance of AssistantsTool </returns>
150-
public static async System.Threading.Tasks.Task<bool> DeleteAsync(DeleteAssistantsToolOptions options,
151-
ITwilioRestClient client = null)
150+
public static async System.Threading.Tasks.Task<bool> DeleteAsync(DeleteAssistantsToolOptions options,
151+
ITwilioRestClient client = null,
152+
CancellationToken cancellationToken = default)
152153
{
153154
client = client ?? TwilioClient.GetRestClient();
154-
var response = await client.RequestAsync(BuildDeleteRequest(options, client));
155+
var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken);
155156
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
156157
}
157158
#endif
@@ -176,7 +177,7 @@ public static bool Delete(string pathAssistantId, string pathId, ITwilioRestClie
176177
public static async System.Threading.Tasks.Task<bool> DeleteAsync(string pathAssistantId, string pathId, ITwilioRestClient client = null)
177178
{
178179
var options = new DeleteAssistantsToolOptions(pathAssistantId, pathId) ;
179-
return await DeleteAsync(options, client);
180+
return await DeleteAsync(options, client, cancellationToken);
180181
}
181182
#endif
182183

@@ -213,10 +214,10 @@ public static ResourceSet<AssistantsToolResource> Read(ReadAssistantsToolOptions
213214
/// <param name="options"> Read AssistantsTool parameters </param>
214215
/// <param name="client"> Client to make requests to Twilio </param>
215216
/// <returns> Task that resolves to A single instance of AssistantsTool </returns>
216-
public static async System.Threading.Tasks.Task<ResourceSet<AssistantsToolResource>> ReadAsync(ReadAssistantsToolOptions options, ITwilioRestClient client = null)
217+
public static async System.Threading.Tasks.Task<ResourceSet<AssistantsToolResource>> ReadAsync(ReadAssistantsToolOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
217218
{
218219
client = client ?? TwilioClient.GetRestClient();
219-
var response = await client.RequestAsync(BuildReadRequest(options, client));
220+
var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
220221

221222
var page = Page<AssistantsToolResource>.FromJson("tools", response.Content);
222223
return new ResourceSet<AssistantsToolResource>(page, options, client);
@@ -252,7 +253,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<AssistantsToolResour
252253
ITwilioRestClient client = null)
253254
{
254255
var options = new ReadAssistantsToolOptions(pathAssistantId){ PageSize = pageSize, Limit = limit};
255-
return await ReadAsync(options, client);
256+
return await ReadAsync(options, client, cancellationToken);
256257
}
257258
#endif
258259

src/Twilio/Rest/Assistants/V1/Assistant/FeedbackResource.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ public static FeedbackResource Create(CreateFeedbackOptions options, ITwilioRest
112112
/// <param name="options"> Create Feedback parameters </param>
113113
/// <param name="client"> Client to make requests to Twilio </param>
114114
/// <returns> Task that resolves to A single instance of Feedback </returns>
115-
public static async System.Threading.Tasks.Task<FeedbackResource> CreateAsync(CreateFeedbackOptions options, ITwilioRestClient client = null)
115+
public static async System.Threading.Tasks.Task<FeedbackResource> CreateAsync(CreateFeedbackOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
116116
{
117117
client = client ?? TwilioClient.GetRestClient();
118-
var response = await client.RequestAsync(BuildCreateRequest(options, client));
118+
var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
119119
return FromJson(response.Content);
120120
}
121121
#endif
@@ -146,7 +146,7 @@ public static async System.Threading.Tasks.Task<FeedbackResource> CreateAsync(
146146
ITwilioRestClient client = null)
147147
{
148148
var options = new CreateFeedbackOptions(pathId, assistantsV1ServiceCreateFeedbackRequest){ };
149-
return await CreateAsync(options, client);
149+
return await CreateAsync(options, client, cancellationToken);
150150
}
151151
#endif
152152

@@ -183,10 +183,10 @@ public static ResourceSet<FeedbackResource> Read(ReadFeedbackOptions options, IT
183183
/// <param name="options"> Read Feedback parameters </param>
184184
/// <param name="client"> Client to make requests to Twilio </param>
185185
/// <returns> Task that resolves to A single instance of Feedback </returns>
186-
public static async System.Threading.Tasks.Task<ResourceSet<FeedbackResource>> ReadAsync(ReadFeedbackOptions options, ITwilioRestClient client = null)
186+
public static async System.Threading.Tasks.Task<ResourceSet<FeedbackResource>> ReadAsync(ReadFeedbackOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
187187
{
188188
client = client ?? TwilioClient.GetRestClient();
189-
var response = await client.RequestAsync(BuildReadRequest(options, client));
189+
var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
190190

191191
var page = Page<FeedbackResource>.FromJson("feedbacks", response.Content);
192192
return new ResourceSet<FeedbackResource>(page, options, client);
@@ -222,7 +222,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<FeedbackResource>> R
222222
ITwilioRestClient client = null)
223223
{
224224
var options = new ReadFeedbackOptions(pathId){ PageSize = pageSize, Limit = limit};
225-
return await ReadAsync(options, client);
225+
return await ReadAsync(options, client, cancellationToken);
226226
}
227227
#endif
228228

src/Twilio/Rest/Assistants/V1/Assistant/MessageResource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ public static MessageResource Create(CreateMessageOptions options, ITwilioRestCl
119119
/// <param name="options"> Create Message parameters </param>
120120
/// <param name="client"> Client to make requests to Twilio </param>
121121
/// <returns> Task that resolves to A single instance of Message </returns>
122-
public static async System.Threading.Tasks.Task<MessageResource> CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null)
122+
public static async System.Threading.Tasks.Task<MessageResource> CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
123123
{
124124
client = client ?? TwilioClient.GetRestClient();
125-
var response = await client.RequestAsync(BuildCreateRequest(options, client));
125+
var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
126126
return FromJson(response.Content);
127127
}
128128
#endif
@@ -153,7 +153,7 @@ public static async System.Threading.Tasks.Task<MessageResource> CreateAsync(
153153
ITwilioRestClient client = null)
154154
{
155155
var options = new CreateMessageOptions(pathId, assistantsV1ServiceAssistantSendMessageRequest){ };
156-
return await CreateAsync(options, client);
156+
return await CreateAsync(options, client, cancellationToken);
157157
}
158158
#endif
159159

0 commit comments

Comments
 (0)