diff --git a/src/Twilio/Rest/PreviewIam/Organizations/AccountResource.cs b/src/Twilio/Rest/PreviewIam/Organizations/AccountResource.cs
index 54b1fc6d2..22687cb7b 100644
--- a/src/Twilio/Rest/PreviewIam/Organizations/AccountResource.cs
+++ b/src/Twilio/Rest/PreviewIam/Organizations/AccountResource.cs
@@ -84,10 +84,10 @@ public static AccountResource Fetch(FetchAccountOptions options, ITwilioRestClie
/// Fetch Account parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Account
- public static async System.Threading.Tasks.Task FetchAsync(FetchAccountOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchAccountOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -114,7 +114,7 @@ public static AccountResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathOrganizationSid, string pathAccountSid, ITwilioRestClient client = null)
{
var options = new FetchAccountOptions(pathOrganizationSid, pathAccountSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -151,10 +151,10 @@ public static ResourceSet Read(ReadAccountOptions options, ITwi
/// Read Account parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Account
- public static async System.Threading.Tasks.Task> ReadAsync(ReadAccountOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadAccountOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("content", response.Content);
return new ResourceSet(page, options, client);
@@ -190,7 +190,7 @@ public static async System.Threading.Tasks.Task> Re
ITwilioRestClient client = null)
{
var options = new ReadAccountOptions(pathOrganizationSid){ PageSize = pageSize, Limit = limit};
- return await ReadAsync(options, client);
+ return await ReadAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/PreviewIam/Organizations/RoleAssignmentResource.cs b/src/Twilio/Rest/PreviewIam/Organizations/RoleAssignmentResource.cs
index c334b792e..0d38bf639 100644
--- a/src/Twilio/Rest/PreviewIam/Organizations/RoleAssignmentResource.cs
+++ b/src/Twilio/Rest/PreviewIam/Organizations/RoleAssignmentResource.cs
@@ -105,10 +105,10 @@ public static RoleAssignmentResource Create(CreateRoleAssignmentOptions options,
/// Create RoleAssignment parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of RoleAssignment
- public static async System.Threading.Tasks.Task CreateAsync(CreateRoleAssignmentOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task CreateAsync(CreateRoleAssignmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildCreateRequest(options, client));
+ var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -139,7 +139,7 @@ public static async System.Threading.Tasks.Task CreateAs
ITwilioRestClient client = null)
{
var options = new CreateRoleAssignmentOptions(pathOrganizationSid, publicApiCreateRoleAssignmentRequest){ };
- return await CreateAsync(options, client);
+ return await CreateAsync(options, client, cancellationToken);
}
#endif
@@ -182,11 +182,12 @@ public static bool Delete(DeleteRoleAssignmentOptions options, ITwilioRestClient
/// Delete RoleAssignment parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of RoleAssignment
- public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleAssignmentOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleAssignmentOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildDeleteRequest(options, client));
+ var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken);
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
}
#endif
@@ -211,7 +212,7 @@ public static bool Delete(string pathOrganizationSid, string pathRoleAssignmentS
public static async System.Threading.Tasks.Task DeleteAsync(string pathOrganizationSid, string pathRoleAssignmentSid, ITwilioRestClient client = null)
{
var options = new DeleteRoleAssignmentOptions(pathOrganizationSid, pathRoleAssignmentSid) ;
- return await DeleteAsync(options, client);
+ return await DeleteAsync(options, client, cancellationToken);
}
#endif
@@ -248,10 +249,10 @@ public static ResourceSet Read(ReadRoleAssignmentOptions
/// Read RoleAssignment parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of RoleAssignment
- public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleAssignmentOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleAssignmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("content", response.Content);
return new ResourceSet(page, options, client);
@@ -295,7 +296,7 @@ public static async System.Threading.Tasks.Task Create User parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of User
- public static async System.Threading.Tasks.Task CreateAsync(CreateUserOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task CreateAsync(CreateUserOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildCreateRequest(options, client));
+ var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -303,7 +303,7 @@ public static async System.Threading.Tasks.Task CreateAsync(
ITwilioRestClient client = null)
{
var options = new CreateUserOptions(pathOrganizationSid, scimUser){ };
- return await CreateAsync(options, client);
+ return await CreateAsync(options, client, cancellationToken);
}
#endif
@@ -346,11 +346,12 @@ public static bool Delete(DeleteUserOptions options, ITwilioRestClient client =
/// Delete User parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of User
- public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildDeleteRequest(options, client));
+ var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken);
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
}
#endif
@@ -375,7 +376,7 @@ public static bool Delete(string pathOrganizationSid, string pathUserSid, ITwili
public static async System.Threading.Tasks.Task DeleteAsync(string pathOrganizationSid, string pathUserSid, ITwilioRestClient client = null)
{
var options = new DeleteUserOptions(pathOrganizationSid, pathUserSid) ;
- return await DeleteAsync(options, client);
+ return await DeleteAsync(options, client, cancellationToken);
}
#endif
@@ -414,10 +415,10 @@ public static UserResource Fetch(FetchUserOptions options, ITwilioRestClient cli
/// Fetch User parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of User
- public static async System.Threading.Tasks.Task FetchAsync(FetchUserOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchUserOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -444,7 +445,7 @@ public static UserResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathOrganizationSid, string pathUserSid, ITwilioRestClient client = null)
{
var options = new FetchUserOptions(pathOrganizationSid, pathUserSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -481,10 +482,10 @@ public static ResourceSet Read(ReadUserOptions options, ITwilioRes
/// Read User parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of User
- public static async System.Threading.Tasks.Task> ReadAsync(ReadUserOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadUserOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("Resources", response.Content);
return new ResourceSet(page, options, client);
@@ -520,7 +521,7 @@ public static async System.Threading.Tasks.Task> ReadA
ITwilioRestClient client = null)
{
var options = new ReadUserOptions(pathOrganizationSid){ Filter = filter, Limit = limit};
- return await ReadAsync(options, client);
+ return await ReadAsync(options, client, cancellationToken);
}
#endif
@@ -610,11 +611,12 @@ public static UserResource Update(UpdateUserOptions options, ITwilioRestClient c
/// Client to make requests to Twilio
/// Task that resolves to A single instance of User
#if !NET35
- public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildUpdateRequest(options, client));
+ var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -653,7 +655,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(
ITwilioRestClient client = null)
{
var options = new UpdateUserOptions(pathOrganizationSid, pathUserSid, scimUser){ IfMatch = ifMatch };
- return await UpdateAsync(options, client);
+ return await UpdateAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/PreviewIam/V1/AuthorizeResource.cs b/src/Twilio/Rest/PreviewIam/V1/AuthorizeResource.cs
index 95c78a2f6..ccf0ebb55 100644
--- a/src/Twilio/Rest/PreviewIam/V1/AuthorizeResource.cs
+++ b/src/Twilio/Rest/PreviewIam/V1/AuthorizeResource.cs
@@ -65,10 +65,10 @@ public static AuthorizeResource Fetch(FetchAuthorizeOptions options, ITwilioRest
/// Fetch Authorize parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Authorize
- public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizeOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetNoAuthRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -104,7 +104,7 @@ public static AuthorizeResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string responseType = null, string clientId = null, string redirectUri = null, string scope = null, string state = null, ITwilioRestClient client = null)
{
var options = new FetchAuthorizeOptions(){ ResponseType = responseType,ClientId = clientId,RedirectUri = redirectUri,Scope = scope,State = state };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/PreviewIam/V1/TokenResource.cs b/src/Twilio/Rest/PreviewIam/V1/TokenResource.cs
index 311407ac9..93c731eb0 100644
--- a/src/Twilio/Rest/PreviewIam/V1/TokenResource.cs
+++ b/src/Twilio/Rest/PreviewIam/V1/TokenResource.cs
@@ -66,10 +66,10 @@ public static TokenResource Create(CreateTokenOptions options, ITwilioRestClient
/// Create Token parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Token
- public static async System.Threading.Tasks.Task CreateAsync(CreateTokenOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task CreateAsync(CreateTokenOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetNoAuthRestClient();
- var response = await client.RequestAsync(BuildCreateRequest(options, client));
+ var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -124,7 +124,7 @@ public static async System.Threading.Tasks.Task CreateAsync(
ITwilioRestClient client = null)
{
var options = new CreateTokenOptions(grantType, clientId){ ClientSecret = clientSecret, Code = code, RedirectUri = redirectUri, Audience = audience, RefreshToken = refreshToken, Scope = scope };
- return await CreateAsync(options, client);
+ return await CreateAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Routes/V2/PhoneNumberResource.cs b/src/Twilio/Rest/Routes/V2/PhoneNumberResource.cs
index 0b58e238c..35321bfd0 100644
--- a/src/Twilio/Rest/Routes/V2/PhoneNumberResource.cs
+++ b/src/Twilio/Rest/Routes/V2/PhoneNumberResource.cs
@@ -67,10 +67,10 @@ public static PhoneNumberResource Fetch(FetchPhoneNumberOptions options, ITwilio
/// Fetch PhoneNumber parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of PhoneNumber
- public static async System.Threading.Tasks.Task FetchAsync(FetchPhoneNumberOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchPhoneNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -91,10 +91,10 @@ public static PhoneNumberResource Fetch(
/// The phone number in E.164 format
/// Client to make requests to Twilio
/// Task that resolves to A single instance of PhoneNumber
- public static async System.Threading.Tasks.Task FetchAsync(string pathPhoneNumber, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(string pathPhoneNumber, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
var options = new FetchPhoneNumberOptions(pathPhoneNumber){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -132,11 +132,12 @@ public static PhoneNumberResource Update(UpdatePhoneNumberOptions options, ITwil
/// Client to make requests to Twilio
/// Task that resolves to A single instance of PhoneNumber
#if !NET35
- public static async System.Threading.Tasks.Task UpdateAsync(UpdatePhoneNumberOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task UpdateAsync(UpdatePhoneNumberOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildUpdateRequest(options, client));
+ var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -171,7 +172,7 @@ public static async System.Threading.Tasks.Task UpdateAsync
ITwilioRestClient client = null)
{
var options = new UpdatePhoneNumberOptions(pathPhoneNumber){ VoiceRegion = voiceRegion, FriendlyName = friendlyName };
- return await UpdateAsync(options, client);
+ return await UpdateAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Routes/V2/SipDomainResource.cs b/src/Twilio/Rest/Routes/V2/SipDomainResource.cs
index c6c4331aa..ebc6679ca 100644
--- a/src/Twilio/Rest/Routes/V2/SipDomainResource.cs
+++ b/src/Twilio/Rest/Routes/V2/SipDomainResource.cs
@@ -67,10 +67,10 @@ public static SipDomainResource Fetch(FetchSipDomainOptions options, ITwilioRest
/// Fetch SipDomain parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of SipDomain
- public static async System.Threading.Tasks.Task FetchAsync(FetchSipDomainOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchSipDomainOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -91,10 +91,10 @@ public static SipDomainResource Fetch(
///
/// Client to make requests to Twilio
/// Task that resolves to A single instance of SipDomain
- public static async System.Threading.Tasks.Task FetchAsync(string pathSipDomain, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(string pathSipDomain, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
var options = new FetchSipDomainOptions(pathSipDomain){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -132,11 +132,12 @@ public static SipDomainResource Update(UpdateSipDomainOptions options, ITwilioRe
/// Client to make requests to Twilio
/// Task that resolves to A single instance of SipDomain
#if !NET35
- public static async System.Threading.Tasks.Task UpdateAsync(UpdateSipDomainOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task UpdateAsync(UpdateSipDomainOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildUpdateRequest(options, client));
+ var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -171,7 +172,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(
ITwilioRestClient client = null)
{
var options = new UpdateSipDomainOptions(pathSipDomain){ VoiceRegion = voiceRegion, FriendlyName = friendlyName };
- return await UpdateAsync(options, client);
+ return await UpdateAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Routes/V2/TrunkResource.cs b/src/Twilio/Rest/Routes/V2/TrunkResource.cs
index 2dad3c67b..b98c313a7 100644
--- a/src/Twilio/Rest/Routes/V2/TrunkResource.cs
+++ b/src/Twilio/Rest/Routes/V2/TrunkResource.cs
@@ -67,10 +67,10 @@ public static TrunkResource Fetch(FetchTrunkOptions options, ITwilioRestClient c
/// Fetch Trunk parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Trunk
- public static async System.Threading.Tasks.Task FetchAsync(FetchTrunkOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchTrunkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -91,10 +91,10 @@ public static TrunkResource Fetch(
/// The absolute URL of the SIP Trunk
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Trunk
- public static async System.Threading.Tasks.Task FetchAsync(string pathSipTrunkDomain, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(string pathSipTrunkDomain, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
var options = new FetchTrunkOptions(pathSipTrunkDomain){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -132,11 +132,12 @@ public static TrunkResource Update(UpdateTrunkOptions options, ITwilioRestClient
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Trunk
#if !NET35
- public static async System.Threading.Tasks.Task UpdateAsync(UpdateTrunkOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task UpdateAsync(UpdateTrunkOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildUpdateRequest(options, client));
+ var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -171,7 +172,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(
ITwilioRestClient client = null)
{
var options = new UpdateTrunkOptions(pathSipTrunkDomain){ VoiceRegion = voiceRegion, FriendlyName = friendlyName };
- return await UpdateAsync(options, client);
+ return await UpdateAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionResource.cs b/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionResource.cs
index 68826ab4c..5db21920e 100644
--- a/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionResource.cs
+++ b/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionResource.cs
@@ -85,10 +85,10 @@ public static AssetVersionResource Fetch(FetchAssetVersionOptions options, ITwil
/// Fetch AssetVersion parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of AssetVersion
- public static async System.Threading.Tasks.Task FetchAsync(FetchAssetVersionOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchAssetVersionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -118,7 +118,7 @@ public static AssetVersionResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathAssetSid, string pathSid, ITwilioRestClient client = null)
{
var options = new FetchAssetVersionOptions(pathServiceSid, pathAssetSid, pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -157,10 +157,10 @@ public static ResourceSet Read(ReadAssetVersionOptions opt
/// Read AssetVersion parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of AssetVersion
- public static async System.Threading.Tasks.Task> ReadAsync(ReadAssetVersionOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadAssetVersionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("asset_versions", response.Content);
return new ResourceSet(page, options, client);
@@ -200,7 +200,7 @@ public static async System.Threading.Tasks.Task Create Asset parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Asset
- public static async System.Threading.Tasks.Task CreateAsync(CreateAssetOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task CreateAsync(CreateAssetOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildCreateRequest(options, client));
+ var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -102,7 +102,7 @@ public static async System.Threading.Tasks.Task CreateAsync(
ITwilioRestClient client = null)
{
var options = new CreateAssetOptions(pathServiceSid, friendlyName){ };
- return await CreateAsync(options, client);
+ return await CreateAsync(options, client, cancellationToken);
}
#endif
@@ -145,11 +145,12 @@ public static bool Delete(DeleteAssetOptions options, ITwilioRestClient client =
/// Delete Asset parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Asset
- public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssetOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssetOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildDeleteRequest(options, client));
+ var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken);
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
}
#endif
@@ -174,7 +175,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie
public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null)
{
var options = new DeleteAssetOptions(pathServiceSid, pathSid) ;
- return await DeleteAsync(options, client);
+ return await DeleteAsync(options, client, cancellationToken);
}
#endif
@@ -213,10 +214,10 @@ public static AssetResource Fetch(FetchAssetOptions options, ITwilioRestClient c
/// Fetch Asset parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Asset
- public static async System.Threading.Tasks.Task FetchAsync(FetchAssetOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchAssetOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -243,7 +244,7 @@ public static AssetResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null)
{
var options = new FetchAssetOptions(pathServiceSid, pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -280,10 +281,10 @@ public static ResourceSet Read(ReadAssetOptions options, ITwilioR
/// Read Asset parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Asset
- public static async System.Threading.Tasks.Task> ReadAsync(ReadAssetOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadAssetOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("assets", response.Content);
return new ResourceSet(page, options, client);
@@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task> Read
ITwilioRestClient client = null)
{
var options = new ReadAssetOptions(pathServiceSid){ PageSize = pageSize, Limit = limit};
- return await ReadAsync(options, client);
+ return await ReadAsync(options, client, cancellationToken);
}
#endif
@@ -408,11 +409,12 @@ public static AssetResource Update(UpdateAssetOptions options, ITwilioRestClient
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Asset
#if !NET35
- public static async System.Threading.Tasks.Task UpdateAsync(UpdateAssetOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task UpdateAsync(UpdateAssetOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildUpdateRequest(options, client));
+ var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -447,7 +449,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(
ITwilioRestClient client = null)
{
var options = new UpdateAssetOptions(pathServiceSid, pathSid, friendlyName){ };
- return await UpdateAsync(options, client);
+ return await UpdateAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusResource.cs b/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusResource.cs
index 09d0d3022..56b56794c 100644
--- a/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusResource.cs
+++ b/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusResource.cs
@@ -83,10 +83,10 @@ public static BuildStatusResource Fetch(FetchBuildStatusOptions options, ITwilio
/// Fetch BuildStatus parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of BuildStatus
- public static async System.Threading.Tasks.Task FetchAsync(FetchBuildStatusOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchBuildStatusOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -113,7 +113,7 @@ public static BuildStatusResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null)
{
var options = new FetchBuildStatusOptions(pathServiceSid, pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Serverless/V1/Service/BuildResource.cs b/src/Twilio/Rest/Serverless/V1/Service/BuildResource.cs
index 52bfa2a50..16b4c680d 100644
--- a/src/Twilio/Rest/Serverless/V1/Service/BuildResource.cs
+++ b/src/Twilio/Rest/Serverless/V1/Service/BuildResource.cs
@@ -99,10 +99,10 @@ public static BuildResource Create(CreateBuildOptions options, ITwilioRestClient
/// Create Build parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Build
- public static async System.Threading.Tasks.Task CreateAsync(CreateBuildOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task CreateAsync(CreateBuildOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildCreateRequest(options, client));
+ var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -145,7 +145,7 @@ public static async System.Threading.Tasks.Task CreateAsync(
ITwilioRestClient client = null)
{
var options = new CreateBuildOptions(pathServiceSid){ AssetVersions = assetVersions, FunctionVersions = functionVersions, Dependencies = dependencies, Runtime = runtime };
- return await CreateAsync(options, client);
+ return await CreateAsync(options, client, cancellationToken);
}
#endif
@@ -188,11 +188,12 @@ public static bool Delete(DeleteBuildOptions options, ITwilioRestClient client =
/// Delete Build parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Build
- public static async System.Threading.Tasks.Task DeleteAsync(DeleteBuildOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task DeleteAsync(DeleteBuildOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildDeleteRequest(options, client));
+ var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken);
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
}
#endif
@@ -217,7 +218,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie
public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null)
{
var options = new DeleteBuildOptions(pathServiceSid, pathSid) ;
- return await DeleteAsync(options, client);
+ return await DeleteAsync(options, client, cancellationToken);
}
#endif
@@ -256,10 +257,10 @@ public static BuildResource Fetch(FetchBuildOptions options, ITwilioRestClient c
/// Fetch Build parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Build
- public static async System.Threading.Tasks.Task FetchAsync(FetchBuildOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchBuildOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -286,7 +287,7 @@ public static BuildResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null)
{
var options = new FetchBuildOptions(pathServiceSid, pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -323,10 +324,10 @@ public static ResourceSet Read(ReadBuildOptions options, ITwilioR
/// Read Build parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Build
- public static async System.Threading.Tasks.Task> ReadAsync(ReadBuildOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadBuildOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("builds", response.Content);
return new ResourceSet(page, options, client);
@@ -362,7 +363,7 @@ public static async System.Threading.Tasks.Task> Read
ITwilioRestClient client = null)
{
var options = new ReadBuildOptions(pathServiceSid){ PageSize = pageSize, Limit = limit};
- return await ReadAsync(options, client);
+ return await ReadAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentResource.cs b/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentResource.cs
index 644d94ac1..44b74c337 100644
--- a/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentResource.cs
+++ b/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentResource.cs
@@ -70,10 +70,10 @@ public static DeploymentResource Create(CreateDeploymentOptions options, ITwilio
/// Create Deployment parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Deployment
- public static async System.Threading.Tasks.Task CreateAsync(CreateDeploymentOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task CreateAsync(CreateDeploymentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildCreateRequest(options, client));
+ var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -112,7 +112,7 @@ public static async System.Threading.Tasks.Task CreateAsync(
ITwilioRestClient client = null)
{
var options = new CreateDeploymentOptions(pathServiceSid, pathEnvironmentSid){ BuildSid = buildSid, IsPlugin = isPlugin };
- return await CreateAsync(options, client);
+ return await CreateAsync(options, client, cancellationToken);
}
#endif
@@ -153,10 +153,10 @@ public static DeploymentResource Fetch(FetchDeploymentOptions options, ITwilioRe
/// Fetch Deployment parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Deployment
- public static async System.Threading.Tasks.Task FetchAsync(FetchDeploymentOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchDeploymentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -186,7 +186,7 @@ public static DeploymentResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathEnvironmentSid, string pathSid, ITwilioRestClient client = null)
{
var options = new FetchDeploymentOptions(pathServiceSid, pathEnvironmentSid, pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -225,10 +225,10 @@ public static ResourceSet Read(ReadDeploymentOptions options
/// Read Deployment parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Deployment
- public static async System.Threading.Tasks.Task> ReadAsync(ReadDeploymentOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadDeploymentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("deployments", response.Content);
return new ResourceSet(page, options, client);
@@ -268,7 +268,7 @@ public static async System.Threading.Tasks.Task>
ITwilioRestClient client = null)
{
var options = new ReadDeploymentOptions(pathServiceSid, pathEnvironmentSid){ PageSize = pageSize, Limit = limit};
- return await ReadAsync(options, client);
+ return await ReadAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Serverless/V1/Service/Environment/LogResource.cs b/src/Twilio/Rest/Serverless/V1/Service/Environment/LogResource.cs
index de7d2fdc8..d46bf77f6 100644
--- a/src/Twilio/Rest/Serverless/V1/Service/Environment/LogResource.cs
+++ b/src/Twilio/Rest/Serverless/V1/Service/Environment/LogResource.cs
@@ -85,10 +85,10 @@ public static LogResource Fetch(FetchLogOptions options, ITwilioRestClient clien
/// Fetch Log parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Log
- public static async System.Threading.Tasks.Task FetchAsync(FetchLogOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchLogOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -118,7 +118,7 @@ public static LogResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathEnvironmentSid, string pathSid, ITwilioRestClient client = null)
{
var options = new FetchLogOptions(pathServiceSid, pathEnvironmentSid, pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -157,10 +157,10 @@ public static ResourceSet Read(ReadLogOptions options, ITwilioRestC
/// Read Log parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Log
- public static async System.Threading.Tasks.Task> ReadAsync(ReadLogOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadLogOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("logs", response.Content);
return new ResourceSet(page, options, client);
@@ -212,7 +212,7 @@ public static async System.Threading.Tasks.Task> ReadAs
ITwilioRestClient client = null)
{
var options = new ReadLogOptions(pathServiceSid, pathEnvironmentSid){ FunctionSid = functionSid, StartDate = startDate, EndDate = endDate, PageSize = pageSize, Limit = limit};
- return await ReadAsync(options, client);
+ return await ReadAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableResource.cs b/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableResource.cs
index ca80aad3c..a82811113 100644
--- a/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableResource.cs
+++ b/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableResource.cs
@@ -70,10 +70,10 @@ public static VariableResource Create(CreateVariableOptions options, ITwilioRest
/// Create Variable parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Variable
- public static async System.Threading.Tasks.Task CreateAsync(CreateVariableOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task CreateAsync(CreateVariableOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildCreateRequest(options, client));
+ var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -112,7 +112,7 @@ public static async System.Threading.Tasks.Task CreateAsync(
ITwilioRestClient client = null)
{
var options = new CreateVariableOptions(pathServiceSid, pathEnvironmentSid, key, value){ };
- return await CreateAsync(options, client);
+ return await CreateAsync(options, client, cancellationToken);
}
#endif
@@ -157,11 +157,12 @@ public static bool Delete(DeleteVariableOptions options, ITwilioRestClient clien
/// Delete Variable parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Variable
- public static async System.Threading.Tasks.Task DeleteAsync(DeleteVariableOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task DeleteAsync(DeleteVariableOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildDeleteRequest(options, client));
+ var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken);
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
}
#endif
@@ -188,7 +189,7 @@ public static bool Delete(string pathServiceSid, string pathEnvironmentSid, stri
public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathEnvironmentSid, string pathSid, ITwilioRestClient client = null)
{
var options = new DeleteVariableOptions(pathServiceSid, pathEnvironmentSid, pathSid) ;
- return await DeleteAsync(options, client);
+ return await DeleteAsync(options, client, cancellationToken);
}
#endif
@@ -229,10 +230,10 @@ public static VariableResource Fetch(FetchVariableOptions options, ITwilioRestCl
/// Fetch Variable parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Variable
- public static async System.Threading.Tasks.Task FetchAsync(FetchVariableOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchVariableOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -262,7 +263,7 @@ public static VariableResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathEnvironmentSid, string pathSid, ITwilioRestClient client = null)
{
var options = new FetchVariableOptions(pathServiceSid, pathEnvironmentSid, pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -301,10 +302,10 @@ public static ResourceSet Read(ReadVariableOptions options, IT
/// Read Variable parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Variable
- public static async System.Threading.Tasks.Task> ReadAsync(ReadVariableOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadVariableOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("variables", response.Content);
return new ResourceSet(page, options, client);
@@ -344,7 +345,7 @@ public static async System.Threading.Tasks.Task> R
ITwilioRestClient client = null)
{
var options = new ReadVariableOptions(pathServiceSid, pathEnvironmentSid){ PageSize = pageSize, Limit = limit};
- return await ReadAsync(options, client);
+ return await ReadAsync(options, client, cancellationToken);
}
#endif
@@ -435,11 +436,12 @@ public static VariableResource Update(UpdateVariableOptions options, ITwilioRest
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Variable
#if !NET35
- public static async System.Threading.Tasks.Task UpdateAsync(UpdateVariableOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task UpdateAsync(UpdateVariableOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildUpdateRequest(options, client));
+ var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -482,7 +484,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(
ITwilioRestClient client = null)
{
var options = new UpdateVariableOptions(pathServiceSid, pathEnvironmentSid, pathSid){ Key = key, Value = value };
- return await UpdateAsync(options, client);
+ return await UpdateAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Serverless/V1/Service/EnvironmentResource.cs b/src/Twilio/Rest/Serverless/V1/Service/EnvironmentResource.cs
index 951f4c522..cae84b6a2 100644
--- a/src/Twilio/Rest/Serverless/V1/Service/EnvironmentResource.cs
+++ b/src/Twilio/Rest/Serverless/V1/Service/EnvironmentResource.cs
@@ -68,10 +68,10 @@ public static EnvironmentResource Create(CreateEnvironmentOptions options, ITwil
/// Create Environment parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Environment
- public static async System.Threading.Tasks.Task CreateAsync(CreateEnvironmentOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task CreateAsync(CreateEnvironmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildCreateRequest(options, client));
+ var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -106,7 +106,7 @@ public static async System.Threading.Tasks.Task CreateAsync
ITwilioRestClient client = null)
{
var options = new CreateEnvironmentOptions(pathServiceSid, uniqueName){ DomainSuffix = domainSuffix };
- return await CreateAsync(options, client);
+ return await CreateAsync(options, client, cancellationToken);
}
#endif
@@ -149,11 +149,12 @@ public static bool Delete(DeleteEnvironmentOptions options, ITwilioRestClient cl
/// Delete Environment parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Environment
- public static async System.Threading.Tasks.Task DeleteAsync(DeleteEnvironmentOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task DeleteAsync(DeleteEnvironmentOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildDeleteRequest(options, client));
+ var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken);
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
}
#endif
@@ -178,7 +179,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie
public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null)
{
var options = new DeleteEnvironmentOptions(pathServiceSid, pathSid) ;
- return await DeleteAsync(options, client);
+ return await DeleteAsync(options, client, cancellationToken);
}
#endif
@@ -217,10 +218,10 @@ public static EnvironmentResource Fetch(FetchEnvironmentOptions options, ITwilio
/// Fetch Environment parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Environment
- public static async System.Threading.Tasks.Task FetchAsync(FetchEnvironmentOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchEnvironmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -247,7 +248,7 @@ public static EnvironmentResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null)
{
var options = new FetchEnvironmentOptions(pathServiceSid, pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -284,10 +285,10 @@ public static ResourceSet Read(ReadEnvironmentOptions optio
/// Read Environment parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Environment
- public static async System.Threading.Tasks.Task> ReadAsync(ReadEnvironmentOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadEnvironmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("environments", response.Content);
return new ResourceSet(page, options, client);
@@ -323,7 +324,7 @@ public static async System.Threading.Tasks.Task
ITwilioRestClient client = null)
{
var options = new ReadEnvironmentOptions(pathServiceSid){ PageSize = pageSize, Limit = limit};
- return await ReadAsync(options, client);
+ return await ReadAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Serverless/V1/Service/Function/FunctionVersion/FunctionVersionContentResource.cs b/src/Twilio/Rest/Serverless/V1/Service/Function/FunctionVersion/FunctionVersionContentResource.cs
index 601a16610..0b984d25e 100644
--- a/src/Twilio/Rest/Serverless/V1/Service/Function/FunctionVersion/FunctionVersionContentResource.cs
+++ b/src/Twilio/Rest/Serverless/V1/Service/Function/FunctionVersion/FunctionVersionContentResource.cs
@@ -71,10 +71,10 @@ public static FunctionVersionContentResource Fetch(FetchFunctionVersionContentOp
/// Fetch FunctionVersionContent parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of FunctionVersionContent
- public static async System.Threading.Tasks.Task FetchAsync(FetchFunctionVersionContentOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchFunctionVersionContentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -104,7 +104,7 @@ public static FunctionVersionContentResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathFunctionSid, string pathSid, ITwilioRestClient client = null)
{
var options = new FetchFunctionVersionContentOptions(pathServiceSid, pathFunctionSid, pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Serverless/V1/Service/Function/FunctionVersionResource.cs b/src/Twilio/Rest/Serverless/V1/Service/Function/FunctionVersionResource.cs
index 0b391e294..16f80204b 100644
--- a/src/Twilio/Rest/Serverless/V1/Service/Function/FunctionVersionResource.cs
+++ b/src/Twilio/Rest/Serverless/V1/Service/Function/FunctionVersionResource.cs
@@ -85,10 +85,10 @@ public static FunctionVersionResource Fetch(FetchFunctionVersionOptions options,
/// Fetch FunctionVersion parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of FunctionVersion
- public static async System.Threading.Tasks.Task FetchAsync(FetchFunctionVersionOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchFunctionVersionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -118,7 +118,7 @@ public static FunctionVersionResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathFunctionSid, string pathSid, ITwilioRestClient client = null)
{
var options = new FetchFunctionVersionOptions(pathServiceSid, pathFunctionSid, pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -157,10 +157,10 @@ public static ResourceSet Read(ReadFunctionVersionOptio
/// Read FunctionVersion parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of FunctionVersion
- public static async System.Threading.Tasks.Task> ReadAsync(ReadFunctionVersionOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadFunctionVersionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("function_versions", response.Content);
return new ResourceSet(page, options, client);
@@ -200,7 +200,7 @@ public static async System.Threading.Tasks.Task Create Function parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Function
- public static async System.Threading.Tasks.Task CreateAsync(CreateFunctionOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task CreateAsync(CreateFunctionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildCreateRequest(options, client));
+ var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -102,7 +102,7 @@ public static async System.Threading.Tasks.Task CreateAsync(
ITwilioRestClient client = null)
{
var options = new CreateFunctionOptions(pathServiceSid, friendlyName){ };
- return await CreateAsync(options, client);
+ return await CreateAsync(options, client, cancellationToken);
}
#endif
@@ -145,11 +145,12 @@ public static bool Delete(DeleteFunctionOptions options, ITwilioRestClient clien
/// Delete Function parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Function
- public static async System.Threading.Tasks.Task DeleteAsync(DeleteFunctionOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task DeleteAsync(DeleteFunctionOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildDeleteRequest(options, client));
+ var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken);
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
}
#endif
@@ -174,7 +175,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie
public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null)
{
var options = new DeleteFunctionOptions(pathServiceSid, pathSid) ;
- return await DeleteAsync(options, client);
+ return await DeleteAsync(options, client, cancellationToken);
}
#endif
@@ -213,10 +214,10 @@ public static FunctionResource Fetch(FetchFunctionOptions options, ITwilioRestCl
/// Fetch Function parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Function
- public static async System.Threading.Tasks.Task FetchAsync(FetchFunctionOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchFunctionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -243,7 +244,7 @@ public static FunctionResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null)
{
var options = new FetchFunctionOptions(pathServiceSid, pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -280,10 +281,10 @@ public static ResourceSet Read(ReadFunctionOptions options, IT
/// Read Function parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Function
- public static async System.Threading.Tasks.Task> ReadAsync(ReadFunctionOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadFunctionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("functions", response.Content);
return new ResourceSet(page, options, client);
@@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task> R
ITwilioRestClient client = null)
{
var options = new ReadFunctionOptions(pathServiceSid){ PageSize = pageSize, Limit = limit};
- return await ReadAsync(options, client);
+ return await ReadAsync(options, client, cancellationToken);
}
#endif
@@ -408,11 +409,12 @@ public static FunctionResource Update(UpdateFunctionOptions options, ITwilioRest
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Function
#if !NET35
- public static async System.Threading.Tasks.Task UpdateAsync(UpdateFunctionOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task UpdateAsync(UpdateFunctionOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildUpdateRequest(options, client));
+ var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -447,7 +449,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(
ITwilioRestClient client = null)
{
var options = new UpdateFunctionOptions(pathServiceSid, pathSid, friendlyName){ };
- return await UpdateAsync(options, client);
+ return await UpdateAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Serverless/V1/ServiceResource.cs b/src/Twilio/Rest/Serverless/V1/ServiceResource.cs
index 6caf7e157..6a4b60f21 100644
--- a/src/Twilio/Rest/Serverless/V1/ServiceResource.cs
+++ b/src/Twilio/Rest/Serverless/V1/ServiceResource.cs
@@ -66,10 +66,10 @@ public static ServiceResource Create(CreateServiceOptions options, ITwilioRestCl
/// Create Service parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Service
- public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildCreateRequest(options, client));
+ var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -108,7 +108,7 @@ public static async System.Threading.Tasks.Task CreateAsync(
ITwilioRestClient client = null)
{
var options = new CreateServiceOptions(uniqueName, friendlyName){ IncludeCredentials = includeCredentials, UiEditable = uiEditable };
- return await CreateAsync(options, client);
+ return await CreateAsync(options, client, cancellationToken);
}
#endif
@@ -149,11 +149,12 @@ public static bool Delete(DeleteServiceOptions options, ITwilioRestClient client
/// Delete Service parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Service
- public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildDeleteRequest(options, client));
+ var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken);
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
}
#endif
@@ -173,10 +174,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null)
/// The `sid` or `unique_name` of the Service resource to delete.
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Service
- public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
var options = new DeleteServiceOptions(pathSid) ;
- return await DeleteAsync(options, client);
+ return await DeleteAsync(options, client, cancellationToken);
}
#endif
@@ -213,10 +214,10 @@ public static ServiceResource Fetch(FetchServiceOptions options, ITwilioRestClie
/// Fetch Service parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Service
- public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -237,10 +238,10 @@ public static ServiceResource Fetch(
/// The `sid` or `unique_name` of the Service resource to fetch.
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Service
- public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
var options = new FetchServiceOptions(pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -275,10 +276,10 @@ public static ResourceSet Read(ReadServiceOptions options, ITwi
/// Read Service parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Service
- public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("services", response.Content);
return new ResourceSet(page, options, client);
@@ -310,7 +311,7 @@ public static async System.Threading.Tasks.Task> Re
ITwilioRestClient client = null)
{
var options = new ReadServiceOptions(){ PageSize = pageSize, Limit = limit};
- return await ReadAsync(options, client);
+ return await ReadAsync(options, client, cancellationToken);
}
#endif
@@ -397,11 +398,12 @@ public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestCl
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Service
#if !NET35
- public static async System.Threading.Tasks.Task UpdateAsync(UpdateServiceOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task UpdateAsync(UpdateServiceOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildUpdateRequest(options, client));
+ var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -440,7 +442,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(
ITwilioRestClient client = null)
{
var options = new UpdateServiceOptions(pathSid){ IncludeCredentials = includeCredentials, FriendlyName = friendlyName, UiEditable = uiEditable };
- return await UpdateAsync(options, client);
+ return await UpdateAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextResource.cs b/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextResource.cs
index c1f22e98c..d840f1d0c 100644
--- a/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextResource.cs
+++ b/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextResource.cs
@@ -69,10 +69,10 @@ public static EngagementContextResource Fetch(FetchEngagementContextOptions opti
/// Fetch EngagementContext parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of EngagementContext
- public static async System.Threading.Tasks.Task FetchAsync(FetchEngagementContextOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchEngagementContextOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -99,7 +99,7 @@ public static EngagementContextResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathEngagementSid, ITwilioRestClient client = null)
{
var options = new FetchEngagementContextOptions(pathFlowSid, pathEngagementSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextResource.cs b/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextResource.cs
index 297bf2f3a..2f064a8fd 100644
--- a/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextResource.cs
+++ b/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextResource.cs
@@ -71,10 +71,10 @@ public static StepContextResource Fetch(FetchStepContextOptions options, ITwilio
/// Fetch StepContext parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of StepContext
- public static async System.Threading.Tasks.Task FetchAsync(FetchStepContextOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchStepContextOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -104,7 +104,7 @@ public static StepContextResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathEngagementSid, string pathStepSid, ITwilioRestClient client = null)
{
var options = new FetchStepContextOptions(pathFlowSid, pathEngagementSid, pathStepSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepResource.cs b/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepResource.cs
index 6a8e237e7..b12d1921f 100644
--- a/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepResource.cs
+++ b/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepResource.cs
@@ -71,10 +71,10 @@ public static StepResource Fetch(FetchStepOptions options, ITwilioRestClient cli
/// Fetch Step parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Step
- public static async System.Threading.Tasks.Task FetchAsync(FetchStepOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchStepOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -104,7 +104,7 @@ public static StepResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathEngagementSid, string pathSid, ITwilioRestClient client = null)
{
var options = new FetchStepOptions(pathFlowSid, pathEngagementSid, pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -143,10 +143,10 @@ public static ResourceSet Read(ReadStepOptions options, ITwilioRes
/// Read Step parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Step
- public static async System.Threading.Tasks.Task> ReadAsync(ReadStepOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadStepOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("steps", response.Content);
return new ResourceSet(page, options, client);
@@ -186,7 +186,7 @@ public static async System.Threading.Tasks.Task> ReadA
ITwilioRestClient client = null)
{
var options = new ReadStepOptions(pathFlowSid, pathEngagementSid){ PageSize = pageSize, Limit = limit};
- return await ReadAsync(options, client);
+ return await ReadAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Studio/V1/Flow/EngagementResource.cs b/src/Twilio/Rest/Studio/V1/Flow/EngagementResource.cs
index dc374cf38..88fdcee29 100644
--- a/src/Twilio/Rest/Studio/V1/Flow/EngagementResource.cs
+++ b/src/Twilio/Rest/Studio/V1/Flow/EngagementResource.cs
@@ -81,10 +81,10 @@ public static EngagementResource Create(CreateEngagementOptions options, ITwilio
/// Create Engagement parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Engagement
- public static async System.Threading.Tasks.Task CreateAsync(CreateEngagementOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task CreateAsync(CreateEngagementOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildCreateRequest(options, client));
+ var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -123,7 +123,7 @@ public static async System.Threading.Tasks.Task CreateAsync(
ITwilioRestClient client = null)
{
var options = new CreateEngagementOptions(pathFlowSid, to, from){ Parameters = parameters };
- return await CreateAsync(options, client);
+ return await CreateAsync(options, client, cancellationToken);
}
#endif
@@ -166,11 +166,12 @@ public static bool Delete(DeleteEngagementOptions options, ITwilioRestClient cli
/// Delete Engagement parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Engagement
- public static async System.Threading.Tasks.Task DeleteAsync(DeleteEngagementOptions options,
- ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task DeleteAsync(DeleteEngagementOptions options,
+ ITwilioRestClient client = null,
+ CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildDeleteRequest(options, client));
+ var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken);
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
}
#endif
@@ -195,7 +196,7 @@ public static bool Delete(string pathFlowSid, string pathSid, ITwilioRestClient
public static async System.Threading.Tasks.Task DeleteAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null)
{
var options = new DeleteEngagementOptions(pathFlowSid, pathSid) ;
- return await DeleteAsync(options, client);
+ return await DeleteAsync(options, client, cancellationToken);
}
#endif
@@ -234,10 +235,10 @@ public static EngagementResource Fetch(FetchEngagementOptions options, ITwilioRe
/// Fetch Engagement parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Engagement
- public static async System.Threading.Tasks.Task FetchAsync(FetchEngagementOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchEngagementOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -264,7 +265,7 @@ public static EngagementResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null)
{
var options = new FetchEngagementOptions(pathFlowSid, pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -301,10 +302,10 @@ public static ResourceSet Read(ReadEngagementOptions options
/// Read Engagement parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of Engagement
- public static async System.Threading.Tasks.Task> ReadAsync(ReadEngagementOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task> ReadAsync(ReadEngagementOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildReadRequest(options, client));
+ var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
var page = Page.FromJson("engagements", response.Content);
return new ResourceSet(page, options, client);
@@ -340,7 +341,7 @@ public static async System.Threading.Tasks.Task>
ITwilioRestClient client = null)
{
var options = new ReadEngagementOptions(pathFlowSid){ PageSize = pageSize, Limit = limit};
- return await ReadAsync(options, client);
+ return await ReadAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextResource.cs b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextResource.cs
index 960052b96..59ecd8951 100644
--- a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextResource.cs
+++ b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextResource.cs
@@ -69,10 +69,10 @@ public static ExecutionContextResource Fetch(FetchExecutionContextOptions option
/// Fetch ExecutionContext parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of ExecutionContext
- public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionContextOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionContextOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -99,7 +99,7 @@ public static ExecutionContextResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, ITwilioRestClient client = null)
{
var options = new FetchExecutionContextOptions(pathFlowSid, pathExecutionSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextResource.cs b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextResource.cs
index fe092f6fc..af1c551b1 100644
--- a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextResource.cs
+++ b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextResource.cs
@@ -71,10 +71,10 @@ public static ExecutionStepContextResource Fetch(FetchExecutionStepContextOption
/// Fetch ExecutionStepContext parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of ExecutionStepContext
- public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionStepContextOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionStepContextOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -104,7 +104,7 @@ public static ExecutionStepContextResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, string pathStepSid, ITwilioRestClient client = null)
{
var options = new FetchExecutionStepContextOptions(pathFlowSid, pathExecutionSid, pathStepSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
diff --git a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepResource.cs b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepResource.cs
index 8e0231b80..d4e2a6e64 100644
--- a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepResource.cs
+++ b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepResource.cs
@@ -71,10 +71,10 @@ public static ExecutionStepResource Fetch(FetchExecutionStepOptions options, ITw
/// Fetch ExecutionStep parameters
/// Client to make requests to Twilio
/// Task that resolves to A single instance of ExecutionStep
- public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionStepOptions options, ITwilioRestClient client = null)
+ public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionStepOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
{
client = client ?? TwilioClient.GetRestClient();
- var response = await client.RequestAsync(BuildFetchRequest(options, client));
+ var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
return FromJson(response.Content);
}
#endif
@@ -104,7 +104,7 @@ public static ExecutionStepResource Fetch(
public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, string pathSid, ITwilioRestClient client = null)
{
var options = new FetchExecutionStepOptions(pathFlowSid, pathExecutionSid, pathSid){ };
- return await FetchAsync(options, client);
+ return await FetchAsync(options, client, cancellationToken);
}
#endif
@@ -143,10 +143,10 @@ public static ResourceSet