Skip to content

Commit e8dd710

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

Some content is hidden

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

42 files changed

+382
-351
lines changed

src/Twilio/Rest/Events/V1/EventTypeResource.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ public static EventTypeResource Fetch(FetchEventTypeOptions options, ITwilioRest
6767
/// <param name="options"> Fetch EventType parameters </param>
6868
/// <param name="client"> Client to make requests to Twilio </param>
6969
/// <returns> Task that resolves to A single instance of EventType </returns>
70-
public static async System.Threading.Tasks.Task<EventTypeResource> FetchAsync(FetchEventTypeOptions options, ITwilioRestClient client = null)
70+
public static async System.Threading.Tasks.Task<EventTypeResource> FetchAsync(FetchEventTypeOptions 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 EventTypeResource Fetch(
9191
/// <param name="pathType"> A string that uniquely identifies this Event Type. </param>
9292
/// <param name="client"> Client to make requests to Twilio </param>
9393
/// <returns> Task that resolves to A single instance of EventType </returns>
94-
public static async System.Threading.Tasks.Task<EventTypeResource> FetchAsync(string pathType, ITwilioRestClient client = null)
94+
public static async System.Threading.Tasks.Task<EventTypeResource> FetchAsync(string pathType, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
9595
{
9696
var options = new FetchEventTypeOptions(pathType){ };
97-
return await FetchAsync(options, client);
97+
return await FetchAsync(options, client, cancellationToken);
9898
}
9999
#endif
100100

@@ -129,10 +129,10 @@ public static ResourceSet<EventTypeResource> Read(ReadEventTypeOptions options,
129129
/// <param name="options"> Read EventType parameters </param>
130130
/// <param name="client"> Client to make requests to Twilio </param>
131131
/// <returns> Task that resolves to A single instance of EventType </returns>
132-
public static async System.Threading.Tasks.Task<ResourceSet<EventTypeResource>> ReadAsync(ReadEventTypeOptions options, ITwilioRestClient client = null)
132+
public static async System.Threading.Tasks.Task<ResourceSet<EventTypeResource>> ReadAsync(ReadEventTypeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
133133
{
134134
client = client ?? TwilioClient.GetRestClient();
135-
var response = await client.RequestAsync(BuildReadRequest(options, client));
135+
var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
136136

137137
var page = Page<EventTypeResource>.FromJson("types", response.Content);
138138
return new ResourceSet<EventTypeResource>(page, options, client);
@@ -168,7 +168,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<EventTypeResource>>
168168
ITwilioRestClient client = null)
169169
{
170170
var options = new ReadEventTypeOptions(){ SchemaId = schemaId, PageSize = pageSize, Limit = limit};
171-
return await ReadAsync(options, client);
171+
return await ReadAsync(options, client, cancellationToken);
172172
}
173173
#endif
174174

src/Twilio/Rest/Events/V1/Schema/SchemaVersionResource.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ public static SchemaVersionResource Fetch(FetchSchemaVersionOptions options, ITw
6969
/// <param name="options"> Fetch SchemaVersion parameters </param>
7070
/// <param name="client"> Client to make requests to Twilio </param>
7171
/// <returns> Task that resolves to A single instance of SchemaVersion </returns>
72-
public static async System.Threading.Tasks.Task<SchemaVersionResource> FetchAsync(FetchSchemaVersionOptions options, ITwilioRestClient client = null)
72+
public static async System.Threading.Tasks.Task<SchemaVersionResource> FetchAsync(FetchSchemaVersionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
7373
{
7474
client = client ?? TwilioClient.GetRestClient();
75-
var response = await client.RequestAsync(BuildFetchRequest(options, client));
75+
var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
7676
return FromJson(response.Content);
7777
}
7878
#endif
@@ -99,7 +99,7 @@ public static SchemaVersionResource Fetch(
9999
public static async System.Threading.Tasks.Task<SchemaVersionResource> FetchAsync(string pathId, int? pathSchemaVersion, ITwilioRestClient client = null)
100100
{
101101
var options = new FetchSchemaVersionOptions(pathId, pathSchemaVersion){ };
102-
return await FetchAsync(options, client);
102+
return await FetchAsync(options, client, cancellationToken);
103103
}
104104
#endif
105105

@@ -136,10 +136,10 @@ public static ResourceSet<SchemaVersionResource> Read(ReadSchemaVersionOptions o
136136
/// <param name="options"> Read SchemaVersion parameters </param>
137137
/// <param name="client"> Client to make requests to Twilio </param>
138138
/// <returns> Task that resolves to A single instance of SchemaVersion </returns>
139-
public static async System.Threading.Tasks.Task<ResourceSet<SchemaVersionResource>> ReadAsync(ReadSchemaVersionOptions options, ITwilioRestClient client = null)
139+
public static async System.Threading.Tasks.Task<ResourceSet<SchemaVersionResource>> ReadAsync(ReadSchemaVersionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
140140
{
141141
client = client ?? TwilioClient.GetRestClient();
142-
var response = await client.RequestAsync(BuildReadRequest(options, client));
142+
var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
143143

144144
var page = Page<SchemaVersionResource>.FromJson("schema_versions", response.Content);
145145
return new ResourceSet<SchemaVersionResource>(page, options, client);
@@ -175,7 +175,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<SchemaVersionResourc
175175
ITwilioRestClient client = null)
176176
{
177177
var options = new ReadSchemaVersionOptions(pathId){ PageSize = pageSize, Limit = limit};
178-
return await ReadAsync(options, client);
178+
return await ReadAsync(options, client, cancellationToken);
179179
}
180180
#endif
181181

src/Twilio/Rest/Events/V1/SchemaResource.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ public static SchemaResource Fetch(FetchSchemaOptions options, ITwilioRestClient
6767
/// <param name="options"> Fetch Schema parameters </param>
6868
/// <param name="client"> Client to make requests to Twilio </param>
6969
/// <returns> Task that resolves to A single instance of Schema </returns>
70-
public static async System.Threading.Tasks.Task<SchemaResource> FetchAsync(FetchSchemaOptions options, ITwilioRestClient client = null)
70+
public static async System.Threading.Tasks.Task<SchemaResource> FetchAsync(FetchSchemaOptions 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 SchemaResource Fetch(
9191
/// <param name="pathId"> The unique identifier of the schema. Each schema can have multiple versions, that share the same id. </param>
9292
/// <param name="client"> Client to make requests to Twilio </param>
9393
/// <returns> Task that resolves to A single instance of Schema </returns>
94-
public static async System.Threading.Tasks.Task<SchemaResource> FetchAsync(string pathId, ITwilioRestClient client = null)
94+
public static async System.Threading.Tasks.Task<SchemaResource> FetchAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
9595
{
9696
var options = new FetchSchemaOptions(pathId){ };
97-
return await FetchAsync(options, client);
97+
return await FetchAsync(options, client, cancellationToken);
9898
}
9999
#endif
100100

src/Twilio/Rest/Events/V1/Sink/SinkTestResource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ public static SinkTestResource Create(CreateSinkTestOptions options, ITwilioRest
6868
/// <param name="options"> Create SinkTest parameters </param>
6969
/// <param name="client"> Client to make requests to Twilio </param>
7070
/// <returns> Task that resolves to A single instance of SinkTest </returns>
71-
public static async System.Threading.Tasks.Task<SinkTestResource> CreateAsync(CreateSinkTestOptions options, ITwilioRestClient client = null)
71+
public static async System.Threading.Tasks.Task<SinkTestResource> CreateAsync(CreateSinkTestOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
7272
{
7373
client = client ?? TwilioClient.GetRestClient();
74-
var response = await client.RequestAsync(BuildCreateRequest(options, client));
74+
var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
7575
return FromJson(response.Content);
7676
}
7777
#endif
@@ -98,7 +98,7 @@ public static async System.Threading.Tasks.Task<SinkTestResource> CreateAsync(
9898
ITwilioRestClient client = null)
9999
{
100100
var options = new CreateSinkTestOptions(pathSid){ };
101-
return await CreateAsync(options, client);
101+
return await CreateAsync(options, client, cancellationToken);
102102
}
103103
#endif
104104

src/Twilio/Rest/Events/V1/Sink/SinkValidateResource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ public static SinkValidateResource Create(CreateSinkValidateOptions options, ITw
6868
/// <param name="options"> Create SinkValidate parameters </param>
6969
/// <param name="client"> Client to make requests to Twilio </param>
7070
/// <returns> Task that resolves to A single instance of SinkValidate </returns>
71-
public static async System.Threading.Tasks.Task<SinkValidateResource> CreateAsync(CreateSinkValidateOptions options, ITwilioRestClient client = null)
71+
public static async System.Threading.Tasks.Task<SinkValidateResource> CreateAsync(CreateSinkValidateOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
7272
{
7373
client = client ?? TwilioClient.GetRestClient();
74-
var response = await client.RequestAsync(BuildCreateRequest(options, client));
74+
var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
7575
return FromJson(response.Content);
7676
}
7777
#endif
@@ -102,7 +102,7 @@ public static async System.Threading.Tasks.Task<SinkValidateResource> CreateAsyn
102102
ITwilioRestClient client = null)
103103
{
104104
var options = new CreateSinkValidateOptions(pathSid, testId){ };
105-
return await CreateAsync(options, client);
105+
return await CreateAsync(options, client, cancellationToken);
106106
}
107107
#endif
108108

0 commit comments

Comments
 (0)