Skip to content

Commit 8713861

Browse files
Bulk Regex Add of CancellationToken Parameters
1 parent 8c94585 commit 8713861

File tree

61 files changed

+713
-655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+713
-655
lines changed

src/Twilio/Rest/Insights/V1/Call/AnnotationResource.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ public static AnnotationResource Fetch(FetchAnnotationOptions options, ITwilioRe
9898
/// <param name="options"> Fetch Annotation parameters </param>
9999
/// <param name="client"> Client to make requests to Twilio </param>
100100
/// <returns> Task that resolves to A single instance of Annotation </returns>
101-
public static async System.Threading.Tasks.Task<AnnotationResource> FetchAsync(FetchAnnotationOptions options, ITwilioRestClient client = null)
101+
public static async System.Threading.Tasks.Task<AnnotationResource> FetchAsync(FetchAnnotationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
102102
{
103103
client = client ?? TwilioClient.GetRestClient();
104-
var response = await client.RequestAsync(BuildFetchRequest(options, client));
104+
var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
105105
return FromJson(response.Content);
106106
}
107107
#endif
@@ -122,10 +122,10 @@ public static AnnotationResource Fetch(
122122
/// <param name="pathCallSid"> The unique SID identifier of the Call. </param>
123123
/// <param name="client"> Client to make requests to Twilio </param>
124124
/// <returns> Task that resolves to A single instance of Annotation </returns>
125-
public static async System.Threading.Tasks.Task<AnnotationResource> FetchAsync(string pathCallSid, ITwilioRestClient client = null)
125+
public static async System.Threading.Tasks.Task<AnnotationResource> FetchAsync(string pathCallSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
126126
{
127127
var options = new FetchAnnotationOptions(pathCallSid){ };
128-
return await FetchAsync(options, client);
128+
return await FetchAsync(options, client, cancellationToken);
129129
}
130130
#endif
131131

@@ -163,11 +163,12 @@ public static AnnotationResource Update(UpdateAnnotationOptions options, ITwilio
163163
/// <param name="client"> Client to make requests to Twilio </param>
164164
/// <returns> Task that resolves to A single instance of Annotation </returns>
165165
#if !NET35
166-
public static async System.Threading.Tasks.Task<AnnotationResource> UpdateAsync(UpdateAnnotationOptions options,
167-
ITwilioRestClient client = null)
166+
public static async System.Threading.Tasks.Task<AnnotationResource> UpdateAsync(UpdateAnnotationOptions options,
167+
ITwilioRestClient client = null,
168+
CancellationToken cancellationToken = default)
168169
{
169170
client = client ?? TwilioClient.GetRestClient();
170-
var response = await client.RequestAsync(BuildUpdateRequest(options, client));
171+
var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken);
171172
return FromJson(response.Content);
172173
}
173174
#endif
@@ -222,7 +223,7 @@ public static async System.Threading.Tasks.Task<AnnotationResource> UpdateAsync(
222223
ITwilioRestClient client = null)
223224
{
224225
var options = new UpdateAnnotationOptions(pathCallSid){ AnsweredBy = answeredBy, ConnectivityIssue = connectivityIssue, QualityIssues = qualityIssues, Spam = spam, CallScore = callScore, Comment = comment, Incident = incident };
225-
return await UpdateAsync(options, client);
226+
return await UpdateAsync(options, client, cancellationToken);
226227
}
227228
#endif
228229

src/Twilio/Rest/Insights/V1/Call/CallSummaryResource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ public static CallSummaryResource Fetch(FetchCallSummaryOptions options, ITwilio
133133
/// <param name="options"> Fetch CallSummary parameters </param>
134134
/// <param name="client"> Client to make requests to Twilio </param>
135135
/// <returns> Task that resolves to A single instance of CallSummary </returns>
136-
public static async System.Threading.Tasks.Task<CallSummaryResource> FetchAsync(FetchCallSummaryOptions options, ITwilioRestClient client = null)
136+
public static async System.Threading.Tasks.Task<CallSummaryResource> FetchAsync(FetchCallSummaryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
137137
{
138138
client = client ?? TwilioClient.GetRestClient();
139-
var response = await client.RequestAsync(BuildFetchRequest(options, client));
139+
var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
140140
return FromJson(response.Content);
141141
}
142142
#endif
@@ -163,7 +163,7 @@ public static CallSummaryResource Fetch(
163163
public static async System.Threading.Tasks.Task<CallSummaryResource> FetchAsync(string pathCallSid, CallSummaryResource.ProcessingStateEnum processingState = null, ITwilioRestClient client = null)
164164
{
165165
var options = new FetchCallSummaryOptions(pathCallSid){ ProcessingState = processingState };
166-
return await FetchAsync(options, client);
166+
return await FetchAsync(options, client, cancellationToken);
167167
}
168168
#endif
169169

src/Twilio/Rest/Insights/V1/Call/EventResource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ public static ResourceSet<EventResource> Read(ReadEventOptions options, ITwilioR
9999
/// <param name="options"> Read Event parameters </param>
100100
/// <param name="client"> Client to make requests to Twilio </param>
101101
/// <returns> Task that resolves to A single instance of Event </returns>
102-
public static async System.Threading.Tasks.Task<ResourceSet<EventResource>> ReadAsync(ReadEventOptions options, ITwilioRestClient client = null)
102+
public static async System.Threading.Tasks.Task<ResourceSet<EventResource>> ReadAsync(ReadEventOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
103103
{
104104
client = client ?? TwilioClient.GetRestClient();
105-
var response = await client.RequestAsync(BuildReadRequest(options, client));
105+
var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
106106

107107
var page = Page<EventResource>.FromJson("events", response.Content);
108108
return new ResourceSet<EventResource>(page, options, client);
@@ -142,7 +142,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<EventResource>> Read
142142
ITwilioRestClient client = null)
143143
{
144144
var options = new ReadEventOptions(pathCallSid){ Edge = edge, PageSize = pageSize, Limit = limit};
145-
return await ReadAsync(options, client);
145+
return await ReadAsync(options, client, cancellationToken);
146146
}
147147
#endif
148148

src/Twilio/Rest/Insights/V1/Call/MetricResource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ public static ResourceSet<MetricResource> Read(ReadMetricOptions options, ITwili
9898
/// <param name="options"> Read Metric parameters </param>
9999
/// <param name="client"> Client to make requests to Twilio </param>
100100
/// <returns> Task that resolves to A single instance of Metric </returns>
101-
public static async System.Threading.Tasks.Task<ResourceSet<MetricResource>> ReadAsync(ReadMetricOptions options, ITwilioRestClient client = null)
101+
public static async System.Threading.Tasks.Task<ResourceSet<MetricResource>> ReadAsync(ReadMetricOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
102102
{
103103
client = client ?? TwilioClient.GetRestClient();
104-
var response = await client.RequestAsync(BuildReadRequest(options, client));
104+
var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
105105

106106
var page = Page<MetricResource>.FromJson("metrics", response.Content);
107107
return new ResourceSet<MetricResource>(page, options, client);
@@ -145,7 +145,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<MetricResource>> Rea
145145
ITwilioRestClient client = null)
146146
{
147147
var options = new ReadMetricOptions(pathCallSid){ Edge = edge, Direction = direction, PageSize = pageSize, Limit = limit};
148-
return await ReadAsync(options, client);
148+
return await ReadAsync(options, client, cancellationToken);
149149
}
150150
#endif
151151

src/Twilio/Rest/Insights/V1/CallResource.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ public static CallResource Fetch(FetchCallOptions options, ITwilioRestClient cli
6767
/// <param name="options"> Fetch Call parameters </param>
6868
/// <param name="client"> Client to make requests to Twilio </param>
6969
/// <returns> Task that resolves to A single instance of Call </returns>
70-
public static async System.Threading.Tasks.Task<CallResource> FetchAsync(FetchCallOptions options, ITwilioRestClient client = null)
70+
public static async System.Threading.Tasks.Task<CallResource> FetchAsync(FetchCallOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
7171
{
7272
client = client ?? TwilioClient.GetRestClient();
73-
var response = await client.RequestAsync(BuildFetchRequest(options, client));
73+
var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
7474
return FromJson(response.Content);
7575
}
7676
#endif
@@ -91,10 +91,10 @@ public static CallResource Fetch(
9191
/// <param name="pathSid"> </param>
9292
/// <param name="client"> Client to make requests to Twilio </param>
9393
/// <returns> Task that resolves to A single instance of Call </returns>
94-
public static async System.Threading.Tasks.Task<CallResource> FetchAsync(string pathSid, ITwilioRestClient client = null)
94+
public static async System.Threading.Tasks.Task<CallResource> FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
9595
{
9696
var options = new FetchCallOptions(pathSid){ };
97-
return await FetchAsync(options, client);
97+
return await FetchAsync(options, client, cancellationToken);
9898
}
9999
#endif
100100

src/Twilio/Rest/Insights/V1/CallSummariesResource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ public static ResourceSet<CallSummariesResource> Read(ReadCallSummariesOptions o
157157
/// <param name="options"> Read CallSummaries parameters </param>
158158
/// <param name="client"> Client to make requests to Twilio </param>
159159
/// <returns> Task that resolves to A single instance of CallSummaries </returns>
160-
public static async System.Threading.Tasks.Task<ResourceSet<CallSummariesResource>> ReadAsync(ReadCallSummariesOptions options, ITwilioRestClient client = null)
160+
public static async System.Threading.Tasks.Task<ResourceSet<CallSummariesResource>> ReadAsync(ReadCallSummariesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
161161
{
162162
client = client ?? TwilioClient.GetRestClient();
163-
var response = await client.RequestAsync(BuildReadRequest(options, client));
163+
var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
164164

165165
var page = Page<CallSummariesResource>.FromJson("call_summaries", response.Content);
166166
return new ResourceSet<CallSummariesResource>(page, options, client);
@@ -320,7 +320,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<CallSummariesResourc
320320
ITwilioRestClient client = null)
321321
{
322322
var options = new ReadCallSummariesOptions(){ From = from, To = to, FromCarrier = fromCarrier, ToCarrier = toCarrier, FromCountryCode = fromCountryCode, ToCountryCode = toCountryCode, VerifiedCaller = verifiedCaller, HasTag = hasTag, StartTime = startTime, EndTime = endTime, CallType = callType, CallState = callState, Direction = direction, ProcessingState = processingState, SortBy = sortBy, Subaccount = subaccount, AbnormalSession = abnormalSession, AnsweredBy = answeredBy, AnsweredByAnnotation = answeredByAnnotation, ConnectivityIssueAnnotation = connectivityIssueAnnotation, QualityIssueAnnotation = qualityIssueAnnotation, SpamAnnotation = spamAnnotation, CallScoreAnnotation = callScoreAnnotation, BrandedEnabled = brandedEnabled, VoiceIntegrityEnabled = voiceIntegrityEnabled, BrandedBundleSid = brandedBundleSid, VoiceIntegrityBundleSid = voiceIntegrityBundleSid, VoiceIntegrityUseCase = voiceIntegrityUseCase, BusinessProfileIdentity = businessProfileIdentity, BusinessProfileIndustry = businessProfileIndustry, BusinessProfileBundleSid = businessProfileBundleSid, BusinessProfileType = businessProfileType, PageSize = pageSize, Limit = limit};
323-
return await ReadAsync(options, client);
323+
return await ReadAsync(options, client, cancellationToken);
324324
}
325325
#endif
326326

src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantResource.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ public static ConferenceParticipantResource Fetch(FetchConferenceParticipantOpti
162162
/// <param name="options"> Fetch ConferenceParticipant parameters </param>
163163
/// <param name="client"> Client to make requests to Twilio </param>
164164
/// <returns> Task that resolves to A single instance of ConferenceParticipant </returns>
165-
public static async System.Threading.Tasks.Task<ConferenceParticipantResource> FetchAsync(FetchConferenceParticipantOptions options, ITwilioRestClient client = null)
165+
public static async System.Threading.Tasks.Task<ConferenceParticipantResource> FetchAsync(FetchConferenceParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
166166
{
167167
client = client ?? TwilioClient.GetRestClient();
168-
var response = await client.RequestAsync(BuildFetchRequest(options, client));
168+
var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
169169
return FromJson(response.Content);
170170
}
171171
#endif
@@ -198,7 +198,7 @@ public static ConferenceParticipantResource Fetch(
198198
public static async System.Threading.Tasks.Task<ConferenceParticipantResource> FetchAsync(string pathConferenceSid, string pathParticipantSid, string events = null, string metrics = null, ITwilioRestClient client = null)
199199
{
200200
var options = new FetchConferenceParticipantOptions(pathConferenceSid, pathParticipantSid){ Events = events,Metrics = metrics };
201-
return await FetchAsync(options, client);
201+
return await FetchAsync(options, client, cancellationToken);
202202
}
203203
#endif
204204

@@ -235,10 +235,10 @@ public static ResourceSet<ConferenceParticipantResource> Read(ReadConferencePart
235235
/// <param name="options"> Read ConferenceParticipant parameters </param>
236236
/// <param name="client"> Client to make requests to Twilio </param>
237237
/// <returns> Task that resolves to A single instance of ConferenceParticipant </returns>
238-
public static async System.Threading.Tasks.Task<ResourceSet<ConferenceParticipantResource>> ReadAsync(ReadConferenceParticipantOptions options, ITwilioRestClient client = null)
238+
public static async System.Threading.Tasks.Task<ResourceSet<ConferenceParticipantResource>> ReadAsync(ReadConferenceParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
239239
{
240240
client = client ?? TwilioClient.GetRestClient();
241-
var response = await client.RequestAsync(BuildReadRequest(options, client));
241+
var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
242242

243243
var page = Page<ConferenceParticipantResource>.FromJson("participants", response.Content);
244244
return new ResourceSet<ConferenceParticipantResource>(page, options, client);
@@ -286,7 +286,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<ConferenceParticipan
286286
ITwilioRestClient client = null)
287287
{
288288
var options = new ReadConferenceParticipantOptions(pathConferenceSid){ ParticipantSid = participantSid, Label = label, Events = events, PageSize = pageSize, Limit = limit};
289-
return await ReadAsync(options, client);
289+
return await ReadAsync(options, client, cancellationToken);
290290
}
291291
#endif
292292

0 commit comments

Comments
 (0)