From f7322681ab0db606734daf22a985f31cd58cbc26 Mon Sep 17 00:00:00 2001 From: Joseph Livecchi Date: Fri, 10 Jan 2025 11:19:14 -0500 Subject: [PATCH 1/8] Added CancellationToken Pass through to Client --- src/Twilio/Clients/ITwilioRestClient.cs | 2 +- src/Twilio/Clients/TwilioRestClient.cs | 4 ++-- src/Twilio/Http/HttpClient.cs | 2 +- src/Twilio/Http/SystemNetHttpClient.cs | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Twilio/Clients/ITwilioRestClient.cs b/src/Twilio/Clients/ITwilioRestClient.cs index 496c03f9f..5af06dbef 100644 --- a/src/Twilio/Clients/ITwilioRestClient.cs +++ b/src/Twilio/Clients/ITwilioRestClient.cs @@ -37,7 +37,7 @@ public interface ITwilioRestClient /// /// Request to make /// response of the request - System.Threading.Tasks.Task RequestAsync(Request request); + System.Threading.Tasks.Task RequestAsync(Request request, CancellationToken cancellationToken = default); #endif } } diff --git a/src/Twilio/Clients/TwilioRestClient.cs b/src/Twilio/Clients/TwilioRestClient.cs index 55d6871e1..c31823c98 100644 --- a/src/Twilio/Clients/TwilioRestClient.cs +++ b/src/Twilio/Clients/TwilioRestClient.cs @@ -169,7 +169,7 @@ public Response Request(Request request) /// /// request to make /// Task that resolves to the response of the request - public async Task RequestAsync(Request request) + public async Task RequestAsync(Request request, CancellationToken cancellationToken = default) { if(_username != null && _password != null){ request.SetAuth(_username, _password); @@ -190,7 +190,7 @@ public async Task RequestAsync(Request request) Response response; try { - response = await HttpClient.MakeRequestAsync(request); + response = await HttpClient.MakeRequestAsync(request, cancellationToken); } catch (Exception clientException) { diff --git a/src/Twilio/Http/HttpClient.cs b/src/Twilio/Http/HttpClient.cs index 674ab133e..0f811b5dc 100644 --- a/src/Twilio/Http/HttpClient.cs +++ b/src/Twilio/Http/HttpClient.cs @@ -34,7 +34,7 @@ public abstract class HttpClient /// request to make /// throws exception on network or connection errors. /// response of the request - public abstract System.Threading.Tasks.Task MakeRequestAsync(Request request); + public abstract System.Threading.Tasks.Task MakeRequestAsync(Request request, CancellationToken cancellationToken = default); #endif /// diff --git a/src/Twilio/Http/SystemNetHttpClient.cs b/src/Twilio/Http/SystemNetHttpClient.cs index 6cf90571e..eb45beef9 100644 --- a/src/Twilio/Http/SystemNetHttpClient.cs +++ b/src/Twilio/Http/SystemNetHttpClient.cs @@ -58,7 +58,7 @@ public override Response MakeRequest(Request request) /// /// Twilio response /// Task that resolves to the response - public override async Task MakeRequestAsync(Request request) + public override async Task MakeRequestAsync(Request request, CancellationToken cancellationToken = default) { var httpRequest = BuildHttpRequest(request); if (!Equals(request.Method, HttpMethod.Get)) @@ -76,13 +76,13 @@ public override async Task MakeRequestAsync(Request request) this.LastRequest = request; this.LastResponse = null; - var httpResponse = await _httpClient.SendAsync(httpRequest).ConfigureAwait(false); - var reader = new StreamReader(await httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false)); + var httpResponse = await _httpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false); + var reader = new StreamReader(await httpResponse.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false)); // Create and return a new Response. Keep a reference to the last // response for debugging, but don't return it as it may be shared // among threads. - var response = new Response(httpResponse.StatusCode, await reader.ReadToEndAsync().ConfigureAwait(false), httpResponse.Headers); + var response = new Response(httpResponse.StatusCode, await reader.ReadToEndAsync(cancellationToken).ConfigureAwait(false), httpResponse.Headers); this.LastResponse = response; return response; } From e35a0c070de217843608a25b0d65dc7bcfc671a7 Mon Sep 17 00:00:00 2001 From: Joseph Livecchi Date: Fri, 10 Jan 2025 11:23:10 -0500 Subject: [PATCH 2/8] Added Cancellation to TokenHttpClient --- .../Clients/BearerToken/TwilioOrgsTokenRestClient.cs | 4 ++-- src/Twilio/Http/BearerToken/SystemNetTokenHttpClient.cs | 8 ++++---- src/Twilio/Http/BearerToken/TokenHttpClient.cs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Twilio/Clients/BearerToken/TwilioOrgsTokenRestClient.cs b/src/Twilio/Clients/BearerToken/TwilioOrgsTokenRestClient.cs index 6ac86fcf4..619db31cb 100644 --- a/src/Twilio/Clients/BearerToken/TwilioOrgsTokenRestClient.cs +++ b/src/Twilio/Clients/BearerToken/TwilioOrgsTokenRestClient.cs @@ -236,7 +236,7 @@ public bool isTokenExpired(string token){ /// /// request to make /// Task that resolves to the response of the request - public async Task RequestAsync(TokenRequest request) + public async Task RequestAsync(TokenRequest request, CancellationToken cancellationToken = default) { request.SetAuth(_accessToken); @@ -252,7 +252,7 @@ public async Task RequestAsync(TokenRequest request) Response response; try { - response = await HttpClient.MakeRequestAsync(request); + response = await HttpClient.MakeRequestAsync(request, cancellationToken); } catch (Exception clientException) { diff --git a/src/Twilio/Http/BearerToken/SystemNetTokenHttpClient.cs b/src/Twilio/Http/BearerToken/SystemNetTokenHttpClient.cs index dfbc84369..81f1a54e0 100644 --- a/src/Twilio/Http/BearerToken/SystemNetTokenHttpClient.cs +++ b/src/Twilio/Http/BearerToken/SystemNetTokenHttpClient.cs @@ -60,7 +60,7 @@ public override Response MakeRequest(TokenRequest request) /// /// Twilio response /// Task that resolves to the response - public override async Task MakeRequestAsync(TokenRequest request) + public override async Task MakeRequestAsync(TokenRequest request, CancellationToken cancellationToken = default) { var httpRequest = BuildHttpRequest(request); if (!Equals(request.Method, HttpMethod.Get)) @@ -81,13 +81,13 @@ public override async Task MakeRequestAsync(TokenRequest request) this.LastRequest = request; this.LastResponse = null; - var httpResponse = await _httpClient.SendAsync(httpRequest).ConfigureAwait(false); - var reader = new StreamReader(await httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false)); + var httpResponse = await _httpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false); + var reader = new StreamReader(await httpResponse.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false)); // Create and return a new Response. Keep a reference to the last // response for debugging, but don't return it as it may be shared // among threads. - var response = new Response(httpResponse.StatusCode, await reader.ReadToEndAsync().ConfigureAwait(false), httpResponse.Headers); + var response = new Response(httpResponse.StatusCode, await reader.ReadToEndAsync(cancellationToken).ConfigureAwait(false), httpResponse.Headers); this.LastResponse = response; return response; } diff --git a/src/Twilio/Http/BearerToken/TokenHttpClient.cs b/src/Twilio/Http/BearerToken/TokenHttpClient.cs index 45e5ea866..8482b8cc8 100644 --- a/src/Twilio/Http/BearerToken/TokenHttpClient.cs +++ b/src/Twilio/Http/BearerToken/TokenHttpClient.cs @@ -36,7 +36,7 @@ public abstract class TokenHttpClient /// request to make /// throws exception on network or connection errors. /// response of the request - public abstract System.Threading.Tasks.Task MakeRequestAsync(TokenRequest request); + public abstract System.Threading.Tasks.Task MakeRequestAsync(TokenRequest request, CancellationToken cancellationToken = Default); #endif } From 982b2e14b18edb117ae1ea8e54ec27142fcf98cd Mon Sep 17 00:00:00 2001 From: Joseph Livecchi Date: Fri, 10 Jan 2025 12:27:03 -0500 Subject: [PATCH 3/8] Bulk Regex Add of CancellationToken Parameters --- .../Accounts/V1/AuthTokenPromotionResource.cs | 12 +++--- .../Rest/Accounts/V1/BulkConsentsResource.cs | 6 +-- .../Rest/Accounts/V1/BulkContactsResource.cs | 6 +-- .../Accounts/V1/Credential/AwsResource.cs | 40 ++++++++++--------- .../V1/Credential/PublicKeyResource.cs | 40 ++++++++++--------- .../Rest/Accounts/V1/SafelistResource.cs | 23 ++++++----- .../Accounts/V1/SecondaryAuthTokenResource.cs | 20 +++++----- .../Address/DependentPhoneNumberResource.cs | 6 +-- .../Rest/Api/V2010/Account/AddressResource.cs | 36 +++++++++-------- .../Api/V2010/Account/ApplicationResource.cs | 36 +++++++++-------- .../Account/AuthorizedConnectAppResource.cs | 12 +++--- .../LocalResource.cs | 6 +-- .../MachineToMachineResource.cs | 6 +-- .../MobileResource.cs | 6 +-- .../NationalResource.cs | 6 +-- .../SharedCostResource.cs | 6 +-- .../AvailablePhoneNumberCountryResource.cs | 12 +++--- .../Rest/Api/V2010/Account/BalanceResource.cs | 6 +-- .../UserDefinedMessageSubscriptionResource.cs | 15 +++---- .../Rest/Api/V2010/Account/CallResource.cs | 36 +++++++++-------- .../Account/Conference/ParticipantResource.cs | 36 +++++++++-------- .../Account/Conference/RecordingResource.cs | 30 +++++++------- .../Api/V2010/Account/ConferenceResource.cs | 21 +++++----- .../Api/V2010/Account/ConnectAppResource.cs | 30 +++++++------- .../AssignedAddOnExtensionResource.cs | 12 +++--- .../AssignedAddOnResource.cs | 27 +++++++------ .../IncomingPhoneNumber/LocalResource.cs | 12 +++--- .../IncomingPhoneNumber/MobileResource.cs | 12 +++--- .../IncomingPhoneNumber/TollFreeResource.cs | 12 +++--- .../Account/IncomingPhoneNumberResource.cs | 36 +++++++++-------- .../Rest/Api/V2010/Account/KeyResource.cs | 30 +++++++------- .../V2010/Account/Message/FeedbackResource.cs | 6 +-- .../V2010/Account/Message/MediaResource.cs | 21 +++++----- .../Rest/Api/V2010/Account/MessageResource.cs | 36 +++++++++-------- .../Rest/Api/V2010/Account/NewKeyResource.cs | 6 +-- .../V2010/Account/NewSigningKeyResource.cs | 6 +-- .../Api/V2010/Account/NotificationResource.cs | 12 +++--- .../V2010/Account/OutgoingCallerIdResource.cs | 30 +++++++------- .../Rest/Api/V2010/Account/QueueResource.cs | 36 +++++++++-------- .../Api/V2010/Account/RecordingResource.cs | 21 +++++----- .../Api/V2010/Account/ShortCodeResource.cs | 21 +++++----- .../Api/V2010/Account/SigningKeyResource.cs | 30 +++++++------- .../Sip/CredentialList/CredentialResource.cs | 36 +++++++++-------- .../AuthCallsCredentialListMappingResource.cs | 27 +++++++------ ...CallsIpAccessControlListMappingResource.cs | 27 +++++++------ ...istrationsCredentialListMappingResource.cs | 27 +++++++------ .../Domain/CredentialListMappingResource.cs | 27 +++++++------ .../IpAccessControlListMappingResource.cs | 27 +++++++------ .../IpAccessControlList/IpAddressResource.cs | 36 +++++++++-------- .../Sip/IpAccessControlListResource.cs | 36 +++++++++-------- .../Rest/Api/V2010/Account/TokenResource.cs | 6 +-- .../V2010/Account/TranscriptionResource.cs | 21 +++++----- .../Account/Usage/Record/AllTimeResource.cs | 6 +-- .../Account/Usage/Record/DailyResource.cs | 6 +-- .../Account/Usage/Record/LastMonthResource.cs | 6 +-- .../Account/Usage/Record/MonthlyResource.cs | 6 +-- .../Account/Usage/Record/ThisMonthResource.cs | 6 +-- .../Account/Usage/Record/TodayResource.cs | 6 +-- .../Account/Usage/Record/YearlyResource.cs | 6 +-- .../Account/Usage/Record/YesterdayResource.cs | 6 +-- .../Api/V2010/Account/Usage/RecordResource.cs | 6 +-- .../V2010/Account/Usage/TriggerResource.cs | 36 +++++++++-------- .../Account/ValidationRequestResource.cs | 6 +-- src/Twilio/Rest/Api/V2010/AccountResource.cs | 27 +++++++------ .../Assistant/AssistantsKnowledgeResource.cs | 21 +++++----- .../V1/Assistant/AssistantsToolResource.cs | 21 +++++----- .../V1/Assistant/FeedbackResource.cs | 12 +++--- .../V1/Assistant/MessageResource.cs | 6 +-- .../Rest/Assistants/V1/AssistantResource.cs | 40 ++++++++++--------- .../Assistants/V1/Knowledge/ChunkResource.cs | 6 +-- .../V1/Knowledge/KnowledgeStatusResource.cs | 8 ++-- .../Rest/Assistants/V1/KnowledgeResource.cs | 40 ++++++++++--------- .../Rest/Assistants/V1/PolicyResource.cs | 6 +-- .../Assistants/V1/Session/MessageResource.cs | 6 +-- .../Rest/Assistants/V1/SessionResource.cs | 14 +++---- src/Twilio/Rest/Assistants/V1/ToolResource.cs | 40 ++++++++++--------- .../Rest/Bulkexports/V1/Export/DayResource.cs | 12 +++--- .../V1/Export/ExportCustomJobResource.cs | 12 +++--- .../Rest/Bulkexports/V1/Export/JobResource.cs | 19 ++++----- .../V1/ExportConfigurationResource.cs | 17 ++++---- .../Rest/Bulkexports/V1/ExportResource.cs | 8 ++-- src/Twilio/Rest/Chat/V1/CredentialResource.cs | 40 ++++++++++--------- .../Chat/V1/Service/Channel/InviteResource.cs | 27 +++++++------ .../Chat/V1/Service/Channel/MemberResource.cs | 36 +++++++++-------- .../V1/Service/Channel/MessageResource.cs | 36 +++++++++-------- .../Rest/Chat/V1/Service/ChannelResource.cs | 36 +++++++++-------- .../Rest/Chat/V1/Service/RoleResource.cs | 36 +++++++++-------- .../V1/Service/User/UserChannelResource.cs | 6 +-- .../Rest/Chat/V1/Service/UserResource.cs | 36 +++++++++-------- src/Twilio/Rest/Chat/V1/ServiceResource.cs | 40 ++++++++++--------- src/Twilio/Rest/Chat/V2/CredentialResource.cs | 40 ++++++++++--------- .../Rest/Chat/V2/Service/BindingResource.cs | 21 +++++----- .../Rest/Chat/V2/Service/ChannelResource.cs | 36 +++++++++-------- src/Twilio/Rest/Chat/V2/ServiceResource.cs | 40 ++++++++++--------- .../V1/Content/ApprovalCreateResource.cs | 6 +-- .../V1/Content/ApprovalFetchResource.cs | 8 ++-- .../Content/V1/ContentAndApprovalsResource.cs | 6 +-- src/Twilio/Rest/Content/V1/ContentResource.cs | 31 +++++++------- .../Rest/Content/V1/LegacyContentResource.cs | 6 +-- .../Content/V2/ContentAndApprovalsResource.cs | 6 +-- src/Twilio/Rest/Content/V2/ContentResource.cs | 6 +-- .../V1/AddressConfigurationResource.cs | 40 ++++++++++--------- .../V1/Configuration/WebhookResource.cs | 17 ++++---- .../Conversations/V1/ConfigurationResource.cs | 17 ++++---- .../Message/DeliveryReceiptResource.cs | 12 +++--- .../V1/Conversation/MessageResource.cs | 36 +++++++++-------- .../V1/Conversation/ParticipantResource.cs | 36 +++++++++-------- .../V1/Conversation/WebhookResource.cs | 36 +++++++++-------- .../Conversations/V1/ConversationResource.cs | 38 +++++++++--------- .../ConversationWithParticipantsResource.cs | 6 +-- .../Conversations/V1/CredentialResource.cs | 40 ++++++++++--------- .../V1/ParticipantConversationResource.cs | 6 +-- .../Rest/Conversations/V1/RoleResource.cs | 40 ++++++++++--------- .../V1/Service/BindingResource.cs | 21 +++++----- .../Configuration/NotificationResource.cs | 17 ++++---- .../Service/Configuration/WebhookResource.cs | 17 ++++---- .../V1/Service/ConfigurationResource.cs | 17 ++++---- .../Message/DeliveryReceiptResource.cs | 12 +++--- .../Service/Conversation/MessageResource.cs | 36 +++++++++-------- .../Conversation/ParticipantResource.cs | 36 +++++++++-------- .../Service/Conversation/WebhookResource.cs | 36 +++++++++-------- .../V1/Service/ConversationResource.cs | 36 +++++++++-------- .../ConversationWithParticipantsResource.cs | 6 +-- .../ParticipantConversationResource.cs | 6 +-- .../Conversations/V1/Service/RoleResource.cs | 36 +++++++++-------- .../Service/User/UserConversationResource.cs | 30 +++++++------- .../Conversations/V1/Service/UserResource.cs | 36 +++++++++-------- .../Rest/Conversations/V1/ServiceResource.cs | 31 +++++++------- .../V1/User/UserConversationResource.cs | 30 +++++++------- .../Rest/Conversations/V1/UserResource.cs | 38 +++++++++--------- .../Rest/Events/V1/EventTypeResource.cs | 14 +++---- .../Events/V1/Schema/SchemaVersionResource.cs | 12 +++--- src/Twilio/Rest/Events/V1/SchemaResource.cs | 8 ++-- .../Rest/Events/V1/Sink/SinkTestResource.cs | 6 +-- .../Events/V1/Sink/SinkValidateResource.cs | 6 +-- src/Twilio/Rest/Events/V1/SinkResource.cs | 40 ++++++++++--------- .../Subscription/SubscribedEventResource.cs | 36 +++++++++-------- .../Rest/Events/V1/SubscriptionResource.cs | 40 ++++++++++--------- .../Rest/FlexApi/V1/AssessmentsResource.cs | 21 +++++----- src/Twilio/Rest/FlexApi/V1/ChannelResource.cs | 31 +++++++------- .../Rest/FlexApi/V1/ConfigurationResource.cs | 18 +++++---- .../Rest/FlexApi/V1/FlexFlowResource.cs | 40 ++++++++++--------- .../V1/InsightsAssessmentsCommentResource.cs | 12 +++--- .../V1/InsightsConversationsResource.cs | 6 +-- .../InsightsQuestionnairesCategoryResource.cs | 30 +++++++------- .../InsightsQuestionnairesQuestionResource.cs | 30 +++++++------- .../V1/InsightsQuestionnairesResource.cs | 36 +++++++++-------- .../FlexApi/V1/InsightsSegmentsResource.cs | 6 +-- .../FlexApi/V1/InsightsSessionResource.cs | 6 +-- .../V1/InsightsSettingsAnswerSetsResource.cs | 6 +-- .../V1/InsightsSettingsCommentResource.cs | 6 +-- .../FlexApi/V1/InsightsUserRolesResource.cs | 6 +-- .../InteractionChannelInviteResource.cs | 12 +++--- .../InteractionChannelParticipantResource.cs | 21 +++++----- .../Interaction/InteractionChannelResource.cs | 21 +++++----- .../Rest/FlexApi/V1/InteractionResource.cs | 14 +++---- .../V1/Plugin/PluginVersionsResource.cs | 18 ++++----- .../Rest/FlexApi/V1/PluginArchiveResource.cs | 9 +++-- .../ConfiguredPluginResource.cs | 12 +++--- .../V1/PluginConfigurationArchiveResource.cs | 9 +++-- .../FlexApi/V1/PluginConfigurationResource.cs | 18 ++++----- .../Rest/FlexApi/V1/PluginReleaseResource.cs | 18 ++++----- src/Twilio/Rest/FlexApi/V1/PluginResource.cs | 27 +++++++------ .../V1/PluginVersionArchiveResource.cs | 9 +++-- .../FlexApi/V1/ProvisioningStatusResource.cs | 8 ++-- .../Rest/FlexApi/V1/WebChannelResource.cs | 40 ++++++++++--------- .../Rest/FlexApi/V2/FlexUserResource.cs | 15 +++---- .../Rest/FlexApi/V2/WebChannelsResource.cs | 6 +-- .../Rest/FrontlineApi/V1/UserResource.cs | 17 ++++---- src/Twilio/Rest/Iam/V1/ApiKeyResource.cs | 28 +++++++------ src/Twilio/Rest/Iam/V1/GetApiKeysResource.cs | 6 +-- src/Twilio/Rest/Iam/V1/KeyResource.cs | 9 +++-- .../Insights/V1/Call/AnnotationResource.cs | 17 ++++---- .../Insights/V1/Call/CallSummaryResource.cs | 6 +-- .../Rest/Insights/V1/Call/EventResource.cs | 6 +-- .../Rest/Insights/V1/Call/MetricResource.cs | 6 +-- src/Twilio/Rest/Insights/V1/CallResource.cs | 8 ++-- .../Rest/Insights/V1/CallSummariesResource.cs | 6 +-- .../ConferenceParticipantResource.cs | 12 +++--- .../Rest/Insights/V1/ConferenceResource.cs | 14 +++---- .../Insights/V1/Room/ParticipantResource.cs | 12 +++--- src/Twilio/Rest/Insights/V1/RoomResource.cs | 14 +++---- .../Rest/Insights/V1/SettingResource.cs | 15 +++---- .../Intelligence/V2/CustomOperatorResource.cs | 40 ++++++++++--------- .../V2/OperatorAttachmentResource.cs | 15 +++---- .../V2/OperatorAttachmentsResource.cs | 8 ++-- .../Rest/Intelligence/V2/OperatorResource.cs | 14 +++---- .../Intelligence/V2/OperatorTypeResource.cs | 14 +++---- .../V2/PrebuiltOperatorResource.cs | 14 +++---- .../Rest/Intelligence/V2/ServiceResource.cs | 40 ++++++++++--------- .../V2/Transcript/MediaResource.cs | 6 +-- .../V2/Transcript/OperatorResultResource.cs | 12 +++--- .../V2/Transcript/SentenceResource.cs | 6 +-- .../Intelligence/V2/TranscriptResource.cs | 31 +++++++------- .../Rest/IpMessaging/V1/CredentialResource.cs | 40 ++++++++++--------- .../V1/Service/Channel/InviteResource.cs | 27 +++++++------ .../V1/Service/Channel/MemberResource.cs | 36 +++++++++-------- .../V1/Service/Channel/MessageResource.cs | 36 +++++++++-------- .../IpMessaging/V1/Service/ChannelResource.cs | 36 +++++++++-------- .../IpMessaging/V1/Service/RoleResource.cs | 36 +++++++++-------- .../V1/Service/User/UserChannelResource.cs | 6 +-- .../IpMessaging/V1/Service/UserResource.cs | 36 +++++++++-------- .../Rest/IpMessaging/V1/ServiceResource.cs | 40 ++++++++++--------- .../Rest/IpMessaging/V2/CredentialResource.cs | 40 ++++++++++--------- .../IpMessaging/V2/Service/BindingResource.cs | 21 +++++----- .../V2/Service/Channel/InviteResource.cs | 27 +++++++------ .../V2/Service/Channel/MemberResource.cs | 36 +++++++++-------- .../V2/Service/Channel/MessageResource.cs | 36 +++++++++-------- .../V2/Service/Channel/WebhookResource.cs | 36 +++++++++-------- .../IpMessaging/V2/Service/ChannelResource.cs | 36 +++++++++-------- .../IpMessaging/V2/Service/RoleResource.cs | 36 +++++++++-------- .../V2/Service/User/UserBindingResource.cs | 21 +++++----- .../V2/Service/User/UserChannelResource.cs | 30 +++++++------- .../IpMessaging/V2/Service/UserResource.cs | 36 +++++++++-------- .../Rest/IpMessaging/V2/ServiceResource.cs | 40 ++++++++++--------- .../Rest/Lookups/V1/PhoneNumberResource.cs | 6 +-- .../Rest/Lookups/V2/PhoneNumberResource.cs | 6 +-- .../AvailableAddOnExtensionResource.cs | 12 +++--- .../Marketplace/V1/AvailableAddOnResource.cs | 14 +++---- .../InstalledAddOnExtensionResource.cs | 21 +++++----- .../InstalledAddOnUsageResource.cs | 6 +-- .../Marketplace/V1/InstalledAddOnResource.cs | 40 ++++++++++--------- .../V1/ModuleDataManagementResource.cs | 17 ++++---- .../V1/ReferralConversionResource.cs | 6 +-- .../BrandRegistrationOtpResource.cs | 6 +-- .../BrandRegistration/BrandVettingResource.cs | 18 ++++----- .../Messaging/V1/BrandRegistrationResource.cs | 29 +++++++------- .../Messaging/V1/DeactivationsResource.cs | 6 +-- .../Rest/Messaging/V1/DomainCertsResource.cs | 28 +++++++------ .../DomainConfigMessagingServiceResource.cs | 8 ++-- .../Rest/Messaging/V1/DomainConfigResource.cs | 17 ++++---- .../Messaging/V1/ExternalCampaignResource.cs | 6 +-- ...ssagingServiceDomainAssociationResource.cs | 8 ++-- .../LinkshorteningMessagingServiceResource.cs | 15 +++---- .../V1/RequestManagedCertResource.cs | 9 +++-- .../V1/Service/AlphaSenderResource.cs | 27 +++++++------ .../V1/Service/ChannelSenderResource.cs | 27 +++++++------ .../V1/Service/PhoneNumberResource.cs | 27 +++++++------ .../Messaging/V1/Service/ShortCodeResource.cs | 27 +++++++------ .../V1/Service/UsAppToPersonResource.cs | 36 +++++++++-------- .../Service/UsAppToPersonUsecaseResource.cs | 6 +-- .../Rest/Messaging/V1/ServiceResource.cs | 40 ++++++++++--------- .../V1/TollfreeVerificationResource.cs | 40 ++++++++++--------- .../Rest/Messaging/V1/UsecaseResource.cs | 8 ++-- .../Microvisor/V1/AccountConfigResource.cs | 40 ++++++++++--------- .../Microvisor/V1/AccountSecretResource.cs | 40 ++++++++++--------- .../Microvisor/V1/App/AppManifestResource.cs | 8 ++-- src/Twilio/Rest/Microvisor/V1/AppResource.cs | 25 ++++++------ .../V1/Device/DeviceConfigResource.cs | 36 +++++++++-------- .../V1/Device/DeviceSecretResource.cs | 36 +++++++++-------- .../Rest/Microvisor/V1/DeviceResource.cs | 23 ++++++----- src/Twilio/Rest/Monitor/V1/AlertResource.cs | 14 +++---- src/Twilio/Rest/Monitor/V1/EventResource.cs | 14 +++---- .../Rest/Notify/V1/CredentialResource.cs | 40 ++++++++++--------- .../Rest/Notify/V1/Service/BindingResource.cs | 27 +++++++------ .../Notify/V1/Service/NotificationResource.cs | 6 +-- src/Twilio/Rest/Notify/V1/ServiceResource.cs | 40 ++++++++++--------- .../Numbers/V1/BulkEligibilityResource.cs | 17 ++++---- .../Rest/Numbers/V1/EligibilityResource.cs | 9 +++-- .../V1/PortingPortInPhoneNumberResource.cs | 15 +++---- .../Rest/Numbers/V1/PortingPortInResource.cs | 28 +++++++------ .../Numbers/V1/PortingPortabilityResource.cs | 6 +-- ...rtingWebhookConfigurationDeleteResource.cs | 9 +++-- .../V1/PortingWebhookConfigurationResource.cs | 9 +++-- .../V1/SigningRequestConfigurationResource.cs | 15 +++---- src/Twilio/Rest/Numbers/V1/WebhookResource.cs | 8 ++-- .../DependentHostedNumberOrderResource.cs | 6 +-- .../V2/AuthorizationDocumentResource.cs | 31 +++++++------- .../V2/BulkHostedNumberOrderResource.cs | 15 +++---- .../Rest/Numbers/V2/BundleCloneResource.cs | 6 +-- .../Numbers/V2/HostedNumberOrderResource.cs | 40 ++++++++++--------- .../Bundle/BundleCopyResource.cs | 12 +++--- .../Bundle/EvaluationResource.cs | 18 ++++----- .../Bundle/ItemAssignmentResource.cs | 27 +++++++------ .../Bundle/ReplaceItemsResource.cs | 6 +-- .../V2/RegulatoryCompliance/BundleResource.cs | 40 ++++++++++--------- .../RegulatoryCompliance/EndUserResource.cs | 40 ++++++++++--------- .../EndUserTypeResource.cs | 14 +++---- .../RegulationResource.cs | 12 +++--- .../SupportingDocumentResource.cs | 40 ++++++++++--------- .../SupportingDocumentTypeResource.cs | 14 +++---- src/Twilio/Rest/Oauth/V1/AuthorizeResource.cs | 6 +-- src/Twilio/Rest/Oauth/V1/TokenResource.cs | 6 +-- .../DependentHostedNumberOrderResource.cs | 6 +-- .../AuthorizationDocumentResource.cs | 29 +++++++------- .../HostedNumberOrderResource.cs | 40 ++++++++++--------- .../AvailableAddOnExtensionResource.cs | 12 +++--- .../Marketplace/AvailableAddOnResource.cs | 14 +++---- .../InstalledAddOnExtensionResource.cs | 21 +++++----- .../Marketplace/InstalledAddOnResource.cs | 40 ++++++++++--------- .../Document/DocumentPermissionResource.cs | 30 +++++++------- .../Preview/Sync/Service/DocumentResource.cs | 36 +++++++++-------- .../Service/SyncList/SyncListItemResource.cs | 36 +++++++++-------- .../SyncList/SyncListPermissionResource.cs | 30 +++++++------- .../Preview/Sync/Service/SyncListResource.cs | 27 +++++++------ .../Service/SyncMap/SyncMapItemResource.cs | 36 +++++++++-------- .../SyncMap/SyncMapPermissionResource.cs | 30 +++++++------- .../Preview/Sync/Service/SyncMapResource.cs | 27 +++++++------ .../Rest/Preview/Sync/ServiceResource.cs | 40 ++++++++++--------- .../Rest/Preview/Wireless/CommandResource.cs | 20 +++++----- .../Rest/Preview/Wireless/RatePlanResource.cs | 40 ++++++++++--------- .../Preview/Wireless/Sim/UsageResource.cs | 6 +-- .../Rest/Preview/Wireless/SimResource.cs | 23 ++++++----- .../Organizations/AccountResource.cs | 12 +++--- .../Organizations/RoleAssignmentResource.cs | 21 +++++----- .../PreviewIam/Organizations/UserResource.cs | 36 +++++++++-------- .../Rest/PreviewIam/V1/AuthorizeResource.cs | 6 +-- .../Rest/PreviewIam/V1/TokenResource.cs | 6 +-- .../Pricing/V1/Messaging/CountryResource.cs | 14 +++---- .../Pricing/V1/PhoneNumber/CountryResource.cs | 14 +++---- .../Rest/Pricing/V1/Voice/CountryResource.cs | 14 +++---- .../Rest/Pricing/V1/Voice/NumberResource.cs | 6 +-- src/Twilio/Rest/Pricing/V2/CountryResource.cs | 14 +++---- src/Twilio/Rest/Pricing/V2/NumberResource.cs | 6 +-- .../Rest/Pricing/V2/Voice/CountryResource.cs | 14 +++---- .../Rest/Pricing/V2/Voice/NumberResource.cs | 6 +-- .../Proxy/V1/Service/PhoneNumberResource.cs | 36 +++++++++-------- .../V1/Service/Session/InteractionResource.cs | 21 +++++----- .../Participant/MessageInteractionResource.cs | 18 ++++----- .../V1/Service/Session/ParticipantResource.cs | 27 +++++++------ .../Rest/Proxy/V1/Service/SessionResource.cs | 36 +++++++++-------- .../Proxy/V1/Service/ShortCodeResource.cs | 36 +++++++++-------- src/Twilio/Rest/Proxy/V1/ServiceResource.cs | 40 ++++++++++--------- .../Rest/Routes/V2/PhoneNumberResource.cs | 17 ++++---- .../Rest/Routes/V2/SipDomainResource.cs | 17 ++++---- src/Twilio/Rest/Routes/V2/TrunkResource.cs | 17 ++++---- .../V1/Service/Asset/AssetVersionResource.cs | 12 +++--- .../Serverless/V1/Service/AssetResource.cs | 36 +++++++++-------- .../V1/Service/Build/BuildStatusResource.cs | 6 +-- .../Serverless/V1/Service/BuildResource.cs | 27 +++++++------ .../Service/Environment/DeploymentResource.cs | 18 ++++----- .../V1/Service/Environment/LogResource.cs | 12 +++--- .../Service/Environment/VariableResource.cs | 36 +++++++++-------- .../V1/Service/EnvironmentResource.cs | 27 +++++++------ .../FunctionVersionContentResource.cs | 6 +-- .../Function/FunctionVersionResource.cs | 12 +++--- .../Serverless/V1/Service/FunctionResource.cs | 36 +++++++++-------- .../Rest/Serverless/V1/ServiceResource.cs | 40 ++++++++++--------- .../Engagement/EngagementContextResource.cs | 6 +-- .../Engagement/Step/StepContextResource.cs | 6 +-- .../Studio/V1/Flow/Engagement/StepResource.cs | 12 +++--- .../Rest/Studio/V1/Flow/EngagementResource.cs | 27 +++++++------ .../Execution/ExecutionContextResource.cs | 6 +-- .../ExecutionStepContextResource.cs | 6 +-- .../Flow/Execution/ExecutionStepResource.cs | 12 +++--- .../Rest/Studio/V1/Flow/ExecutionResource.cs | 36 +++++++++-------- src/Twilio/Rest/Studio/V1/FlowResource.cs | 25 ++++++------ .../Execution/ExecutionContextResource.cs | 6 +-- .../ExecutionStepContextResource.cs | 6 +-- .../Flow/Execution/ExecutionStepResource.cs | 12 +++--- .../Rest/Studio/V2/Flow/ExecutionResource.cs | 36 +++++++++-------- .../Studio/V2/Flow/FlowRevisionResource.cs | 12 +++--- .../Studio/V2/Flow/FlowTestUserResource.cs | 17 ++++---- src/Twilio/Rest/Studio/V2/FlowResource.cs | 40 ++++++++++--------- .../Rest/Studio/V2/FlowValidateResource.cs | 9 +++-- .../Rest/Supersim/V1/EsimProfileResource.cs | 20 +++++----- src/Twilio/Rest/Supersim/V1/FleetResource.cs | 29 +++++++------- .../Rest/Supersim/V1/IpCommandResource.cs | 20 +++++----- .../NetworkAccessProfileNetworkResource.cs | 27 +++++++------ .../V1/NetworkAccessProfileResource.cs | 29 +++++++------- .../Rest/Supersim/V1/NetworkResource.cs | 14 +++---- .../Supersim/V1/SettingsUpdateResource.cs | 6 +-- .../Supersim/V1/Sim/BillingPeriodResource.cs | 6 +-- .../Supersim/V1/Sim/SimIpAddressResource.cs | 6 +-- src/Twilio/Rest/Supersim/V1/SimResource.cs | 29 +++++++------- .../Rest/Supersim/V1/SmsCommandResource.cs | 20 +++++----- .../Rest/Supersim/V1/UsageRecordResource.cs | 6 +-- .../Document/DocumentPermissionResource.cs | 30 +++++++------- .../Rest/Sync/V1/Service/DocumentResource.cs | 36 +++++++++-------- .../Service/SyncList/SyncListItemResource.cs | 36 +++++++++-------- .../SyncList/SyncListPermissionResource.cs | 30 +++++++------- .../Rest/Sync/V1/Service/SyncListResource.cs | 36 +++++++++-------- .../V1/Service/SyncMap/SyncMapItemResource.cs | 36 +++++++++-------- .../SyncMap/SyncMapPermissionResource.cs | 30 +++++++------- .../Rest/Sync/V1/Service/SyncMapResource.cs | 36 +++++++++-------- .../SyncStream/StreamMessageResource.cs | 6 +-- .../Sync/V1/Service/SyncStreamResource.cs | 36 +++++++++-------- src/Twilio/Rest/Sync/V1/ServiceResource.cs | 40 ++++++++++--------- .../V1/Workspace/ActivityResource.cs | 36 +++++++++-------- .../Taskrouter/V1/Workspace/EventResource.cs | 12 +++--- .../V1/Workspace/Task/ReservationResource.cs | 21 +++++----- .../V1/Workspace/TaskChannelResource.cs | 36 +++++++++-------- ...TaskQueueBulkRealTimeStatisticsResource.cs | 6 +-- .../TaskQueueCumulativeStatisticsResource.cs | 6 +-- .../TaskQueueRealTimeStatisticsResource.cs | 6 +-- .../TaskQueue/TaskQueueStatisticsResource.cs | 6 +-- .../TaskQueue/TaskQueuesStatisticsResource.cs | 6 +-- .../V1/Workspace/TaskQueueResource.cs | 36 +++++++++-------- .../Taskrouter/V1/Workspace/TaskResource.cs | 36 +++++++++-------- .../Workspace/Worker/ReservationResource.cs | 21 +++++----- .../Workspace/Worker/WorkerChannelResource.cs | 21 +++++----- .../Worker/WorkerStatisticsResource.cs | 6 +-- .../WorkersCumulativeStatisticsResource.cs | 6 +-- .../WorkersRealTimeStatisticsResource.cs | 6 +-- .../Worker/WorkersStatisticsResource.cs | 6 +-- .../Taskrouter/V1/Workspace/WorkerResource.cs | 36 +++++++++-------- .../WorkflowCumulativeStatisticsResource.cs | 6 +-- .../WorkflowRealTimeStatisticsResource.cs | 6 +-- .../Workflow/WorkflowStatisticsResource.cs | 6 +-- .../V1/Workspace/WorkflowResource.cs | 36 +++++++++-------- .../WorkspaceCumulativeStatisticsResource.cs | 6 +-- .../WorkspaceRealTimeStatisticsResource.cs | 6 +-- .../Workspace/WorkspaceStatisticsResource.cs | 6 +-- .../Rest/Taskrouter/V1/WorkspaceResource.cs | 40 ++++++++++--------- .../V1/Trunk/CredentialListResource.cs | 27 +++++++------ .../V1/Trunk/IpAccessControlListResource.cs | 27 +++++++------ .../V1/Trunk/OriginationUrlResource.cs | 36 +++++++++-------- .../Trunking/V1/Trunk/PhoneNumberResource.cs | 27 +++++++------ .../Trunking/V1/Trunk/RecordingResource.cs | 17 ++++---- src/Twilio/Rest/Trunking/V1/TrunkResource.cs | 40 ++++++++++--------- .../V1/ComplianceInquiriesResource.cs | 15 +++---- ...ComplianceRegistrationInquiriesResource.cs | 15 +++---- .../V1/ComplianceTollfreeInquiriesResource.cs | 6 +-- ...ofilesChannelEndpointAssignmentResource.cs | 27 +++++++------ ...stomerProfilesEntityAssignmentsResource.cs | 27 +++++++------ .../CustomerProfilesEvaluationsResource.cs | 18 ++++----- .../Trusthub/V1/CustomerProfilesResource.cs | 40 ++++++++++--------- .../Rest/Trusthub/V1/EndUserResource.cs | 40 ++++++++++--------- .../Rest/Trusthub/V1/EndUserTypeResource.cs | 14 +++---- .../Rest/Trusthub/V1/PoliciesResource.cs | 14 +++---- .../Trusthub/V1/SupportingDocumentResource.cs | 40 ++++++++++--------- .../V1/SupportingDocumentTypeResource.cs | 14 +++---- ...oductsChannelEndpointAssignmentResource.cs | 27 +++++++------ .../TrustProductsEntityAssignmentsResource.cs | 27 +++++++------ .../TrustProductsEvaluationsResource.cs | 18 ++++----- .../Rest/Trusthub/V1/TrustProductsResource.cs | 40 ++++++++++--------- src/Twilio/Rest/Verify/V2/FormResource.cs | 6 +-- src/Twilio/Rest/Verify/V2/SafelistResource.cs | 25 ++++++------ .../Verify/V2/Service/AccessTokenResource.cs | 12 +++--- .../Entity/Challenge/NotificationResource.cs | 6 +-- .../V2/Service/Entity/ChallengeResource.cs | 27 +++++++------ .../V2/Service/Entity/FactorResource.cs | 30 +++++++------- .../V2/Service/Entity/NewFactorResource.cs | 6 +-- .../Rest/Verify/V2/Service/EntityResource.cs | 27 +++++++------ .../Service/MessagingConfigurationResource.cs | 36 +++++++++-------- .../V2/Service/RateLimit/BucketResource.cs | 36 +++++++++-------- .../Verify/V2/Service/RateLimitResource.cs | 36 +++++++++-------- .../V2/Service/VerificationCheckResource.cs | 6 +-- .../Verify/V2/Service/VerificationResource.cs | 21 +++++----- .../Rest/Verify/V2/Service/WebhookResource.cs | 36 +++++++++-------- src/Twilio/Rest/Verify/V2/ServiceResource.cs | 40 ++++++++++--------- src/Twilio/Rest/Verify/V2/TemplateResource.cs | 6 +-- .../Verify/V2/VerificationAttemptResource.cs | 14 +++---- .../V2/VerificationAttemptsSummaryResource.cs | 6 +-- .../Rest/Video/V1/CompositionHookResource.cs | 40 ++++++++++--------- .../Rest/Video/V1/CompositionResource.cs | 31 +++++++------- .../Video/V1/CompositionSettingsResource.cs | 14 +++---- src/Twilio/Rest/Video/V1/RecordingResource.cs | 25 ++++++------ .../Video/V1/RecordingSettingsResource.cs | 14 +++---- .../V1/Room/Participant/AnonymizeResource.cs | 9 +++-- .../Participant/PublishedTrackResource.cs | 12 +++--- .../Participant/SubscribeRulesResource.cs | 15 +++---- .../Participant/SubscribedTrackResource.cs | 12 +++--- .../Rest/Video/V1/Room/ParticipantResource.cs | 21 +++++----- .../Video/V1/Room/RecordingRulesResource.cs | 17 ++++---- .../Video/V1/Room/RoomRecordingResource.cs | 21 +++++----- src/Twilio/Rest/Video/V1/RoomResource.cs | 29 +++++++------- .../Rest/Voice/V1/ArchivedCallResource.cs | 9 +++-- src/Twilio/Rest/Voice/V1/ByocTrunkResource.cs | 40 ++++++++++--------- .../ConnectionPolicyTargetResource.cs | 36 +++++++++-------- .../Rest/Voice/V1/ConnectionPolicyResource.cs | 40 ++++++++++--------- .../BulkCountryUpdateResource.cs | 6 +-- .../Country/HighriskSpecialPrefixResource.cs | 6 +-- .../V1/DialingPermissions/CountryResource.cs | 14 +++---- .../V1/DialingPermissions/SettingsResource.cs | 17 ++++---- src/Twilio/Rest/Voice/V1/IpRecordResource.cs | 40 ++++++++++--------- .../Rest/Voice/V1/SourceIpMappingResource.cs | 40 ++++++++++--------- .../Rest/Wireless/V1/CommandResource.cs | 31 +++++++------- .../Rest/Wireless/V1/RatePlanResource.cs | 40 ++++++++++--------- .../Wireless/V1/Sim/DataSessionResource.cs | 6 +-- .../Wireless/V1/Sim/UsageRecordResource.cs | 6 +-- src/Twilio/Rest/Wireless/V1/SimResource.cs | 34 ++++++++-------- .../Rest/Wireless/V1/UsageRecordResource.cs | 6 +-- 473 files changed, 5152 insertions(+), 4730 deletions(-) diff --git a/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionResource.cs b/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionResource.cs index 1b7405a36..bf307e3e1 100644 --- a/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionResource.cs +++ b/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionResource.cs @@ -66,11 +66,12 @@ public static AuthTokenPromotionResource Update(UpdateAuthTokenPromotionOptions /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthTokenPromotion #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAuthTokenPromotionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateAuthTokenPromotionOptions 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 @@ -90,10 +91,11 @@ public static AuthTokenPromotionResource Update( /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthTokenPromotion public static async System.Threading.Tasks.Task UpdateAsync( - ITwilioRestClient client = null) + ITwilioRestClient client = null, + CancellationToken cancellationToken = default) { var options = new UpdateAuthTokenPromotionOptions(){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Accounts/V1/BulkConsentsResource.cs b/src/Twilio/Rest/Accounts/V1/BulkConsentsResource.cs index ee76ff29b..3c90dbde6 100644 --- a/src/Twilio/Rest/Accounts/V1/BulkConsentsResource.cs +++ b/src/Twilio/Rest/Accounts/V1/BulkConsentsResource.cs @@ -66,10 +66,10 @@ public static BulkConsentsResource Create(CreateBulkConsentsOptions options, ITw /// Create BulkConsents parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkConsents - public static async System.Threading.Tasks.Task CreateAsync(CreateBulkConsentsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateBulkConsentsOptions 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 @@ -96,7 +96,7 @@ public static async System.Threading.Tasks.Task CreateAsyn ITwilioRestClient client = null) { var options = new CreateBulkConsentsOptions(items){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Accounts/V1/BulkContactsResource.cs b/src/Twilio/Rest/Accounts/V1/BulkContactsResource.cs index 7c3f99283..f549c7617 100644 --- a/src/Twilio/Rest/Accounts/V1/BulkContactsResource.cs +++ b/src/Twilio/Rest/Accounts/V1/BulkContactsResource.cs @@ -66,10 +66,10 @@ public static BulkContactsResource Create(CreateBulkContactsOptions options, ITw /// Create BulkContacts parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkContacts - public static async System.Threading.Tasks.Task CreateAsync(CreateBulkContactsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateBulkContactsOptions 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 @@ -96,7 +96,7 @@ public static async System.Threading.Tasks.Task CreateAsyn ITwilioRestClient client = null) { var options = new CreateBulkContactsOptions(items){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Accounts/V1/Credential/AwsResource.cs b/src/Twilio/Rest/Accounts/V1/Credential/AwsResource.cs index 38f9fc0dd..33264cad3 100644 --- a/src/Twilio/Rest/Accounts/V1/Credential/AwsResource.cs +++ b/src/Twilio/Rest/Accounts/V1/Credential/AwsResource.cs @@ -66,10 +66,10 @@ public static AwsResource Create(CreateAwsOptions options, ITwilioRestClient cli /// Create Aws parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Aws - public static async System.Threading.Tasks.Task CreateAsync(CreateAwsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAwsOptions 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 @@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateAwsOptions(credentials){ FriendlyName = friendlyName, AccountSid = accountSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteAwsOptions options, ITwilioRestClient client = n /// Delete Aws parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Aws - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAwsOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAwsOptions 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 @@ -169,10 +170,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the AWS resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Aws - 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 DeleteAwsOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -209,10 +210,10 @@ public static AwsResource Fetch(FetchAwsOptions options, ITwilioRestClient clien /// Fetch Aws parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Aws - public static async System.Threading.Tasks.Task FetchAsync(FetchAwsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAwsOptions 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 @@ -233,10 +234,10 @@ public static AwsResource Fetch( /// The Twilio-provided string that uniquely identifies the AWS resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Aws - 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 FetchAwsOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -271,10 +272,10 @@ public static ResourceSet Read(ReadAwsOptions options, ITwilioRestC /// Read Aws parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Aws - public static async System.Threading.Tasks.Task> ReadAsync(ReadAwsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAwsOptions 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("credentials", response.Content); return new ResourceSet(page, options, client); @@ -306,7 +307,7 @@ public static async System.Threading.Tasks.Task> ReadAs ITwilioRestClient client = null) { var options = new ReadAwsOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -393,11 +394,12 @@ public static AwsResource Update(UpdateAwsOptions options, ITwilioRestClient cli /// Client to make requests to Twilio /// Task that resolves to A single instance of Aws #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAwsOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateAwsOptions 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 @@ -428,7 +430,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateAwsOptions(pathSid){ FriendlyName = friendlyName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyResource.cs b/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyResource.cs index c724a60c8..6ff6c4119 100644 --- a/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyResource.cs +++ b/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyResource.cs @@ -66,10 +66,10 @@ public static PublicKeyResource Create(CreatePublicKeyOptions options, ITwilioRe /// Create PublicKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PublicKey - public static async System.Threading.Tasks.Task CreateAsync(CreatePublicKeyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreatePublicKeyOptions 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 @@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreatePublicKeyOptions(publicKey){ FriendlyName = friendlyName, AccountSid = accountSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeletePublicKeyOptions options, ITwilioRestClient clie /// Delete PublicKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PublicKey - public static async System.Threading.Tasks.Task DeleteAsync(DeletePublicKeyOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeletePublicKeyOptions 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 @@ -169,10 +170,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the PublicKey resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of PublicKey - 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 DeletePublicKeyOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -209,10 +210,10 @@ public static PublicKeyResource Fetch(FetchPublicKeyOptions options, ITwilioRest /// Fetch PublicKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PublicKey - public static async System.Threading.Tasks.Task FetchAsync(FetchPublicKeyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchPublicKeyOptions 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 @@ -233,10 +234,10 @@ public static PublicKeyResource Fetch( /// The Twilio-provided string that uniquely identifies the PublicKey resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of PublicKey - 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 FetchPublicKeyOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -271,10 +272,10 @@ public static ResourceSet Read(ReadPublicKeyOptions options, /// Read PublicKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PublicKey - public static async System.Threading.Tasks.Task> ReadAsync(ReadPublicKeyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPublicKeyOptions 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("credentials", response.Content); return new ResourceSet(page, options, client); @@ -306,7 +307,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadPublicKeyOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -393,11 +394,12 @@ public static PublicKeyResource Update(UpdatePublicKeyOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of PublicKey #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdatePublicKeyOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdatePublicKeyOptions 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 @@ -428,7 +430,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdatePublicKeyOptions(pathSid){ FriendlyName = friendlyName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Accounts/V1/SafelistResource.cs b/src/Twilio/Rest/Accounts/V1/SafelistResource.cs index 6397d5bf4..89176cb59 100644 --- a/src/Twilio/Rest/Accounts/V1/SafelistResource.cs +++ b/src/Twilio/Rest/Accounts/V1/SafelistResource.cs @@ -66,10 +66,10 @@ public static SafelistResource Create(CreateSafelistOptions options, ITwilioRest /// Create Safelist parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task CreateAsync(CreateSafelistOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSafelistOptions 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 @@ -96,7 +96,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateSafelistOptions(phoneNumber){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -135,11 +135,12 @@ public static bool Delete(DeleteSafelistOptions options, ITwilioRestClient clien /// Delete Safelist parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSafelistOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSafelistOptions 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 @@ -157,10 +158,10 @@ public static bool Delete(ITwilioRestClient client = null) /// Remove a phone number from SafeList. /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task DeleteAsync(ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new DeleteSafelistOptions() ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -195,10 +196,10 @@ public static SafelistResource Fetch(FetchSafelistOptions options, ITwilioRestCl /// Fetch Safelist parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task FetchAsync(FetchSafelistOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSafelistOptions 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 @@ -222,7 +223,7 @@ public static SafelistResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string phoneNumber = null, ITwilioRestClient client = null) { var options = new FetchSafelistOptions(){ PhoneNumber = phoneNumber }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenResource.cs b/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenResource.cs index be845313a..92d8d8dbc 100644 --- a/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenResource.cs +++ b/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenResource.cs @@ -66,10 +66,10 @@ public static SecondaryAuthTokenResource Create(CreateSecondaryAuthTokenOptions /// Create SecondaryAuthToken parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SecondaryAuthToken - public static async System.Threading.Tasks.Task CreateAsync(CreateSecondaryAuthTokenOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSecondaryAuthTokenOptions 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 @@ -89,10 +89,11 @@ public static SecondaryAuthTokenResource Create( /// Client to make requests to Twilio /// Task that resolves to A single instance of SecondaryAuthToken public static async System.Threading.Tasks.Task CreateAsync( - ITwilioRestClient client = null) + ITwilioRestClient client = null, + CancellationToken cancellationToken = default) { var options = new CreateSecondaryAuthTokenOptions(){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -131,11 +132,12 @@ public static bool Delete(DeleteSecondaryAuthTokenOptions options, ITwilioRestCl /// Delete SecondaryAuthToken parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SecondaryAuthToken - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSecondaryAuthTokenOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSecondaryAuthTokenOptions 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 @@ -153,10 +155,10 @@ public static bool Delete(ITwilioRestClient client = null) /// Delete the secondary Auth Token from your account /// Client to make requests to Twilio /// Task that resolves to A single instance of SecondaryAuthToken - public static async System.Threading.Tasks.Task DeleteAsync(ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new DeleteSecondaryAuthTokenOptions() ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberResource.cs b/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberResource.cs index 9c7f053e0..f7284edb6 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberResource.cs @@ -97,10 +97,10 @@ public static ResourceSet Read(ReadDependentPhoneN /// Read DependentPhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DependentPhoneNumber - public static async System.Threading.Tasks.Task> ReadAsync(ReadDependentPhoneNumberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDependentPhoneNumberOptions 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("dependent_phone_numbers", response.Content); return new ResourceSet(page, options, client); @@ -140,7 +140,7 @@ public static async System.Threading.Tasks.Task Create Address parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Address - public static async System.Threading.Tasks.Task CreateAsync(CreateAddressOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAddressOptions 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 @@ -138,7 +138,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateAddressOptions(customerName, street, city, region, postalCode, isoCountry){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, EmergencyEnabled = emergencyEnabled, AutoCorrectAddress = autoCorrectAddress, StreetSecondary = streetSecondary }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -181,11 +181,12 @@ public static bool Delete(DeleteAddressOptions options, ITwilioRestClient client /// Delete Address parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Address - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAddressOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAddressOptions 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 @@ -210,7 +211,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteAddressOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -249,10 +250,10 @@ public static AddressResource Fetch(FetchAddressOptions options, ITwilioRestClie /// Fetch Address parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Address - public static async System.Threading.Tasks.Task FetchAsync(FetchAddressOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAddressOptions 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 @@ -279,7 +280,7 @@ public static AddressResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchAddressOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -316,10 +317,10 @@ public static ResourceSet Read(ReadAddressOptions options, ITwi /// Read Address parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Address - public static async System.Threading.Tasks.Task> ReadAsync(ReadAddressOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAddressOptions 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("addresses", response.Content); return new ResourceSet(page, options, client); @@ -367,7 +368,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadAddressOptions(){ PathAccountSid = pathAccountSid, CustomerName = customerName, FriendlyName = friendlyName, IsoCountry = isoCountry, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -456,11 +457,12 @@ public static AddressResource Update(UpdateAddressOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Address #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAddressOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateAddressOptions 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 @@ -527,7 +529,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateAddressOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, CustomerName = customerName, Street = street, City = city, Region = region, PostalCode = postalCode, EmergencyEnabled = emergencyEnabled, AutoCorrectAddress = autoCorrectAddress, StreetSecondary = streetSecondary }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/ApplicationResource.cs b/src/Twilio/Rest/Api/V2010/Account/ApplicationResource.cs index 89e8389cf..9af66b7b7 100644 --- a/src/Twilio/Rest/Api/V2010/Account/ApplicationResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/ApplicationResource.cs @@ -68,10 +68,10 @@ public static ApplicationResource Create(CreateApplicationOptions options, ITwil /// Create Application parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Application - public static async System.Threading.Tasks.Task CreateAsync(CreateApplicationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateApplicationOptions 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 @@ -162,7 +162,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreateApplicationOptions(){ PathAccountSid = pathAccountSid, ApiVersion = apiVersion, VoiceUrl = voiceUrl, VoiceMethod = voiceMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceFallbackMethod = voiceFallbackMethod, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceCallerIdLookup = voiceCallerIdLookup, SmsUrl = smsUrl, SmsMethod = smsMethod, SmsFallbackUrl = smsFallbackUrl, SmsFallbackMethod = smsFallbackMethod, SmsStatusCallback = smsStatusCallback, MessageStatusCallback = messageStatusCallback, FriendlyName = friendlyName, PublicApplicationConnectEnabled = publicApplicationConnectEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -205,11 +205,12 @@ public static bool Delete(DeleteApplicationOptions options, ITwilioRestClient cl /// Delete Application parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Application - public static async System.Threading.Tasks.Task DeleteAsync(DeleteApplicationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteApplicationOptions 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 @@ -234,7 +235,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteApplicationOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -273,10 +274,10 @@ public static ApplicationResource Fetch(FetchApplicationOptions options, ITwilio /// Fetch Application parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Application - public static async System.Threading.Tasks.Task FetchAsync(FetchApplicationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchApplicationOptions 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 @@ -303,7 +304,7 @@ public static ApplicationResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchApplicationOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -340,10 +341,10 @@ public static ResourceSet Read(ReadApplicationOptions optio /// Read Application parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Application - public static async System.Threading.Tasks.Task> ReadAsync(ReadApplicationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadApplicationOptions 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("applications", response.Content); return new ResourceSet(page, options, client); @@ -383,7 +384,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadApplicationOptions(){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -472,11 +473,12 @@ public static ApplicationResource Update(UpdateApplicationOptions options, ITwil /// Client to make requests to Twilio /// Task that resolves to A single instance of Application #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateApplicationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateApplicationOptions 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 @@ -571,7 +573,7 @@ public static async System.Threading.Tasks.Task UpdateAsync ITwilioRestClient client = null) { var options = new UpdateApplicationOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, ApiVersion = apiVersion, VoiceUrl = voiceUrl, VoiceMethod = voiceMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceFallbackMethod = voiceFallbackMethod, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceCallerIdLookup = voiceCallerIdLookup, SmsUrl = smsUrl, SmsMethod = smsMethod, SmsFallbackUrl = smsFallbackUrl, SmsFallbackMethod = smsFallbackMethod, SmsStatusCallback = smsStatusCallback, MessageStatusCallback = messageStatusCallback, PublicApplicationConnectEnabled = publicApplicationConnectEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppResource.cs b/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppResource.cs index f7657c1ed..de1202dde 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppResource.cs @@ -82,10 +82,10 @@ public static AuthorizedConnectAppResource Fetch(FetchAuthorizedConnectAppOption /// Fetch AuthorizedConnectApp parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizedConnectApp - public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizedConnectAppOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizedConnectAppOptions 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 @@ -112,7 +112,7 @@ public static AuthorizedConnectAppResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathConnectAppSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchAuthorizedConnectAppOptions(pathConnectAppSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -149,10 +149,10 @@ public static ResourceSet Read(ReadAuthorizedConne /// Read AuthorizedConnectApp parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizedConnectApp - public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthorizedConnectAppOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthorizedConnectAppOptions 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("authorized_connect_apps", response.Content); return new ResourceSet(page, options, client); @@ -188,7 +188,7 @@ public static async System.Threading.Tasks.Task Read(ReadLocalOptions options, ITwilioR /// Read Local parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Local - public static async System.Threading.Tasks.Task> ReadAsync(ReadLocalOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadLocalOptions 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("available_phone_numbers", response.Content); return new ResourceSet(page, options, client); @@ -184,7 +184,7 @@ public static async System.Threading.Tasks.Task> Read ITwilioRestClient client = null) { var options = new ReadLocalOptions(pathCountryCode){ PathAccountSid = pathAccountSid, AreaCode = areaCode, Contains = contains, SmsEnabled = smsEnabled, MmsEnabled = mmsEnabled, VoiceEnabled = voiceEnabled, ExcludeAllAddressRequired = excludeAllAddressRequired, ExcludeLocalAddressRequired = excludeLocalAddressRequired, ExcludeForeignAddressRequired = excludeForeignAddressRequired, Beta = beta, NearNumber = nearNumber, NearLatLong = nearLatLong, Distance = distance, InPostalCode = inPostalCode, InRegion = inRegion, InRateCenter = inRateCenter, InLata = inLata, InLocality = inLocality, FaxEnabled = faxEnabled, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineResource.cs b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineResource.cs index 0fe299f82..069a86a85 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineResource.cs @@ -69,10 +69,10 @@ public static ResourceSet Read(ReadMachineToMachineOpt /// Read MachineToMachine parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MachineToMachine - public static async System.Threading.Tasks.Task> ReadAsync(ReadMachineToMachineOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMachineToMachineOptions 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("available_phone_numbers", response.Content); return new ResourceSet(page, options, client); @@ -184,7 +184,7 @@ public static async System.Threading.Tasks.Task Read(ReadMobileOptions options, ITwili /// Read Mobile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Mobile - public static async System.Threading.Tasks.Task> ReadAsync(ReadMobileOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMobileOptions 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("available_phone_numbers", response.Content); return new ResourceSet(page, options, client); @@ -184,7 +184,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadMobileOptions(pathCountryCode){ PathAccountSid = pathAccountSid, AreaCode = areaCode, Contains = contains, SmsEnabled = smsEnabled, MmsEnabled = mmsEnabled, VoiceEnabled = voiceEnabled, ExcludeAllAddressRequired = excludeAllAddressRequired, ExcludeLocalAddressRequired = excludeLocalAddressRequired, ExcludeForeignAddressRequired = excludeForeignAddressRequired, Beta = beta, NearNumber = nearNumber, NearLatLong = nearLatLong, Distance = distance, InPostalCode = inPostalCode, InRegion = inRegion, InRateCenter = inRateCenter, InLata = inLata, InLocality = inLocality, FaxEnabled = faxEnabled, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalResource.cs b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalResource.cs index c78deeb3d..bd4ee4013 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalResource.cs @@ -69,10 +69,10 @@ public static ResourceSet Read(ReadNationalOptions options, IT /// Read National parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of National - public static async System.Threading.Tasks.Task> ReadAsync(ReadNationalOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadNationalOptions 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("available_phone_numbers", response.Content); return new ResourceSet(page, options, client); @@ -184,7 +184,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadNationalOptions(pathCountryCode){ PathAccountSid = pathAccountSid, AreaCode = areaCode, Contains = contains, SmsEnabled = smsEnabled, MmsEnabled = mmsEnabled, VoiceEnabled = voiceEnabled, ExcludeAllAddressRequired = excludeAllAddressRequired, ExcludeLocalAddressRequired = excludeLocalAddressRequired, ExcludeForeignAddressRequired = excludeForeignAddressRequired, Beta = beta, NearNumber = nearNumber, NearLatLong = nearLatLong, Distance = distance, InPostalCode = inPostalCode, InRegion = inRegion, InRateCenter = inRateCenter, InLata = inLata, InLocality = inLocality, FaxEnabled = faxEnabled, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostResource.cs b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostResource.cs index f0c387a49..eb8269dbd 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostResource.cs @@ -69,10 +69,10 @@ public static ResourceSet Read(ReadSharedCostOptions options /// Read SharedCost parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SharedCost - public static async System.Threading.Tasks.Task> ReadAsync(ReadSharedCostOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSharedCostOptions 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("available_phone_numbers", response.Content); return new ResourceSet(page, options, client); @@ -184,7 +184,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadSharedCostOptions(pathCountryCode){ PathAccountSid = pathAccountSid, AreaCode = areaCode, Contains = contains, SmsEnabled = smsEnabled, MmsEnabled = mmsEnabled, VoiceEnabled = voiceEnabled, ExcludeAllAddressRequired = excludeAllAddressRequired, ExcludeLocalAddressRequired = excludeLocalAddressRequired, ExcludeForeignAddressRequired = excludeForeignAddressRequired, Beta = beta, NearNumber = nearNumber, NearLatLong = nearLatLong, Distance = distance, InPostalCode = inPostalCode, InRegion = inRegion, InRateCenter = inRateCenter, InLata = inLata, InLocality = inLocality, FaxEnabled = faxEnabled, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryResource.cs b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryResource.cs index 2b97a1ab3..cc6e11fb3 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryResource.cs @@ -69,10 +69,10 @@ public static AvailablePhoneNumberCountryResource Fetch(FetchAvailablePhoneNumbe /// Fetch AvailablePhoneNumberCountry parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailablePhoneNumberCountry - public static async System.Threading.Tasks.Task FetchAsync(FetchAvailablePhoneNumberCountryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAvailablePhoneNumberCountryOptions 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 AvailablePhoneNumberCountryResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathCountryCode, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchAvailablePhoneNumberCountryOptions(pathCountryCode){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -136,10 +136,10 @@ public static ResourceSet Read(ReadAvailabl /// Read AvailablePhoneNumberCountry parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailablePhoneNumberCountry - public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailablePhoneNumberCountryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailablePhoneNumberCountryOptions 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("countries", response.Content); return new ResourceSet(page, options, client); @@ -175,7 +175,7 @@ public static async System.Threading.Tasks.Task Fetch Balance parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Balance - public static async System.Threading.Tasks.Task FetchAsync(FetchBalanceOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchBalanceOptions 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 @@ -94,7 +94,7 @@ public static BalanceResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchBalanceOptions(){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionResource.cs b/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionResource.cs index 78ec37096..d7fa883b5 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionResource.cs @@ -70,10 +70,10 @@ public static UserDefinedMessageSubscriptionResource Create(CreateUserDefinedMes /// Create UserDefinedMessageSubscription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserDefinedMessageSubscription - public static async System.Threading.Tasks.Task CreateAsync(CreateUserDefinedMessageSubscriptionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateUserDefinedMessageSubscriptionOptions 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 @@ -116,7 +116,7 @@ public static async System.Threading.Tasks.Task Delete UserDefinedMessageSubscription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserDefinedMessageSubscription - public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserDefinedMessageSubscriptionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserDefinedMessageSubscriptionOptions 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 @@ -192,7 +193,7 @@ public static bool Delete(string pathCallSid, string pathSid, string pathAccount public static async System.Threading.Tasks.Task DeleteAsync(string pathCallSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteUserDefinedMessageSubscriptionOptions(pathCallSid, pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/CallResource.cs b/src/Twilio/Rest/Api/V2010/Account/CallResource.cs index 95b5c13e4..f355582d9 100644 --- a/src/Twilio/Rest/Api/V2010/Account/CallResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/CallResource.cs @@ -99,10 +99,10 @@ public static CallResource Create(CreateCallOptions options, ITwilioRestClient c /// Create Call parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Call - public static async System.Threading.Tasks.Task CreateAsync(CreateCallOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCallOptions 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 @@ -269,7 +269,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateCallOptions(to, from){ PathAccountSid = pathAccountSid, Url = url, Twiml = twiml, ApplicationSid = applicationSid, Method = method, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StatusCallbackEvent = statusCallbackEvent, StatusCallbackMethod = statusCallbackMethod, SendDigits = sendDigits, Timeout = timeout, Record = record, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, MachineDetection = machineDetection, MachineDetectionTimeout = machineDetectionTimeout, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, Trim = trim, CallerId = callerId, MachineDetectionSpeechThreshold = machineDetectionSpeechThreshold, MachineDetectionSpeechEndThreshold = machineDetectionSpeechEndThreshold, MachineDetectionSilenceTimeout = machineDetectionSilenceTimeout, AsyncAmd = asyncAmd, AsyncAmdStatusCallback = asyncAmdStatusCallback, AsyncAmdStatusCallbackMethod = asyncAmdStatusCallbackMethod, Byoc = byoc, CallReason = callReason, CallToken = callToken, RecordingTrack = recordingTrack, TimeLimit = timeLimit }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -312,11 +312,12 @@ public static bool Delete(DeleteCallOptions options, ITwilioRestClient client = /// Delete Call parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Call - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCallOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCallOptions 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 @@ -341,7 +342,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteCallOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -380,10 +381,10 @@ public static CallResource Fetch(FetchCallOptions options, ITwilioRestClient cli /// Fetch Call parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Call - public static async System.Threading.Tasks.Task FetchAsync(FetchCallOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCallOptions 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 @@ -410,7 +411,7 @@ public static CallResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchCallOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -447,10 +448,10 @@ public static ResourceSet Read(ReadCallOptions options, ITwilioRes /// Read Call parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Call - public static async System.Threading.Tasks.Task> ReadAsync(ReadCallOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCallOptions 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("calls", response.Content); return new ResourceSet(page, options, client); @@ -526,7 +527,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadCallOptions(){ PathAccountSid = pathAccountSid, To = to, From = from, ParentCallSid = parentCallSid, Status = status, StartTimeBefore = startTimeBefore, StartTime = startTime, StartTimeAfter = startTimeAfter, EndTimeBefore = endTimeBefore, EndTime = endTime, EndTimeAfter = endTimeAfter, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -615,11 +616,12 @@ public static CallResource Update(UpdateCallOptions options, ITwilioRestClient c /// Client to make requests to Twilio /// Task that resolves to A single instance of Call #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateCallOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateCallOptions 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 @@ -686,7 +688,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateCallOptions(pathSid){ PathAccountSid = pathAccountSid, Url = url, Method = method, Status = status, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, Twiml = twiml, TimeLimit = timeLimit }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs index 7114905d7..a3058687c 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs @@ -87,10 +87,10 @@ public static ParticipantResource Create(CreateParticipantOptions options, ITwil /// Create Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions 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 @@ -313,7 +313,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreateParticipantOptions(pathConferenceSid, from, to){ PathAccountSid = pathAccountSid, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Label = label, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, Region = region, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, ConferenceRecordingStatusCallbackEvent = conferenceRecordingStatusCallbackEvent, Coaching = coaching, CallSidToCoach = callSidToCoach, JitterBufferSize = jitterBufferSize, Byoc = byoc, CallerId = callerId, CallReason = callReason, RecordingTrack = recordingTrack, TimeLimit = timeLimit, MachineDetection = machineDetection, MachineDetectionTimeout = machineDetectionTimeout, MachineDetectionSpeechThreshold = machineDetectionSpeechThreshold, MachineDetectionSpeechEndThreshold = machineDetectionSpeechEndThreshold, MachineDetectionSilenceTimeout = machineDetectionSilenceTimeout, AmdStatusCallback = amdStatusCallback, AmdStatusCallbackMethod = amdStatusCallbackMethod, Trim = trim, CallToken = callToken }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -358,11 +358,12 @@ public static bool Delete(DeleteParticipantOptions options, ITwilioRestClient cl /// Delete Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task DeleteAsync(DeleteParticipantOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteParticipantOptions 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 @@ -389,7 +390,7 @@ public static bool Delete(string pathConferenceSid, string pathCallSid, string p public static async System.Threading.Tasks.Task DeleteAsync(string pathConferenceSid, string pathCallSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteParticipantOptions(pathConferenceSid, pathCallSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -430,10 +431,10 @@ public static ParticipantResource Fetch(FetchParticipantOptions options, ITwilio /// Fetch Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions 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 @@ -463,7 +464,7 @@ public static ParticipantResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathConferenceSid, string pathCallSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchParticipantOptions(pathConferenceSid, pathCallSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -502,10 +503,10 @@ public static ResourceSet Read(ReadParticipantOptions optio /// Read Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions 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("participants", response.Content); return new ResourceSet(page, options, client); @@ -557,7 +558,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadParticipantOptions(pathConferenceSid){ PathAccountSid = pathAccountSid, Muted = muted, Hold = hold, Coaching = coaching, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -648,11 +649,12 @@ public static ParticipantResource Update(UpdateParticipantOptions options, ITwil /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateParticipantOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateParticipantOptions 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 @@ -735,7 +737,7 @@ public static async System.Threading.Tasks.Task UpdateAsync ITwilioRestClient client = null) { var options = new UpdateParticipantOptions(pathConferenceSid, pathCallSid){ PathAccountSid = pathAccountSid, Muted = muted, Hold = hold, HoldUrl = holdUrl, HoldMethod = holdMethod, AnnounceUrl = announceUrl, AnnounceMethod = announceMethod, WaitUrl = waitUrl, WaitMethod = waitMethod, BeepOnExit = beepOnExit, EndConferenceOnExit = endConferenceOnExit, Coaching = coaching, CallSidToCoach = callSidToCoach }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingResource.cs b/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingResource.cs index 3c81e6b87..45803354c 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingResource.cs @@ -110,11 +110,12 @@ public static bool Delete(DeleteRecordingOptions options, ITwilioRestClient clie /// Delete Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task DeleteAsync(DeleteRecordingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteRecordingOptions 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 @@ -141,7 +142,7 @@ public static bool Delete(string pathConferenceSid, string pathSid, string pathA public static async System.Threading.Tasks.Task DeleteAsync(string pathConferenceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteRecordingOptions(pathConferenceSid, pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -182,10 +183,10 @@ public static RecordingResource Fetch(FetchRecordingOptions options, ITwilioRest /// Fetch Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions 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 @@ -215,7 +216,7 @@ public static RecordingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathConferenceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchRecordingOptions(pathConferenceSid, pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -254,10 +255,10 @@ public static ResourceSet Read(ReadRecordingOptions options, /// Read Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordingOptions 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("recordings", response.Content); return new ResourceSet(page, options, client); @@ -309,7 +310,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadRecordingOptions(pathConferenceSid){ PathAccountSid = pathAccountSid, DateCreatedBefore = dateCreatedBefore, DateCreated = dateCreated, DateCreatedAfter = dateCreatedAfter, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -400,11 +401,12 @@ public static RecordingResource Update(UpdateRecordingOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateRecordingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateRecordingOptions 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 UpdateRecordingOptions(pathConferenceSid, pathSid, status){ PathAccountSid = pathAccountSid, PauseBehavior = pauseBehavior }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/ConferenceResource.cs b/src/Twilio/Rest/Api/V2010/Account/ConferenceResource.cs index 794d44cfd..424575c2a 100644 --- a/src/Twilio/Rest/Api/V2010/Account/ConferenceResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/ConferenceResource.cs @@ -110,10 +110,10 @@ public static ConferenceResource Fetch(FetchConferenceOptions options, ITwilioRe /// Fetch Conference parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conference - public static async System.Threading.Tasks.Task FetchAsync(FetchConferenceOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchConferenceOptions 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 @@ -140,7 +140,7 @@ public static ConferenceResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchConferenceOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -177,10 +177,10 @@ public static ResourceSet Read(ReadConferenceOptions options /// Read Conference parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conference - public static async System.Threading.Tasks.Task> ReadAsync(ReadConferenceOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConferenceOptions 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("conferences", response.Content); return new ResourceSet(page, options, client); @@ -248,7 +248,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadConferenceOptions(){ PathAccountSid = pathAccountSid, DateCreatedBefore = dateCreatedBefore, DateCreated = dateCreated, DateCreatedAfter = dateCreatedAfter, DateUpdatedBefore = dateUpdatedBefore, DateUpdated = dateUpdated, DateUpdatedAfter = dateUpdatedAfter, FriendlyName = friendlyName, Status = status, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -337,11 +337,12 @@ public static ConferenceResource Update(UpdateConferenceOptions options, ITwilio /// Client to make requests to Twilio /// Task that resolves to A single instance of Conference #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateConferenceOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateConferenceOptions 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 @@ -384,7 +385,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateConferenceOptions(pathSid){ PathAccountSid = pathAccountSid, Status = status, AnnounceUrl = announceUrl, AnnounceMethod = announceMethod }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/ConnectAppResource.cs b/src/Twilio/Rest/Api/V2010/Account/ConnectAppResource.cs index c1284fb89..26b9d023d 100644 --- a/src/Twilio/Rest/Api/V2010/Account/ConnectAppResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/ConnectAppResource.cs @@ -86,11 +86,12 @@ public static bool Delete(DeleteConnectAppOptions options, ITwilioRestClient cli /// Delete ConnectApp parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectApp - public static async System.Threading.Tasks.Task DeleteAsync(DeleteConnectAppOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteConnectAppOptions 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 @@ -115,7 +116,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteConnectAppOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -154,10 +155,10 @@ public static ConnectAppResource Fetch(FetchConnectAppOptions options, ITwilioRe /// Fetch ConnectApp parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectApp - public static async System.Threading.Tasks.Task FetchAsync(FetchConnectAppOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchConnectAppOptions 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 @@ -184,7 +185,7 @@ public static ConnectAppResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchConnectAppOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -221,10 +222,10 @@ public static ResourceSet Read(ReadConnectAppOptions options /// Read ConnectApp parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectApp - public static async System.Threading.Tasks.Task> ReadAsync(ReadConnectAppOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConnectAppOptions 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("connect_apps", response.Content); return new ResourceSet(page, options, client); @@ -260,7 +261,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadConnectAppOptions(){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -349,11 +350,12 @@ public static ConnectAppResource Update(UpdateConnectAppOptions options, ITwilio /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectApp #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateConnectAppOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateConnectAppOptions 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 @@ -416,7 +418,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateConnectAppOptions(pathSid){ PathAccountSid = pathAccountSid, AuthorizeRedirectUrl = authorizeRedirectUrl, CompanyName = companyName, DeauthorizeCallbackMethod = deauthorizeCallbackMethod, DeauthorizeCallbackUrl = deauthorizeCallbackUrl, Description = description, FriendlyName = friendlyName, HomepageUrl = homepageUrl, Permissions = permissions }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionResource.cs b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionResource.cs index 63aab4936..213a3707d 100644 --- a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionResource.cs @@ -73,10 +73,10 @@ public static AssignedAddOnExtensionResource Fetch(FetchAssignedAddOnExtensionOp /// Fetch AssignedAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssignedAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(FetchAssignedAddOnExtensionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAssignedAddOnExtensionOptions 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 @@ -109,7 +109,7 @@ public static AssignedAddOnExtensionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathResourceSid, string pathAssignedAddOnSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchAssignedAddOnExtensionOptions(pathResourceSid, pathAssignedAddOnSid, pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -150,10 +150,10 @@ public static ResourceSet Read(ReadAssignedAddOn /// Read AssignedAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssignedAddOnExtension - public static async System.Threading.Tasks.Task> ReadAsync(ReadAssignedAddOnExtensionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAssignedAddOnExtensionOptions 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("extensions", response.Content); return new ResourceSet(page, options, client); @@ -197,7 +197,7 @@ public static async System.Threading.Tasks.Task Create AssignedAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssignedAddOn - public static async System.Threading.Tasks.Task CreateAsync(CreateAssignedAddOnOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAssignedAddOnOptions 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 CreateAsy ITwilioRestClient client = null) { var options = new CreateAssignedAddOnOptions(pathResourceSid, installedAddOnSid){ PathAccountSid = pathAccountSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -153,11 +153,12 @@ public static bool Delete(DeleteAssignedAddOnOptions options, ITwilioRestClient /// Delete AssignedAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssignedAddOn - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssignedAddOnOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssignedAddOnOptions 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 @@ -184,7 +185,7 @@ public static bool Delete(string pathResourceSid, string pathSid, string pathAcc public static async System.Threading.Tasks.Task DeleteAsync(string pathResourceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteAssignedAddOnOptions(pathResourceSid, pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -225,10 +226,10 @@ public static AssignedAddOnResource Fetch(FetchAssignedAddOnOptions options, ITw /// Fetch AssignedAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssignedAddOn - public static async System.Threading.Tasks.Task FetchAsync(FetchAssignedAddOnOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAssignedAddOnOptions 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 @@ -258,7 +259,7 @@ public static AssignedAddOnResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathResourceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchAssignedAddOnOptions(pathResourceSid, pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -297,10 +298,10 @@ public static ResourceSet Read(ReadAssignedAddOnOptions o /// Read AssignedAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssignedAddOn - public static async System.Threading.Tasks.Task> ReadAsync(ReadAssignedAddOnOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAssignedAddOnOptions 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("assigned_add_ons", response.Content); return new ResourceSet(page, options, client); @@ -340,7 +341,7 @@ public static async System.Threading.Tasks.Task Create Local parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Local - public static async System.Threading.Tasks.Task CreateAsync(CreateLocalOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateLocalOptions 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 @@ -248,7 +248,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateLocalOptions(phoneNumber){ PathAccountSid = pathAccountSid, ApiVersion = apiVersion, FriendlyName = friendlyName, SmsApplicationSid = smsApplicationSid, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceApplicationSid = voiceApplicationSid, VoiceCallerIdLookup = voiceCallerIdLookup, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl, IdentitySid = identitySid, AddressSid = addressSid, EmergencyStatus = emergencyStatus, EmergencyAddressSid = emergencyAddressSid, TrunkSid = trunkSid, VoiceReceiveMode = voiceReceiveMode, BundleSid = bundleSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -285,10 +285,10 @@ public static ResourceSet Read(ReadLocalOptions options, ITwilioR /// Read Local parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Local - public static async System.Threading.Tasks.Task> ReadAsync(ReadLocalOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadLocalOptions 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("incoming_phone_numbers", response.Content); return new ResourceSet(page, options, client); @@ -340,7 +340,7 @@ public static async System.Threading.Tasks.Task> Read ITwilioRestClient client = null) { var options = new ReadLocalOptions(){ PathAccountSid = pathAccountSid, Beta = beta, FriendlyName = friendlyName, PhoneNumber = phoneNumber, Origin = origin, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileResource.cs b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileResource.cs index b8f6e47df..2d175c816 100644 --- a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileResource.cs @@ -126,10 +126,10 @@ public static MobileResource Create(CreateMobileOptions options, ITwilioRestClie /// Create Mobile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Mobile - public static async System.Threading.Tasks.Task CreateAsync(CreateMobileOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMobileOptions 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 @@ -248,7 +248,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateMobileOptions(phoneNumber){ PathAccountSid = pathAccountSid, ApiVersion = apiVersion, FriendlyName = friendlyName, SmsApplicationSid = smsApplicationSid, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceApplicationSid = voiceApplicationSid, VoiceCallerIdLookup = voiceCallerIdLookup, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl, IdentitySid = identitySid, AddressSid = addressSid, EmergencyStatus = emergencyStatus, EmergencyAddressSid = emergencyAddressSid, TrunkSid = trunkSid, VoiceReceiveMode = voiceReceiveMode, BundleSid = bundleSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -285,10 +285,10 @@ public static ResourceSet Read(ReadMobileOptions options, ITwili /// Read Mobile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Mobile - public static async System.Threading.Tasks.Task> ReadAsync(ReadMobileOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMobileOptions 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("incoming_phone_numbers", response.Content); return new ResourceSet(page, options, client); @@ -340,7 +340,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadMobileOptions(){ PathAccountSid = pathAccountSid, Beta = beta, FriendlyName = friendlyName, PhoneNumber = phoneNumber, Origin = origin, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeResource.cs b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeResource.cs index 226a27c6f..5205739db 100644 --- a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeResource.cs @@ -126,10 +126,10 @@ public static TollFreeResource Create(CreateTollFreeOptions options, ITwilioRest /// Create TollFree parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TollFree - public static async System.Threading.Tasks.Task CreateAsync(CreateTollFreeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateTollFreeOptions 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 @@ -248,7 +248,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateTollFreeOptions(phoneNumber){ PathAccountSid = pathAccountSid, ApiVersion = apiVersion, FriendlyName = friendlyName, SmsApplicationSid = smsApplicationSid, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceApplicationSid = voiceApplicationSid, VoiceCallerIdLookup = voiceCallerIdLookup, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl, IdentitySid = identitySid, AddressSid = addressSid, EmergencyStatus = emergencyStatus, EmergencyAddressSid = emergencyAddressSid, TrunkSid = trunkSid, VoiceReceiveMode = voiceReceiveMode, BundleSid = bundleSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -285,10 +285,10 @@ public static ResourceSet Read(ReadTollFreeOptions options, IT /// Read TollFree parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TollFree - public static async System.Threading.Tasks.Task> ReadAsync(ReadTollFreeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTollFreeOptions 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("incoming_phone_numbers", response.Content); return new ResourceSet(page, options, client); @@ -340,7 +340,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadTollFreeOptions(){ PathAccountSid = pathAccountSid, Beta = beta, FriendlyName = friendlyName, PhoneNumber = phoneNumber, Origin = origin, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberResource.cs b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberResource.cs index 5415fdf3b..a422a4486 100644 --- a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberResource.cs @@ -126,10 +126,10 @@ public static IncomingPhoneNumberResource Create(CreateIncomingPhoneNumberOption /// Create IncomingPhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IncomingPhoneNumber - public static async System.Threading.Tasks.Task CreateAsync(CreateIncomingPhoneNumberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateIncomingPhoneNumberOptions 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 @@ -252,7 +252,7 @@ public static async System.Threading.Tasks.Task Cre ITwilioRestClient client = null) { var options = new CreateIncomingPhoneNumberOptions(){ PathAccountSid = pathAccountSid, PhoneNumber = phoneNumber, AreaCode = areaCode, ApiVersion = apiVersion, FriendlyName = friendlyName, SmsApplicationSid = smsApplicationSid, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceApplicationSid = voiceApplicationSid, VoiceCallerIdLookup = voiceCallerIdLookup, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl, EmergencyStatus = emergencyStatus, EmergencyAddressSid = emergencyAddressSid, TrunkSid = trunkSid, IdentitySid = identitySid, AddressSid = addressSid, VoiceReceiveMode = voiceReceiveMode, BundleSid = bundleSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -295,11 +295,12 @@ public static bool Delete(DeleteIncomingPhoneNumberOptions options, ITwilioRestC /// Delete IncomingPhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IncomingPhoneNumber - public static async System.Threading.Tasks.Task DeleteAsync(DeleteIncomingPhoneNumberOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteIncomingPhoneNumberOptions 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 @@ -324,7 +325,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteIncomingPhoneNumberOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -363,10 +364,10 @@ public static IncomingPhoneNumberResource Fetch(FetchIncomingPhoneNumberOptions /// Fetch IncomingPhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IncomingPhoneNumber - public static async System.Threading.Tasks.Task FetchAsync(FetchIncomingPhoneNumberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchIncomingPhoneNumberOptions 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 @@ -393,7 +394,7 @@ public static IncomingPhoneNumberResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchIncomingPhoneNumberOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -430,10 +431,10 @@ public static ResourceSet Read(ReadIncomingPhoneNum /// Read IncomingPhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IncomingPhoneNumber - public static async System.Threading.Tasks.Task> ReadAsync(ReadIncomingPhoneNumberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadIncomingPhoneNumberOptions 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("incoming_phone_numbers", response.Content); return new ResourceSet(page, options, client); @@ -485,7 +486,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of IncomingPhoneNumber #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateIncomingPhoneNumberOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateIncomingPhoneNumberOptions 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 @@ -701,7 +703,7 @@ public static async System.Threading.Tasks.Task Upd ITwilioRestClient client = null) { var options = new UpdateIncomingPhoneNumberOptions(pathSid){ PathAccountSid = pathAccountSid, AccountSid = accountSid, ApiVersion = apiVersion, FriendlyName = friendlyName, SmsApplicationSid = smsApplicationSid, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceApplicationSid = voiceApplicationSid, VoiceCallerIdLookup = voiceCallerIdLookup, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl, EmergencyStatus = emergencyStatus, EmergencyAddressSid = emergencyAddressSid, TrunkSid = trunkSid, VoiceReceiveMode = voiceReceiveMode, IdentitySid = identitySid, AddressSid = addressSid, BundleSid = bundleSid }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/KeyResource.cs b/src/Twilio/Rest/Api/V2010/Account/KeyResource.cs index 2c5bb52a5..f2007bf9d 100644 --- a/src/Twilio/Rest/Api/V2010/Account/KeyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/KeyResource.cs @@ -73,11 +73,12 @@ public static bool Delete(DeleteKeyOptions options, ITwilioRestClient client = n /// Delete Key parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Key - public static async System.Threading.Tasks.Task DeleteAsync(DeleteKeyOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteKeyOptions 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 @@ -102,7 +103,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteKeyOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -141,10 +142,10 @@ public static KeyResource Fetch(FetchKeyOptions options, ITwilioRestClient clien /// Fetch Key parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Key - public static async System.Threading.Tasks.Task FetchAsync(FetchKeyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchKeyOptions 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 @@ -171,7 +172,7 @@ public static KeyResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchKeyOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -208,10 +209,10 @@ public static ResourceSet Read(ReadKeyOptions options, ITwilioRestC /// Read Key parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Key - public static async System.Threading.Tasks.Task> ReadAsync(ReadKeyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadKeyOptions 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("keys", response.Content); return new ResourceSet(page, options, client); @@ -247,7 +248,7 @@ public static async System.Threading.Tasks.Task> ReadAs ITwilioRestClient client = null) { var options = new ReadKeyOptions(){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -336,11 +337,12 @@ public static KeyResource Update(UpdateKeyOptions options, ITwilioRestClient cli /// Client to make requests to Twilio /// Task that resolves to A single instance of Key #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateKeyOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateKeyOptions 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 @@ -375,7 +377,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateKeyOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackResource.cs b/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackResource.cs index 224a2a8ea..789ac0ab1 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackResource.cs @@ -83,10 +83,10 @@ public static FeedbackResource Create(CreateFeedbackOptions options, ITwilioRest /// Create Feedback parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Feedback - public static async System.Threading.Tasks.Task CreateAsync(CreateFeedbackOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateFeedbackOptions 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 @@ -121,7 +121,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateFeedbackOptions(pathMessageSid){ PathAccountSid = pathAccountSid, Outcome = outcome }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Message/MediaResource.cs b/src/Twilio/Rest/Api/V2010/Account/Message/MediaResource.cs index 5571dc963..bd9912494 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Message/MediaResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Message/MediaResource.cs @@ -75,11 +75,12 @@ public static bool Delete(DeleteMediaOptions options, ITwilioRestClient client = /// Delete Media parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Media - public static async System.Threading.Tasks.Task DeleteAsync(DeleteMediaOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteMediaOptions 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 @@ -106,7 +107,7 @@ public static bool Delete(string pathMessageSid, string pathSid, string pathAcco public static async System.Threading.Tasks.Task DeleteAsync(string pathMessageSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteMediaOptions(pathMessageSid, pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -147,10 +148,10 @@ public static MediaResource Fetch(FetchMediaOptions options, ITwilioRestClient c /// Fetch Media parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Media - public static async System.Threading.Tasks.Task FetchAsync(FetchMediaOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMediaOptions 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 @@ -180,7 +181,7 @@ public static MediaResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathMessageSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchMediaOptions(pathMessageSid, pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -219,10 +220,10 @@ public static ResourceSet Read(ReadMediaOptions options, ITwilioR /// Read Media parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Media - public static async System.Threading.Tasks.Task> ReadAsync(ReadMediaOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMediaOptions 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("media_list", response.Content); return new ResourceSet(page, options, client); @@ -274,7 +275,7 @@ public static async System.Threading.Tasks.Task> Read ITwilioRestClient client = null) { var options = new ReadMediaOptions(pathMessageSid){ PathAccountSid = pathAccountSid, DateCreatedBefore = dateCreatedBefore, DateCreated = dateCreated, DateCreatedAfter = dateCreatedAfter, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/MessageResource.cs b/src/Twilio/Rest/Api/V2010/Account/MessageResource.cs index 2f2822757..acf1f3f9d 100644 --- a/src/Twilio/Rest/Api/V2010/Account/MessageResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/MessageResource.cs @@ -165,10 +165,10 @@ public static MessageResource Create(CreateMessageOptions options, ITwilioRestCl /// Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions 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 @@ -287,7 +287,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateMessageOptions(to){ PathAccountSid = pathAccountSid, From = from, MessagingServiceSid = messagingServiceSid, Body = body, MediaUrl = mediaUrl, ContentSid = contentSid, StatusCallback = statusCallback, ApplicationSid = applicationSid, MaxPrice = maxPrice, ProvideFeedback = provideFeedback, Attempt = attempt, ValidityPeriod = validityPeriod, ForceDelivery = forceDelivery, ContentRetention = contentRetention, AddressRetention = addressRetention, SmartEncoded = smartEncoded, PersistentAction = persistentAction, ShortenUrls = shortenUrls, ScheduleType = scheduleType, SendAt = sendAt, SendAsMms = sendAsMms, ContentVariables = contentVariables, RiskCheck = riskCheck }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -330,11 +330,12 @@ public static bool Delete(DeleteMessageOptions options, ITwilioRestClient client /// Delete Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions 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 @@ -359,7 +360,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteMessageOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -398,10 +399,10 @@ public static MessageResource Fetch(FetchMessageOptions options, ITwilioRestClie /// Fetch Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions 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 @@ -428,7 +429,7 @@ public static MessageResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchMessageOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -465,10 +466,10 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions 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("messages", response.Content); return new ResourceSet(page, options, client); @@ -524,7 +525,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadMessageOptions(){ PathAccountSid = pathAccountSid, To = to, From = from, DateSentBefore = dateSentBefore, DateSent = dateSent, DateSentAfter = dateSentAfter, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -613,11 +614,12 @@ public static MessageResource Update(UpdateMessageOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Message #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions 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 @@ -656,7 +658,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateMessageOptions(pathSid){ PathAccountSid = pathAccountSid, Body = body, Status = status }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/NewKeyResource.cs b/src/Twilio/Rest/Api/V2010/Account/NewKeyResource.cs index 8e43323b2..da508ca28 100644 --- a/src/Twilio/Rest/Api/V2010/Account/NewKeyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/NewKeyResource.cs @@ -68,10 +68,10 @@ public static NewKeyResource Create(CreateNewKeyOptions options, ITwilioRestClie /// Create NewKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NewKey - public static async System.Threading.Tasks.Task CreateAsync(CreateNewKeyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateNewKeyOptions 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 CreateNewKeyOptions(){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyResource.cs b/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyResource.cs index 55e464699..e7f81bdb6 100644 --- a/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyResource.cs @@ -68,10 +68,10 @@ public static NewSigningKeyResource Create(CreateNewSigningKeyOptions options, I /// Create NewSigningKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NewSigningKey - public static async System.Threading.Tasks.Task CreateAsync(CreateNewSigningKeyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateNewSigningKeyOptions 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 CreateAsy ITwilioRestClient client = null) { var options = new CreateNewSigningKeyOptions(){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/NotificationResource.cs b/src/Twilio/Rest/Api/V2010/Account/NotificationResource.cs index 33b63a926..582229df5 100644 --- a/src/Twilio/Rest/Api/V2010/Account/NotificationResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/NotificationResource.cs @@ -69,10 +69,10 @@ public static NotificationResource Fetch(FetchNotificationOptions options, ITwil /// Fetch Notification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task FetchAsync(FetchNotificationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchNotificationOptions 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 NotificationResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchNotificationOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -136,10 +136,10 @@ public static ResourceSet Read(ReadNotificationOptions opt /// Read Notification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task> ReadAsync(ReadNotificationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadNotificationOptions 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("notifications", response.Content); return new ResourceSet(page, options, client); @@ -191,7 +191,7 @@ public static async System.Threading.Tasks.Task Delete OutgoingCallerId parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OutgoingCallerId - public static async System.Threading.Tasks.Task DeleteAsync(DeleteOutgoingCallerIdOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteOutgoingCallerIdOptions 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 @@ -102,7 +103,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteOutgoingCallerIdOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -141,10 +142,10 @@ public static OutgoingCallerIdResource Fetch(FetchOutgoingCallerIdOptions option /// Fetch OutgoingCallerId parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OutgoingCallerId - public static async System.Threading.Tasks.Task FetchAsync(FetchOutgoingCallerIdOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchOutgoingCallerIdOptions 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 @@ -171,7 +172,7 @@ public static OutgoingCallerIdResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchOutgoingCallerIdOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -208,10 +209,10 @@ public static ResourceSet Read(ReadOutgoingCallerIdOpt /// Read OutgoingCallerId parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OutgoingCallerId - public static async System.Threading.Tasks.Task> ReadAsync(ReadOutgoingCallerIdOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadOutgoingCallerIdOptions 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("outgoing_caller_ids", response.Content); return new ResourceSet(page, options, client); @@ -255,7 +256,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of OutgoingCallerId #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateOutgoingCallerIdOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateOutgoingCallerIdOptions 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 @@ -383,7 +385,7 @@ public static async System.Threading.Tasks.Task Update ITwilioRestClient client = null) { var options = new UpdateOutgoingCallerIdOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/QueueResource.cs b/src/Twilio/Rest/Api/V2010/Account/QueueResource.cs index be01b54e6..13f8a6f49 100644 --- a/src/Twilio/Rest/Api/V2010/Account/QueueResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/QueueResource.cs @@ -68,10 +68,10 @@ public static QueueResource Create(CreateQueueOptions options, ITwilioRestClient /// Create Queue parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Queue - public static async System.Threading.Tasks.Task CreateAsync(CreateQueueOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateQueueOptions 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 CreateQueueOptions(friendlyName){ PathAccountSid = pathAccountSid, MaxSize = maxSize }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -149,11 +149,12 @@ public static bool Delete(DeleteQueueOptions options, ITwilioRestClient client = /// Delete Queue parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Queue - public static async System.Threading.Tasks.Task DeleteAsync(DeleteQueueOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteQueueOptions 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 pathSid, string pathAccountSid = null, ITwilioR public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteQueueOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -217,10 +218,10 @@ public static QueueResource Fetch(FetchQueueOptions options, ITwilioRestClient c /// Fetch Queue parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Queue - public static async System.Threading.Tasks.Task FetchAsync(FetchQueueOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchQueueOptions 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 QueueResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchQueueOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +285,10 @@ public static ResourceSet Read(ReadQueueOptions options, ITwilioR /// Read Queue parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Queue - public static async System.Threading.Tasks.Task> ReadAsync(ReadQueueOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadQueueOptions 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("queues", response.Content); return new ResourceSet(page, options, client); @@ -323,7 +324,7 @@ public static async System.Threading.Tasks.Task> Read ITwilioRestClient client = null) { var options = new ReadQueueOptions(){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -412,11 +413,12 @@ public static QueueResource Update(UpdateQueueOptions options, ITwilioRestClient /// Client to make requests to Twilio /// Task that resolves to A single instance of Queue #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateQueueOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateQueueOptions 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 @@ -455,7 +457,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateQueueOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, MaxSize = maxSize }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/RecordingResource.cs b/src/Twilio/Rest/Api/V2010/Account/RecordingResource.cs index f9cddc31b..a56eb3bf5 100644 --- a/src/Twilio/Rest/Api/V2010/Account/RecordingResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/RecordingResource.cs @@ -109,11 +109,12 @@ public static bool Delete(DeleteRecordingOptions options, ITwilioRestClient clie /// Delete Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task DeleteAsync(DeleteRecordingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteRecordingOptions 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 @@ -138,7 +139,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteRecordingOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -177,10 +178,10 @@ public static RecordingResource Fetch(FetchRecordingOptions options, ITwilioRest /// Fetch Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions 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 @@ -210,7 +211,7 @@ public static RecordingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, bool? includeSoftDeleted = null, ITwilioRestClient client = null) { var options = new FetchRecordingOptions(pathSid){ PathAccountSid = pathAccountSid,IncludeSoftDeleted = includeSoftDeleted }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -247,10 +248,10 @@ public static ResourceSet Read(ReadRecordingOptions options, /// Read Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordingOptions 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("recordings", response.Content); return new ResourceSet(page, options, client); @@ -310,7 +311,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadRecordingOptions(){ PathAccountSid = pathAccountSid, DateCreatedBefore = dateCreatedBefore, DateCreated = dateCreated, DateCreatedAfter = dateCreatedAfter, CallSid = callSid, ConferenceSid = conferenceSid, IncludeSoftDeleted = includeSoftDeleted, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/ShortCodeResource.cs b/src/Twilio/Rest/Api/V2010/Account/ShortCodeResource.cs index 2205e7f03..c3d0bf007 100644 --- a/src/Twilio/Rest/Api/V2010/Account/ShortCodeResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/ShortCodeResource.cs @@ -69,10 +69,10 @@ public static ShortCodeResource Fetch(FetchShortCodeOptions options, ITwilioRest /// Fetch ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task FetchAsync(FetchShortCodeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchShortCodeOptions 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 ShortCodeResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchShortCodeOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -136,10 +136,10 @@ public static ResourceSet Read(ReadShortCodeOptions options, /// Read ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task> ReadAsync(ReadShortCodeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadShortCodeOptions 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("short_codes", response.Content); return new ResourceSet(page, options, client); @@ -183,7 +183,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadShortCodeOptions(){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, ShortCode = shortCode, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -272,11 +272,12 @@ public static ShortCodeResource Update(UpdateShortCodeOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateShortCodeOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateShortCodeOptions 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 @@ -331,7 +332,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateShortCodeOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, ApiVersion = apiVersion, SmsUrl = smsUrl, SmsMethod = smsMethod, SmsFallbackUrl = smsFallbackUrl, SmsFallbackMethod = smsFallbackMethod }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/SigningKeyResource.cs b/src/Twilio/Rest/Api/V2010/Account/SigningKeyResource.cs index e0d8a6549..47b5d316a 100644 --- a/src/Twilio/Rest/Api/V2010/Account/SigningKeyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/SigningKeyResource.cs @@ -73,11 +73,12 @@ public static bool Delete(DeleteSigningKeyOptions options, ITwilioRestClient cli /// Delete SigningKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SigningKey - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSigningKeyOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSigningKeyOptions 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 @@ -102,7 +103,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteSigningKeyOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -141,10 +142,10 @@ public static SigningKeyResource Fetch(FetchSigningKeyOptions options, ITwilioRe /// Fetch SigningKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SigningKey - public static async System.Threading.Tasks.Task FetchAsync(FetchSigningKeyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSigningKeyOptions 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 @@ -171,7 +172,7 @@ public static SigningKeyResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchSigningKeyOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -208,10 +209,10 @@ public static ResourceSet Read(ReadSigningKeyOptions options /// Read SigningKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SigningKey - public static async System.Threading.Tasks.Task> ReadAsync(ReadSigningKeyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSigningKeyOptions 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("signing_keys", response.Content); return new ResourceSet(page, options, client); @@ -247,7 +248,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadSigningKeyOptions(){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -336,11 +337,12 @@ public static SigningKeyResource Update(UpdateSigningKeyOptions options, ITwilio /// Client to make requests to Twilio /// Task that resolves to A single instance of SigningKey #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSigningKeyOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSigningKeyOptions 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 @@ -375,7 +377,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateSigningKeyOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialResource.cs b/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialResource.cs index 72cc262ba..935c89aba 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialResource.cs @@ -70,10 +70,10 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio /// Create Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions 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 CreateCredentialOptions(pathCredentialListSid, username, password){ PathAccountSid = pathAccountSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -157,11 +157,12 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli /// Delete Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions 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 pathCredentialListSid, string pathSid, string p public static async System.Threading.Tasks.Task DeleteAsync(string pathCredentialListSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteCredentialOptions(pathCredentialListSid, pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -229,10 +230,10 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe /// Fetch Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions 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 CredentialResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathCredentialListSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchCredentialOptions(pathCredentialListSid, pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadCredentialOptions options /// Read Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions 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("credentials", response.Content); return new ResourceSet(page, options, client); @@ -344,7 +345,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadCredentialOptions(pathCredentialListSid){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -435,11 +436,12 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions 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 @@ -478,7 +480,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateCredentialOptions(pathCredentialListSid, pathSid){ PathAccountSid = pathAccountSid, Password = password }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingResource.cs b/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingResource.cs index 4ab5411a9..391227ae4 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingResource.cs @@ -70,10 +70,10 @@ public static AuthCallsCredentialListMappingResource Create(CreateAuthCallsCrede /// Create AuthCallsCredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsCredentialListMapping - public static async System.Threading.Tasks.Task CreateAsync(CreateAuthCallsCredentialListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAuthCallsCredentialListMappingOptions 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 Delete AuthCallsCredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsCredentialListMapping - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAuthCallsCredentialListMappingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAuthCallsCredentialListMappingOptions 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 @@ -184,7 +185,7 @@ public static bool Delete(string pathDomainSid, string pathSid, string pathAccou public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteAuthCallsCredentialListMappingOptions(pathDomainSid, pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -225,10 +226,10 @@ public static AuthCallsCredentialListMappingResource Fetch(FetchAuthCallsCredent /// Fetch AuthCallsCredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsCredentialListMapping - public static async System.Threading.Tasks.Task FetchAsync(FetchAuthCallsCredentialListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAuthCallsCredentialListMappingOptions 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 @@ -258,7 +259,7 @@ public static AuthCallsCredentialListMappingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchAuthCallsCredentialListMappingOptions(pathDomainSid, pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -297,10 +298,10 @@ public static ResourceSet Read(ReadAuthC /// Read AuthCallsCredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsCredentialListMapping - public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthCallsCredentialListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthCallsCredentialListMappingOptions 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("contents", response.Content); return new ResourceSet(page, options, client); @@ -340,7 +341,7 @@ public static async System.Threading.Tasks.Task Create AuthCallsIpAccessControlListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsIpAccessControlListMapping - public static async System.Threading.Tasks.Task CreateAsync(CreateAuthCallsIpAccessControlListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAuthCallsIpAccessControlListMappingOptions 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 Delete AuthCallsIpAccessControlListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsIpAccessControlListMapping - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAuthCallsIpAccessControlListMappingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAuthCallsIpAccessControlListMappingOptions 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 @@ -184,7 +185,7 @@ public static bool Delete(string pathDomainSid, string pathSid, string pathAccou public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteAuthCallsIpAccessControlListMappingOptions(pathDomainSid, pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -225,10 +226,10 @@ public static AuthCallsIpAccessControlListMappingResource Fetch(FetchAuthCallsIp /// Fetch AuthCallsIpAccessControlListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsIpAccessControlListMapping - public static async System.Threading.Tasks.Task FetchAsync(FetchAuthCallsIpAccessControlListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAuthCallsIpAccessControlListMappingOptions 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 @@ -258,7 +259,7 @@ public static AuthCallsIpAccessControlListMappingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchAuthCallsIpAccessControlListMappingOptions(pathDomainSid, pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -297,10 +298,10 @@ public static ResourceSet Read(Read /// Read AuthCallsIpAccessControlListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsIpAccessControlListMapping - public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthCallsIpAccessControlListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthCallsIpAccessControlListMappingOptions 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("contents", response.Content); return new ResourceSet(page, options, client); @@ -340,7 +341,7 @@ public static async System.Threading.Tasks.Task Create AuthRegistrationsCredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthRegistrationsCredentialListMapping - public static async System.Threading.Tasks.Task CreateAsync(CreateAuthRegistrationsCredentialListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAuthRegistrationsCredentialListMappingOptions 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 Delete AuthRegistrationsCredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthRegistrationsCredentialListMapping - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAuthRegistrationsCredentialListMappingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAuthRegistrationsCredentialListMappingOptions 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 @@ -184,7 +185,7 @@ public static bool Delete(string pathDomainSid, string pathSid, string pathAccou public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteAuthRegistrationsCredentialListMappingOptions(pathDomainSid, pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -225,10 +226,10 @@ public static AuthRegistrationsCredentialListMappingResource Fetch(FetchAuthRegi /// Fetch AuthRegistrationsCredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthRegistrationsCredentialListMapping - public static async System.Threading.Tasks.Task FetchAsync(FetchAuthRegistrationsCredentialListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAuthRegistrationsCredentialListMappingOptions 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 @@ -258,7 +259,7 @@ public static AuthRegistrationsCredentialListMappingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchAuthRegistrationsCredentialListMappingOptions(pathDomainSid, pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -297,10 +298,10 @@ public static ResourceSet Read(R /// Read AuthRegistrationsCredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthRegistrationsCredentialListMapping - public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthRegistrationsCredentialListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthRegistrationsCredentialListMappingOptions 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("contents", response.Content); return new ResourceSet(page, options, client); @@ -340,7 +341,7 @@ public static async System.Threading.Tasks.Task Create CredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialListMapping - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialListMappingOptions 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 C ITwilioRestClient client = null) { var options = new CreateCredentialListMappingOptions(pathDomainSid, credentialListSid){ PathAccountSid = pathAccountSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -153,11 +153,12 @@ public static bool Delete(DeleteCredentialListMappingOptions options, ITwilioRes /// Delete CredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialListMapping - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialListMappingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialListMappingOptions 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 @@ -184,7 +185,7 @@ public static bool Delete(string pathDomainSid, string pathSid, string pathAccou public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteCredentialListMappingOptions(pathDomainSid, pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -225,10 +226,10 @@ public static CredentialListMappingResource Fetch(FetchCredentialListMappingOpti /// Fetch CredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialListMapping - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialListMappingOptions 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 @@ -258,7 +259,7 @@ public static CredentialListMappingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchCredentialListMappingOptions(pathDomainSid, pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -297,10 +298,10 @@ public static ResourceSet Read(ReadCredentialList /// Read CredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialListMapping - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialListMappingOptions 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("credential_list_mappings", response.Content); return new ResourceSet(page, options, client); @@ -340,7 +341,7 @@ public static async System.Threading.Tasks.Task Create IpAccessControlListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlListMapping - public static async System.Threading.Tasks.Task CreateAsync(CreateIpAccessControlListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateIpAccessControlListMappingOptions 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 Delete IpAccessControlListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlListMapping - public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpAccessControlListMappingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpAccessControlListMappingOptions 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 @@ -184,7 +185,7 @@ public static bool Delete(string pathDomainSid, string pathSid, string pathAccou public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteIpAccessControlListMappingOptions(pathDomainSid, pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -225,10 +226,10 @@ public static IpAccessControlListMappingResource Fetch(FetchIpAccessControlListM /// Fetch IpAccessControlListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlListMapping - public static async System.Threading.Tasks.Task FetchAsync(FetchIpAccessControlListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchIpAccessControlListMappingOptions 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 @@ -258,7 +259,7 @@ public static IpAccessControlListMappingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchIpAccessControlListMappingOptions(pathDomainSid, pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -297,10 +298,10 @@ public static ResourceSet Read(ReadIpAccessC /// Read IpAccessControlListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlListMapping - public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAccessControlListMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAccessControlListMappingOptions 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("ip_access_control_list_mappings", response.Content); return new ResourceSet(page, options, client); @@ -340,7 +341,7 @@ public static async System.Threading.Tasks.Task Create IpAddress parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAddress - public static async System.Threading.Tasks.Task CreateAsync(CreateIpAddressOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateIpAddressOptions 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 @@ -116,7 +116,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateIpAddressOptions(pathIpAccessControlListSid, friendlyName, ipAddress){ PathAccountSid = pathAccountSid, CidrPrefixLength = cidrPrefixLength }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -161,11 +161,12 @@ public static bool Delete(DeleteIpAddressOptions options, ITwilioRestClient clie /// Delete IpAddress parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAddress - public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpAddressOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpAddressOptions 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 @@ -192,7 +193,7 @@ public static bool Delete(string pathIpAccessControlListSid, string pathSid, str public static async System.Threading.Tasks.Task DeleteAsync(string pathIpAccessControlListSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteIpAddressOptions(pathIpAccessControlListSid, pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -233,10 +234,10 @@ public static IpAddressResource Fetch(FetchIpAddressOptions options, ITwilioRest /// Fetch IpAddress parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAddress - public static async System.Threading.Tasks.Task FetchAsync(FetchIpAddressOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchIpAddressOptions 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 @@ -266,7 +267,7 @@ public static IpAddressResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathIpAccessControlListSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchIpAddressOptions(pathIpAccessControlListSid, pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -305,10 +306,10 @@ public static ResourceSet Read(ReadIpAddressOptions options, /// Read IpAddress parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAddress - public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAddressOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAddressOptions 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("ip_addresses", response.Content); return new ResourceSet(page, options, client); @@ -348,7 +349,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadIpAddressOptions(pathIpAccessControlListSid){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -439,11 +440,12 @@ public static IpAddressResource Update(UpdateIpAddressOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAddress #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateIpAddressOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateIpAddressOptions 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 @@ -490,7 +492,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateIpAddressOptions(pathIpAccessControlListSid, pathSid){ PathAccountSid = pathAccountSid, IpAddress = ipAddress, FriendlyName = friendlyName, CidrPrefixLength = cidrPrefixLength }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListResource.cs b/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListResource.cs index 86bfe0a7c..ed96dbb9c 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListResource.cs @@ -68,10 +68,10 @@ public static IpAccessControlListResource Create(CreateIpAccessControlListOption /// Create IpAccessControlList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task CreateAsync(CreateIpAccessControlListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateIpAccessControlListOptions 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 Cre ITwilioRestClient client = null) { var options = new CreateIpAccessControlListOptions(friendlyName){ PathAccountSid = pathAccountSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteIpAccessControlListOptions options, ITwilioRestC /// Delete IpAccessControlList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpAccessControlListOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpAccessControlListOptions 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 pathSid, string pathAccountSid = null, ITwilioR public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteIpAccessControlListOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static IpAccessControlListResource Fetch(FetchIpAccessControlListOptions /// Fetch IpAccessControlList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task FetchAsync(FetchIpAccessControlListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchIpAccessControlListOptions 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 IpAccessControlListResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchIpAccessControlListOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadIpAccessControlL /// Read IpAccessControlList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAccessControlListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAccessControlListOptions 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("ip_access_control_lists", response.Content); return new ResourceSet(page, options, client); @@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateIpAccessControlListOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateIpAccessControlListOptions 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 Upd ITwilioRestClient client = null) { var options = new UpdateIpAccessControlListOptions(pathSid, friendlyName){ PathAccountSid = pathAccountSid }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/TokenResource.cs b/src/Twilio/Rest/Api/V2010/Account/TokenResource.cs index 74d24f8bf..244ce4fbc 100644 --- a/src/Twilio/Rest/Api/V2010/Account/TokenResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/TokenResource.cs @@ -68,10 +68,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.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 CreateTokenOptions(){ PathAccountSid = pathAccountSid, Ttl = ttl }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/TranscriptionResource.cs b/src/Twilio/Rest/Api/V2010/Account/TranscriptionResource.cs index 21a12ddec..9e6b01315 100644 --- a/src/Twilio/Rest/Api/V2010/Account/TranscriptionResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/TranscriptionResource.cs @@ -87,11 +87,12 @@ public static bool Delete(DeleteTranscriptionOptions options, ITwilioRestClient /// Delete Transcription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcription - public static async System.Threading.Tasks.Task DeleteAsync(DeleteTranscriptionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteTranscriptionOptions 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 @@ -116,7 +117,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteTranscriptionOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -155,10 +156,10 @@ public static TranscriptionResource Fetch(FetchTranscriptionOptions options, ITw /// Fetch Transcription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcription - public static async System.Threading.Tasks.Task FetchAsync(FetchTranscriptionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTranscriptionOptions 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 @@ -185,7 +186,7 @@ public static TranscriptionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchTranscriptionOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -222,10 +223,10 @@ public static ResourceSet Read(ReadTranscriptionOptions o /// Read Transcription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcription - public static async System.Threading.Tasks.Task> ReadAsync(ReadTranscriptionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTranscriptionOptions 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("transcriptions", response.Content); return new ResourceSet(page, options, client); @@ -261,7 +262,7 @@ public static async System.Threading.Tasks.Task Read(ReadAllTimeOptions options, ITwi /// Read AllTime parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AllTime - public static async System.Threading.Tasks.Task> ReadAsync(ReadAllTimeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAllTimeOptions 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("usage_records", response.Content); return new ResourceSet(page, options, client); @@ -384,7 +384,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadAllTimeOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyResource.cs index 5ae023f89..13ef5d8b7 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyResource.cs @@ -329,10 +329,10 @@ public static ResourceSet Read(ReadDailyOptions options, ITwilioR /// Read Daily parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Daily - public static async System.Threading.Tasks.Task> ReadAsync(ReadDailyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDailyOptions 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("usage_records", response.Content); return new ResourceSet(page, options, client); @@ -384,7 +384,7 @@ public static async System.Threading.Tasks.Task> Read ITwilioRestClient client = null) { var options = new ReadDailyOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthResource.cs index 5eb02bbbe..0e0aaec9f 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthResource.cs @@ -329,10 +329,10 @@ public static ResourceSet Read(ReadLastMonthOptions options, /// Read LastMonth parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of LastMonth - public static async System.Threading.Tasks.Task> ReadAsync(ReadLastMonthOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadLastMonthOptions 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("usage_records", response.Content); return new ResourceSet(page, options, client); @@ -384,7 +384,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadLastMonthOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyResource.cs index 194a2a094..d67347c08 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyResource.cs @@ -329,10 +329,10 @@ public static ResourceSet Read(ReadMonthlyOptions options, ITwi /// Read Monthly parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Monthly - public static async System.Threading.Tasks.Task> ReadAsync(ReadMonthlyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMonthlyOptions 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("usage_records", response.Content); return new ResourceSet(page, options, client); @@ -384,7 +384,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadMonthlyOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthResource.cs index 17d07ab1c..6abceae22 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthResource.cs @@ -329,10 +329,10 @@ public static ResourceSet Read(ReadThisMonthOptions options, /// Read ThisMonth parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ThisMonth - public static async System.Threading.Tasks.Task> ReadAsync(ReadThisMonthOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadThisMonthOptions 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("usage_records", response.Content); return new ResourceSet(page, options, client); @@ -384,7 +384,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadThisMonthOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayResource.cs index 741cc1f6a..c943679c1 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayResource.cs @@ -329,10 +329,10 @@ public static ResourceSet Read(ReadTodayOptions options, ITwilioR /// Read Today parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Today - public static async System.Threading.Tasks.Task> ReadAsync(ReadTodayOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTodayOptions 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("usage_records", response.Content); return new ResourceSet(page, options, client); @@ -384,7 +384,7 @@ public static async System.Threading.Tasks.Task> Read ITwilioRestClient client = null) { var options = new ReadTodayOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyResource.cs index 590e0012b..70efd17c1 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyResource.cs @@ -329,10 +329,10 @@ public static ResourceSet Read(ReadYearlyOptions options, ITwili /// Read Yearly parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Yearly - public static async System.Threading.Tasks.Task> ReadAsync(ReadYearlyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadYearlyOptions 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("usage_records", response.Content); return new ResourceSet(page, options, client); @@ -384,7 +384,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadYearlyOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayResource.cs index ee0838818..4da3138d4 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayResource.cs @@ -329,10 +329,10 @@ public static ResourceSet Read(ReadYesterdayOptions options, /// Read Yesterday parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Yesterday - public static async System.Threading.Tasks.Task> ReadAsync(ReadYesterdayOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadYesterdayOptions 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("usage_records", response.Content); return new ResourceSet(page, options, client); @@ -384,7 +384,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadYesterdayOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/RecordResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/RecordResource.cs index f08048b80..49a392f6a 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/RecordResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/RecordResource.cs @@ -329,10 +329,10 @@ public static ResourceSet Read(ReadRecordOptions options, ITwili /// Read Record parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Record - public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordOptions 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("usage_records", response.Content); return new ResourceSet(page, options, client); @@ -384,7 +384,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadRecordOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerResource.cs index cf9ee61e3..769a25c5f 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerResource.cs @@ -359,10 +359,10 @@ public static TriggerResource Create(CreateTriggerOptions options, ITwilioRestCl /// Create Trigger parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Trigger - public static async System.Threading.Tasks.Task CreateAsync(CreateTriggerOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateTriggerOptions 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 @@ -417,7 +417,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateTriggerOptions(callbackUrl, triggerValue, usageCategory){ PathAccountSid = pathAccountSid, CallbackMethod = callbackMethod, FriendlyName = friendlyName, Recurring = recurring, TriggerBy = triggerBy }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -460,11 +460,12 @@ public static bool Delete(DeleteTriggerOptions options, ITwilioRestClient client /// Delete Trigger parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Trigger - public static async System.Threading.Tasks.Task DeleteAsync(DeleteTriggerOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteTriggerOptions 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 @@ -489,7 +490,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteTriggerOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -528,10 +529,10 @@ public static TriggerResource Fetch(FetchTriggerOptions options, ITwilioRestClie /// Fetch Trigger parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Trigger - public static async System.Threading.Tasks.Task FetchAsync(FetchTriggerOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTriggerOptions 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 @@ -558,7 +559,7 @@ public static TriggerResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchTriggerOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -595,10 +596,10 @@ public static ResourceSet Read(ReadTriggerOptions options, ITwi /// Read Trigger parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Trigger - public static async System.Threading.Tasks.Task> ReadAsync(ReadTriggerOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTriggerOptions 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("usage_triggers", response.Content); return new ResourceSet(page, options, client); @@ -646,7 +647,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadTriggerOptions(){ PathAccountSid = pathAccountSid, Recurring = recurring, TriggerBy = triggerBy, UsageCategory = usageCategory, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -735,11 +736,12 @@ public static TriggerResource Update(UpdateTriggerOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Trigger #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateTriggerOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateTriggerOptions 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 @@ -782,7 +784,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateTriggerOptions(pathSid){ PathAccountSid = pathAccountSid, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, FriendlyName = friendlyName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/ValidationRequestResource.cs b/src/Twilio/Rest/Api/V2010/Account/ValidationRequestResource.cs index 22d4b971c..e0fc01abd 100644 --- a/src/Twilio/Rest/Api/V2010/Account/ValidationRequestResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/ValidationRequestResource.cs @@ -68,10 +68,10 @@ public static ValidationRequestResource Create(CreateValidationRequestOptions op /// Create ValidationRequest parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ValidationRequest - public static async System.Threading.Tasks.Task CreateAsync(CreateValidationRequestOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateValidationRequestOptions 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 @@ -122,7 +122,7 @@ public static async System.Threading.Tasks.Task Creat ITwilioRestClient client = null) { var options = new CreateValidationRequestOptions(phoneNumber){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, CallDelay = callDelay, Extension = extension, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Api/V2010/AccountResource.cs b/src/Twilio/Rest/Api/V2010/AccountResource.cs index 24ee51136..16292a686 100644 --- a/src/Twilio/Rest/Api/V2010/AccountResource.cs +++ b/src/Twilio/Rest/Api/V2010/AccountResource.cs @@ -93,10 +93,10 @@ public static AccountResource Create(CreateAccountOptions options, ITwilioRestCl /// Create Account parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Account - public static async System.Threading.Tasks.Task CreateAsync(CreateAccountOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAccountOptions 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 CreateAccountOptions(){ FriendlyName = friendlyName }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -160,10 +160,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 @@ -187,7 +187,7 @@ public static AccountResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid = null, ITwilioRestClient client = null) { var options = new FetchAccountOptions(){ PathSid = pathSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -222,10 +222,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("accounts", response.Content); return new ResourceSet(page, options, client); @@ -265,7 +265,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadAccountOptions(){ FriendlyName = friendlyName, Status = status, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -352,11 +352,12 @@ public static AccountResource Update(UpdateAccountOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Account #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAccountOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateAccountOptions 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 @@ -391,7 +392,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateAccountOptions(){ PathSid = pathSid, FriendlyName = friendlyName, Status = status }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Assistants/V1/Assistant/AssistantsKnowledgeResource.cs b/src/Twilio/Rest/Assistants/V1/Assistant/AssistantsKnowledgeResource.cs index fbb592112..1c03d2d34 100644 --- a/src/Twilio/Rest/Assistants/V1/Assistant/AssistantsKnowledgeResource.cs +++ b/src/Twilio/Rest/Assistants/V1/Assistant/AssistantsKnowledgeResource.cs @@ -70,10 +70,10 @@ public static AssistantsKnowledgeResource Create(CreateAssistantsKnowledgeOption /// Create AssistantsKnowledge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssistantsKnowledge - public static async System.Threading.Tasks.Task CreateAsync(CreateAssistantsKnowledgeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAssistantsKnowledgeOptions 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 @@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task Cre ITwilioRestClient client = null) { var options = new CreateAssistantsKnowledgeOptions(pathAssistantId, pathId){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -147,11 +147,12 @@ public static bool Delete(DeleteAssistantsKnowledgeOptions options, ITwilioRestC /// Delete AssistantsKnowledge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssistantsKnowledge - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssistantsKnowledgeOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssistantsKnowledgeOptions 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 @@ -176,7 +177,7 @@ public static bool Delete(string pathAssistantId, string pathId, ITwilioRestClie public static async System.Threading.Tasks.Task DeleteAsync(string pathAssistantId, string pathId, ITwilioRestClient client = null) { var options = new DeleteAssistantsKnowledgeOptions(pathAssistantId, pathId) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static ResourceSet Read(ReadAssistantsKnowle /// Read AssistantsKnowledge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssistantsKnowledge - public static async System.Threading.Tasks.Task> ReadAsync(ReadAssistantsKnowledgeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAssistantsKnowledgeOptions 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("knowledge", response.Content); return new ResourceSet(page, options, client); @@ -252,7 +253,7 @@ public static async System.Threading.Tasks.Task Create AssistantsTool parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssistantsTool - public static async System.Threading.Tasks.Task CreateAsync(CreateAssistantsToolOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAssistantsToolOptions 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 @@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task CreateAs ITwilioRestClient client = null) { var options = new CreateAssistantsToolOptions(pathAssistantId, pathId){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -147,11 +147,12 @@ public static bool Delete(DeleteAssistantsToolOptions options, ITwilioRestClient /// Delete AssistantsTool parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssistantsTool - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssistantsToolOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssistantsToolOptions 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 @@ -176,7 +177,7 @@ public static bool Delete(string pathAssistantId, string pathId, ITwilioRestClie public static async System.Threading.Tasks.Task DeleteAsync(string pathAssistantId, string pathId, ITwilioRestClient client = null) { var options = new DeleteAssistantsToolOptions(pathAssistantId, pathId) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static ResourceSet Read(ReadAssistantsToolOptions /// Read AssistantsTool parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssistantsTool - public static async System.Threading.Tasks.Task> ReadAsync(ReadAssistantsToolOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAssistantsToolOptions 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("tools", response.Content); return new ResourceSet(page, options, client); @@ -252,7 +253,7 @@ public static async System.Threading.Tasks.Task Create Feedback parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Feedback - public static async System.Threading.Tasks.Task CreateAsync(CreateFeedbackOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateFeedbackOptions 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 @@ -146,7 +146,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateFeedbackOptions(pathId, assistantsV1ServiceCreateFeedbackRequest){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -183,10 +183,10 @@ public static ResourceSet Read(ReadFeedbackOptions options, IT /// Read Feedback parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Feedback - public static async System.Threading.Tasks.Task> ReadAsync(ReadFeedbackOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFeedbackOptions 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("feedbacks", response.Content); return new ResourceSet(page, options, client); @@ -222,7 +222,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadFeedbackOptions(pathId){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Assistants/V1/Assistant/MessageResource.cs b/src/Twilio/Rest/Assistants/V1/Assistant/MessageResource.cs index e400b194c..2d21ff40a 100644 --- a/src/Twilio/Rest/Assistants/V1/Assistant/MessageResource.cs +++ b/src/Twilio/Rest/Assistants/V1/Assistant/MessageResource.cs @@ -119,10 +119,10 @@ public static MessageResource Create(CreateMessageOptions options, ITwilioRestCl /// Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions 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 @@ -153,7 +153,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateMessageOptions(pathId, assistantsV1ServiceAssistantSendMessageRequest){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Assistants/V1/AssistantResource.cs b/src/Twilio/Rest/Assistants/V1/AssistantResource.cs index 2a2fa14da..794a427cb 100644 --- a/src/Twilio/Rest/Assistants/V1/AssistantResource.cs +++ b/src/Twilio/Rest/Assistants/V1/AssistantResource.cs @@ -416,10 +416,10 @@ public static AssistantResource Create(CreateAssistantOptions options, ITwilioRe /// Create Assistant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task CreateAsync(CreateAssistantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAssistantOptions 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 @@ -446,7 +446,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateAssistantOptions(assistantsV1ServiceCreateAssistantRequest){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -487,11 +487,12 @@ public static bool Delete(DeleteAssistantOptions options, ITwilioRestClient clie /// Delete Assistant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssistantOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssistantOptions 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 @@ -511,10 +512,10 @@ public static bool Delete(string pathId, ITwilioRestClient client = null) /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task DeleteAsync(string pathId, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new DeleteAssistantOptions(pathId) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -551,10 +552,10 @@ public static AssistantResource Fetch(FetchAssistantOptions options, ITwilioRest /// Fetch Assistant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task FetchAsync(FetchAssistantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAssistantOptions 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 @@ -575,10 +576,10 @@ public static AssistantResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchAssistantOptions(pathId){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -613,10 +614,10 @@ public static ResourceSet Read(ReadAssistantOptions options, /// Read Assistant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task> ReadAsync(ReadAssistantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAssistantOptions 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("assistants", response.Content); return new ResourceSet(page, options, client); @@ -648,7 +649,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadAssistantOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -736,11 +737,12 @@ public static AssistantResource Update(UpdateAssistantOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of Assistant #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAssistantOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateAssistantOptions 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 @@ -767,7 +769,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateAssistantOptions(pathId){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Assistants/V1/Knowledge/ChunkResource.cs b/src/Twilio/Rest/Assistants/V1/Knowledge/ChunkResource.cs index ae02b5829..2332b7210 100644 --- a/src/Twilio/Rest/Assistants/V1/Knowledge/ChunkResource.cs +++ b/src/Twilio/Rest/Assistants/V1/Knowledge/ChunkResource.cs @@ -67,10 +67,10 @@ public static ResourceSet Read(ReadChunkOptions options, ITwilioR /// Read Chunk parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Chunk - public static async System.Threading.Tasks.Task> ReadAsync(ReadChunkOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChunkOptions 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("chunks", response.Content); return new ResourceSet(page, options, client); @@ -106,7 +106,7 @@ public static async System.Threading.Tasks.Task> Read ITwilioRestClient client = null) { var options = new ReadChunkOptions(pathId){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Assistants/V1/Knowledge/KnowledgeStatusResource.cs b/src/Twilio/Rest/Assistants/V1/Knowledge/KnowledgeStatusResource.cs index 9d071634d..801c1a32b 100644 --- a/src/Twilio/Rest/Assistants/V1/Knowledge/KnowledgeStatusResource.cs +++ b/src/Twilio/Rest/Assistants/V1/Knowledge/KnowledgeStatusResource.cs @@ -67,10 +67,10 @@ public static KnowledgeStatusResource Fetch(FetchKnowledgeStatusOptions options, /// Fetch KnowledgeStatus parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of KnowledgeStatus - public static async System.Threading.Tasks.Task FetchAsync(FetchKnowledgeStatusOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchKnowledgeStatusOptions 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 KnowledgeStatusResource Fetch( /// the Knowledge ID. /// Client to make requests to Twilio /// Task that resolves to A single instance of KnowledgeStatus - public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchKnowledgeStatusOptions(pathId){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Assistants/V1/KnowledgeResource.cs b/src/Twilio/Rest/Assistants/V1/KnowledgeResource.cs index 7608d27a3..f66c70493 100644 --- a/src/Twilio/Rest/Assistants/V1/KnowledgeResource.cs +++ b/src/Twilio/Rest/Assistants/V1/KnowledgeResource.cs @@ -238,10 +238,10 @@ public static KnowledgeResource Create(CreateKnowledgeOptions options, ITwilioRe /// Create Knowledge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Knowledge - public static async System.Threading.Tasks.Task CreateAsync(CreateKnowledgeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateKnowledgeOptions 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 @@ -268,7 +268,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateKnowledgeOptions(assistantsV1ServiceCreateKnowledgeRequest){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -309,11 +309,12 @@ public static bool Delete(DeleteKnowledgeOptions options, ITwilioRestClient clie /// Delete Knowledge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Knowledge - public static async System.Threading.Tasks.Task DeleteAsync(DeleteKnowledgeOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteKnowledgeOptions 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 @@ -333,10 +334,10 @@ public static bool Delete(string pathId, ITwilioRestClient client = null) /// the Knowledge ID. /// Client to make requests to Twilio /// Task that resolves to A single instance of Knowledge - public static async System.Threading.Tasks.Task DeleteAsync(string pathId, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new DeleteKnowledgeOptions(pathId) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -373,10 +374,10 @@ public static KnowledgeResource Fetch(FetchKnowledgeOptions options, ITwilioRest /// Fetch Knowledge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Knowledge - public static async System.Threading.Tasks.Task FetchAsync(FetchKnowledgeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchKnowledgeOptions 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 @@ -397,10 +398,10 @@ public static KnowledgeResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Knowledge - public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchKnowledgeOptions(pathId){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -435,10 +436,10 @@ public static ResourceSet Read(ReadKnowledgeOptions options, /// Read Knowledge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Knowledge - public static async System.Threading.Tasks.Task> ReadAsync(ReadKnowledgeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadKnowledgeOptions 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("knowledge", response.Content); return new ResourceSet(page, options, client); @@ -474,7 +475,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadKnowledgeOptions(){ AssistantId = assistantId, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -562,11 +563,12 @@ public static KnowledgeResource Update(UpdateKnowledgeOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of Knowledge #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateKnowledgeOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateKnowledgeOptions 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 @@ -593,7 +595,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateKnowledgeOptions(pathId){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Assistants/V1/PolicyResource.cs b/src/Twilio/Rest/Assistants/V1/PolicyResource.cs index 83ec75ea0..ff15ba305 100644 --- a/src/Twilio/Rest/Assistants/V1/PolicyResource.cs +++ b/src/Twilio/Rest/Assistants/V1/PolicyResource.cs @@ -65,10 +65,10 @@ public static ResourceSet Read(ReadPolicyOptions options, ITwili /// Read Policy parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Policy - public static async System.Threading.Tasks.Task> ReadAsync(ReadPolicyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPolicyOptions 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("policies", response.Content); return new ResourceSet(page, options, client); @@ -108,7 +108,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadPolicyOptions(){ ToolId = toolId, KnowledgeId = knowledgeId, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Assistants/V1/Session/MessageResource.cs b/src/Twilio/Rest/Assistants/V1/Session/MessageResource.cs index 8b3abfa09..7ef3bdce7 100644 --- a/src/Twilio/Rest/Assistants/V1/Session/MessageResource.cs +++ b/src/Twilio/Rest/Assistants/V1/Session/MessageResource.cs @@ -67,10 +67,10 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions 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("messages", response.Content); return new ResourceSet(page, options, client); @@ -106,7 +106,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadMessageOptions(pathSessionId){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Assistants/V1/SessionResource.cs b/src/Twilio/Rest/Assistants/V1/SessionResource.cs index 2788b3ef4..ea70c0b8d 100644 --- a/src/Twilio/Rest/Assistants/V1/SessionResource.cs +++ b/src/Twilio/Rest/Assistants/V1/SessionResource.cs @@ -67,10 +67,10 @@ public static SessionResource Fetch(FetchSessionOptions options, ITwilioRestClie /// Fetch Session parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task FetchAsync(FetchSessionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSessionOptions 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 SessionResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchSessionOptions(pathId){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadSessionOptions options, ITwi /// Read Session parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task> ReadAsync(ReadSessionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSessionOptions 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("sessions", response.Content); return new ResourceSet(page, options, client); @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadSessionOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Assistants/V1/ToolResource.cs b/src/Twilio/Rest/Assistants/V1/ToolResource.cs index a8be3c6dd..61ee20229 100644 --- a/src/Twilio/Rest/Assistants/V1/ToolResource.cs +++ b/src/Twilio/Rest/Assistants/V1/ToolResource.cs @@ -323,10 +323,10 @@ public static ToolResource Create(CreateToolOptions options, ITwilioRestClient c /// Create Tool parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Tool - public static async System.Threading.Tasks.Task CreateAsync(CreateToolOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateToolOptions 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 @@ -353,7 +353,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateToolOptions(assistantsV1ServiceCreateToolRequest){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -394,11 +394,12 @@ public static bool Delete(DeleteToolOptions options, ITwilioRestClient client = /// Delete Tool parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Tool - public static async System.Threading.Tasks.Task DeleteAsync(DeleteToolOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteToolOptions 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 @@ -418,10 +419,10 @@ public static bool Delete(string pathId, ITwilioRestClient client = null) /// The tool ID. /// Client to make requests to Twilio /// Task that resolves to A single instance of Tool - public static async System.Threading.Tasks.Task DeleteAsync(string pathId, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new DeleteToolOptions(pathId) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -458,10 +459,10 @@ public static ToolResource Fetch(FetchToolOptions options, ITwilioRestClient cli /// Fetch Tool parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Tool - public static async System.Threading.Tasks.Task FetchAsync(FetchToolOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchToolOptions 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 @@ -482,10 +483,10 @@ public static ToolResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Tool - public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchToolOptions(pathId){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -520,10 +521,10 @@ public static ResourceSet Read(ReadToolOptions options, ITwilioRes /// Read Tool parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Tool - public static async System.Threading.Tasks.Task> ReadAsync(ReadToolOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadToolOptions 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("tools", response.Content); return new ResourceSet(page, options, client); @@ -559,7 +560,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadToolOptions(){ AssistantId = assistantId, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -647,11 +648,12 @@ public static ToolResource Update(UpdateToolOptions options, ITwilioRestClient c /// Client to make requests to Twilio /// Task that resolves to A single instance of Tool #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateToolOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateToolOptions 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 @@ -678,7 +680,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateToolOptions(pathId){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Bulkexports/V1/Export/DayResource.cs b/src/Twilio/Rest/Bulkexports/V1/Export/DayResource.cs index 965bcc940..dfdf7b0eb 100644 --- a/src/Twilio/Rest/Bulkexports/V1/Export/DayResource.cs +++ b/src/Twilio/Rest/Bulkexports/V1/Export/DayResource.cs @@ -69,10 +69,10 @@ public static DayResource Fetch(FetchDayOptions options, ITwilioRestClient clien /// Fetch Day parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Day - public static async System.Threading.Tasks.Task FetchAsync(FetchDayOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDayOptions 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 DayResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathResourceType, string pathDay, ITwilioRestClient client = null) { var options = new FetchDayOptions(pathResourceType, pathDay){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -136,10 +136,10 @@ public static ResourceSet Read(ReadDayOptions options, ITwilioRestC /// Read Day parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Day - public static async System.Threading.Tasks.Task> ReadAsync(ReadDayOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDayOptions 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("days", response.Content); return new ResourceSet(page, options, client); @@ -175,7 +175,7 @@ public static async System.Threading.Tasks.Task> ReadAs ITwilioRestClient client = null) { var options = new ReadDayOptions(pathResourceType){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobResource.cs b/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobResource.cs index b9bf0f10b..fbd9089d7 100644 --- a/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobResource.cs +++ b/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobResource.cs @@ -68,10 +68,10 @@ public static ExportCustomJobResource Create(CreateExportCustomJobOptions option /// Create ExportCustomJob parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ExportCustomJob - public static async System.Threading.Tasks.Task CreateAsync(CreateExportCustomJobOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateExportCustomJobOptions 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 @@ -122,7 +122,7 @@ public static async System.Threading.Tasks.Task CreateA ITwilioRestClient client = null) { var options = new CreateExportCustomJobOptions(pathResourceType, startDay, endDay, friendlyName){ WebhookUrl = webhookUrl, WebhookMethod = webhookMethod, Email = email }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -159,10 +159,10 @@ public static ResourceSet Read(ReadExportCustomJobOptio /// Read ExportCustomJob parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ExportCustomJob - public static async System.Threading.Tasks.Task> ReadAsync(ReadExportCustomJobOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadExportCustomJobOptions 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("jobs", response.Content); return new ResourceSet(page, options, client); @@ -198,7 +198,7 @@ public static async System.Threading.Tasks.Task Delete Job parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Job - public static async System.Threading.Tasks.Task DeleteAsync(DeleteJobOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteJobOptions 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 @@ -95,10 +96,10 @@ public static bool Delete(string pathJobSid, ITwilioRestClient client = null) /// The unique string that that we created to identify the Bulk Export job /// Client to make requests to Twilio /// Task that resolves to A single instance of Job - public static async System.Threading.Tasks.Task DeleteAsync(string pathJobSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathJobSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new DeleteJobOptions(pathJobSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -135,10 +136,10 @@ public static JobResource Fetch(FetchJobOptions options, ITwilioRestClient clien /// Fetch Job parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Job - public static async System.Threading.Tasks.Task FetchAsync(FetchJobOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchJobOptions 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 @@ -159,10 +160,10 @@ public static JobResource Fetch( /// The unique string that that we created to identify the Bulk Export job /// Client to make requests to Twilio /// Task that resolves to A single instance of Job - public static async System.Threading.Tasks.Task FetchAsync(string pathJobSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathJobSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchJobOptions(pathJobSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationResource.cs b/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationResource.cs index ec8ffc17a..13e71978f 100644 --- a/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationResource.cs +++ b/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationResource.cs @@ -67,10 +67,10 @@ public static ExportConfigurationResource Fetch(FetchExportConfigurationOptions /// Fetch ExportConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ExportConfiguration - public static async System.Threading.Tasks.Task FetchAsync(FetchExportConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchExportConfigurationOptions 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 ExportConfigurationResource Fetch( /// The type of communication – Messages, Calls, Conferences, and Participants /// Client to make requests to Twilio /// Task that resolves to A single instance of ExportConfiguration - public static async System.Threading.Tasks.Task FetchAsync(string pathResourceType, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathResourceType, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchExportConfigurationOptions(pathResourceType){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -132,11 +132,12 @@ public static ExportConfigurationResource Update(UpdateExportConfigurationOption /// Client to make requests to Twilio /// Task that resolves to A single instance of ExportConfiguration #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateExportConfigurationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateExportConfigurationOptions 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 @@ -175,7 +176,7 @@ public static async System.Threading.Tasks.Task Upd ITwilioRestClient client = null) { var options = new UpdateExportConfigurationOptions(pathResourceType){ Enabled = enabled, WebhookUrl = webhookUrl, WebhookMethod = webhookMethod }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Bulkexports/V1/ExportResource.cs b/src/Twilio/Rest/Bulkexports/V1/ExportResource.cs index 7deb09bdc..f092e5f48 100644 --- a/src/Twilio/Rest/Bulkexports/V1/ExportResource.cs +++ b/src/Twilio/Rest/Bulkexports/V1/ExportResource.cs @@ -67,10 +67,10 @@ public static ExportResource Fetch(FetchExportOptions options, ITwilioRestClient /// Fetch Export parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Export - public static async System.Threading.Tasks.Task FetchAsync(FetchExportOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchExportOptions 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 ExportResource Fetch( /// The type of communication – Messages, Calls, Conferences, and Participants /// Client to make requests to Twilio /// Task that resolves to A single instance of Export - public static async System.Threading.Tasks.Task FetchAsync(string pathResourceType, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathResourceType, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchExportOptions(pathResourceType){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Chat/V1/CredentialResource.cs b/src/Twilio/Rest/Chat/V1/CredentialResource.cs index 76e909978..41697510a 100644 --- a/src/Twilio/Rest/Chat/V1/CredentialResource.cs +++ b/src/Twilio/Rest/Chat/V1/CredentialResource.cs @@ -80,10 +80,10 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio /// Create Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions 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 @@ -134,7 +134,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateCredentialOptions(type){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -175,11 +175,12 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli /// Delete Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions 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 @@ -199,10 +200,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the Credential resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - 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 DeleteCredentialOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -239,10 +240,10 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe /// Fetch Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions 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 @@ -263,10 +264,10 @@ public static CredentialResource Fetch( /// The Twilio-provided string that uniquely identifies the Credential resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - 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 FetchCredentialOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadCredentialOptions options /// Read Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions 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("credentials", response.Content); return new ResourceSet(page, options, client); @@ -336,7 +337,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadCredentialOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -423,11 +424,12 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions 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 @@ -478,7 +480,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateCredentialOptions(pathSid){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Chat/V1/Service/Channel/InviteResource.cs b/src/Twilio/Rest/Chat/V1/Service/Channel/InviteResource.cs index 15b020150..8c4c40b05 100644 --- a/src/Twilio/Rest/Chat/V1/Service/Channel/InviteResource.cs +++ b/src/Twilio/Rest/Chat/V1/Service/Channel/InviteResource.cs @@ -70,10 +70,10 @@ public static InviteResource Create(CreateInviteOptions options, ITwilioRestClie /// Create Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task CreateAsync(CreateInviteOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInviteOptions 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 CreateInviteOptions(pathServiceSid, pathChannelSid, identity){ RoleSid = roleSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -157,11 +157,12 @@ public static bool Delete(DeleteInviteOptions options, ITwilioRestClient client /// Delete Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task DeleteAsync(DeleteInviteOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteInviteOptions 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 pathChannelSid, string p public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteInviteOptions(pathServiceSid, pathChannelSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -229,10 +230,10 @@ public static InviteResource Fetch(FetchInviteOptions options, ITwilioRestClient /// Fetch Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task FetchAsync(FetchInviteOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInviteOptions 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 InviteResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchInviteOptions(pathServiceSid, pathChannelSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadInviteOptions options, ITwili /// Read Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task> ReadAsync(ReadInviteOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInviteOptions 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("invites", response.Content); return new ResourceSet(page, options, client); @@ -348,7 +349,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadInviteOptions(pathServiceSid, pathChannelSid){ Identity = identity, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Chat/V1/Service/Channel/MemberResource.cs b/src/Twilio/Rest/Chat/V1/Service/Channel/MemberResource.cs index 989d94319..5cb12793f 100644 --- a/src/Twilio/Rest/Chat/V1/Service/Channel/MemberResource.cs +++ b/src/Twilio/Rest/Chat/V1/Service/Channel/MemberResource.cs @@ -70,10 +70,10 @@ public static MemberResource Create(CreateMemberOptions options, ITwilioRestClie /// Create Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task CreateAsync(CreateMemberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMemberOptions 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 CreateMemberOptions(pathServiceSid, pathChannelSid, identity){ RoleSid = roleSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -157,11 +157,12 @@ public static bool Delete(DeleteMemberOptions options, ITwilioRestClient client /// Delete Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task DeleteAsync(DeleteMemberOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteMemberOptions 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 pathChannelSid, string p public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteMemberOptions(pathServiceSid, pathChannelSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -229,10 +230,10 @@ public static MemberResource Fetch(FetchMemberOptions options, ITwilioRestClient /// Fetch Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions 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 MemberResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchMemberOptions(pathServiceSid, pathChannelSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadMemberOptions options, ITwili /// Read Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions 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("members", response.Content); return new ResourceSet(page, options, client); @@ -348,7 +349,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadMemberOptions(pathServiceSid, pathChannelSid){ Identity = identity, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -439,11 +440,12 @@ public static MemberResource Update(UpdateMemberOptions options, ITwilioRestClie /// Client to make requests to Twilio /// Task that resolves to A single instance of Member #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateMemberOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateMemberOptions 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 @@ -486,7 +488,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateMemberOptions(pathServiceSid, pathChannelSid, pathSid){ RoleSid = roleSid, LastConsumedMessageIndex = lastConsumedMessageIndex }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Chat/V1/Service/Channel/MessageResource.cs b/src/Twilio/Rest/Chat/V1/Service/Channel/MessageResource.cs index 09b668b97..f604cb135 100644 --- a/src/Twilio/Rest/Chat/V1/Service/Channel/MessageResource.cs +++ b/src/Twilio/Rest/Chat/V1/Service/Channel/MessageResource.cs @@ -82,10 +82,10 @@ public static MessageResource Create(CreateMessageOptions options, ITwilioRestCl /// Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions 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 @@ -128,7 +128,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateMessageOptions(pathServiceSid, pathChannelSid, body){ From = from, Attributes = attributes }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -173,11 +173,12 @@ public static bool Delete(DeleteMessageOptions options, ITwilioRestClient client /// Delete Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions 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 @@ -204,7 +205,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteMessageOptions(pathServiceSid, pathChannelSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -245,10 +246,10 @@ public static MessageResource Fetch(FetchMessageOptions options, ITwilioRestClie /// Fetch Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions 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 @@ -278,7 +279,7 @@ public static MessageResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchMessageOptions(pathServiceSid, pathChannelSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -317,10 +318,10 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions 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("messages", response.Content); return new ResourceSet(page, options, client); @@ -364,7 +365,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadMessageOptions(pathServiceSid, pathChannelSid){ Order = order, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -455,11 +456,12 @@ public static MessageResource Update(UpdateMessageOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Message #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions 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 @@ -502,7 +504,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateMessageOptions(pathServiceSid, pathChannelSid, pathSid){ Body = body, Attributes = attributes }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Chat/V1/Service/ChannelResource.cs b/src/Twilio/Rest/Chat/V1/Service/ChannelResource.cs index fbf81e1b9..24626128f 100644 --- a/src/Twilio/Rest/Chat/V1/Service/ChannelResource.cs +++ b/src/Twilio/Rest/Chat/V1/Service/ChannelResource.cs @@ -81,10 +81,10 @@ public static ChannelResource Create(CreateChannelOptions options, ITwilioRestCl /// Create Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions 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 @@ -127,7 +127,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateChannelOptions(pathServiceSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes, Type = type }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -170,11 +170,12 @@ public static bool Delete(DeleteChannelOptions options, ITwilioRestClient client /// Delete Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions 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 @@ -199,7 +200,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 DeleteChannelOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -238,10 +239,10 @@ public static ChannelResource Fetch(FetchChannelOptions options, ITwilioRestClie /// Fetch Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions 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 @@ -268,7 +269,7 @@ public static ChannelResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchChannelOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -305,10 +306,10 @@ public static ResourceSet Read(ReadChannelOptions options, ITwi /// Read Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions 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("channels", response.Content); return new ResourceSet(page, options, client); @@ -348,7 +349,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadChannelOptions(pathServiceSid){ Type = type, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -437,11 +438,12 @@ public static ChannelResource Update(UpdateChannelOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateChannelOptions 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 @@ -484,7 +486,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateChannelOptions(pathServiceSid, pathSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Chat/V1/Service/RoleResource.cs b/src/Twilio/Rest/Chat/V1/Service/RoleResource.cs index 8504cd263..5b94d3acd 100644 --- a/src/Twilio/Rest/Chat/V1/Service/RoleResource.cs +++ b/src/Twilio/Rest/Chat/V1/Service/RoleResource.cs @@ -81,10 +81,10 @@ public static RoleResource Create(CreateRoleOptions options, ITwilioRestClient c /// Create Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions 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 CreateRoleOptions(pathServiceSid, friendlyName, type, permission){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -166,11 +166,12 @@ public static bool Delete(DeleteRoleOptions options, ITwilioRestClient client = /// Delete Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions 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 pathServiceSid, string pathSid, ITwilioRestClie public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteRoleOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -234,10 +235,10 @@ public static RoleResource Fetch(FetchRoleOptions options, ITwilioRestClient cli /// Fetch Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions 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 RoleResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchRoleOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadRoleOptions options, ITwilioRes /// Read Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions 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("roles", response.Content); return new ResourceSet(page, options, client); @@ -340,7 +341,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadRoleOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -429,11 +430,12 @@ public static RoleResource Update(UpdateRoleOptions options, ITwilioRestClient c /// Client to make requests to Twilio /// Task that resolves to A single instance of Role #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions 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 @@ -468,7 +470,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateRoleOptions(pathServiceSid, pathSid, permission){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Chat/V1/Service/User/UserChannelResource.cs b/src/Twilio/Rest/Chat/V1/Service/User/UserChannelResource.cs index 63e12087d..91f185959 100644 --- a/src/Twilio/Rest/Chat/V1/Service/User/UserChannelResource.cs +++ b/src/Twilio/Rest/Chat/V1/Service/User/UserChannelResource.cs @@ -83,10 +83,10 @@ public static ResourceSet Read(ReadUserChannelOptions optio /// Read UserChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadUserChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserChannelOptions 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("channels", response.Content); return new ResourceSet(page, options, client); @@ -126,7 +126,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadUserChannelOptions(pathServiceSid, pathUserSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Chat/V1/Service/UserResource.cs b/src/Twilio/Rest/Chat/V1/Service/UserResource.cs index e7c9591ec..ad86a908f 100644 --- a/src/Twilio/Rest/Chat/V1/Service/UserResource.cs +++ b/src/Twilio/Rest/Chat/V1/Service/UserResource.cs @@ -68,10 +68,10 @@ public static UserResource Create(CreateUserOptions options, ITwilioRestClient c /// 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 @@ -114,7 +114,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateUserOptions(pathServiceSid, identity){ RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -157,11 +157,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 @@ -186,7 +187,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 DeleteUserOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -225,10 +226,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 @@ -255,7 +256,7 @@ public static UserResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchUserOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -292,10 +293,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("users", response.Content); return new ResourceSet(page, options, client); @@ -331,7 +332,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadUserOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -420,11 +421,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 @@ -467,7 +469,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateUserOptions(pathServiceSid, pathSid){ RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Chat/V1/ServiceResource.cs b/src/Twilio/Rest/Chat/V1/ServiceResource.cs index 8e199826a..28f421abb 100644 --- a/src/Twilio/Rest/Chat/V1/ServiceResource.cs +++ b/src/Twilio/Rest/Chat/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 @@ -96,7 +96,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateServiceOptions(friendlyName){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -137,11 +137,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 @@ -161,10 +162,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies 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 @@ -201,10 +202,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 @@ -225,10 +226,10 @@ public static ServiceResource Fetch( /// The Twilio-provided string that uniquely identifies 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 @@ -263,10 +264,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); @@ -298,7 +299,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 @@ -385,11 +386,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 @@ -632,7 +634,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, DefaultServiceRoleSid = defaultServiceRoleSid, DefaultChannelRoleSid = defaultChannelRoleSid, DefaultChannelCreatorRoleSid = defaultChannelCreatorRoleSid, ReadStatusEnabled = readStatusEnabled, ReachabilityEnabled = reachabilityEnabled, TypingIndicatorTimeout = typingIndicatorTimeout, ConsumptionReportInterval = consumptionReportInterval, NotificationsNewMessageEnabled = notificationsNewMessageEnabled, NotificationsNewMessageTemplate = notificationsNewMessageTemplate, NotificationsAddedToChannelEnabled = notificationsAddedToChannelEnabled, NotificationsAddedToChannelTemplate = notificationsAddedToChannelTemplate, NotificationsRemovedFromChannelEnabled = notificationsRemovedFromChannelEnabled, NotificationsRemovedFromChannelTemplate = notificationsRemovedFromChannelTemplate, NotificationsInvitedToChannelEnabled = notificationsInvitedToChannelEnabled, NotificationsInvitedToChannelTemplate = notificationsInvitedToChannelTemplate, PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, WebhookMethod = webhookMethod, WebhookFilters = webhookFilters, WebhooksOnMessageSendUrl = webhooksOnMessageSendUrl, WebhooksOnMessageSendMethod = webhooksOnMessageSendMethod, WebhooksOnMessageUpdateUrl = webhooksOnMessageUpdateUrl, WebhooksOnMessageUpdateMethod = webhooksOnMessageUpdateMethod, WebhooksOnMessageRemoveUrl = webhooksOnMessageRemoveUrl, WebhooksOnMessageRemoveMethod = webhooksOnMessageRemoveMethod, WebhooksOnChannelAddUrl = webhooksOnChannelAddUrl, WebhooksOnChannelAddMethod = webhooksOnChannelAddMethod, WebhooksOnChannelDestroyUrl = webhooksOnChannelDestroyUrl, WebhooksOnChannelDestroyMethod = webhooksOnChannelDestroyMethod, WebhooksOnChannelUpdateUrl = webhooksOnChannelUpdateUrl, WebhooksOnChannelUpdateMethod = webhooksOnChannelUpdateMethod, WebhooksOnMemberAddUrl = webhooksOnMemberAddUrl, WebhooksOnMemberAddMethod = webhooksOnMemberAddMethod, WebhooksOnMemberRemoveUrl = webhooksOnMemberRemoveUrl, WebhooksOnMemberRemoveMethod = webhooksOnMemberRemoveMethod, WebhooksOnMessageSentUrl = webhooksOnMessageSentUrl, WebhooksOnMessageSentMethod = webhooksOnMessageSentMethod, WebhooksOnMessageUpdatedUrl = webhooksOnMessageUpdatedUrl, WebhooksOnMessageUpdatedMethod = webhooksOnMessageUpdatedMethod, WebhooksOnMessageRemovedUrl = webhooksOnMessageRemovedUrl, WebhooksOnMessageRemovedMethod = webhooksOnMessageRemovedMethod, WebhooksOnChannelAddedUrl = webhooksOnChannelAddedUrl, WebhooksOnChannelAddedMethod = webhooksOnChannelAddedMethod, WebhooksOnChannelDestroyedUrl = webhooksOnChannelDestroyedUrl, WebhooksOnChannelDestroyedMethod = webhooksOnChannelDestroyedMethod, WebhooksOnChannelUpdatedUrl = webhooksOnChannelUpdatedUrl, WebhooksOnChannelUpdatedMethod = webhooksOnChannelUpdatedMethod, WebhooksOnMemberAddedUrl = webhooksOnMemberAddedUrl, WebhooksOnMemberAddedMethod = webhooksOnMemberAddedMethod, WebhooksOnMemberRemovedUrl = webhooksOnMemberRemovedUrl, WebhooksOnMemberRemovedMethod = webhooksOnMemberRemovedMethod, LimitsChannelMembers = limitsChannelMembers, LimitsUserChannels = limitsUserChannels }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Chat/V2/CredentialResource.cs b/src/Twilio/Rest/Chat/V2/CredentialResource.cs index 2835f40a2..fb604666c 100644 --- a/src/Twilio/Rest/Chat/V2/CredentialResource.cs +++ b/src/Twilio/Rest/Chat/V2/CredentialResource.cs @@ -80,10 +80,10 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio /// Create Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions 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 @@ -134,7 +134,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateCredentialOptions(type){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -175,11 +175,12 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli /// Delete Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions 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 @@ -199,10 +200,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Credential resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - 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 DeleteCredentialOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -239,10 +240,10 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe /// Fetch Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions 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 @@ -263,10 +264,10 @@ public static CredentialResource Fetch( /// The SID of the Credential resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - 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 FetchCredentialOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadCredentialOptions options /// Read Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions 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("credentials", response.Content); return new ResourceSet(page, options, client); @@ -336,7 +337,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadCredentialOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -423,11 +424,12 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions 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 @@ -478,7 +480,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateCredentialOptions(pathSid){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Chat/V2/Service/BindingResource.cs b/src/Twilio/Rest/Chat/V2/Service/BindingResource.cs index 4a24ceea4..498335c47 100644 --- a/src/Twilio/Rest/Chat/V2/Service/BindingResource.cs +++ b/src/Twilio/Rest/Chat/V2/Service/BindingResource.cs @@ -87,11 +87,12 @@ public static bool Delete(DeleteBindingOptions options, ITwilioRestClient client /// Delete Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task DeleteAsync(DeleteBindingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteBindingOptions 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 @@ -116,7 +117,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 DeleteBindingOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -155,10 +156,10 @@ public static BindingResource Fetch(FetchBindingOptions options, ITwilioRestClie /// Fetch Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions 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 @@ -185,7 +186,7 @@ public static BindingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchBindingOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -222,10 +223,10 @@ public static ResourceSet Read(ReadBindingOptions options, ITwi /// Read Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions 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("bindings", response.Content); return new ResourceSet(page, options, client); @@ -269,7 +270,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadBindingOptions(pathServiceSid){ BindingType = bindingType, Identity = identity, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Chat/V2/Service/ChannelResource.cs b/src/Twilio/Rest/Chat/V2/Service/ChannelResource.cs index 804cb63f9..7aadd8d51 100644 --- a/src/Twilio/Rest/Chat/V2/Service/ChannelResource.cs +++ b/src/Twilio/Rest/Chat/V2/Service/ChannelResource.cs @@ -93,10 +93,10 @@ public static ChannelResource Create(CreateChannelOptions options, ITwilioRestCl /// Create Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions 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 @@ -155,7 +155,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateChannelOptions(pathServiceSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes, Type = type, DateCreated = dateCreated, DateUpdated = dateUpdated, CreatedBy = createdBy, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -198,11 +198,12 @@ public static bool Delete(DeleteChannelOptions options, ITwilioRestClient client /// Delete Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions 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 @@ -229,7 +230,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ChannelResource public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ChannelResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new DeleteChannelOptions(pathServiceSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -268,10 +269,10 @@ public static ChannelResource Fetch(FetchChannelOptions options, ITwilioRestClie /// Fetch Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions 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 @@ -298,7 +299,7 @@ public static ChannelResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchChannelOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -335,10 +336,10 @@ public static ResourceSet Read(ReadChannelOptions options, ITwi /// Read Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions 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("channels", response.Content); return new ResourceSet(page, options, client); @@ -378,7 +379,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadChannelOptions(pathServiceSid){ Type = type, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -467,11 +468,12 @@ public static ChannelResource Update(UpdateChannelOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateChannelOptions 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 @@ -530,7 +532,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateChannelOptions(pathServiceSid, pathSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, CreatedBy = createdBy, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Chat/V2/ServiceResource.cs b/src/Twilio/Rest/Chat/V2/ServiceResource.cs index de1cd07f8..542084964 100644 --- a/src/Twilio/Rest/Chat/V2/ServiceResource.cs +++ b/src/Twilio/Rest/Chat/V2/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 @@ -96,7 +96,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateServiceOptions(friendlyName){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -137,11 +137,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 @@ -161,10 +162,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID 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 @@ -201,10 +202,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 @@ -225,10 +226,10 @@ public static ServiceResource Fetch( /// The SID 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 @@ -263,10 +264,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); @@ -298,7 +299,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 @@ -385,11 +386,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 @@ -540,7 +542,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, DefaultServiceRoleSid = defaultServiceRoleSid, DefaultChannelRoleSid = defaultChannelRoleSid, DefaultChannelCreatorRoleSid = defaultChannelCreatorRoleSid, ReadStatusEnabled = readStatusEnabled, ReachabilityEnabled = reachabilityEnabled, TypingIndicatorTimeout = typingIndicatorTimeout, ConsumptionReportInterval = consumptionReportInterval, NotificationsNewMessageEnabled = notificationsNewMessageEnabled, NotificationsNewMessageTemplate = notificationsNewMessageTemplate, NotificationsNewMessageSound = notificationsNewMessageSound, NotificationsNewMessageBadgeCountEnabled = notificationsNewMessageBadgeCountEnabled, NotificationsAddedToChannelEnabled = notificationsAddedToChannelEnabled, NotificationsAddedToChannelTemplate = notificationsAddedToChannelTemplate, NotificationsAddedToChannelSound = notificationsAddedToChannelSound, NotificationsRemovedFromChannelEnabled = notificationsRemovedFromChannelEnabled, NotificationsRemovedFromChannelTemplate = notificationsRemovedFromChannelTemplate, NotificationsRemovedFromChannelSound = notificationsRemovedFromChannelSound, NotificationsInvitedToChannelEnabled = notificationsInvitedToChannelEnabled, NotificationsInvitedToChannelTemplate = notificationsInvitedToChannelTemplate, NotificationsInvitedToChannelSound = notificationsInvitedToChannelSound, PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, WebhookMethod = webhookMethod, WebhookFilters = webhookFilters, LimitsChannelMembers = limitsChannelMembers, LimitsUserChannels = limitsUserChannels, MediaCompatibilityMessage = mediaCompatibilityMessage, PreWebhookRetryCount = preWebhookRetryCount, PostWebhookRetryCount = postWebhookRetryCount, NotificationsLogEnabled = notificationsLogEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalCreateResource.cs b/src/Twilio/Rest/Content/V1/Content/ApprovalCreateResource.cs index 27ed6670e..d9b7381af 100644 --- a/src/Twilio/Rest/Content/V1/Content/ApprovalCreateResource.cs +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalCreateResource.cs @@ -98,10 +98,10 @@ public static ApprovalCreateResource Create(CreateApprovalCreateOptions options, /// Create ApprovalCreate parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ApprovalCreate - public static async System.Threading.Tasks.Task CreateAsync(CreateApprovalCreateOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateApprovalCreateOptions 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 @@ -132,7 +132,7 @@ public static async System.Threading.Tasks.Task CreateAs ITwilioRestClient client = null) { var options = new CreateApprovalCreateOptions(pathContentSid, contentApprovalRequest){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalFetchResource.cs b/src/Twilio/Rest/Content/V1/Content/ApprovalFetchResource.cs index 0ceb1b5b5..7ea704fe1 100644 --- a/src/Twilio/Rest/Content/V1/Content/ApprovalFetchResource.cs +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalFetchResource.cs @@ -67,10 +67,10 @@ public static ApprovalFetchResource Fetch(FetchApprovalFetchOptions options, ITw /// Fetch ApprovalFetch parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ApprovalFetch - public static async System.Threading.Tasks.Task FetchAsync(FetchApprovalFetchOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchApprovalFetchOptions 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 ApprovalFetchResource Fetch( /// The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ApprovalFetch - 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 FetchApprovalFetchOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Content/V1/ContentAndApprovalsResource.cs b/src/Twilio/Rest/Content/V1/ContentAndApprovalsResource.cs index 797600c3a..c5fba2c84 100644 --- a/src/Twilio/Rest/Content/V1/ContentAndApprovalsResource.cs +++ b/src/Twilio/Rest/Content/V1/ContentAndApprovalsResource.cs @@ -65,10 +65,10 @@ public static ResourceSet Read(ReadContentAndApprov /// Read ContentAndApprovals parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ContentAndApprovals - public static async System.Threading.Tasks.Task> ReadAsync(ReadContentAndApprovalsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadContentAndApprovalsOptions 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("contents", response.Content); return new ResourceSet(page, options, client); @@ -100,7 +100,7 @@ public static async System.Threading.Tasks.Task Create Content parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Content - public static async System.Threading.Tasks.Task CreateAsync(CreateContentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateContentOptions 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 @@ -1204,7 +1204,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateContentOptions(contentCreateRequest){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -1245,11 +1245,12 @@ public static bool Delete(DeleteContentOptions options, ITwilioRestClient client /// Delete Content parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Content - public static async System.Threading.Tasks.Task DeleteAsync(DeleteContentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteContentOptions 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 @@ -1269,10 +1270,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the Content resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Content - 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 DeleteContentOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -1309,10 +1310,10 @@ public static ContentResource Fetch(FetchContentOptions options, ITwilioRestClie /// Fetch Content parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Content - public static async System.Threading.Tasks.Task FetchAsync(FetchContentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchContentOptions 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 @@ -1333,10 +1334,10 @@ public static ContentResource Fetch( /// The Twilio-provided string that uniquely identifies the Content resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Content - 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 FetchContentOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -1371,10 +1372,10 @@ public static ResourceSet Read(ReadContentOptions options, ITwi /// Read Content parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Content - public static async System.Threading.Tasks.Task> ReadAsync(ReadContentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadContentOptions 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("contents", response.Content); return new ResourceSet(page, options, client); @@ -1406,7 +1407,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadContentOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Content/V1/LegacyContentResource.cs b/src/Twilio/Rest/Content/V1/LegacyContentResource.cs index c1339842c..9de9baf6d 100644 --- a/src/Twilio/Rest/Content/V1/LegacyContentResource.cs +++ b/src/Twilio/Rest/Content/V1/LegacyContentResource.cs @@ -65,10 +65,10 @@ public static ResourceSet Read(ReadLegacyContentOptions o /// Read LegacyContent parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of LegacyContent - public static async System.Threading.Tasks.Task> ReadAsync(ReadLegacyContentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadLegacyContentOptions 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("contents", response.Content); return new ResourceSet(page, options, client); @@ -100,7 +100,7 @@ public static async System.Threading.Tasks.Task Read(ReadContentAndApprov /// Read ContentAndApprovals parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ContentAndApprovals - public static async System.Threading.Tasks.Task> ReadAsync(ReadContentAndApprovalsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadContentAndApprovalsOptions 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("contents", response.Content); return new ResourceSet(page, options, client); @@ -136,7 +136,7 @@ public static async System.Threading.Tasks.Task Read(ReadContentOptions options, ITwi /// Read Content parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Content - public static async System.Threading.Tasks.Task> ReadAsync(ReadContentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadContentOptions 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("contents", response.Content); return new ResourceSet(page, options, client); @@ -136,7 +136,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadContentOptions(){ PageSize = pageSize, SortByDate = sortByDate, SortByContentName = sortByContentName, DateCreatedAfter = dateCreatedAfter, DateCreatedBefore = dateCreatedBefore, ContentName = contentName, Content = content, Language = language, ContentType = contentType, ChannelEligibility = channelEligibility, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/AddressConfigurationResource.cs b/src/Twilio/Rest/Conversations/V1/AddressConfigurationResource.cs index b41409794..a98651d72 100644 --- a/src/Twilio/Rest/Conversations/V1/AddressConfigurationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/AddressConfigurationResource.cs @@ -107,10 +107,10 @@ public static AddressConfigurationResource Create(CreateAddressConfigurationOpti /// Create AddressConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AddressConfiguration - public static async System.Threading.Tasks.Task CreateAsync(CreateAddressConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAddressConfigurationOptions 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 @@ -181,7 +181,7 @@ public static async System.Threading.Tasks.Task Cr ITwilioRestClient client = null) { var options = new CreateAddressConfigurationOptions(type, address){ FriendlyName = friendlyName, AutoCreationEnabled = autoCreationEnabled, AutoCreationType = autoCreationType, AutoCreationConversationServiceSid = autoCreationConversationServiceSid, AutoCreationWebhookUrl = autoCreationWebhookUrl, AutoCreationWebhookMethod = autoCreationWebhookMethod, AutoCreationWebhookFilters = autoCreationWebhookFilters, AutoCreationStudioFlowSid = autoCreationStudioFlowSid, AutoCreationStudioRetryCount = autoCreationStudioRetryCount, AddressCountry = addressCountry }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -222,11 +222,12 @@ public static bool Delete(DeleteAddressConfigurationOptions options, ITwilioRest /// Delete AddressConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AddressConfiguration - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAddressConfigurationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAddressConfigurationOptions 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 @@ -246,10 +247,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Address Configuration resource. This value can be either the `sid` or the `address` of the configuration /// Client to make requests to Twilio /// Task that resolves to A single instance of AddressConfiguration - 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 DeleteAddressConfigurationOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -286,10 +287,10 @@ public static AddressConfigurationResource Fetch(FetchAddressConfigurationOption /// Fetch AddressConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AddressConfiguration - public static async System.Threading.Tasks.Task FetchAsync(FetchAddressConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAddressConfigurationOptions 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 @@ -310,10 +311,10 @@ public static AddressConfigurationResource Fetch( /// The SID of the Address Configuration resource. This value can be either the `sid` or the `address` of the configuration /// Client to make requests to Twilio /// Task that resolves to A single instance of AddressConfiguration - 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 FetchAddressConfigurationOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -348,10 +349,10 @@ public static ResourceSet Read(ReadAddressConfigur /// Read AddressConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AddressConfiguration - public static async System.Threading.Tasks.Task> ReadAsync(ReadAddressConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAddressConfigurationOptions 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("address_configurations", response.Content); return new ResourceSet(page, options, client); @@ -387,7 +388,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of AddressConfiguration #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAddressConfigurationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateAddressConfigurationOptions 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 @@ -541,7 +543,7 @@ public static async System.Threading.Tasks.Task Up ITwilioRestClient client = null) { var options = new UpdateAddressConfigurationOptions(pathSid){ FriendlyName = friendlyName, AutoCreationEnabled = autoCreationEnabled, AutoCreationType = autoCreationType, AutoCreationConversationServiceSid = autoCreationConversationServiceSid, AutoCreationWebhookUrl = autoCreationWebhookUrl, AutoCreationWebhookMethod = autoCreationWebhookMethod, AutoCreationWebhookFilters = autoCreationWebhookFilters, AutoCreationStudioFlowSid = autoCreationStudioFlowSid, AutoCreationStudioRetryCount = autoCreationStudioRetryCount }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Configuration/WebhookResource.cs b/src/Twilio/Rest/Conversations/V1/Configuration/WebhookResource.cs index 0673195ce..79f5d0142 100644 --- a/src/Twilio/Rest/Conversations/V1/Configuration/WebhookResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Configuration/WebhookResource.cs @@ -91,10 +91,10 @@ public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClie /// Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions 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 @@ -112,10 +112,10 @@ public static WebhookResource Fetch( /// fetch /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchWebhookOptions(){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -151,11 +151,12 @@ public static WebhookResource Update(UpdateWebhookOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions 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 @@ -198,7 +199,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateWebhookOptions(){ Method = method, Filters = filters, PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, Target = target }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/ConfigurationResource.cs b/src/Twilio/Rest/Conversations/V1/ConfigurationResource.cs index 0aee08883..9ad72a449 100644 --- a/src/Twilio/Rest/Conversations/V1/ConfigurationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/ConfigurationResource.cs @@ -65,10 +65,10 @@ public static ConfigurationResource Fetch(FetchConfigurationOptions options, ITw /// Fetch Configuration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration - public static async System.Threading.Tasks.Task FetchAsync(FetchConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchConfigurationOptions 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 @@ -86,10 +86,10 @@ public static ConfigurationResource Fetch( /// Fetch the global configuration of conversations on your account /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchConfigurationOptions(){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -125,11 +125,12 @@ public static ConfigurationResource Update(UpdateConfigurationOptions options, I /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateConfigurationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateConfigurationOptions 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 @@ -168,7 +169,7 @@ public static async System.Threading.Tasks.Task UpdateAsy ITwilioRestClient client = null) { var options = new UpdateConfigurationOptions(){ DefaultChatServiceSid = defaultChatServiceSid, DefaultMessagingServiceSid = defaultMessagingServiceSid, DefaultInactiveTimer = defaultInactiveTimer, DefaultClosedTimer = defaultClosedTimer }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptResource.cs b/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptResource.cs index 3b1240a88..5c539e3c8 100644 --- a/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptResource.cs @@ -87,10 +87,10 @@ public static DeliveryReceiptResource Fetch(FetchDeliveryReceiptOptions options, /// Fetch DeliveryReceipt parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeliveryReceipt - public static async System.Threading.Tasks.Task FetchAsync(FetchDeliveryReceiptOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDeliveryReceiptOptions 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 @@ -120,7 +120,7 @@ public static DeliveryReceiptResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathConversationSid, string pathMessageSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchDeliveryReceiptOptions(pathConversationSid, pathMessageSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -159,10 +159,10 @@ public static ResourceSet Read(ReadDeliveryReceiptOptio /// Read DeliveryReceipt parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeliveryReceipt - public static async System.Threading.Tasks.Task> ReadAsync(ReadDeliveryReceiptOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDeliveryReceiptOptions 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("delivery_receipts", response.Content); return new ResourceSet(page, options, client); @@ -202,7 +202,7 @@ public static async System.Threading.Tasks.Task Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions 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 @@ -162,7 +162,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateMessageOptions(pathConversationSid){ Author = author, Body = body, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MediaSid = mediaSid, ContentSid = contentSid, ContentVariables = contentVariables, Subject = subject, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -205,11 +205,12 @@ public static bool Delete(DeleteMessageOptions options, ITwilioRestClient client /// Delete Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions 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 @@ -236,7 +237,7 @@ public static bool Delete(string pathConversationSid, string pathSid, MessageRes public static async System.Threading.Tasks.Task DeleteAsync(string pathConversationSid, string pathSid, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new DeleteMessageOptions(pathConversationSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -275,10 +276,10 @@ public static MessageResource Fetch(FetchMessageOptions options, ITwilioRestClie /// Fetch Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions 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 @@ -305,7 +306,7 @@ public static MessageResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathConversationSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchMessageOptions(pathConversationSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -342,10 +343,10 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions 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("messages", response.Content); return new ResourceSet(page, options, client); @@ -385,7 +386,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadMessageOptions(pathConversationSid){ Order = order, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -474,11 +475,12 @@ public static MessageResource Update(UpdateMessageOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Message #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions 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 @@ -537,7 +539,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateMessageOptions(pathConversationSid, pathSid){ Author = author, Body = body, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, Subject = subject, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantResource.cs b/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantResource.cs index 16a05c8ab..edbc446e4 100644 --- a/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantResource.cs @@ -80,10 +80,10 @@ public static ParticipantResource Create(CreateParticipantOptions options, ITwil /// Create Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions 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 @@ -146,7 +146,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreateParticipantOptions(pathConversationSid){ Identity = identity, MessagingBindingAddress = messagingBindingAddress, MessagingBindingProxyAddress = messagingBindingProxyAddress, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MessagingBindingProjectedAddress = messagingBindingProjectedAddress, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -189,11 +189,12 @@ public static bool Delete(DeleteParticipantOptions options, ITwilioRestClient cl /// Delete Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task DeleteAsync(DeleteParticipantOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteParticipantOptions 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 @@ -220,7 +221,7 @@ public static bool Delete(string pathConversationSid, string pathSid, Participan public static async System.Threading.Tasks.Task DeleteAsync(string pathConversationSid, string pathSid, ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new DeleteParticipantOptions(pathConversationSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -259,10 +260,10 @@ public static ParticipantResource Fetch(FetchParticipantOptions options, ITwilio /// Fetch Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions 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 @@ -289,7 +290,7 @@ public static ParticipantResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathConversationSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchParticipantOptions(pathConversationSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -326,10 +327,10 @@ public static ResourceSet Read(ReadParticipantOptions optio /// Read Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions 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("participants", response.Content); return new ResourceSet(page, options, client); @@ -365,7 +366,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadParticipantOptions(pathConversationSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -454,11 +455,12 @@ public static ParticipantResource Update(UpdateParticipantOptions options, ITwil /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateParticipantOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateParticipantOptions 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 @@ -529,7 +531,7 @@ public static async System.Threading.Tasks.Task UpdateAsync ITwilioRestClient client = null) { var options = new UpdateParticipantOptions(pathConversationSid, pathSid){ DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, RoleSid = roleSid, MessagingBindingProxyAddress = messagingBindingProxyAddress, MessagingBindingProjectedAddress = messagingBindingProjectedAddress, Identity = identity, LastReadMessageIndex = lastReadMessageIndex, LastReadTimestamp = lastReadTimestamp, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Conversation/WebhookResource.cs b/src/Twilio/Rest/Conversations/V1/Conversation/WebhookResource.cs index 2fc6801cd..0c7569408 100644 --- a/src/Twilio/Rest/Conversations/V1/Conversation/WebhookResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Conversation/WebhookResource.cs @@ -93,10 +93,10 @@ public static WebhookResource Create(CreateWebhookOptions options, ITwilioRestCl /// Create Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions 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 @@ -151,7 +151,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateWebhookOptions(pathConversationSid, target){ ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid, ConfigurationReplayAfter = configurationReplayAfter }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -194,11 +194,12 @@ public static bool Delete(DeleteWebhookOptions options, ITwilioRestClient client /// Delete Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebhookOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebhookOptions 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 @@ -223,7 +224,7 @@ public static bool Delete(string pathConversationSid, string pathSid, ITwilioRes public static async System.Threading.Tasks.Task DeleteAsync(string pathConversationSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteWebhookOptions(pathConversationSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -262,10 +263,10 @@ public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClie /// Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions 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 @@ -292,7 +293,7 @@ public static WebhookResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathConversationSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchWebhookOptions(pathConversationSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -329,10 +330,10 @@ public static ResourceSet Read(ReadWebhookOptions options, ITwi /// Read Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions 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("webhooks", response.Content); return new ResourceSet(page, options, client); @@ -368,7 +369,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadWebhookOptions(pathConversationSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -457,11 +458,12 @@ public static WebhookResource Update(UpdateWebhookOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions 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 @@ -512,7 +514,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateWebhookOptions(pathConversationSid, pathSid){ ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/ConversationResource.cs b/src/Twilio/Rest/Conversations/V1/ConversationResource.cs index 384509651..ef8f1c811 100644 --- a/src/Twilio/Rest/Conversations/V1/ConversationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/ConversationResource.cs @@ -92,10 +92,10 @@ public static ConversationResource Create(CreateConversationOptions options, ITw /// Create Conversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task CreateAsync(CreateConversationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateConversationOptions 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 @@ -166,7 +166,7 @@ public static async System.Threading.Tasks.Task CreateAsyn ITwilioRestClient client = null) { var options = new CreateConversationOptions(){ FriendlyName = friendlyName, UniqueName = uniqueName, DateCreated = dateCreated, DateUpdated = dateUpdated, MessagingServiceSid = messagingServiceSid, Attributes = attributes, State = state, TimersInactive = timersInactive, TimersClosed = timersClosed, BindingsEmailAddress = bindingsEmailAddress, BindingsEmailName = bindingsEmailName, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -207,11 +207,12 @@ public static bool Delete(DeleteConversationOptions options, ITwilioRestClient c /// Delete Conversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task DeleteAsync(DeleteConversationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteConversationOptions 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 @@ -236,7 +237,7 @@ public static bool Delete(string pathSid, ConversationResource.WebhookEnabledTyp public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ConversationResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new DeleteConversationOptions(pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -273,10 +274,10 @@ public static ConversationResource Fetch(FetchConversationOptions options, ITwil /// Fetch Conversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task FetchAsync(FetchConversationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchConversationOptions 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 @@ -297,10 +298,10 @@ public static ConversationResource Fetch( /// A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - 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 FetchConversationOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -335,10 +336,10 @@ public static ResourceSet Read(ReadConversationOptions opt /// Read Conversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task> ReadAsync(ReadConversationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConversationOptions 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("conversations", response.Content); return new ResourceSet(page, options, client); @@ -382,7 +383,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of Conversation #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateConversationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateConversationOptions 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 @@ -548,7 +550,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn ITwilioRestClient client = null) { var options = new UpdateConversationOptions(pathSid){ FriendlyName = friendlyName, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MessagingServiceSid = messagingServiceSid, State = state, TimersInactive = timersInactive, TimersClosed = timersClosed, UniqueName = uniqueName, BindingsEmailAddress = bindingsEmailAddress, BindingsEmailName = bindingsEmailName, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/ConversationWithParticipantsResource.cs b/src/Twilio/Rest/Conversations/V1/ConversationWithParticipantsResource.cs index 9bc268c2a..3e7b266ac 100644 --- a/src/Twilio/Rest/Conversations/V1/ConversationWithParticipantsResource.cs +++ b/src/Twilio/Rest/Conversations/V1/ConversationWithParticipantsResource.cs @@ -92,10 +92,10 @@ public static ConversationWithParticipantsResource Create(CreateConversationWith /// Create ConversationWithParticipants parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConversationWithParticipants - public static async System.Threading.Tasks.Task CreateAsync(CreateConversationWithParticipantsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateConversationWithParticipantsOptions 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 @@ -170,7 +170,7 @@ public static async System.Threading.Tasks.Task Create Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions 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 @@ -134,7 +134,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateCredentialOptions(type){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -175,11 +175,12 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli /// Delete Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions 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 @@ -199,10 +200,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - 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 DeleteCredentialOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -239,10 +240,10 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe /// Fetch Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions 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 @@ -263,10 +264,10 @@ public static CredentialResource Fetch( /// A 34 character string that uniquely identifies this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - 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 FetchCredentialOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadCredentialOptions options /// Read Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions 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("credentials", response.Content); return new ResourceSet(page, options, client); @@ -336,7 +337,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadCredentialOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -423,11 +424,12 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions 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 UpdateCredentialOptions(pathSid){ Type = type, FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/ParticipantConversationResource.cs b/src/Twilio/Rest/Conversations/V1/ParticipantConversationResource.cs index 47ad7c07e..853470cb5 100644 --- a/src/Twilio/Rest/Conversations/V1/ParticipantConversationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/ParticipantConversationResource.cs @@ -79,10 +79,10 @@ public static ResourceSet Read(ReadParticipantC /// Read ParticipantConversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ParticipantConversation - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantConversationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantConversationOptions 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("conversations", response.Content); return new ResourceSet(page, options, client); @@ -122,7 +122,7 @@ public static async System.Threading.Tasks.Task Create Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions 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 @@ -117,7 +117,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateRoleOptions(friendlyName, type, permission){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -158,11 +158,12 @@ public static bool Delete(DeleteRoleOptions options, ITwilioRestClient client = /// Delete Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions 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 @@ -182,10 +183,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Role resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - 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 DeleteRoleOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -222,10 +223,10 @@ public static RoleResource Fetch(FetchRoleOptions options, ITwilioRestClient cli /// Fetch Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions 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 @@ -246,10 +247,10 @@ public static RoleResource Fetch( /// The SID of the Role resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - 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 FetchRoleOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +285,10 @@ public static ResourceSet Read(ReadRoleOptions options, ITwilioRes /// Read Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions 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("roles", response.Content); return new ResourceSet(page, options, client); @@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadRoleOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -406,11 +407,12 @@ public static RoleResource Update(UpdateRoleOptions options, ITwilioRestClient c /// Client to make requests to Twilio /// Task that resolves to A single instance of Role #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions 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 @@ -441,7 +443,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateRoleOptions(pathSid, permission){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Service/BindingResource.cs b/src/Twilio/Rest/Conversations/V1/Service/BindingResource.cs index 4d2b374cb..1cfbf420c 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/BindingResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/BindingResource.cs @@ -87,11 +87,12 @@ public static bool Delete(DeleteBindingOptions options, ITwilioRestClient client /// Delete Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task DeleteAsync(DeleteBindingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteBindingOptions 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 @@ -116,7 +117,7 @@ public static bool Delete(string pathChatServiceSid, string pathSid, ITwilioRest public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteBindingOptions(pathChatServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -155,10 +156,10 @@ public static BindingResource Fetch(FetchBindingOptions options, ITwilioRestClie /// Fetch Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions 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 @@ -185,7 +186,7 @@ public static BindingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchBindingOptions(pathChatServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -222,10 +223,10 @@ public static ResourceSet Read(ReadBindingOptions options, ITwi /// Read Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions 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("bindings", response.Content); return new ResourceSet(page, options, client); @@ -269,7 +270,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadBindingOptions(pathChatServiceSid){ BindingType = bindingType, Identity = identity, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationResource.cs b/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationResource.cs index 1bde68149..ba662d72c 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationResource.cs @@ -67,10 +67,10 @@ public static NotificationResource Fetch(FetchNotificationOptions options, ITwil /// Fetch Notification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task FetchAsync(FetchNotificationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchNotificationOptions 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 NotificationResource Fetch( /// The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Configuration applies to. /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchNotificationOptions(pathChatServiceSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -132,11 +132,12 @@ public static NotificationResource Update(UpdateNotificationOptions options, ITw /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateNotificationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateNotificationOptions 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 @@ -215,7 +216,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn ITwilioRestClient client = null) { var options = new UpdateNotificationOptions(pathChatServiceSid){ LogEnabled = logEnabled, NewMessageEnabled = newMessageEnabled, NewMessageTemplate = newMessageTemplate, NewMessageSound = newMessageSound, NewMessageBadgeCountEnabled = newMessageBadgeCountEnabled, AddedToConversationEnabled = addedToConversationEnabled, AddedToConversationTemplate = addedToConversationTemplate, AddedToConversationSound = addedToConversationSound, RemovedFromConversationEnabled = removedFromConversationEnabled, RemovedFromConversationTemplate = removedFromConversationTemplate, RemovedFromConversationSound = removedFromConversationSound, NewMessageWithMediaEnabled = newMessageWithMediaEnabled, NewMessageWithMediaTemplate = newMessageWithMediaTemplate }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookResource.cs b/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookResource.cs index b4dc72edf..c376b6953 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookResource.cs @@ -80,10 +80,10 @@ public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClie /// Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions 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,10 +104,10 @@ public static WebhookResource Fetch( /// The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchWebhookOptions(pathChatServiceSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static WebhookResource Update(UpdateWebhookOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions 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 @@ -192,7 +193,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateWebhookOptions(pathChatServiceSid){ PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, Filters = filters, Method = method }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Service/ConfigurationResource.cs b/src/Twilio/Rest/Conversations/V1/Service/ConfigurationResource.cs index f6b8b0f37..d6e75abea 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/ConfigurationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/ConfigurationResource.cs @@ -67,10 +67,10 @@ public static ConfigurationResource Fetch(FetchConfigurationOptions options, ITw /// Fetch Configuration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration - public static async System.Threading.Tasks.Task FetchAsync(FetchConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchConfigurationOptions 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 ConfigurationResource Fetch( /// The SID of the Service configuration resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchConfigurationOptions(pathChatServiceSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -132,11 +132,12 @@ public static ConfigurationResource Update(UpdateConfigurationOptions options, I /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateConfigurationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateConfigurationOptions 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 @@ -179,7 +180,7 @@ public static async System.Threading.Tasks.Task UpdateAsy ITwilioRestClient client = null) { var options = new UpdateConfigurationOptions(pathChatServiceSid){ DefaultConversationCreatorRoleSid = defaultConversationCreatorRoleSid, DefaultConversationRoleSid = defaultConversationRoleSid, DefaultChatServiceRoleSid = defaultChatServiceRoleSid, ReachabilityEnabled = reachabilityEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptResource.cs b/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptResource.cs index a7a31cb26..5694cbb0c 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptResource.cs @@ -89,10 +89,10 @@ public static DeliveryReceiptResource Fetch(FetchDeliveryReceiptOptions options, /// Fetch DeliveryReceipt parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeliveryReceipt - public static async System.Threading.Tasks.Task FetchAsync(FetchDeliveryReceiptOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDeliveryReceiptOptions 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 @@ -125,7 +125,7 @@ public static DeliveryReceiptResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathConversationSid, string pathMessageSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchDeliveryReceiptOptions(pathChatServiceSid, pathConversationSid, pathMessageSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -166,10 +166,10 @@ public static ResourceSet Read(ReadDeliveryReceiptOptio /// Read DeliveryReceipt parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeliveryReceipt - public static async System.Threading.Tasks.Task> ReadAsync(ReadDeliveryReceiptOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDeliveryReceiptOptions 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("delivery_receipts", response.Content); return new ResourceSet(page, options, client); @@ -213,7 +213,7 @@ public static async System.Threading.Tasks.Task Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions 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 @@ -168,7 +168,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateMessageOptions(pathChatServiceSid, pathConversationSid){ Author = author, Body = body, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MediaSid = mediaSid, ContentSid = contentSid, ContentVariables = contentVariables, Subject = subject, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -213,11 +213,12 @@ public static bool Delete(DeleteMessageOptions options, ITwilioRestClient client /// Delete Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions 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 @@ -246,7 +247,7 @@ public static bool Delete(string pathChatServiceSid, string pathConversationSid, public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new DeleteMessageOptions(pathChatServiceSid, pathConversationSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -287,10 +288,10 @@ public static MessageResource Fetch(FetchMessageOptions options, ITwilioRestClie /// Fetch Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions 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 @@ -320,7 +321,7 @@ public static MessageResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchMessageOptions(pathChatServiceSid, pathConversationSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -359,10 +360,10 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions 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("messages", response.Content); return new ResourceSet(page, options, client); @@ -406,7 +407,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadMessageOptions(pathChatServiceSid, pathConversationSid){ Order = order, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -497,11 +498,12 @@ public static MessageResource Update(UpdateMessageOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Message #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions 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 @@ -564,7 +566,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateMessageOptions(pathChatServiceSid, pathConversationSid, pathSid){ Author = author, Body = body, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, Subject = subject, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantResource.cs b/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantResource.cs index 282aa4ddd..64a3b5144 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantResource.cs @@ -82,10 +82,10 @@ public static ParticipantResource Create(CreateParticipantOptions options, ITwil /// Create Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions 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 @@ -152,7 +152,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreateParticipantOptions(pathChatServiceSid, pathConversationSid){ Identity = identity, MessagingBindingAddress = messagingBindingAddress, MessagingBindingProxyAddress = messagingBindingProxyAddress, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MessagingBindingProjectedAddress = messagingBindingProjectedAddress, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -197,11 +197,12 @@ public static bool Delete(DeleteParticipantOptions options, ITwilioRestClient cl /// Delete Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task DeleteAsync(DeleteParticipantOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteParticipantOptions 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 @@ -230,7 +231,7 @@ public static bool Delete(string pathChatServiceSid, string pathConversationSid, public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new DeleteParticipantOptions(pathChatServiceSid, pathConversationSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -271,10 +272,10 @@ public static ParticipantResource Fetch(FetchParticipantOptions options, ITwilio /// Fetch Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions 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 @@ -304,7 +305,7 @@ public static ParticipantResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchParticipantOptions(pathChatServiceSid, pathConversationSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -343,10 +344,10 @@ public static ResourceSet Read(ReadParticipantOptions optio /// Read Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions 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("participants", response.Content); return new ResourceSet(page, options, client); @@ -386,7 +387,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadParticipantOptions(pathChatServiceSid, pathConversationSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -477,11 +478,12 @@ public static ParticipantResource Update(UpdateParticipantOptions options, ITwil /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateParticipantOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateParticipantOptions 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 @@ -556,7 +558,7 @@ public static async System.Threading.Tasks.Task UpdateAsync ITwilioRestClient client = null) { var options = new UpdateParticipantOptions(pathChatServiceSid, pathConversationSid, pathSid){ DateCreated = dateCreated, DateUpdated = dateUpdated, Identity = identity, Attributes = attributes, RoleSid = roleSid, MessagingBindingProxyAddress = messagingBindingProxyAddress, MessagingBindingProjectedAddress = messagingBindingProjectedAddress, LastReadMessageIndex = lastReadMessageIndex, LastReadTimestamp = lastReadTimestamp, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookResource.cs b/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookResource.cs index 0d772ad19..32a4798ed 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookResource.cs @@ -95,10 +95,10 @@ public static WebhookResource Create(CreateWebhookOptions options, ITwilioRestCl /// Create Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions 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 @@ -157,7 +157,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateWebhookOptions(pathChatServiceSid, pathConversationSid, target){ ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid, ConfigurationReplayAfter = configurationReplayAfter }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -202,11 +202,12 @@ public static bool Delete(DeleteWebhookOptions options, ITwilioRestClient client /// Delete Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebhookOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebhookOptions 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 @@ -233,7 +234,7 @@ public static bool Delete(string pathChatServiceSid, string pathConversationSid, public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteWebhookOptions(pathChatServiceSid, pathConversationSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -274,10 +275,10 @@ public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClie /// Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions 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 @@ -307,7 +308,7 @@ public static WebhookResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchWebhookOptions(pathChatServiceSid, pathConversationSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -346,10 +347,10 @@ public static ResourceSet Read(ReadWebhookOptions options, ITwi /// Read Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions 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("webhooks", response.Content); return new ResourceSet(page, options, client); @@ -389,7 +390,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadWebhookOptions(pathChatServiceSid, pathConversationSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -480,11 +481,12 @@ public static WebhookResource Update(UpdateWebhookOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions 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 @@ -539,7 +541,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateWebhookOptions(pathChatServiceSid, pathConversationSid, pathSid){ ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Service/ConversationResource.cs b/src/Twilio/Rest/Conversations/V1/Service/ConversationResource.cs index fe70db4cc..002ad8247 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/ConversationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/ConversationResource.cs @@ -94,10 +94,10 @@ public static ConversationResource Create(CreateConversationOptions options, ITw /// Create Conversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task CreateAsync(CreateConversationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateConversationOptions 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 @@ -172,7 +172,7 @@ public static async System.Threading.Tasks.Task CreateAsyn ITwilioRestClient client = null) { var options = new CreateConversationOptions(pathChatServiceSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes, MessagingServiceSid = messagingServiceSid, DateCreated = dateCreated, DateUpdated = dateUpdated, State = state, TimersInactive = timersInactive, TimersClosed = timersClosed, BindingsEmailAddress = bindingsEmailAddress, BindingsEmailName = bindingsEmailName, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -215,11 +215,12 @@ public static bool Delete(DeleteConversationOptions options, ITwilioRestClient c /// Delete Conversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task DeleteAsync(DeleteConversationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteConversationOptions 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 @@ -246,7 +247,7 @@ public static bool Delete(string pathChatServiceSid, string pathSid, Conversatio public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathSid, ConversationResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new DeleteConversationOptions(pathChatServiceSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -285,10 +286,10 @@ public static ConversationResource Fetch(FetchConversationOptions options, ITwil /// Fetch Conversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task FetchAsync(FetchConversationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchConversationOptions 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 @@ -315,7 +316,7 @@ public static ConversationResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchConversationOptions(pathChatServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -352,10 +353,10 @@ public static ResourceSet Read(ReadConversationOptions opt /// Read Conversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task> ReadAsync(ReadConversationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConversationOptions 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("conversations", response.Content); return new ResourceSet(page, options, client); @@ -403,7 +404,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of Conversation #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateConversationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateConversationOptions 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 @@ -575,7 +577,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn ITwilioRestClient client = null) { var options = new UpdateConversationOptions(pathChatServiceSid, pathSid){ FriendlyName = friendlyName, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MessagingServiceSid = messagingServiceSid, State = state, TimersInactive = timersInactive, TimersClosed = timersClosed, UniqueName = uniqueName, BindingsEmailAddress = bindingsEmailAddress, BindingsEmailName = bindingsEmailName, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Service/ConversationWithParticipantsResource.cs b/src/Twilio/Rest/Conversations/V1/Service/ConversationWithParticipantsResource.cs index 9349800b3..ea2fd0903 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/ConversationWithParticipantsResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/ConversationWithParticipantsResource.cs @@ -94,10 +94,10 @@ public static ConversationWithParticipantsResource Create(CreateConversationWith /// Create ConversationWithParticipants parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConversationWithParticipants - public static async System.Threading.Tasks.Task CreateAsync(CreateConversationWithParticipantsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateConversationWithParticipantsOptions 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 @@ -176,7 +176,7 @@ public static async System.Threading.Tasks.Task Read(ReadParticipantC /// Read ParticipantConversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ParticipantConversation - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantConversationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantConversationOptions 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("conversations", response.Content); return new ResourceSet(page, options, client); @@ -128,7 +128,7 @@ public static async System.Threading.Tasks.Task Create Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions 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 CreateRoleOptions(pathChatServiceSid, friendlyName, type, permission){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -166,11 +166,12 @@ public static bool Delete(DeleteRoleOptions options, ITwilioRestClient client = /// Delete Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions 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 pathChatServiceSid, string pathSid, ITwilioRest public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteRoleOptions(pathChatServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -234,10 +235,10 @@ public static RoleResource Fetch(FetchRoleOptions options, ITwilioRestClient cli /// Fetch Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions 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 RoleResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchRoleOptions(pathChatServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadRoleOptions options, ITwilioRes /// Read Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions 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("roles", response.Content); return new ResourceSet(page, options, client); @@ -340,7 +341,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadRoleOptions(pathChatServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -429,11 +430,12 @@ public static RoleResource Update(UpdateRoleOptions options, ITwilioRestClient c /// Client to make requests to Twilio /// Task that resolves to A single instance of Role #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions 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 @@ -468,7 +470,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateRoleOptions(pathChatServiceSid, pathSid, permission){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationResource.cs b/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationResource.cs index 10e9e6e68..d17eb853b 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationResource.cs @@ -102,11 +102,12 @@ public static bool Delete(DeleteUserConversationOptions options, ITwilioRestClie /// Delete UserConversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation - public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserConversationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserConversationOptions 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 @@ -133,7 +134,7 @@ public static bool Delete(string pathChatServiceSid, string pathUserSid, string public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathUserSid, string pathConversationSid, ITwilioRestClient client = null) { var options = new DeleteUserConversationOptions(pathChatServiceSid, pathUserSid, pathConversationSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -174,10 +175,10 @@ public static UserConversationResource Fetch(FetchUserConversationOptions option /// Fetch UserConversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation - public static async System.Threading.Tasks.Task FetchAsync(FetchUserConversationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserConversationOptions 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 @@ -207,7 +208,7 @@ public static UserConversationResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathUserSid, string pathConversationSid, ITwilioRestClient client = null) { var options = new FetchUserConversationOptions(pathChatServiceSid, pathUserSid, pathConversationSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -246,10 +247,10 @@ public static ResourceSet Read(ReadUserConversationOpt /// Read UserConversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation - public static async System.Threading.Tasks.Task> ReadAsync(ReadUserConversationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserConversationOptions 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("conversations", response.Content); return new ResourceSet(page, options, client); @@ -289,7 +290,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserConversationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserConversationOptions 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 @@ -431,7 +433,7 @@ public static async System.Threading.Tasks.Task Update ITwilioRestClient client = null) { var options = new UpdateUserConversationOptions(pathChatServiceSid, pathUserSid, pathConversationSid){ NotificationLevel = notificationLevel, LastReadTimestamp = lastReadTimestamp, LastReadMessageIndex = lastReadMessageIndex }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/Service/UserResource.cs b/src/Twilio/Rest/Conversations/V1/Service/UserResource.cs index 5dff2b4d2..d97121591 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/UserResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/UserResource.cs @@ -80,10 +80,10 @@ public static UserResource Create(CreateUserOptions options, ITwilioRestClient c /// 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 @@ -130,7 +130,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateUserOptions(pathChatServiceSid, identity){ FriendlyName = friendlyName, Attributes = attributes, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -173,11 +173,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 @@ -204,7 +205,7 @@ public static bool Delete(string pathChatServiceSid, string pathSid, UserResourc public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathSid, UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new DeleteUserOptions(pathChatServiceSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -243,10 +244,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 @@ -273,7 +274,7 @@ public static UserResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchUserOptions(pathChatServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -310,10 +311,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("users", response.Content); return new ResourceSet(page, options, client); @@ -349,7 +350,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadUserOptions(pathChatServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -438,11 +439,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 @@ -489,7 +491,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateUserOptions(pathChatServiceSid, pathSid){ FriendlyName = friendlyName, Attributes = attributes, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/ServiceResource.cs b/src/Twilio/Rest/Conversations/V1/ServiceResource.cs index c9a4c1a6c..64ab79fa1 100644 --- a/src/Twilio/Rest/Conversations/V1/ServiceResource.cs +++ b/src/Twilio/Rest/Conversations/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 @@ -96,7 +96,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateServiceOptions(friendlyName){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -137,11 +137,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 @@ -161,10 +162,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this resource. /// 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 @@ -201,10 +202,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 @@ -225,10 +226,10 @@ public static ServiceResource Fetch( /// A 34 character string that uniquely identifies this resource. /// 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 @@ -263,10 +264,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); @@ -298,7 +299,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 diff --git a/src/Twilio/Rest/Conversations/V1/User/UserConversationResource.cs b/src/Twilio/Rest/Conversations/V1/User/UserConversationResource.cs index 882d7f083..fb45fe39f 100644 --- a/src/Twilio/Rest/Conversations/V1/User/UserConversationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/User/UserConversationResource.cs @@ -100,11 +100,12 @@ public static bool Delete(DeleteUserConversationOptions options, ITwilioRestClie /// Delete UserConversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation - public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserConversationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserConversationOptions 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 @@ -129,7 +130,7 @@ public static bool Delete(string pathUserSid, string pathConversationSid, ITwili public static async System.Threading.Tasks.Task DeleteAsync(string pathUserSid, string pathConversationSid, ITwilioRestClient client = null) { var options = new DeleteUserConversationOptions(pathUserSid, pathConversationSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -168,10 +169,10 @@ public static UserConversationResource Fetch(FetchUserConversationOptions option /// Fetch UserConversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation - public static async System.Threading.Tasks.Task FetchAsync(FetchUserConversationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserConversationOptions 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 @@ -198,7 +199,7 @@ public static UserConversationResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathUserSid, string pathConversationSid, ITwilioRestClient client = null) { var options = new FetchUserConversationOptions(pathUserSid, pathConversationSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -235,10 +236,10 @@ public static ResourceSet Read(ReadUserConversationOpt /// Read UserConversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation - public static async System.Threading.Tasks.Task> ReadAsync(ReadUserConversationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserConversationOptions 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("conversations", response.Content); return new ResourceSet(page, options, client); @@ -274,7 +275,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserConversationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserConversationOptions 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 @@ -410,7 +412,7 @@ public static async System.Threading.Tasks.Task Update ITwilioRestClient client = null) { var options = new UpdateUserConversationOptions(pathUserSid, pathConversationSid){ NotificationLevel = notificationLevel, LastReadTimestamp = lastReadTimestamp, LastReadMessageIndex = lastReadMessageIndex }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Conversations/V1/UserResource.cs b/src/Twilio/Rest/Conversations/V1/UserResource.cs index 2b14d0b5f..c7c20eee2 100644 --- a/src/Twilio/Rest/Conversations/V1/UserResource.cs +++ b/src/Twilio/Rest/Conversations/V1/UserResource.cs @@ -78,10 +78,10 @@ public static UserResource Create(CreateUserOptions options, ITwilioRestClient c /// 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 @@ -124,7 +124,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateUserOptions(identity){ FriendlyName = friendlyName, Attributes = attributes, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -165,11 +165,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 @@ -194,7 +195,7 @@ public static bool Delete(string pathSid, UserResource.WebhookEnabledTypeEnum xT public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new DeleteUserOptions(pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -231,10 +232,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 @@ -255,10 +256,10 @@ public static UserResource Fetch( /// The SID of the User resource to fetch. This value can be either the `sid` or the `identity` of the User resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of User - 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 FetchUserOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -293,10 +294,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("users", response.Content); return new ResourceSet(page, options, client); @@ -328,7 +329,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadUserOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -415,11 +416,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 @@ -462,7 +464,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateUserOptions(pathSid){ FriendlyName = friendlyName, Attributes = attributes, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Events/V1/EventTypeResource.cs b/src/Twilio/Rest/Events/V1/EventTypeResource.cs index ba333dfbd..f125530b9 100644 --- a/src/Twilio/Rest/Events/V1/EventTypeResource.cs +++ b/src/Twilio/Rest/Events/V1/EventTypeResource.cs @@ -67,10 +67,10 @@ public static EventTypeResource Fetch(FetchEventTypeOptions options, ITwilioRest /// Fetch EventType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EventType - public static async System.Threading.Tasks.Task FetchAsync(FetchEventTypeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchEventTypeOptions 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 EventTypeResource Fetch( /// A string that uniquely identifies this Event Type. /// Client to make requests to Twilio /// Task that resolves to A single instance of EventType - public static async System.Threading.Tasks.Task FetchAsync(string pathType, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathType, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchEventTypeOptions(pathType){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadEventTypeOptions options, /// Read EventType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EventType - public static async System.Threading.Tasks.Task> ReadAsync(ReadEventTypeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEventTypeOptions 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("types", response.Content); return new ResourceSet(page, options, client); @@ -168,7 +168,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadEventTypeOptions(){ SchemaId = schemaId, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Events/V1/Schema/SchemaVersionResource.cs b/src/Twilio/Rest/Events/V1/Schema/SchemaVersionResource.cs index 9e7a2119a..7e561bd0d 100644 --- a/src/Twilio/Rest/Events/V1/Schema/SchemaVersionResource.cs +++ b/src/Twilio/Rest/Events/V1/Schema/SchemaVersionResource.cs @@ -69,10 +69,10 @@ public static SchemaVersionResource Fetch(FetchSchemaVersionOptions options, ITw /// Fetch SchemaVersion parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SchemaVersion - public static async System.Threading.Tasks.Task FetchAsync(FetchSchemaVersionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSchemaVersionOptions 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 SchemaVersionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathId, int? pathSchemaVersion, ITwilioRestClient client = null) { var options = new FetchSchemaVersionOptions(pathId, pathSchemaVersion){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -136,10 +136,10 @@ public static ResourceSet Read(ReadSchemaVersionOptions o /// Read SchemaVersion parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SchemaVersion - public static async System.Threading.Tasks.Task> ReadAsync(ReadSchemaVersionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSchemaVersionOptions 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("schema_versions", response.Content); return new ResourceSet(page, options, client); @@ -175,7 +175,7 @@ public static async System.Threading.Tasks.Task Fetch Schema parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Schema - public static async System.Threading.Tasks.Task FetchAsync(FetchSchemaOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSchemaOptions 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 SchemaResource Fetch( /// The unique identifier of the schema. Each schema can have multiple versions, that share the same id. /// Client to make requests to Twilio /// Task that resolves to A single instance of Schema - public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchSchemaOptions(pathId){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Events/V1/Sink/SinkTestResource.cs b/src/Twilio/Rest/Events/V1/Sink/SinkTestResource.cs index 7b3700f6c..50879169b 100644 --- a/src/Twilio/Rest/Events/V1/Sink/SinkTestResource.cs +++ b/src/Twilio/Rest/Events/V1/Sink/SinkTestResource.cs @@ -68,10 +68,10 @@ public static SinkTestResource Create(CreateSinkTestOptions options, ITwilioRest /// Create SinkTest parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SinkTest - public static async System.Threading.Tasks.Task CreateAsync(CreateSinkTestOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSinkTestOptions 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 @@ -98,7 +98,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateSinkTestOptions(pathSid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Events/V1/Sink/SinkValidateResource.cs b/src/Twilio/Rest/Events/V1/Sink/SinkValidateResource.cs index 5106154fe..37edb6fea 100644 --- a/src/Twilio/Rest/Events/V1/Sink/SinkValidateResource.cs +++ b/src/Twilio/Rest/Events/V1/Sink/SinkValidateResource.cs @@ -68,10 +68,10 @@ public static SinkValidateResource Create(CreateSinkValidateOptions options, ITw /// Create SinkValidate parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SinkValidate - public static async System.Threading.Tasks.Task CreateAsync(CreateSinkValidateOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSinkValidateOptions 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 CreateAsyn ITwilioRestClient client = null) { var options = new CreateSinkValidateOptions(pathSid, testId){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Events/V1/SinkResource.cs b/src/Twilio/Rest/Events/V1/SinkResource.cs index 889333b1a..b5431f351 100644 --- a/src/Twilio/Rest/Events/V1/SinkResource.cs +++ b/src/Twilio/Rest/Events/V1/SinkResource.cs @@ -95,10 +95,10 @@ public static SinkResource Create(CreateSinkOptions options, ITwilioRestClient c /// Create Sink parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sink - public static async System.Threading.Tasks.Task CreateAsync(CreateSinkOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSinkOptions 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 @@ -133,7 +133,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateSinkOptions(description, sinkConfiguration, sinkType){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -174,11 +174,12 @@ public static bool Delete(DeleteSinkOptions options, ITwilioRestClient client = /// Delete Sink parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sink - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSinkOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSinkOptions 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 @@ -198,10 +199,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this Sink. /// Client to make requests to Twilio /// Task that resolves to A single instance of Sink - 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 DeleteSinkOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -238,10 +239,10 @@ public static SinkResource Fetch(FetchSinkOptions options, ITwilioRestClient cli /// Fetch Sink parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sink - public static async System.Threading.Tasks.Task FetchAsync(FetchSinkOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSinkOptions 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,10 +263,10 @@ public static SinkResource Fetch( /// A 34 character string that uniquely identifies this Sink. /// Client to make requests to Twilio /// Task that resolves to A single instance of Sink - 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 FetchSinkOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -300,10 +301,10 @@ public static ResourceSet Read(ReadSinkOptions options, ITwilioRes /// Read Sink parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sink - public static async System.Threading.Tasks.Task> ReadAsync(ReadSinkOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSinkOptions 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("sinks", response.Content); return new ResourceSet(page, options, client); @@ -343,7 +344,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadSinkOptions(){ InUse = inUse, Status = status, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -430,11 +431,12 @@ public static SinkResource Update(UpdateSinkOptions options, ITwilioRestClient c /// Client to make requests to Twilio /// Task that resolves to A single instance of Sink #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSinkOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSinkOptions 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 @@ -465,7 +467,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateSinkOptions(pathSid, description){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventResource.cs b/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventResource.cs index ec6a1fa47..7925d2e6d 100644 --- a/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventResource.cs +++ b/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventResource.cs @@ -68,10 +68,10 @@ public static SubscribedEventResource Create(CreateSubscribedEventOptions option /// Create SubscribedEvent parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedEvent - public static async System.Threading.Tasks.Task CreateAsync(CreateSubscribedEventOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSubscribedEventOptions 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 CreateA ITwilioRestClient client = null) { var options = new CreateSubscribedEventOptions(pathSubscriptionSid, type){ SchemaVersion = schemaVersion }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -149,11 +149,12 @@ public static bool Delete(DeleteSubscribedEventOptions options, ITwilioRestClien /// Delete SubscribedEvent parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedEvent - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSubscribedEventOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSubscribedEventOptions 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 pathSubscriptionSid, string pathType, ITwilioRe public static async System.Threading.Tasks.Task DeleteAsync(string pathSubscriptionSid, string pathType, ITwilioRestClient client = null) { var options = new DeleteSubscribedEventOptions(pathSubscriptionSid, pathType) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -217,10 +218,10 @@ public static SubscribedEventResource Fetch(FetchSubscribedEventOptions options, /// Fetch SubscribedEvent parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedEvent - public static async System.Threading.Tasks.Task FetchAsync(FetchSubscribedEventOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSubscribedEventOptions 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 SubscribedEventResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSubscriptionSid, string pathType, ITwilioRestClient client = null) { var options = new FetchSubscribedEventOptions(pathSubscriptionSid, pathType){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +285,10 @@ public static ResourceSet Read(ReadSubscribedEventOptio /// Read SubscribedEvent parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedEvent - public static async System.Threading.Tasks.Task> ReadAsync(ReadSubscribedEventOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSubscribedEventOptions 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("types", response.Content); return new ResourceSet(page, options, client); @@ -323,7 +324,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedEvent #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSubscribedEventOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSubscribedEventOptions 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 @@ -451,7 +453,7 @@ public static async System.Threading.Tasks.Task UpdateA ITwilioRestClient client = null) { var options = new UpdateSubscribedEventOptions(pathSubscriptionSid, pathType){ SchemaVersion = schemaVersion }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Events/V1/SubscriptionResource.cs b/src/Twilio/Rest/Events/V1/SubscriptionResource.cs index d9dea740c..433328705 100644 --- a/src/Twilio/Rest/Events/V1/SubscriptionResource.cs +++ b/src/Twilio/Rest/Events/V1/SubscriptionResource.cs @@ -66,10 +66,10 @@ public static SubscriptionResource Create(CreateSubscriptionOptions options, ITw /// Create Subscription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Subscription - public static async System.Threading.Tasks.Task CreateAsync(CreateSubscriptionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSubscriptionOptions 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 @@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task CreateAsyn ITwilioRestClient client = null) { var options = new CreateSubscriptionOptions(description, sinkSid, types){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteSubscriptionOptions options, ITwilioRestClient c /// Delete Subscription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Subscription - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSubscriptionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSubscriptionOptions 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 @@ -169,10 +170,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this Subscription. /// Client to make requests to Twilio /// Task that resolves to A single instance of Subscription - 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 DeleteSubscriptionOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -209,10 +210,10 @@ public static SubscriptionResource Fetch(FetchSubscriptionOptions options, ITwil /// Fetch Subscription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Subscription - public static async System.Threading.Tasks.Task FetchAsync(FetchSubscriptionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSubscriptionOptions 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 @@ -233,10 +234,10 @@ public static SubscriptionResource Fetch( /// A 34 character string that uniquely identifies this Subscription. /// Client to make requests to Twilio /// Task that resolves to A single instance of Subscription - 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 FetchSubscriptionOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -271,10 +272,10 @@ public static ResourceSet Read(ReadSubscriptionOptions opt /// Read Subscription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Subscription - public static async System.Threading.Tasks.Task> ReadAsync(ReadSubscriptionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSubscriptionOptions 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("subscriptions", response.Content); return new ResourceSet(page, options, client); @@ -310,7 +311,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of Subscription #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSubscriptionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSubscriptionOptions 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 @@ -436,7 +438,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn ITwilioRestClient client = null) { var options = new UpdateSubscriptionOptions(pathSid){ Description = description, SinkSid = sinkSid }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/AssessmentsResource.cs b/src/Twilio/Rest/FlexApi/V1/AssessmentsResource.cs index ab0ffcdb4..1201d7e53 100644 --- a/src/Twilio/Rest/FlexApi/V1/AssessmentsResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/AssessmentsResource.cs @@ -66,10 +66,10 @@ public static AssessmentsResource Create(CreateAssessmentsOptions options, ITwil /// Create Assessments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Assessments - public static async System.Threading.Tasks.Task CreateAsync(CreateAssessmentsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAssessmentsOptions 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 @@ -136,7 +136,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreateAssessmentsOptions(categorySid, categoryName, segmentId, agentId, offset, metricId, metricName, answerText, answerId, questionnaireSid){ Authorization = authorization }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -171,10 +171,10 @@ public static ResourceSet Read(ReadAssessmentsOptions optio /// Read Assessments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Assessments - public static async System.Threading.Tasks.Task> ReadAsync(ReadAssessmentsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAssessmentsOptions 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("assessments", response.Content); return new ResourceSet(page, options, client); @@ -214,7 +214,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadAssessmentsOptions(){ Authorization = authorization, SegmentId = segmentId, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -301,11 +301,12 @@ public static AssessmentsResource Update(UpdateAssessmentsOptions options, ITwil /// Client to make requests to Twilio /// Task that resolves to A single instance of Assessments #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAssessmentsOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateAssessmentsOptions 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 @@ -348,7 +349,7 @@ public static async System.Threading.Tasks.Task UpdateAsync ITwilioRestClient client = null) { var options = new UpdateAssessmentsOptions(pathAssessmentSid, offset, answerText, answerId){ Authorization = authorization }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/ChannelResource.cs b/src/Twilio/Rest/FlexApi/V1/ChannelResource.cs index 96b4eaf7a..ba05f8fe8 100644 --- a/src/Twilio/Rest/FlexApi/V1/ChannelResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/ChannelResource.cs @@ -66,10 +66,10 @@ public static ChannelResource Create(CreateChannelOptions options, ITwilioRestCl /// Create Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions 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 @@ -132,7 +132,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateChannelOptions(flexFlowSid, identity, chatUserFriendlyName, chatFriendlyName){ Target = target, ChatUniqueName = chatUniqueName, PreEngagementData = preEngagementData, TaskSid = taskSid, TaskAttributes = taskAttributes, LongLived = longLived }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -173,11 +173,12 @@ public static bool Delete(DeleteChannelOptions options, ITwilioRestClient client /// Delete Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions 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 @@ -197,10 +198,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Flex chat channel resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - 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 DeleteChannelOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -237,10 +238,10 @@ public static ChannelResource Fetch(FetchChannelOptions options, ITwilioRestClie /// Fetch Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions 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 @@ -261,10 +262,10 @@ public static ChannelResource Fetch( /// The SID of the Flex chat channel resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - 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 FetchChannelOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -299,10 +300,10 @@ public static ResourceSet Read(ReadChannelOptions options, ITwi /// Read Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions 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("flex_chat_channels", response.Content); return new ResourceSet(page, options, client); @@ -334,7 +335,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadChannelOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs b/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs index 40081b59f..995550220 100644 --- a/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs @@ -79,10 +79,10 @@ public static ConfigurationResource Fetch(FetchConfigurationOptions options, ITw /// Fetch Configuration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration - public static async System.Threading.Tasks.Task FetchAsync(FetchConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchConfigurationOptions 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 @@ -106,7 +106,7 @@ public static ConfigurationResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string uiVersion = null, ITwilioRestClient client = null) { var options = new FetchConfigurationOptions(){ UiVersion = uiVersion }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -143,11 +143,12 @@ public static ConfigurationResource Update(UpdateConfigurationOptions options, I /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateConfigurationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateConfigurationOptions 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 @@ -167,10 +168,11 @@ public static ConfigurationResource Update( /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration public static async System.Threading.Tasks.Task UpdateAsync( - ITwilioRestClient client = null) + ITwilioRestClient client = null, + CancellationToken cancellationToken = default) { var options = new UpdateConfigurationOptions(){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/FlexFlowResource.cs b/src/Twilio/Rest/FlexApi/V1/FlexFlowResource.cs index c947203ff..43622eadf 100644 --- a/src/Twilio/Rest/FlexApi/V1/FlexFlowResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/FlexFlowResource.cs @@ -97,10 +97,10 @@ public static FlexFlowResource Create(CreateFlexFlowOptions options, ITwilioRest /// Create FlexFlow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexFlow - public static async System.Threading.Tasks.Task CreateAsync(CreateFlexFlowOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateFlexFlowOptions 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 @@ -191,7 +191,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateFlexFlowOptions(friendlyName, chatServiceSid, channelType){ ContactIdentity = contactIdentity, Enabled = enabled, IntegrationType = integrationType, IntegrationFlowSid = integrationFlowSid, IntegrationUrl = integrationUrl, IntegrationWorkspaceSid = integrationWorkspaceSid, IntegrationWorkflowSid = integrationWorkflowSid, IntegrationChannel = integrationChannel, IntegrationTimeout = integrationTimeout, IntegrationPriority = integrationPriority, IntegrationCreationOnMessage = integrationCreationOnMessage, LongLived = longLived, JanitorEnabled = janitorEnabled, IntegrationRetryCount = integrationRetryCount }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -232,11 +232,12 @@ public static bool Delete(DeleteFlexFlowOptions options, ITwilioRestClient clien /// Delete FlexFlow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexFlow - public static async System.Threading.Tasks.Task DeleteAsync(DeleteFlexFlowOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteFlexFlowOptions 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 @@ -256,10 +257,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Flex Flow resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexFlow - 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 DeleteFlexFlowOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -296,10 +297,10 @@ public static FlexFlowResource Fetch(FetchFlexFlowOptions options, ITwilioRestCl /// Fetch FlexFlow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexFlow - public static async System.Threading.Tasks.Task FetchAsync(FetchFlexFlowOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchFlexFlowOptions 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 @@ -320,10 +321,10 @@ public static FlexFlowResource Fetch( /// The SID of the Flex Flow resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexFlow - 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 FetchFlexFlowOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -358,10 +359,10 @@ public static ResourceSet Read(ReadFlexFlowOptions options, IT /// Read FlexFlow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexFlow - public static async System.Threading.Tasks.Task> ReadAsync(ReadFlexFlowOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFlexFlowOptions 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("flex_flows", response.Content); return new ResourceSet(page, options, client); @@ -397,7 +398,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadFlexFlowOptions(){ FriendlyName = friendlyName, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -484,11 +485,12 @@ public static FlexFlowResource Update(UpdateFlexFlowOptions options, ITwilioRest /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexFlow #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlexFlowOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlexFlowOptions 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 @@ -583,7 +585,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateFlexFlowOptions(pathSid){ FriendlyName = friendlyName, ChatServiceSid = chatServiceSid, ChannelType = channelType, ContactIdentity = contactIdentity, Enabled = enabled, IntegrationType = integrationType, IntegrationFlowSid = integrationFlowSid, IntegrationUrl = integrationUrl, IntegrationWorkspaceSid = integrationWorkspaceSid, IntegrationWorkflowSid = integrationWorkflowSid, IntegrationChannel = integrationChannel, IntegrationTimeout = integrationTimeout, IntegrationPriority = integrationPriority, IntegrationCreationOnMessage = integrationCreationOnMessage, LongLived = longLived, JanitorEnabled = janitorEnabled, IntegrationRetryCount = integrationRetryCount }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentResource.cs b/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentResource.cs index b6e31afbb..70e3bc890 100644 --- a/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentResource.cs @@ -66,10 +66,10 @@ public static InsightsAssessmentsCommentResource Create(CreateInsightsAssessment /// Create InsightsAssessmentsComment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsAssessmentsComment - public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsAssessmentsCommentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsAssessmentsCommentOptions 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 @@ -120,7 +120,7 @@ public static async System.Threading.Tasks.Task Read(ReadInsightsA /// Read InsightsAssessmentsComment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsAssessmentsComment - public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsAssessmentsCommentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsAssessmentsCommentOptions 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("comments", response.Content); return new ResourceSet(page, options, client); @@ -202,7 +202,7 @@ public static async System.Threading.Tasks.Task Read(ReadInsightsConver /// Read InsightsConversations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsConversations - public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsConversationsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsConversationsOptions 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("conversations", response.Content); return new ResourceSet(page, options, client); @@ -108,7 +108,7 @@ public static async System.Threading.Tasks.Task Create InsightsQuestionnairesCategory parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnairesCategory - public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsQuestionnairesCategoryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsQuestionnairesCategoryOptions 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 @@ -100,7 +100,7 @@ public static async System.Threading.Tasks.Task Delete InsightsQuestionnairesCategory parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnairesCategory - public static async System.Threading.Tasks.Task DeleteAsync(DeleteInsightsQuestionnairesCategoryOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteInsightsQuestionnairesCategoryOptions 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 @@ -170,7 +171,7 @@ public static bool Delete(string pathCategorySid, string authorization = null, I public static async System.Threading.Tasks.Task DeleteAsync(string pathCategorySid, string authorization = null, ITwilioRestClient client = null) { var options = new DeleteInsightsQuestionnairesCategoryOptions(pathCategorySid) { Authorization = authorization }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -205,10 +206,10 @@ public static ResourceSet Read(ReadInsig /// Read InsightsQuestionnairesCategory parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnairesCategory - public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsQuestionnairesCategoryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsQuestionnairesCategoryOptions 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("categories", response.Content); return new ResourceSet(page, options, client); @@ -244,7 +245,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnairesCategory #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateInsightsQuestionnairesCategoryOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateInsightsQuestionnairesCategoryOptions 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 @@ -370,7 +372,7 @@ public static async System.Threading.Tasks.Task Create InsightsQuestionnairesQuestion parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnairesQuestion - public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsQuestionnairesQuestionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsQuestionnairesQuestionOptions 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 @@ -116,7 +116,7 @@ public static async System.Threading.Tasks.Task Delete InsightsQuestionnairesQuestion parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnairesQuestion - public static async System.Threading.Tasks.Task DeleteAsync(DeleteInsightsQuestionnairesQuestionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteInsightsQuestionnairesQuestionOptions 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 @@ -186,7 +187,7 @@ public static bool Delete(string pathQuestionSid, string authorization = null, I public static async System.Threading.Tasks.Task DeleteAsync(string pathQuestionSid, string authorization = null, ITwilioRestClient client = null) { var options = new DeleteInsightsQuestionnairesQuestionOptions(pathQuestionSid) { Authorization = authorization }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -221,10 +222,10 @@ public static ResourceSet Read(ReadInsig /// Read InsightsQuestionnairesQuestion parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnairesQuestion - public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsQuestionnairesQuestionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsQuestionnairesQuestionOptions 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("questions", response.Content); return new ResourceSet(page, options, client); @@ -264,7 +265,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnairesQuestion #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateInsightsQuestionnairesQuestionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateInsightsQuestionnairesQuestionOptions 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 @@ -406,7 +408,7 @@ public static async System.Threading.Tasks.Task Create InsightsQuestionnaires parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnaires - public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsQuestionnairesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsQuestionnairesOptions 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 ITwilioRestClient client = null) { var options = new CreateInsightsQuestionnairesOptions(name){ Description = description, Active = active, QuestionSids = questionSids, Authorization = authorization }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -153,11 +153,12 @@ public static bool Delete(DeleteInsightsQuestionnairesOptions options, ITwilioRe /// Delete InsightsQuestionnaires parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnaires - public static async System.Threading.Tasks.Task DeleteAsync(DeleteInsightsQuestionnairesOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteInsightsQuestionnairesOptions 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 @@ -182,7 +183,7 @@ public static bool Delete(string pathQuestionnaireSid, string authorization = nu public static async System.Threading.Tasks.Task DeleteAsync(string pathQuestionnaireSid, string authorization = null, ITwilioRestClient client = null) { var options = new DeleteInsightsQuestionnairesOptions(pathQuestionnaireSid) { Authorization = authorization }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -219,10 +220,10 @@ public static InsightsQuestionnairesResource Fetch(FetchInsightsQuestionnairesOp /// Fetch InsightsQuestionnaires parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnaires - public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsQuestionnairesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsQuestionnairesOptions 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 @@ -249,7 +250,7 @@ public static InsightsQuestionnairesResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathQuestionnaireSid, string authorization = null, ITwilioRestClient client = null) { var options = new FetchInsightsQuestionnairesOptions(pathQuestionnaireSid){ Authorization = authorization }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +285,10 @@ public static ResourceSet Read(ReadInsightsQuest /// Read InsightsQuestionnaires parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnaires - public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsQuestionnairesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsQuestionnairesOptions 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("questionnaires", response.Content); return new ResourceSet(page, options, client); @@ -327,7 +328,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnaires #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateInsightsQuestionnairesOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateInsightsQuestionnairesOptions 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 @@ -465,7 +467,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new UpdateInsightsQuestionnairesOptions(pathQuestionnaireSid, active){ Name = name, Description = description, QuestionSids = questionSids, Authorization = authorization }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsResource.cs b/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsResource.cs index dc22fa09f..d742bead2 100644 --- a/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsResource.cs @@ -65,10 +65,10 @@ public static ResourceSet Read(ReadInsightsSegmentsOpt /// Read InsightsSegments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsSegments - public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsSegmentsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsSegmentsOptions 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("segments", response.Content); return new ResourceSet(page, options, client); @@ -112,7 +112,7 @@ public static async System.Threading.Tasks.Task Create InsightsSession parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsSession - public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsSessionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsSessionOptions 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 @@ -96,7 +96,7 @@ public static async System.Threading.Tasks.Task CreateA ITwilioRestClient client = null) { var options = new CreateInsightsSessionOptions(){ Authorization = authorization }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsResource.cs b/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsResource.cs index fb86fa36f..7de0d7aec 100644 --- a/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsResource.cs @@ -65,10 +65,10 @@ public static InsightsSettingsAnswerSetsResource Fetch(FetchInsightsSettingsAnsw /// Fetch InsightsSettingsAnswerSets parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsSettingsAnswerSets - public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsSettingsAnswerSetsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsSettingsAnswerSetsOptions 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 @@ -92,7 +92,7 @@ public static InsightsSettingsAnswerSetsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string authorization = null, ITwilioRestClient client = null) { var options = new FetchInsightsSettingsAnswerSetsOptions(){ Authorization = authorization }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentResource.cs b/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentResource.cs index ad9c72499..d68e43ff1 100644 --- a/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentResource.cs @@ -65,10 +65,10 @@ public static InsightsSettingsCommentResource Fetch(FetchInsightsSettingsComment /// Fetch InsightsSettingsComment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsSettingsComment - public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsSettingsCommentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsSettingsCommentOptions 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 @@ -92,7 +92,7 @@ public static InsightsSettingsCommentResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string authorization = null, ITwilioRestClient client = null) { var options = new FetchInsightsSettingsCommentOptions(){ Authorization = authorization }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesResource.cs b/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesResource.cs index c076acef6..c7d1967a1 100644 --- a/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesResource.cs @@ -65,10 +65,10 @@ public static InsightsUserRolesResource Fetch(FetchInsightsUserRolesOptions opti /// Fetch InsightsUserRoles parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsUserRoles - public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsUserRolesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsUserRolesOptions 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 @@ -92,7 +92,7 @@ public static InsightsUserRolesResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string authorization = null, ITwilioRestClient client = null) { var options = new FetchInsightsUserRolesOptions(){ Authorization = authorization }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteResource.cs b/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteResource.cs index f3d2309a0..400988e8a 100644 --- a/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteResource.cs @@ -70,10 +70,10 @@ public static InteractionChannelInviteResource Create(CreateInteractionChannelIn /// Create InteractionChannelInvite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannelInvite - public static async System.Threading.Tasks.Task CreateAsync(CreateInteractionChannelInviteOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInteractionChannelInviteOptions 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 Read(ReadInteraction /// Read InteractionChannelInvite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannelInvite - public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionChannelInviteOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionChannelInviteOptions 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("invites", response.Content); return new ResourceSet(page, options, client); @@ -190,7 +190,7 @@ public static async System.Threading.Tasks.Task Create InteractionChannelParticipant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannelParticipant - public static async System.Threading.Tasks.Task CreateAsync(CreateInteractionChannelParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInteractionChannelParticipantOptions 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 @@ -144,7 +144,7 @@ public static async System.Threading.Tasks.Task Read(ReadIntera /// Read InteractionChannelParticipant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannelParticipant - public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionChannelParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionChannelParticipantOptions 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("participants", response.Content); return new ResourceSet(page, options, client); @@ -226,7 +226,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannelParticipant #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateInteractionChannelParticipantOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateInteractionChannelParticipantOptions 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 @@ -360,7 +361,7 @@ public static async System.Threading.Tasks.Task Fetch InteractionChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannel - public static async System.Threading.Tasks.Task FetchAsync(FetchInteractionChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInteractionChannelOptions 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 @@ -146,7 +146,7 @@ public static InteractionChannelResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathInteractionSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchInteractionChannelOptions(pathInteractionSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -183,10 +183,10 @@ public static ResourceSet Read(ReadInteractionChanne /// Read InteractionChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionChannelOptions 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("channels", response.Content); return new ResourceSet(page, options, client); @@ -222,7 +222,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannel #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateInteractionChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateInteractionChannelOptions 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 @@ -354,7 +355,7 @@ public static async System.Threading.Tasks.Task Upda ITwilioRestClient client = null) { var options = new UpdateInteractionChannelOptions(pathInteractionSid, pathSid, status){ Routing = routing }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/InteractionResource.cs b/src/Twilio/Rest/FlexApi/V1/InteractionResource.cs index 20f350a9a..9a22071d6 100644 --- a/src/Twilio/Rest/FlexApi/V1/InteractionResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/InteractionResource.cs @@ -66,10 +66,10 @@ public static InteractionResource Create(CreateInteractionOptions options, ITwil /// Create Interaction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Interaction - public static async System.Threading.Tasks.Task CreateAsync(CreateInteractionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInteractionOptions 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 @@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreateInteractionOptions(channel){ Routing = routing, InteractionContextSid = interactionContextSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -141,10 +141,10 @@ public static InteractionResource Fetch(FetchInteractionOptions options, ITwilio /// Fetch Interaction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Interaction - public static async System.Threading.Tasks.Task FetchAsync(FetchInteractionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInteractionOptions 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 @@ -165,10 +165,10 @@ public static InteractionResource Fetch( /// The SID of the Interaction resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Interaction - 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 FetchInteractionOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsResource.cs b/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsResource.cs index d48dc144e..10584c773 100644 --- a/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsResource.cs @@ -68,10 +68,10 @@ public static PluginVersionsResource Create(CreatePluginVersionsOptions options, /// Create PluginVersions parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginVersions - public static async System.Threading.Tasks.Task CreateAsync(CreatePluginVersionsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreatePluginVersionsOptions 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 @@ -126,7 +126,7 @@ public static async System.Threading.Tasks.Task CreateAs ITwilioRestClient client = null) { var options = new CreatePluginVersionsOptions(pathPluginSid, version, pluginUrl){ Changelog = changelog, Private = _private, CliVersion = cliVersion, ValidateStatus = validateStatus, FlexMetadata = flexMetadata }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -165,10 +165,10 @@ public static PluginVersionsResource Fetch(FetchPluginVersionsOptions options, I /// Fetch PluginVersions parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginVersions - public static async System.Threading.Tasks.Task FetchAsync(FetchPluginVersionsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchPluginVersionsOptions 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 @@ -198,7 +198,7 @@ public static PluginVersionsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathPluginSid, string pathSid, string flexMetadata = null, ITwilioRestClient client = null) { var options = new FetchPluginVersionsOptions(pathPluginSid, pathSid){ FlexMetadata = flexMetadata }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -235,10 +235,10 @@ public static ResourceSet Read(ReadPluginVersionsOptions /// Read PluginVersions parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginVersions - public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginVersionsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginVersionsOptions 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("plugin_versions", response.Content); return new ResourceSet(page, options, client); @@ -278,7 +278,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of PluginArchive #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdatePluginArchiveOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdatePluginArchiveOptions 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 @@ -103,7 +104,7 @@ public static async System.Threading.Tasks.Task UpdateAsy ITwilioRestClient client = null) { var options = new UpdatePluginArchiveOptions(pathSid){ FlexMetadata = flexMetadata }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginResource.cs b/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginResource.cs index ffa72ecb4..d9bb8ddbc 100644 --- a/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginResource.cs @@ -69,10 +69,10 @@ public static ConfiguredPluginResource Fetch(FetchConfiguredPluginOptions option /// Fetch ConfiguredPlugin parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConfiguredPlugin - public static async System.Threading.Tasks.Task FetchAsync(FetchConfiguredPluginOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchConfiguredPluginOptions 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 @@ -102,7 +102,7 @@ public static ConfiguredPluginResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathConfigurationSid, string pathPluginSid, string flexMetadata = null, ITwilioRestClient client = null) { var options = new FetchConfiguredPluginOptions(pathConfigurationSid, pathPluginSid){ FlexMetadata = flexMetadata }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -139,10 +139,10 @@ public static ResourceSet Read(ReadConfiguredPluginOpt /// Read ConfiguredPlugin parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConfiguredPlugin - public static async System.Threading.Tasks.Task> ReadAsync(ReadConfiguredPluginOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConfiguredPluginOptions 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("plugins", response.Content); return new ResourceSet(page, options, client); @@ -182,7 +182,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of PluginConfigurationArchive #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdatePluginConfigurationArchiveOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdatePluginConfigurationArchiveOptions 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 @@ -103,7 +104,7 @@ public static async System.Threading.Tasks.Task Create PluginConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginConfiguration - public static async System.Threading.Tasks.Task CreateAsync(CreatePluginConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreatePluginConfigurationOptions 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 Cre ITwilioRestClient client = null) { var options = new CreatePluginConfigurationOptions(name){ Plugins = plugins, Description = description, FlexMetadata = flexMetadata }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,10 +145,10 @@ public static PluginConfigurationResource Fetch(FetchPluginConfigurationOptions /// Fetch PluginConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginConfiguration - public static async System.Threading.Tasks.Task FetchAsync(FetchPluginConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchPluginConfigurationOptions 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 @@ -175,7 +175,7 @@ public static PluginConfigurationResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string flexMetadata = null, ITwilioRestClient client = null) { var options = new FetchPluginConfigurationOptions(pathSid){ FlexMetadata = flexMetadata }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -210,10 +210,10 @@ public static ResourceSet Read(ReadPluginConfigurat /// Read PluginConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginConfiguration - public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginConfigurationOptions 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("configurations", response.Content); return new ResourceSet(page, options, client); @@ -249,7 +249,7 @@ public static async System.Threading.Tasks.Task Create PluginRelease parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginRelease - public static async System.Threading.Tasks.Task CreateAsync(CreatePluginReleaseOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreatePluginReleaseOptions 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 @@ -100,7 +100,7 @@ public static async System.Threading.Tasks.Task CreateAsy ITwilioRestClient client = null) { var options = new CreatePluginReleaseOptions(configurationId){ FlexMetadata = flexMetadata }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -137,10 +137,10 @@ public static PluginReleaseResource Fetch(FetchPluginReleaseOptions options, ITw /// Fetch PluginRelease parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginRelease - public static async System.Threading.Tasks.Task FetchAsync(FetchPluginReleaseOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchPluginReleaseOptions 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 @@ -167,7 +167,7 @@ public static PluginReleaseResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string flexMetadata = null, ITwilioRestClient client = null) { var options = new FetchPluginReleaseOptions(pathSid){ FlexMetadata = flexMetadata }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -202,10 +202,10 @@ public static ResourceSet Read(ReadPluginReleaseOptions o /// Read PluginRelease parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginRelease - public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginReleaseOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginReleaseOptions 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("releases", response.Content); return new ResourceSet(page, options, client); @@ -241,7 +241,7 @@ public static async System.Threading.Tasks.Task Create Plugin parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Plugin - public static async System.Threading.Tasks.Task CreateAsync(CreatePluginOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreatePluginOptions 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 CreatePluginOptions(uniqueName){ FriendlyName = friendlyName, Description = description, FlexMetadata = flexMetadata }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,10 +145,10 @@ public static PluginResource Fetch(FetchPluginOptions options, ITwilioRestClient /// Fetch Plugin parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Plugin - public static async System.Threading.Tasks.Task FetchAsync(FetchPluginOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchPluginOptions 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 @@ -175,7 +175,7 @@ public static PluginResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string flexMetadata = null, ITwilioRestClient client = null) { var options = new FetchPluginOptions(pathSid){ FlexMetadata = flexMetadata }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -210,10 +210,10 @@ public static ResourceSet Read(ReadPluginOptions options, ITwili /// Read Plugin parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Plugin - public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginOptions 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("plugins", response.Content); return new ResourceSet(page, options, client); @@ -249,7 +249,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadPluginOptions(){ FlexMetadata = flexMetadata, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -336,11 +336,12 @@ public static PluginResource Update(UpdatePluginOptions options, ITwilioRestClie /// Client to make requests to Twilio /// Task that resolves to A single instance of Plugin #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdatePluginOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdatePluginOptions 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 @@ -379,7 +380,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdatePluginOptions(pathSid){ FriendlyName = friendlyName, Description = description, FlexMetadata = flexMetadata }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveResource.cs b/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveResource.cs index d1d735fc6..f1a25ca8a 100644 --- a/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveResource.cs @@ -70,11 +70,12 @@ public static PluginVersionArchiveResource Update(UpdatePluginVersionArchiveOpti /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginVersionArchive #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdatePluginVersionArchiveOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdatePluginVersionArchiveOptions 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 @@ -109,7 +110,7 @@ public static async System.Threading.Tasks.Task Up ITwilioRestClient client = null) { var options = new UpdatePluginVersionArchiveOptions(pathPluginSid, pathSid){ FlexMetadata = flexMetadata }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusResource.cs b/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusResource.cs index cb5e2893b..fc8dd394b 100644 --- a/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusResource.cs @@ -80,10 +80,10 @@ public static ProvisioningStatusResource Fetch(FetchProvisioningStatusOptions op /// Fetch ProvisioningStatus parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ProvisioningStatus - public static async System.Threading.Tasks.Task FetchAsync(FetchProvisioningStatusOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchProvisioningStatusOptions 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 @@ -101,10 +101,10 @@ public static ProvisioningStatusResource Fetch( /// fetch /// Client to make requests to Twilio /// Task that resolves to A single instance of ProvisioningStatus - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchProvisioningStatusOptions(){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V1/WebChannelResource.cs b/src/Twilio/Rest/FlexApi/V1/WebChannelResource.cs index 707de5e61..04ff47499 100644 --- a/src/Twilio/Rest/FlexApi/V1/WebChannelResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/WebChannelResource.cs @@ -77,10 +77,10 @@ public static WebChannelResource Create(CreateWebChannelOptions options, ITwilio /// Create WebChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WebChannel - public static async System.Threading.Tasks.Task CreateAsync(CreateWebChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateWebChannelOptions 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 @@ -127,7 +127,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateWebChannelOptions(flexFlowSid, identity, customerFriendlyName, chatFriendlyName){ ChatUniqueName = chatUniqueName, PreEngagementData = preEngagementData }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -168,11 +168,12 @@ public static bool Delete(DeleteWebChannelOptions options, ITwilioRestClient cli /// Delete WebChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WebChannel - public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebChannelOptions 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 @@ -192,10 +193,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the WebChannel resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of WebChannel - 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 DeleteWebChannelOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -232,10 +233,10 @@ public static WebChannelResource Fetch(FetchWebChannelOptions options, ITwilioRe /// Fetch WebChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WebChannel - public static async System.Threading.Tasks.Task FetchAsync(FetchWebChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebChannelOptions 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 @@ -256,10 +257,10 @@ public static WebChannelResource Fetch( /// The SID of the WebChannel resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of WebChannel - 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 FetchWebChannelOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -294,10 +295,10 @@ public static ResourceSet Read(ReadWebChannelOptions options /// Read WebChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WebChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadWebChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWebChannelOptions 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("flex_chat_channels", response.Content); return new ResourceSet(page, options, client); @@ -329,7 +330,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadWebChannelOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -416,11 +417,12 @@ public static WebChannelResource Update(UpdateWebChannelOptions options, ITwilio /// Client to make requests to Twilio /// Task that resolves to A single instance of WebChannel #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebChannelOptions 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 @@ -455,7 +457,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateWebChannelOptions(pathSid){ ChatStatus = chatStatus, PostEngagementData = postEngagementData }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V2/FlexUserResource.cs b/src/Twilio/Rest/FlexApi/V2/FlexUserResource.cs index 3365ed5ba..ea3f74ffd 100644 --- a/src/Twilio/Rest/FlexApi/V2/FlexUserResource.cs +++ b/src/Twilio/Rest/FlexApi/V2/FlexUserResource.cs @@ -69,10 +69,10 @@ public static FlexUserResource Fetch(FetchFlexUserOptions options, ITwilioRestCl /// Fetch FlexUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexUser - public static async System.Threading.Tasks.Task FetchAsync(FetchFlexUserOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchFlexUserOptions 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 FlexUserResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathInstanceSid, string pathFlexUserSid, ITwilioRestClient client = null) { var options = new FetchFlexUserOptions(pathInstanceSid, pathFlexUserSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -139,11 +139,12 @@ public static FlexUserResource Update(UpdateFlexUserOptions options, ITwilioRest /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexUser #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlexUserOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlexUserOptions 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 @@ -198,7 +199,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateFlexUserOptions(pathInstanceSid, pathFlexUserSid){ FirstName = firstName, LastName = lastName, Email = email, FriendlyName = friendlyName, UserSid = userSid, Locale = locale }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FlexApi/V2/WebChannelsResource.cs b/src/Twilio/Rest/FlexApi/V2/WebChannelsResource.cs index cb00fd5db..2578c78ed 100644 --- a/src/Twilio/Rest/FlexApi/V2/WebChannelsResource.cs +++ b/src/Twilio/Rest/FlexApi/V2/WebChannelsResource.cs @@ -66,10 +66,10 @@ public static WebChannelsResource Create(CreateWebChannelsOptions options, ITwil /// Create WebChannels parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WebChannels - public static async System.Threading.Tasks.Task CreateAsync(CreateWebChannelsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateWebChannelsOptions 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 CreateWebChannelsOptions(addressSid){ ChatFriendlyName = chatFriendlyName, CustomerFriendlyName = customerFriendlyName, PreEngagementData = preEngagementData, UiVersion = uiVersion }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/FrontlineApi/V1/UserResource.cs b/src/Twilio/Rest/FrontlineApi/V1/UserResource.cs index 1058e3559..5181df693 100644 --- a/src/Twilio/Rest/FrontlineApi/V1/UserResource.cs +++ b/src/Twilio/Rest/FrontlineApi/V1/UserResource.cs @@ -80,10 +80,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 @@ -104,10 +104,10 @@ public static UserResource Fetch( /// The SID of the User resource to fetch. This value can be either the `sid` or the `identity` of the User resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of User - 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 FetchUserOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,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 @@ -192,7 +193,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateUserOptions(pathSid){ FriendlyName = friendlyName, Avatar = avatar, State = state, IsAvailable = isAvailable }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Iam/V1/ApiKeyResource.cs b/src/Twilio/Rest/Iam/V1/ApiKeyResource.cs index 1228a7d42..266ea8f82 100644 --- a/src/Twilio/Rest/Iam/V1/ApiKeyResource.cs +++ b/src/Twilio/Rest/Iam/V1/ApiKeyResource.cs @@ -71,11 +71,12 @@ public static bool Delete(DeleteApiKeyOptions options, ITwilioRestClient client /// Delete ApiKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ApiKey - public static async System.Threading.Tasks.Task DeleteAsync(DeleteApiKeyOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteApiKeyOptions 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 @@ -95,10 +96,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the Key resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of ApiKey - 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 DeleteApiKeyOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -135,10 +136,10 @@ public static ApiKeyResource Fetch(FetchApiKeyOptions options, ITwilioRestClient /// Fetch ApiKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ApiKey - public static async System.Threading.Tasks.Task FetchAsync(FetchApiKeyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchApiKeyOptions 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 @@ -159,10 +160,10 @@ public static ApiKeyResource Fetch( /// The Twilio-provided string that uniquely identifies the Key resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ApiKey - 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 FetchApiKeyOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -200,11 +201,12 @@ public static ApiKeyResource Update(UpdateApiKeyOptions options, ITwilioRestClie /// Client to make requests to Twilio /// Task that resolves to A single instance of ApiKey #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateApiKeyOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateApiKeyOptions 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 @@ -239,7 +241,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateApiKeyOptions(pathSid){ FriendlyName = friendlyName, Policy = policy }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Iam/V1/GetApiKeysResource.cs b/src/Twilio/Rest/Iam/V1/GetApiKeysResource.cs index 81b52aeea..f286f7770 100644 --- a/src/Twilio/Rest/Iam/V1/GetApiKeysResource.cs +++ b/src/Twilio/Rest/Iam/V1/GetApiKeysResource.cs @@ -65,10 +65,10 @@ public static ResourceSet Read(ReadGetApiKeysOptions options /// Read GetApiKeys parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of GetApiKeys - public static async System.Threading.Tasks.Task> ReadAsync(ReadGetApiKeysOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadGetApiKeysOptions 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("keys", response.Content); return new ResourceSet(page, options, client); @@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadGetApiKeysOptions(accountSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Iam/V1/KeyResource.cs b/src/Twilio/Rest/Iam/V1/KeyResource.cs index 364df7cc7..29cde4336 100644 --- a/src/Twilio/Rest/Iam/V1/KeyResource.cs +++ b/src/Twilio/Rest/Iam/V1/KeyResource.cs @@ -77,10 +77,10 @@ public static KeyResource Create(CreateKeyOptions options, ITwilioRestClient cli /// Create Key parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Key - public static async System.Threading.Tasks.Task CreateAsync(CreateKeyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateKeyOptions 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 @@ -116,10 +116,11 @@ public static async System.Threading.Tasks.Task CreateAsync( string friendlyName = null, KeyResource.KeytypeEnum keyType = null, object policy = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + CancellationToken cancellationToken = default) { var options = new CreateKeyOptions(accountSid){ FriendlyName = friendlyName, KeyType = keyType, Policy = policy }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Insights/V1/Call/AnnotationResource.cs b/src/Twilio/Rest/Insights/V1/Call/AnnotationResource.cs index 170e0e87c..dacf5c293 100644 --- a/src/Twilio/Rest/Insights/V1/Call/AnnotationResource.cs +++ b/src/Twilio/Rest/Insights/V1/Call/AnnotationResource.cs @@ -98,10 +98,10 @@ public static AnnotationResource Fetch(FetchAnnotationOptions options, ITwilioRe /// Fetch Annotation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Annotation - public static async System.Threading.Tasks.Task FetchAsync(FetchAnnotationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAnnotationOptions 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 @@ -122,10 +122,10 @@ public static AnnotationResource Fetch( /// The unique SID identifier of the Call. /// Client to make requests to Twilio /// Task that resolves to A single instance of Annotation - public static async System.Threading.Tasks.Task FetchAsync(string pathCallSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathCallSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchAnnotationOptions(pathCallSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -163,11 +163,12 @@ public static AnnotationResource Update(UpdateAnnotationOptions options, ITwilio /// Client to make requests to Twilio /// Task that resolves to A single instance of Annotation #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAnnotationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateAnnotationOptions 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 @@ -222,7 +223,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateAnnotationOptions(pathCallSid){ AnsweredBy = answeredBy, ConnectivityIssue = connectivityIssue, QualityIssues = qualityIssues, Spam = spam, CallScore = callScore, Comment = comment, Incident = incident }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Insights/V1/Call/CallSummaryResource.cs b/src/Twilio/Rest/Insights/V1/Call/CallSummaryResource.cs index 7b4b18715..2e1ff6ac7 100644 --- a/src/Twilio/Rest/Insights/V1/Call/CallSummaryResource.cs +++ b/src/Twilio/Rest/Insights/V1/Call/CallSummaryResource.cs @@ -133,10 +133,10 @@ public static CallSummaryResource Fetch(FetchCallSummaryOptions options, ITwilio /// Fetch CallSummary parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CallSummary - public static async System.Threading.Tasks.Task FetchAsync(FetchCallSummaryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCallSummaryOptions 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 @@ -163,7 +163,7 @@ public static CallSummaryResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathCallSid, CallSummaryResource.ProcessingStateEnum processingState = null, ITwilioRestClient client = null) { var options = new FetchCallSummaryOptions(pathCallSid){ ProcessingState = processingState }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Insights/V1/Call/EventResource.cs b/src/Twilio/Rest/Insights/V1/Call/EventResource.cs index 2c74df5f3..4300098ff 100644 --- a/src/Twilio/Rest/Insights/V1/Call/EventResource.cs +++ b/src/Twilio/Rest/Insights/V1/Call/EventResource.cs @@ -99,10 +99,10 @@ public static ResourceSet Read(ReadEventOptions options, ITwilioR /// Read Event parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Event - public static async System.Threading.Tasks.Task> ReadAsync(ReadEventOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEventOptions 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("events", response.Content); return new ResourceSet(page, options, client); @@ -142,7 +142,7 @@ public static async System.Threading.Tasks.Task> Read ITwilioRestClient client = null) { var options = new ReadEventOptions(pathCallSid){ Edge = edge, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Insights/V1/Call/MetricResource.cs b/src/Twilio/Rest/Insights/V1/Call/MetricResource.cs index 80902d4fd..f52ebde35 100644 --- a/src/Twilio/Rest/Insights/V1/Call/MetricResource.cs +++ b/src/Twilio/Rest/Insights/V1/Call/MetricResource.cs @@ -98,10 +98,10 @@ public static ResourceSet Read(ReadMetricOptions options, ITwili /// Read Metric parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Metric - public static async System.Threading.Tasks.Task> ReadAsync(ReadMetricOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMetricOptions 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("metrics", response.Content); return new ResourceSet(page, options, client); @@ -145,7 +145,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadMetricOptions(pathCallSid){ Edge = edge, Direction = direction, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Insights/V1/CallResource.cs b/src/Twilio/Rest/Insights/V1/CallResource.cs index 6ada69f8b..aad4ed38f 100644 --- a/src/Twilio/Rest/Insights/V1/CallResource.cs +++ b/src/Twilio/Rest/Insights/V1/CallResource.cs @@ -67,10 +67,10 @@ public static CallResource Fetch(FetchCallOptions options, ITwilioRestClient cli /// Fetch Call parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Call - public static async System.Threading.Tasks.Task FetchAsync(FetchCallOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCallOptions 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 CallResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Call - 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 FetchCallOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Insights/V1/CallSummariesResource.cs b/src/Twilio/Rest/Insights/V1/CallSummariesResource.cs index d0fd192d4..e4855def0 100644 --- a/src/Twilio/Rest/Insights/V1/CallSummariesResource.cs +++ b/src/Twilio/Rest/Insights/V1/CallSummariesResource.cs @@ -157,10 +157,10 @@ public static ResourceSet Read(ReadCallSummariesOptions o /// Read CallSummaries parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CallSummaries - public static async System.Threading.Tasks.Task> ReadAsync(ReadCallSummariesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCallSummariesOptions 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("call_summaries", response.Content); return new ResourceSet(page, options, client); @@ -320,7 +320,7 @@ public static async System.Threading.Tasks.Task Fetch ConferenceParticipant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConferenceParticipant - public static async System.Threading.Tasks.Task FetchAsync(FetchConferenceParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchConferenceParticipantOptions 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 @@ -198,7 +198,7 @@ public static ConferenceParticipantResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathConferenceSid, string pathParticipantSid, string events = null, string metrics = null, ITwilioRestClient client = null) { var options = new FetchConferenceParticipantOptions(pathConferenceSid, pathParticipantSid){ Events = events,Metrics = metrics }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -235,10 +235,10 @@ public static ResourceSet Read(ReadConferencePart /// Read ConferenceParticipant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConferenceParticipant - public static async System.Threading.Tasks.Task> ReadAsync(ReadConferenceParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConferenceParticipantOptions 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("participants", response.Content); return new ResourceSet(page, options, client); @@ -286,7 +286,7 @@ public static async System.Threading.Tasks.Task Fetch Conference parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conference - public static async System.Threading.Tasks.Task FetchAsync(FetchConferenceOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchConferenceOptions 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 @@ -177,10 +177,10 @@ public static ConferenceResource Fetch( /// The unique SID identifier of the Conference. /// Client to make requests to Twilio /// Task that resolves to A single instance of Conference - public static async System.Threading.Tasks.Task FetchAsync(string pathConferenceSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathConferenceSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchConferenceOptions(pathConferenceSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -215,10 +215,10 @@ public static ResourceSet Read(ReadConferenceOptions options /// Read Conference parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conference - public static async System.Threading.Tasks.Task> ReadAsync(ReadConferenceOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConferenceOptions 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("conferences", response.Content); return new ResourceSet(page, options, client); @@ -290,7 +290,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadConferenceOptions(){ ConferenceSid = conferenceSid, FriendlyName = friendlyName, Status = status, CreatedAfter = createdAfter, CreatedBefore = createdBefore, MixerRegion = mixerRegion, Tags = tags, Subaccount = subaccount, DetectedIssues = detectedIssues, EndReason = endReason, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Insights/V1/Room/ParticipantResource.cs b/src/Twilio/Rest/Insights/V1/Room/ParticipantResource.cs index bf4844abd..35a740ea7 100644 --- a/src/Twilio/Rest/Insights/V1/Room/ParticipantResource.cs +++ b/src/Twilio/Rest/Insights/V1/Room/ParticipantResource.cs @@ -140,10 +140,10 @@ public static ParticipantResource Fetch(FetchParticipantOptions options, ITwilio /// Fetch Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions 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 @@ -170,7 +170,7 @@ public static ParticipantResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathParticipantSid, ITwilioRestClient client = null) { var options = new FetchParticipantOptions(pathRoomSid, pathParticipantSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -207,10 +207,10 @@ public static ResourceSet Read(ReadParticipantOptions optio /// Read Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions 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("participants", response.Content); return new ResourceSet(page, options, client); @@ -246,7 +246,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadParticipantOptions(pathRoomSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Insights/V1/RoomResource.cs b/src/Twilio/Rest/Insights/V1/RoomResource.cs index 54bdbcf9b..4a3edd6e3 100644 --- a/src/Twilio/Rest/Insights/V1/RoomResource.cs +++ b/src/Twilio/Rest/Insights/V1/RoomResource.cs @@ -193,10 +193,10 @@ public static RoomResource Fetch(FetchRoomOptions options, ITwilioRestClient cli /// Fetch Room parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Room - public static async System.Threading.Tasks.Task FetchAsync(FetchRoomOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoomOptions 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 @@ -217,10 +217,10 @@ public static RoomResource Fetch( /// The SID of the Room resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Room - public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchRoomOptions(pathRoomSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -255,10 +255,10 @@ public static ResourceSet Read(ReadRoomOptions options, ITwilioRes /// Read Room parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Room - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoomOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoomOptions 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("rooms", response.Content); return new ResourceSet(page, options, client); @@ -310,7 +310,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadRoomOptions(){ RoomType = roomType, Codec = codec, RoomName = roomName, CreatedAfter = createdAfter, CreatedBefore = createdBefore, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Insights/V1/SettingResource.cs b/src/Twilio/Rest/Insights/V1/SettingResource.cs index 33144c634..3bde88eef 100644 --- a/src/Twilio/Rest/Insights/V1/SettingResource.cs +++ b/src/Twilio/Rest/Insights/V1/SettingResource.cs @@ -65,10 +65,10 @@ public static SettingResource Fetch(FetchSettingOptions options, ITwilioRestClie /// Fetch Setting parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Setting - public static async System.Threading.Tasks.Task FetchAsync(FetchSettingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSettingOptions 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 @@ -92,7 +92,7 @@ public static SettingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string subaccountSid = null, ITwilioRestClient client = null) { var options = new FetchSettingOptions(){ SubaccountSid = subaccountSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -128,11 +128,12 @@ public static SettingResource Update(UpdateSettingOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Setting #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSettingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSettingOptions 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 @@ -167,7 +168,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateSettingOptions(){ AdvancedFeatures = advancedFeatures, VoiceTrace = voiceTrace, SubaccountSid = subaccountSid }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Intelligence/V2/CustomOperatorResource.cs b/src/Twilio/Rest/Intelligence/V2/CustomOperatorResource.cs index 90dd68dce..093d73eba 100644 --- a/src/Twilio/Rest/Intelligence/V2/CustomOperatorResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/CustomOperatorResource.cs @@ -81,10 +81,10 @@ public static CustomOperatorResource Create(CreateCustomOperatorOptions options, /// Create CustomOperator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomOperator - public static async System.Threading.Tasks.Task CreateAsync(CreateCustomOperatorOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCustomOperatorOptions 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 @@ -119,7 +119,7 @@ public static async System.Threading.Tasks.Task CreateAs ITwilioRestClient client = null) { var options = new CreateCustomOperatorOptions(friendlyName, operatorType, config){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -160,11 +160,12 @@ public static bool Delete(DeleteCustomOperatorOptions options, ITwilioRestClient /// Delete CustomOperator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomOperator - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCustomOperatorOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCustomOperatorOptions 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 @@ -184,10 +185,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this Custom Operator. /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomOperator - 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 DeleteCustomOperatorOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -224,10 +225,10 @@ public static CustomOperatorResource Fetch(FetchCustomOperatorOptions options, I /// Fetch CustomOperator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomOperator - public static async System.Threading.Tasks.Task FetchAsync(FetchCustomOperatorOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCustomOperatorOptions 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 @@ -248,10 +249,10 @@ public static CustomOperatorResource Fetch( /// A 34 character string that uniquely identifies this Custom Operator. /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomOperator - 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 FetchCustomOperatorOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -286,10 +287,10 @@ public static ResourceSet Read(ReadCustomOperatorOptions /// Read CustomOperator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomOperator - public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomOperatorOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomOperatorOptions 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("operators", response.Content); return new ResourceSet(page, options, client); @@ -329,7 +330,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of CustomOperator #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateCustomOperatorOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateCustomOperatorOptions 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 @@ -459,7 +461,7 @@ public static async System.Threading.Tasks.Task UpdateAs ITwilioRestClient client = null) { var options = new UpdateCustomOperatorOptions(pathSid, friendlyName, config){ IfMatch = ifMatch }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentResource.cs b/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentResource.cs index 6c2693bc5..0d7461f71 100644 --- a/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentResource.cs @@ -70,10 +70,10 @@ public static OperatorAttachmentResource Create(CreateOperatorAttachmentOptions /// Create OperatorAttachment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorAttachment - public static async System.Threading.Tasks.Task CreateAsync(CreateOperatorAttachmentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateOperatorAttachmentOptions 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 @@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task Crea ITwilioRestClient client = null) { var options = new CreateOperatorAttachmentOptions(pathServiceSid, pathOperatorSid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -147,11 +147,12 @@ public static bool Delete(DeleteOperatorAttachmentOptions options, ITwilioRestCl /// Delete OperatorAttachment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorAttachment - public static async System.Threading.Tasks.Task DeleteAsync(DeleteOperatorAttachmentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteOperatorAttachmentOptions 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 @@ -176,7 +177,7 @@ public static bool Delete(string pathServiceSid, string pathOperatorSid, ITwilio public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathOperatorSid, ITwilioRestClient client = null) { var options = new DeleteOperatorAttachmentOptions(pathServiceSid, pathOperatorSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsResource.cs b/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsResource.cs index e5e894018..e2c7a01bc 100644 --- a/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsResource.cs @@ -67,10 +67,10 @@ public static OperatorAttachmentsResource Fetch(FetchOperatorAttachmentsOptions /// Fetch OperatorAttachments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorAttachments - public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorAttachmentsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorAttachmentsOptions 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 OperatorAttachmentsResource Fetch( /// The unique SID identifier of the Service. /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorAttachments - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchOperatorAttachmentsOptions(pathServiceSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Intelligence/V2/OperatorResource.cs b/src/Twilio/Rest/Intelligence/V2/OperatorResource.cs index b868a96a4..9922ed86d 100644 --- a/src/Twilio/Rest/Intelligence/V2/OperatorResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/OperatorResource.cs @@ -82,10 +82,10 @@ public static OperatorResource Fetch(FetchOperatorOptions options, ITwilioRestCl /// Fetch Operator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Operator - public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorOptions 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 @@ -106,10 +106,10 @@ public static OperatorResource Fetch( /// A 34 character string that uniquely identifies this Operator. /// Client to make requests to Twilio /// Task that resolves to A single instance of Operator - 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 FetchOperatorOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -144,10 +144,10 @@ public static ResourceSet Read(ReadOperatorOptions options, IT /// Read Operator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Operator - public static async System.Threading.Tasks.Task> ReadAsync(ReadOperatorOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadOperatorOptions 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("operators", response.Content); return new ResourceSet(page, options, client); @@ -187,7 +187,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadOperatorOptions(){ Availability = availability, LanguageCode = languageCode, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Intelligence/V2/OperatorTypeResource.cs b/src/Twilio/Rest/Intelligence/V2/OperatorTypeResource.cs index 08d9e6cd8..3a072a155 100644 --- a/src/Twilio/Rest/Intelligence/V2/OperatorTypeResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/OperatorTypeResource.cs @@ -112,10 +112,10 @@ public static OperatorTypeResource Fetch(FetchOperatorTypeOptions options, ITwil /// Fetch OperatorType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorType - public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorTypeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorTypeOptions 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 @@ -136,10 +136,10 @@ public static OperatorTypeResource Fetch( /// Either a 34 character string that uniquely identifies this Operator Type or the unique name that references an Operator Type. /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorType - 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 FetchOperatorTypeOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -174,10 +174,10 @@ public static ResourceSet Read(ReadOperatorTypeOptions opt /// Read OperatorType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorType - public static async System.Threading.Tasks.Task> ReadAsync(ReadOperatorTypeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadOperatorTypeOptions 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("operator_types", response.Content); return new ResourceSet(page, options, client); @@ -209,7 +209,7 @@ public static async System.Threading.Tasks.Task Fetch PrebuiltOperator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PrebuiltOperator - public static async System.Threading.Tasks.Task FetchAsync(FetchPrebuiltOperatorOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchPrebuiltOperatorOptions 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 @@ -106,10 +106,10 @@ public static PrebuiltOperatorResource Fetch( /// A 34 character string that uniquely identifies this Pre-built Operator. /// Client to make requests to Twilio /// Task that resolves to A single instance of PrebuiltOperator - 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 FetchPrebuiltOperatorOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -144,10 +144,10 @@ public static ResourceSet Read(ReadPrebuiltOperatorOpt /// Read PrebuiltOperator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PrebuiltOperator - public static async System.Threading.Tasks.Task> ReadAsync(ReadPrebuiltOperatorOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPrebuiltOperatorOptions 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("operators", response.Content); return new ResourceSet(page, options, client); @@ -187,7 +187,7 @@ public static async System.Threading.Tasks.Task 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 @@ -142,7 +142,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateServiceOptions(uniqueName){ AutoTranscribe = autoTranscribe, DataLogging = dataLogging, FriendlyName = friendlyName, LanguageCode = languageCode, AutoRedaction = autoRedaction, MediaRedaction = mediaRedaction, WebhookUrl = webhookUrl, WebhookHttpMethod = webhookHttpMethod }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -183,11 +183,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 @@ -207,10 +208,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this Service. /// 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 @@ -247,10 +248,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 @@ -271,10 +272,10 @@ public static ServiceResource Fetch( /// A 34 character string that uniquely identifies this Service. /// 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 @@ -309,10 +310,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); @@ -344,7 +345,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 @@ -431,11 +432,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 @@ -498,7 +500,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid){ AutoTranscribe = autoTranscribe, DataLogging = dataLogging, FriendlyName = friendlyName, UniqueName = uniqueName, AutoRedaction = autoRedaction, MediaRedaction = mediaRedaction, WebhookUrl = webhookUrl, WebhookHttpMethod = webhookHttpMethod, IfMatch = ifMatch }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Intelligence/V2/Transcript/MediaResource.cs b/src/Twilio/Rest/Intelligence/V2/Transcript/MediaResource.cs index efc83953f..57f6f3ceb 100644 --- a/src/Twilio/Rest/Intelligence/V2/Transcript/MediaResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/Transcript/MediaResource.cs @@ -67,10 +67,10 @@ public static MediaResource Fetch(FetchMediaOptions options, ITwilioRestClient c /// Fetch Media parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Media - public static async System.Threading.Tasks.Task FetchAsync(FetchMediaOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMediaOptions 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 @@ -97,7 +97,7 @@ public static MediaResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, bool? redacted = null, ITwilioRestClient client = null) { var options = new FetchMediaOptions(pathSid){ Redacted = redacted }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultResource.cs b/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultResource.cs index 58baefc4f..1fde7fe44 100644 --- a/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultResource.cs @@ -85,10 +85,10 @@ public static OperatorResultResource Fetch(FetchOperatorResultOptions options, I /// Fetch OperatorResult parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorResult - public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorResultOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorResultOptions 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 OperatorResultResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathTranscriptSid, string pathOperatorSid, bool? redacted = null, ITwilioRestClient client = null) { var options = new FetchOperatorResultOptions(pathTranscriptSid, pathOperatorSid){ Redacted = redacted }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -155,10 +155,10 @@ public static ResourceSet Read(ReadOperatorResultOptions /// Read OperatorResult parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorResult - public static async System.Threading.Tasks.Task> ReadAsync(ReadOperatorResultOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadOperatorResultOptions 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("operator_results", response.Content); return new ResourceSet(page, options, client); @@ -198,7 +198,7 @@ public static async System.Threading.Tasks.Task Read(ReadSentenceOptions options, IT /// Read Sentence parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sentence - public static async System.Threading.Tasks.Task> ReadAsync(ReadSentenceOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSentenceOptions 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("sentences", response.Content); return new ResourceSet(page, options, client); @@ -114,7 +114,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadSentenceOptions(pathTranscriptSid){ Redacted = redacted, WordTimestamps = wordTimestamps, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Intelligence/V2/TranscriptResource.cs b/src/Twilio/Rest/Intelligence/V2/TranscriptResource.cs index 45151380d..ad07750ef 100644 --- a/src/Twilio/Rest/Intelligence/V2/TranscriptResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/TranscriptResource.cs @@ -82,10 +82,10 @@ public static TranscriptResource Create(CreateTranscriptOptions options, ITwilio /// Create Transcript parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcript - public static async System.Threading.Tasks.Task CreateAsync(CreateTranscriptOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateTranscriptOptions 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 @@ -124,7 +124,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateTranscriptOptions(serviceSid, channel){ CustomerKey = customerKey, MediaStartTime = mediaStartTime }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -165,11 +165,12 @@ public static bool Delete(DeleteTranscriptOptions options, ITwilioRestClient cli /// Delete Transcript parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcript - public static async System.Threading.Tasks.Task DeleteAsync(DeleteTranscriptOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteTranscriptOptions 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 @@ -189,10 +190,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this Transcript. /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcript - 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 DeleteTranscriptOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -229,10 +230,10 @@ public static TranscriptResource Fetch(FetchTranscriptOptions options, ITwilioRe /// Fetch Transcript parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcript - public static async System.Threading.Tasks.Task FetchAsync(FetchTranscriptOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTranscriptOptions 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 @@ -253,10 +254,10 @@ public static TranscriptResource Fetch( /// A 34 character string that uniquely identifies this Transcript. /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcript - 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 FetchTranscriptOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -291,10 +292,10 @@ public static ResourceSet Read(ReadTranscriptOptions options /// Read Transcript parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcript - public static async System.Threading.Tasks.Task> ReadAsync(ReadTranscriptOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTranscriptOptions 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("transcripts", response.Content); return new ResourceSet(page, options, client); @@ -358,7 +359,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadTranscriptOptions(){ ServiceSid = serviceSid, BeforeStartTime = beforeStartTime, AfterStartTime = afterStartTime, BeforeDateCreated = beforeDateCreated, AfterDateCreated = afterDateCreated, Status = status, LanguageCode = languageCode, SourceSid = sourceSid, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V1/CredentialResource.cs b/src/Twilio/Rest/IpMessaging/V1/CredentialResource.cs index a2968629f..a98711c27 100644 --- a/src/Twilio/Rest/IpMessaging/V1/CredentialResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/CredentialResource.cs @@ -80,10 +80,10 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio /// Create Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions 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 @@ -134,7 +134,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateCredentialOptions(type){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -175,11 +175,12 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli /// Delete Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions 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 @@ -199,10 +200,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - 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 DeleteCredentialOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -239,10 +240,10 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe /// Fetch Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions 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 @@ -263,10 +264,10 @@ public static CredentialResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - 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 FetchCredentialOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadCredentialOptions options /// Read Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions 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("credentials", response.Content); return new ResourceSet(page, options, client); @@ -336,7 +337,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadCredentialOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -423,11 +424,12 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions 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 @@ -478,7 +480,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateCredentialOptions(pathSid){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteResource.cs b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteResource.cs index 99f3b6302..49215a4c2 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteResource.cs @@ -70,10 +70,10 @@ public static InviteResource Create(CreateInviteOptions options, ITwilioRestClie /// Create Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task CreateAsync(CreateInviteOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInviteOptions 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 CreateInviteOptions(pathServiceSid, pathChannelSid, identity){ RoleSid = roleSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -157,11 +157,12 @@ public static bool Delete(DeleteInviteOptions options, ITwilioRestClient client /// Delete Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task DeleteAsync(DeleteInviteOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteInviteOptions 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 pathChannelSid, string p public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteInviteOptions(pathServiceSid, pathChannelSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -229,10 +230,10 @@ public static InviteResource Fetch(FetchInviteOptions options, ITwilioRestClient /// Fetch Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task FetchAsync(FetchInviteOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInviteOptions 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 InviteResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchInviteOptions(pathServiceSid, pathChannelSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadInviteOptions options, ITwili /// Read Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task> ReadAsync(ReadInviteOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInviteOptions 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("invites", response.Content); return new ResourceSet(page, options, client); @@ -348,7 +349,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadInviteOptions(pathServiceSid, pathChannelSid){ Identity = identity, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberResource.cs b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberResource.cs index 91f2f029c..b239010fc 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberResource.cs @@ -70,10 +70,10 @@ public static MemberResource Create(CreateMemberOptions options, ITwilioRestClie /// Create Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task CreateAsync(CreateMemberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMemberOptions 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 CreateMemberOptions(pathServiceSid, pathChannelSid, identity){ RoleSid = roleSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -157,11 +157,12 @@ public static bool Delete(DeleteMemberOptions options, ITwilioRestClient client /// Delete Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task DeleteAsync(DeleteMemberOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteMemberOptions 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 pathChannelSid, string p public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteMemberOptions(pathServiceSid, pathChannelSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -229,10 +230,10 @@ public static MemberResource Fetch(FetchMemberOptions options, ITwilioRestClient /// Fetch Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions 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 MemberResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchMemberOptions(pathServiceSid, pathChannelSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadMemberOptions options, ITwili /// Read Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions 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("members", response.Content); return new ResourceSet(page, options, client); @@ -348,7 +349,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadMemberOptions(pathServiceSid, pathChannelSid){ Identity = identity, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -439,11 +440,12 @@ public static MemberResource Update(UpdateMemberOptions options, ITwilioRestClie /// Client to make requests to Twilio /// Task that resolves to A single instance of Member #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateMemberOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateMemberOptions 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 @@ -486,7 +488,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateMemberOptions(pathServiceSid, pathChannelSid, pathSid){ RoleSid = roleSid, LastConsumedMessageIndex = lastConsumedMessageIndex }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageResource.cs b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageResource.cs index 9c01a1d4f..837060321 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageResource.cs @@ -82,10 +82,10 @@ public static MessageResource Create(CreateMessageOptions options, ITwilioRestCl /// Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions 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 @@ -128,7 +128,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateMessageOptions(pathServiceSid, pathChannelSid, body){ From = from, Attributes = attributes }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -173,11 +173,12 @@ public static bool Delete(DeleteMessageOptions options, ITwilioRestClient client /// Delete Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions 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 @@ -204,7 +205,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteMessageOptions(pathServiceSid, pathChannelSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -245,10 +246,10 @@ public static MessageResource Fetch(FetchMessageOptions options, ITwilioRestClie /// Fetch Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions 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 @@ -278,7 +279,7 @@ public static MessageResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchMessageOptions(pathServiceSid, pathChannelSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -317,10 +318,10 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions 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("messages", response.Content); return new ResourceSet(page, options, client); @@ -364,7 +365,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadMessageOptions(pathServiceSid, pathChannelSid){ Order = order, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -455,11 +456,12 @@ public static MessageResource Update(UpdateMessageOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Message #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions 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 @@ -502,7 +504,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateMessageOptions(pathServiceSid, pathChannelSid, pathSid){ Body = body, Attributes = attributes }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/ChannelResource.cs b/src/Twilio/Rest/IpMessaging/V1/Service/ChannelResource.cs index c016c2bca..aab45716c 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/ChannelResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/Service/ChannelResource.cs @@ -81,10 +81,10 @@ public static ChannelResource Create(CreateChannelOptions options, ITwilioRestCl /// Create Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions 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 @@ -127,7 +127,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateChannelOptions(pathServiceSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes, Type = type }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -170,11 +170,12 @@ public static bool Delete(DeleteChannelOptions options, ITwilioRestClient client /// Delete Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions 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 @@ -199,7 +200,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 DeleteChannelOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -238,10 +239,10 @@ public static ChannelResource Fetch(FetchChannelOptions options, ITwilioRestClie /// Fetch Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions 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 @@ -268,7 +269,7 @@ public static ChannelResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchChannelOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -305,10 +306,10 @@ public static ResourceSet Read(ReadChannelOptions options, ITwi /// Read Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions 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("channels", response.Content); return new ResourceSet(page, options, client); @@ -348,7 +349,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadChannelOptions(pathServiceSid){ Type = type, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -437,11 +438,12 @@ public static ChannelResource Update(UpdateChannelOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateChannelOptions 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 @@ -484,7 +486,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateChannelOptions(pathServiceSid, pathSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/RoleResource.cs b/src/Twilio/Rest/IpMessaging/V1/Service/RoleResource.cs index b5204ec5f..ad660d7ab 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/RoleResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/Service/RoleResource.cs @@ -81,10 +81,10 @@ public static RoleResource Create(CreateRoleOptions options, ITwilioRestClient c /// Create Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions 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 CreateRoleOptions(pathServiceSid, friendlyName, type, permission){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -166,11 +166,12 @@ public static bool Delete(DeleteRoleOptions options, ITwilioRestClient client = /// Delete Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions 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 pathServiceSid, string pathSid, ITwilioRestClie public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteRoleOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -234,10 +235,10 @@ public static RoleResource Fetch(FetchRoleOptions options, ITwilioRestClient cli /// Fetch Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions 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 RoleResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchRoleOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadRoleOptions options, ITwilioRes /// Read Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions 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("roles", response.Content); return new ResourceSet(page, options, client); @@ -340,7 +341,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadRoleOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -429,11 +430,12 @@ public static RoleResource Update(UpdateRoleOptions options, ITwilioRestClient c /// Client to make requests to Twilio /// Task that resolves to A single instance of Role #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions 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 @@ -468,7 +470,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateRoleOptions(pathServiceSid, pathSid, permission){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelResource.cs b/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelResource.cs index 9c3ee724b..3b7d581e5 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelResource.cs @@ -83,10 +83,10 @@ public static ResourceSet Read(ReadUserChannelOptions optio /// Read UserChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadUserChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserChannelOptions 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("channels", response.Content); return new ResourceSet(page, options, client); @@ -126,7 +126,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadUserChannelOptions(pathServiceSid, pathUserSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/UserResource.cs b/src/Twilio/Rest/IpMessaging/V1/Service/UserResource.cs index c7a89271d..bb3b200f9 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/UserResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/Service/UserResource.cs @@ -68,10 +68,10 @@ public static UserResource Create(CreateUserOptions options, ITwilioRestClient c /// 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 @@ -114,7 +114,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateUserOptions(pathServiceSid, identity){ RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -157,11 +157,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 @@ -186,7 +187,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 DeleteUserOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -225,10 +226,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 @@ -255,7 +256,7 @@ public static UserResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchUserOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -292,10 +293,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("users", response.Content); return new ResourceSet(page, options, client); @@ -331,7 +332,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadUserOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -420,11 +421,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 @@ -467,7 +469,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateUserOptions(pathServiceSid, pathSid){ RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V1/ServiceResource.cs b/src/Twilio/Rest/IpMessaging/V1/ServiceResource.cs index e7c4925b4..0d595aee3 100644 --- a/src/Twilio/Rest/IpMessaging/V1/ServiceResource.cs +++ b/src/Twilio/Rest/IpMessaging/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 @@ -96,7 +96,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateServiceOptions(friendlyName){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -137,11 +137,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 @@ -161,10 +162,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// /// 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 @@ -201,10 +202,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 @@ -225,10 +226,10 @@ public static ServiceResource 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 @@ -263,10 +264,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); @@ -298,7 +299,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 @@ -385,11 +386,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 @@ -632,7 +634,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, DefaultServiceRoleSid = defaultServiceRoleSid, DefaultChannelRoleSid = defaultChannelRoleSid, DefaultChannelCreatorRoleSid = defaultChannelCreatorRoleSid, ReadStatusEnabled = readStatusEnabled, ReachabilityEnabled = reachabilityEnabled, TypingIndicatorTimeout = typingIndicatorTimeout, ConsumptionReportInterval = consumptionReportInterval, NotificationsNewMessageEnabled = notificationsNewMessageEnabled, NotificationsNewMessageTemplate = notificationsNewMessageTemplate, NotificationsAddedToChannelEnabled = notificationsAddedToChannelEnabled, NotificationsAddedToChannelTemplate = notificationsAddedToChannelTemplate, NotificationsRemovedFromChannelEnabled = notificationsRemovedFromChannelEnabled, NotificationsRemovedFromChannelTemplate = notificationsRemovedFromChannelTemplate, NotificationsInvitedToChannelEnabled = notificationsInvitedToChannelEnabled, NotificationsInvitedToChannelTemplate = notificationsInvitedToChannelTemplate, PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, WebhookMethod = webhookMethod, WebhookFilters = webhookFilters, WebhooksOnMessageSendUrl = webhooksOnMessageSendUrl, WebhooksOnMessageSendMethod = webhooksOnMessageSendMethod, WebhooksOnMessageUpdateUrl = webhooksOnMessageUpdateUrl, WebhooksOnMessageUpdateMethod = webhooksOnMessageUpdateMethod, WebhooksOnMessageRemoveUrl = webhooksOnMessageRemoveUrl, WebhooksOnMessageRemoveMethod = webhooksOnMessageRemoveMethod, WebhooksOnChannelAddUrl = webhooksOnChannelAddUrl, WebhooksOnChannelAddMethod = webhooksOnChannelAddMethod, WebhooksOnChannelDestroyUrl = webhooksOnChannelDestroyUrl, WebhooksOnChannelDestroyMethod = webhooksOnChannelDestroyMethod, WebhooksOnChannelUpdateUrl = webhooksOnChannelUpdateUrl, WebhooksOnChannelUpdateMethod = webhooksOnChannelUpdateMethod, WebhooksOnMemberAddUrl = webhooksOnMemberAddUrl, WebhooksOnMemberAddMethod = webhooksOnMemberAddMethod, WebhooksOnMemberRemoveUrl = webhooksOnMemberRemoveUrl, WebhooksOnMemberRemoveMethod = webhooksOnMemberRemoveMethod, WebhooksOnMessageSentUrl = webhooksOnMessageSentUrl, WebhooksOnMessageSentMethod = webhooksOnMessageSentMethod, WebhooksOnMessageUpdatedUrl = webhooksOnMessageUpdatedUrl, WebhooksOnMessageUpdatedMethod = webhooksOnMessageUpdatedMethod, WebhooksOnMessageRemovedUrl = webhooksOnMessageRemovedUrl, WebhooksOnMessageRemovedMethod = webhooksOnMessageRemovedMethod, WebhooksOnChannelAddedUrl = webhooksOnChannelAddedUrl, WebhooksOnChannelAddedMethod = webhooksOnChannelAddedMethod, WebhooksOnChannelDestroyedUrl = webhooksOnChannelDestroyedUrl, WebhooksOnChannelDestroyedMethod = webhooksOnChannelDestroyedMethod, WebhooksOnChannelUpdatedUrl = webhooksOnChannelUpdatedUrl, WebhooksOnChannelUpdatedMethod = webhooksOnChannelUpdatedMethod, WebhooksOnMemberAddedUrl = webhooksOnMemberAddedUrl, WebhooksOnMemberAddedMethod = webhooksOnMemberAddedMethod, WebhooksOnMemberRemovedUrl = webhooksOnMemberRemovedUrl, WebhooksOnMemberRemovedMethod = webhooksOnMemberRemovedMethod, LimitsChannelMembers = limitsChannelMembers, LimitsUserChannels = limitsUserChannels }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V2/CredentialResource.cs b/src/Twilio/Rest/IpMessaging/V2/CredentialResource.cs index 70bb791a1..f90b5cece 100644 --- a/src/Twilio/Rest/IpMessaging/V2/CredentialResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/CredentialResource.cs @@ -80,10 +80,10 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio /// Create Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions 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 @@ -134,7 +134,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateCredentialOptions(type){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -175,11 +175,12 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli /// Delete Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions 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 @@ -199,10 +200,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - 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 DeleteCredentialOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -239,10 +240,10 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe /// Fetch Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions 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 @@ -263,10 +264,10 @@ public static CredentialResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - 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 FetchCredentialOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadCredentialOptions options /// Read Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions 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("credentials", response.Content); return new ResourceSet(page, options, client); @@ -336,7 +337,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadCredentialOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -423,11 +424,12 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions 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 @@ -478,7 +480,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateCredentialOptions(pathSid){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/BindingResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/BindingResource.cs index c2d72aa2c..92d0d823e 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/BindingResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/BindingResource.cs @@ -87,11 +87,12 @@ public static bool Delete(DeleteBindingOptions options, ITwilioRestClient client /// Delete Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task DeleteAsync(DeleteBindingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteBindingOptions 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 @@ -116,7 +117,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 DeleteBindingOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -155,10 +156,10 @@ public static BindingResource Fetch(FetchBindingOptions options, ITwilioRestClie /// Fetch Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions 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 @@ -185,7 +186,7 @@ public static BindingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchBindingOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -222,10 +223,10 @@ public static ResourceSet Read(ReadBindingOptions options, ITwi /// Read Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions 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("bindings", response.Content); return new ResourceSet(page, options, client); @@ -269,7 +270,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadBindingOptions(pathServiceSid){ BindingType = bindingType, Identity = identity, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteResource.cs index 13f9532bb..4e21d3ed0 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteResource.cs @@ -70,10 +70,10 @@ public static InviteResource Create(CreateInviteOptions options, ITwilioRestClie /// Create Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task CreateAsync(CreateInviteOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInviteOptions 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 CreateInviteOptions(pathServiceSid, pathChannelSid, identity){ RoleSid = roleSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -157,11 +157,12 @@ public static bool Delete(DeleteInviteOptions options, ITwilioRestClient client /// Delete Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task DeleteAsync(DeleteInviteOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteInviteOptions 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 pathChannelSid, string p public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteInviteOptions(pathServiceSid, pathChannelSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -229,10 +230,10 @@ public static InviteResource Fetch(FetchInviteOptions options, ITwilioRestClient /// Fetch Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task FetchAsync(FetchInviteOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInviteOptions 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 InviteResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchInviteOptions(pathServiceSid, pathChannelSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadInviteOptions options, ITwili /// Read Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task> ReadAsync(ReadInviteOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInviteOptions 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("invites", response.Content); return new ResourceSet(page, options, client); @@ -348,7 +349,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadInviteOptions(pathServiceSid, pathChannelSid){ Identity = identity, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberResource.cs index 3dcca97e9..59b079b06 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberResource.cs @@ -82,10 +82,10 @@ public static MemberResource Create(CreateMemberOptions options, ITwilioRestClie /// Create Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task CreateAsync(CreateMemberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMemberOptions 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 @@ -148,7 +148,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateMemberOptions(pathServiceSid, pathChannelSid, identity){ RoleSid = roleSid, LastConsumedMessageIndex = lastConsumedMessageIndex, LastConsumptionTimestamp = lastConsumptionTimestamp, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -193,11 +193,12 @@ public static bool Delete(DeleteMemberOptions options, ITwilioRestClient client /// Delete Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task DeleteAsync(DeleteMemberOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteMemberOptions 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 @@ -226,7 +227,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, MemberResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new DeleteMemberOptions(pathServiceSid, pathChannelSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -267,10 +268,10 @@ public static MemberResource Fetch(FetchMemberOptions options, ITwilioRestClient /// Fetch Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions 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 @@ -300,7 +301,7 @@ public static MemberResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchMemberOptions(pathServiceSid, pathChannelSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -339,10 +340,10 @@ public static ResourceSet Read(ReadMemberOptions options, ITwili /// Read Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions 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("members", response.Content); return new ResourceSet(page, options, client); @@ -386,7 +387,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadMemberOptions(pathServiceSid, pathChannelSid){ Identity = identity, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -477,11 +478,12 @@ public static MemberResource Update(UpdateMemberOptions options, ITwilioRestClie /// Client to make requests to Twilio /// Task that resolves to A single instance of Member #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateMemberOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateMemberOptions 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 @@ -544,7 +546,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateMemberOptions(pathServiceSid, pathChannelSid, pathSid){ RoleSid = roleSid, LastConsumedMessageIndex = lastConsumedMessageIndex, LastConsumptionTimestamp = lastConsumptionTimestamp, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageResource.cs index 94a7c97a3..8aba48233 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageResource.cs @@ -94,10 +94,10 @@ public static MessageResource Create(CreateMessageOptions options, ITwilioRestCl /// Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions 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 @@ -160,7 +160,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateMessageOptions(pathServiceSid, pathChannelSid){ From = from, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, LastUpdatedBy = lastUpdatedBy, Body = body, MediaSid = mediaSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -205,11 +205,12 @@ public static bool Delete(DeleteMessageOptions options, ITwilioRestClient client /// Delete Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions 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 @@ -238,7 +239,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new DeleteMessageOptions(pathServiceSid, pathChannelSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -279,10 +280,10 @@ public static MessageResource Fetch(FetchMessageOptions options, ITwilioRestClie /// Fetch Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions 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 @@ -312,7 +313,7 @@ public static MessageResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchMessageOptions(pathServiceSid, pathChannelSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -351,10 +352,10 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions 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("messages", response.Content); return new ResourceSet(page, options, client); @@ -398,7 +399,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadMessageOptions(pathServiceSid, pathChannelSid){ Order = order, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -489,11 +490,12 @@ public static MessageResource Update(UpdateMessageOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Message #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions 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 @@ -556,7 +558,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateMessageOptions(pathServiceSid, pathChannelSid, pathSid){ Body = body, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, LastUpdatedBy = lastUpdatedBy, From = from, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookResource.cs index f07f7cde0..121883827 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookResource.cs @@ -95,10 +95,10 @@ public static WebhookResource Create(CreateWebhookOptions options, ITwilioRestCl /// Create Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions 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 @@ -157,7 +157,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateWebhookOptions(pathServiceSid, pathChannelSid, type){ ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid, ConfigurationRetryCount = configurationRetryCount }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -202,11 +202,12 @@ public static bool Delete(DeleteWebhookOptions options, ITwilioRestClient client /// Delete Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebhookOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebhookOptions 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 @@ -233,7 +234,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteWebhookOptions(pathServiceSid, pathChannelSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -274,10 +275,10 @@ public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClie /// Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions 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 @@ -307,7 +308,7 @@ public static WebhookResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchWebhookOptions(pathServiceSid, pathChannelSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -346,10 +347,10 @@ public static ResourceSet Read(ReadWebhookOptions options, ITwi /// Read Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions 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("webhooks", response.Content); return new ResourceSet(page, options, client); @@ -389,7 +390,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadWebhookOptions(pathServiceSid, pathChannelSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -480,11 +481,12 @@ public static WebhookResource Update(UpdateWebhookOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions 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 @@ -543,7 +545,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateWebhookOptions(pathServiceSid, pathChannelSid, pathSid){ ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid, ConfigurationRetryCount = configurationRetryCount }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/ChannelResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/ChannelResource.cs index d52811ee3..342d98b0f 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/ChannelResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/ChannelResource.cs @@ -93,10 +93,10 @@ public static ChannelResource Create(CreateChannelOptions options, ITwilioRestCl /// Create Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions 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 @@ -155,7 +155,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateChannelOptions(pathServiceSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes, Type = type, DateCreated = dateCreated, DateUpdated = dateUpdated, CreatedBy = createdBy, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -198,11 +198,12 @@ public static bool Delete(DeleteChannelOptions options, ITwilioRestClient client /// Delete Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions 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 @@ -229,7 +230,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ChannelResource public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ChannelResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new DeleteChannelOptions(pathServiceSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -268,10 +269,10 @@ public static ChannelResource Fetch(FetchChannelOptions options, ITwilioRestClie /// Fetch Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions 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 @@ -298,7 +299,7 @@ public static ChannelResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchChannelOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -335,10 +336,10 @@ public static ResourceSet Read(ReadChannelOptions options, ITwi /// Read Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions 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("channels", response.Content); return new ResourceSet(page, options, client); @@ -378,7 +379,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadChannelOptions(pathServiceSid){ Type = type, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -467,11 +468,12 @@ public static ChannelResource Update(UpdateChannelOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateChannelOptions 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 @@ -530,7 +532,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateChannelOptions(pathServiceSid, pathSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, CreatedBy = createdBy, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/RoleResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/RoleResource.cs index 470eeaaca..528fb7c70 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/RoleResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/RoleResource.cs @@ -81,10 +81,10 @@ public static RoleResource Create(CreateRoleOptions options, ITwilioRestClient c /// Create Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions 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 CreateRoleOptions(pathServiceSid, friendlyName, type, permission){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -166,11 +166,12 @@ public static bool Delete(DeleteRoleOptions options, ITwilioRestClient client = /// Delete Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions 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 pathServiceSid, string pathSid, ITwilioRestClie public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteRoleOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -234,10 +235,10 @@ public static RoleResource Fetch(FetchRoleOptions options, ITwilioRestClient cli /// Fetch Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions 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 RoleResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchRoleOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadRoleOptions options, ITwilioRes /// Read Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions 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("roles", response.Content); return new ResourceSet(page, options, client); @@ -340,7 +341,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadRoleOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -429,11 +430,12 @@ public static RoleResource Update(UpdateRoleOptions options, ITwilioRestClient c /// Client to make requests to Twilio /// Task that resolves to A single instance of Role #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions 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 @@ -468,7 +470,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateRoleOptions(pathServiceSid, pathSid, permission){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingResource.cs index dfd152737..c3d4653e9 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingResource.cs @@ -89,11 +89,12 @@ public static bool Delete(DeleteUserBindingOptions options, ITwilioRestClient cl /// Delete UserBinding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserBinding - public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserBindingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserBindingOptions 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 @@ -120,7 +121,7 @@ public static bool Delete(string pathServiceSid, string pathUserSid, string path public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathUserSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteUserBindingOptions(pathServiceSid, pathUserSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -161,10 +162,10 @@ public static UserBindingResource Fetch(FetchUserBindingOptions options, ITwilio /// Fetch UserBinding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserBinding - public static async System.Threading.Tasks.Task FetchAsync(FetchUserBindingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserBindingOptions 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 @@ -194,7 +195,7 @@ public static UserBindingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathUserSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchUserBindingOptions(pathServiceSid, pathUserSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -233,10 +234,10 @@ public static ResourceSet Read(ReadUserBindingOptions optio /// Read UserBinding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserBinding - public static async System.Threading.Tasks.Task> ReadAsync(ReadUserBindingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserBindingOptions 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("bindings", response.Content); return new ResourceSet(page, options, client); @@ -280,7 +281,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadUserBindingOptions(pathServiceSid, pathUserSid){ BindingType = bindingType, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelResource.cs index 96e29eaaa..fdc457bea 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelResource.cs @@ -102,11 +102,12 @@ public static bool Delete(DeleteUserChannelOptions options, ITwilioRestClient cl /// Delete UserChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserChannelOptions 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 @@ -133,7 +134,7 @@ public static bool Delete(string pathServiceSid, string pathUserSid, string path public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathUserSid, string pathChannelSid, ITwilioRestClient client = null) { var options = new DeleteUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -174,10 +175,10 @@ public static UserChannelResource Fetch(FetchUserChannelOptions options, ITwilio /// Fetch UserChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task FetchAsync(FetchUserChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserChannelOptions 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 @@ -207,7 +208,7 @@ public static UserChannelResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathUserSid, string pathChannelSid, ITwilioRestClient client = null) { var options = new FetchUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -246,10 +247,10 @@ public static ResourceSet Read(ReadUserChannelOptions optio /// Read UserChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadUserChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserChannelOptions 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("channels", response.Content); return new ResourceSet(page, options, client); @@ -289,7 +290,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadUserChannelOptions(pathServiceSid, pathUserSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -380,11 +381,12 @@ public static UserChannelResource Update(UpdateUserChannelOptions options, ITwil /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserChannelOptions 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 @@ -431,7 +433,7 @@ public static async System.Threading.Tasks.Task UpdateAsync ITwilioRestClient client = null) { var options = new UpdateUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid){ NotificationLevel = notificationLevel, LastConsumedMessageIndex = lastConsumedMessageIndex, LastConsumptionTimestamp = lastConsumptionTimestamp }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/UserResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/UserResource.cs index 5a72ac20f..434237bec 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/UserResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/UserResource.cs @@ -80,10 +80,10 @@ public static UserResource Create(CreateUserOptions options, ITwilioRestClient c /// 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 @@ -130,7 +130,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateUserOptions(pathServiceSid, identity){ RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -173,11 +173,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 @@ -202,7 +203,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 DeleteUserOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -241,10 +242,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 @@ -271,7 +272,7 @@ public static UserResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchUserOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -308,10 +309,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("users", response.Content); return new ResourceSet(page, options, client); @@ -347,7 +348,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadUserOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -436,11 +437,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 @@ -487,7 +489,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateUserOptions(pathServiceSid, pathSid){ RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/IpMessaging/V2/ServiceResource.cs b/src/Twilio/Rest/IpMessaging/V2/ServiceResource.cs index 22508d6e5..6aab31cef 100644 --- a/src/Twilio/Rest/IpMessaging/V2/ServiceResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/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 @@ -96,7 +96,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateServiceOptions(friendlyName){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -137,11 +137,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 @@ -161,10 +162,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// /// 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 @@ -201,10 +202,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 @@ -225,10 +226,10 @@ public static ServiceResource 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 @@ -263,10 +264,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); @@ -298,7 +299,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 @@ -385,11 +386,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 @@ -540,7 +542,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, DefaultServiceRoleSid = defaultServiceRoleSid, DefaultChannelRoleSid = defaultChannelRoleSid, DefaultChannelCreatorRoleSid = defaultChannelCreatorRoleSid, ReadStatusEnabled = readStatusEnabled, ReachabilityEnabled = reachabilityEnabled, TypingIndicatorTimeout = typingIndicatorTimeout, ConsumptionReportInterval = consumptionReportInterval, NotificationsNewMessageEnabled = notificationsNewMessageEnabled, NotificationsNewMessageTemplate = notificationsNewMessageTemplate, NotificationsNewMessageSound = notificationsNewMessageSound, NotificationsNewMessageBadgeCountEnabled = notificationsNewMessageBadgeCountEnabled, NotificationsAddedToChannelEnabled = notificationsAddedToChannelEnabled, NotificationsAddedToChannelTemplate = notificationsAddedToChannelTemplate, NotificationsAddedToChannelSound = notificationsAddedToChannelSound, NotificationsRemovedFromChannelEnabled = notificationsRemovedFromChannelEnabled, NotificationsRemovedFromChannelTemplate = notificationsRemovedFromChannelTemplate, NotificationsRemovedFromChannelSound = notificationsRemovedFromChannelSound, NotificationsInvitedToChannelEnabled = notificationsInvitedToChannelEnabled, NotificationsInvitedToChannelTemplate = notificationsInvitedToChannelTemplate, NotificationsInvitedToChannelSound = notificationsInvitedToChannelSound, PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, WebhookMethod = webhookMethod, WebhookFilters = webhookFilters, LimitsChannelMembers = limitsChannelMembers, LimitsUserChannels = limitsUserChannels, MediaCompatibilityMessage = mediaCompatibilityMessage, PreWebhookRetryCount = preWebhookRetryCount, PostWebhookRetryCount = postWebhookRetryCount, NotificationsLogEnabled = notificationsLogEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Lookups/V1/PhoneNumberResource.cs b/src/Twilio/Rest/Lookups/V1/PhoneNumberResource.cs index 54be952dd..a2fc64112 100644 --- a/src/Twilio/Rest/Lookups/V1/PhoneNumberResource.cs +++ b/src/Twilio/Rest/Lookups/V1/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 @@ -106,7 +106,7 @@ public static PhoneNumberResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathPhoneNumber, string countryCode = null, List type = null, List addOns = null, Dictionary addOnsData = null, ITwilioRestClient client = null) { var options = new FetchPhoneNumberOptions(pathPhoneNumber){ CountryCode = countryCode,Type = type,AddOns = addOns,AddOnsData = addOnsData }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Lookups/V2/PhoneNumberResource.cs b/src/Twilio/Rest/Lookups/V2/PhoneNumberResource.cs index e691aca6d..72f6ad90f 100644 --- a/src/Twilio/Rest/Lookups/V2/PhoneNumberResource.cs +++ b/src/Twilio/Rest/Lookups/V2/PhoneNumberResource.cs @@ -84,10 +84,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 @@ -153,7 +153,7 @@ public static PhoneNumberResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathPhoneNumber, string fields = null, string countryCode = null, string firstName = null, string lastName = null, string addressLine1 = null, string addressLine2 = null, string city = null, string state = null, string postalCode = null, string addressCountryCode = null, string nationalId = null, string dateOfBirth = null, string lastVerifiedDate = null, string verificationSid = null, ITwilioRestClient client = null) { var options = new FetchPhoneNumberOptions(pathPhoneNumber){ Fields = fields,CountryCode = countryCode,FirstName = firstName,LastName = lastName,AddressLine1 = addressLine1,AddressLine2 = addressLine2,City = city,State = state,PostalCode = postalCode,AddressCountryCode = addressCountryCode,NationalId = nationalId,DateOfBirth = dateOfBirth,LastVerifiedDate = lastVerifiedDate,VerificationSid = verificationSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionResource.cs b/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionResource.cs index 9a4773cb9..af3f3c54e 100644 --- a/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionResource.cs +++ b/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionResource.cs @@ -69,10 +69,10 @@ public static AvailableAddOnExtensionResource Fetch(FetchAvailableAddOnExtension /// Fetch AvailableAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnExtensionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnExtensionOptions 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 AvailableAddOnExtensionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathAvailableAddOnSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchAvailableAddOnExtensionOptions(pathAvailableAddOnSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -136,10 +136,10 @@ public static ResourceSet Read(ReadAvailableAdd /// Read AvailableAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOnExtension - public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnExtensionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnExtensionOptions 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("extensions", response.Content); return new ResourceSet(page, options, client); @@ -175,7 +175,7 @@ public static async System.Threading.Tasks.Task Fetch AvailableAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOn - public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnOptions 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 AvailableAddOnResource Fetch( /// The SID of the AvailableAddOn resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOn - 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 FetchAvailableAddOnOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadAvailableAddOnOptions /// Read AvailableAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOn - public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnOptions 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("available_add_ons", response.Content); return new ResourceSet(page, options, client); @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task Fetch InstalledAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnExtensionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnExtensionOptions 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 InstalledAddOnExtensionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathInstalledAddOnSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchInstalledAddOnExtensionOptions(pathInstalledAddOnSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -136,10 +136,10 @@ public static ResourceSet Read(ReadInstalledAdd /// Read InstalledAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOnExtension - public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnExtensionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnExtensionOptions 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("extensions", response.Content); return new ResourceSet(page, options, client); @@ -175,7 +175,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOnExtension #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateInstalledAddOnExtensionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateInstalledAddOnExtensionOptions 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 @@ -303,7 +304,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new UpdateInstalledAddOnExtensionOptions(pathInstalledAddOnSid, pathSid, enabled){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageResource.cs b/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageResource.cs index 0e455976a..d641bfa0e 100644 --- a/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageResource.cs +++ b/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageResource.cs @@ -134,10 +134,10 @@ public static InstalledAddOnUsageResource Create(CreateInstalledAddOnUsageOption /// Create InstalledAddOnUsage parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOnUsage - public static async System.Threading.Tasks.Task CreateAsync(CreateInstalledAddOnUsageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInstalledAddOnUsageOptions 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 @@ -168,7 +168,7 @@ public static async System.Threading.Tasks.Task Cre ITwilioRestClient client = null) { var options = new CreateInstalledAddOnUsageOptions(pathInstalledAddOnSid, marketplaceV1InstalledAddOnInstalledAddOnUsage){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Marketplace/V1/InstalledAddOnResource.cs b/src/Twilio/Rest/Marketplace/V1/InstalledAddOnResource.cs index be3e7716e..09387d7b8 100644 --- a/src/Twilio/Rest/Marketplace/V1/InstalledAddOnResource.cs +++ b/src/Twilio/Rest/Marketplace/V1/InstalledAddOnResource.cs @@ -66,10 +66,10 @@ public static InstalledAddOnResource Create(CreateInstalledAddOnOptions options, /// Create InstalledAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task CreateAsync(CreateInstalledAddOnOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInstalledAddOnOptions 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 CreateAs ITwilioRestClient client = null) { var options = new CreateInstalledAddOnOptions(availableAddOnSid, acceptTermsOfService){ Configuration = configuration, UniqueName = uniqueName }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -149,11 +149,12 @@ public static bool Delete(DeleteInstalledAddOnOptions options, ITwilioRestClient /// Delete InstalledAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task DeleteAsync(DeleteInstalledAddOnOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteInstalledAddOnOptions 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 of the InstalledAddOn resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - 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 DeleteInstalledAddOnOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static InstalledAddOnResource Fetch(FetchInstalledAddOnOptions options, I /// Fetch InstalledAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnOptions 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 InstalledAddOnResource Fetch( /// The SID of the InstalledAddOn resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - 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 FetchInstalledAddOnOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -275,10 +276,10 @@ public static ResourceSet Read(ReadInstalledAddOnOptions /// Read InstalledAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnOptions 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("installed_add_ons", response.Content); return new ResourceSet(page, options, client); @@ -310,7 +311,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateInstalledAddOnOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateInstalledAddOnOptions 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 @@ -436,7 +438,7 @@ public static async System.Threading.Tasks.Task UpdateAs ITwilioRestClient client = null) { var options = new UpdateInstalledAddOnOptions(pathSid){ Configuration = configuration, UniqueName = uniqueName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementResource.cs b/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementResource.cs index 25f3bb701..0e68fbaf4 100644 --- a/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementResource.cs +++ b/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementResource.cs @@ -67,10 +67,10 @@ public static ModuleDataManagementResource Fetch(FetchModuleDataManagementOption /// Fetch ModuleDataManagement parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ModuleDataManagement - public static async System.Threading.Tasks.Task FetchAsync(FetchModuleDataManagementOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchModuleDataManagementOptions 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 ModuleDataManagementResource Fetch( /// The unique identifier of a Listing. /// Client to make requests to Twilio /// Task that resolves to A single instance of ModuleDataManagement - 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 FetchModuleDataManagementOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -132,11 +132,12 @@ public static ModuleDataManagementResource Update(UpdateModuleDataManagementOpti /// Client to make requests to Twilio /// Task that resolves to A single instance of ModuleDataManagement #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateModuleDataManagementOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateModuleDataManagementOptions 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 @@ -191,7 +192,7 @@ public static async System.Threading.Tasks.Task Up ITwilioRestClient client = null) { var options = new UpdateModuleDataManagementOptions(pathSid){ ModuleInfo = moduleInfo, Description = description, Documentation = documentation, Policies = policies, Support = support, Configuration = configuration, Pricing = pricing }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Marketplace/V1/ReferralConversionResource.cs b/src/Twilio/Rest/Marketplace/V1/ReferralConversionResource.cs index 7cfa62133..2ae73ff7f 100644 --- a/src/Twilio/Rest/Marketplace/V1/ReferralConversionResource.cs +++ b/src/Twilio/Rest/Marketplace/V1/ReferralConversionResource.cs @@ -89,10 +89,10 @@ public static ReferralConversionResource Create(CreateReferralConversionOptions /// Create ReferralConversion parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ReferralConversion - public static async System.Threading.Tasks.Task CreateAsync(CreateReferralConversionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateReferralConversionOptions 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 @@ -119,7 +119,7 @@ public static async System.Threading.Tasks.Task Crea ITwilioRestClient client = null) { var options = new CreateReferralConversionOptions(createReferralConversionRequest){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpResource.cs b/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpResource.cs index 3260146db..3a030d349 100644 --- a/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpResource.cs +++ b/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpResource.cs @@ -68,10 +68,10 @@ public static BrandRegistrationOtpResource Create(CreateBrandRegistrationOtpOpti /// Create BrandRegistrationOtp parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandRegistrationOtp - public static async System.Threading.Tasks.Task CreateAsync(CreateBrandRegistrationOtpOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateBrandRegistrationOtpOptions 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 @@ -98,7 +98,7 @@ public static async System.Threading.Tasks.Task Cr ITwilioRestClient client = null) { var options = new CreateBrandRegistrationOtpOptions(pathBrandRegistrationSid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingResource.cs b/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingResource.cs index 7d8ff153f..793b8a29c 100644 --- a/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingResource.cs +++ b/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingResource.cs @@ -80,10 +80,10 @@ public static BrandVettingResource Create(CreateBrandVettingOptions options, ITw /// Create BrandVetting parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandVetting - public static async System.Threading.Tasks.Task CreateAsync(CreateBrandVettingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateBrandVettingOptions 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 @@ -118,7 +118,7 @@ public static async System.Threading.Tasks.Task CreateAsyn ITwilioRestClient client = null) { var options = new CreateBrandVettingOptions(pathBrandSid, vettingProvider){ VettingId = vettingId }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -157,10 +157,10 @@ public static BrandVettingResource Fetch(FetchBrandVettingOptions options, ITwil /// Fetch BrandVetting parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandVetting - public static async System.Threading.Tasks.Task FetchAsync(FetchBrandVettingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchBrandVettingOptions 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 @@ -187,7 +187,7 @@ public static BrandVettingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathBrandSid, string pathBrandVettingSid, ITwilioRestClient client = null) { var options = new FetchBrandVettingOptions(pathBrandSid, pathBrandVettingSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -224,10 +224,10 @@ public static ResourceSet Read(ReadBrandVettingOptions opt /// Read BrandVetting parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandVetting - public static async System.Threading.Tasks.Task> ReadAsync(ReadBrandVettingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBrandVettingOptions 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("data", response.Content); return new ResourceSet(page, options, client); @@ -267,7 +267,7 @@ public static async System.Threading.Tasks.Task Create BrandRegistration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandRegistration - public static async System.Threading.Tasks.Task CreateAsync(CreateBrandRegistrationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateBrandRegistrationOptions 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 @@ -159,7 +159,7 @@ public static async System.Threading.Tasks.Task Creat ITwilioRestClient client = null) { var options = new CreateBrandRegistrationOptions(customerProfileBundleSid, a2PProfileBundleSid){ BrandType = brandType, Mock = mock, SkipAutomaticSecVet = skipAutomaticSecVet }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -196,10 +196,10 @@ public static BrandRegistrationResource Fetch(FetchBrandRegistrationOptions opti /// Fetch BrandRegistration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandRegistration - public static async System.Threading.Tasks.Task FetchAsync(FetchBrandRegistrationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchBrandRegistrationOptions 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 @@ -220,10 +220,10 @@ public static BrandRegistrationResource Fetch( /// The SID of the Brand Registration resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandRegistration - 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 FetchBrandRegistrationOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -258,10 +258,10 @@ public static ResourceSet Read(ReadBrandRegistrationO /// Read BrandRegistration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandRegistration - public static async System.Threading.Tasks.Task> ReadAsync(ReadBrandRegistrationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBrandRegistrationOptions 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("data", response.Content); return new ResourceSet(page, options, client); @@ -293,7 +293,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of BrandRegistration #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateBrandRegistrationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateBrandRegistrationOptions 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 @@ -411,7 +412,7 @@ public static async System.Threading.Tasks.Task Updat ITwilioRestClient client = null) { var options = new UpdateBrandRegistrationOptions(pathSid){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/DeactivationsResource.cs b/src/Twilio/Rest/Messaging/V1/DeactivationsResource.cs index 85e876f25..4701c4dc3 100644 --- a/src/Twilio/Rest/Messaging/V1/DeactivationsResource.cs +++ b/src/Twilio/Rest/Messaging/V1/DeactivationsResource.cs @@ -65,10 +65,10 @@ public static DeactivationsResource Fetch(FetchDeactivationsOptions options, ITw /// Fetch Deactivations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Deactivations - public static async System.Threading.Tasks.Task FetchAsync(FetchDeactivationsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDeactivationsOptions 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 @@ -92,7 +92,7 @@ public static DeactivationsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(DateTime? date = null, ITwilioRestClient client = null) { var options = new FetchDeactivationsOptions(){ Date = date }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/DomainCertsResource.cs b/src/Twilio/Rest/Messaging/V1/DomainCertsResource.cs index 612144c0f..03bae5160 100644 --- a/src/Twilio/Rest/Messaging/V1/DomainCertsResource.cs +++ b/src/Twilio/Rest/Messaging/V1/DomainCertsResource.cs @@ -71,11 +71,12 @@ public static bool Delete(DeleteDomainCertsOptions options, ITwilioRestClient cl /// Delete DomainCerts parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainCerts - public static async System.Threading.Tasks.Task DeleteAsync(DeleteDomainCertsOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteDomainCertsOptions 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 @@ -95,10 +96,10 @@ public static bool Delete(string pathDomainSid, ITwilioRestClient client = null) /// Unique string used to identify the domain that this certificate should be associated with. /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainCerts - public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new DeleteDomainCertsOptions(pathDomainSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -135,10 +136,10 @@ public static DomainCertsResource Fetch(FetchDomainCertsOptions options, ITwilio /// Fetch DomainCerts parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainCerts - public static async System.Threading.Tasks.Task FetchAsync(FetchDomainCertsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDomainCertsOptions 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 @@ -159,10 +160,10 @@ public static DomainCertsResource Fetch( /// Unique string used to identify the domain that this certificate should be associated with. /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainCerts - public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchDomainCertsOptions(pathDomainSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -200,11 +201,12 @@ public static DomainCertsResource Update(UpdateDomainCertsOptions options, ITwil /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainCerts #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateDomainCertsOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateDomainCertsOptions 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 @@ -235,7 +237,7 @@ public static async System.Threading.Tasks.Task UpdateAsync ITwilioRestClient client = null) { var options = new UpdateDomainCertsOptions(pathDomainSid, tlsCert){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceResource.cs b/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceResource.cs index 60ad7e7d8..12fc48a87 100644 --- a/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceResource.cs +++ b/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceResource.cs @@ -67,10 +67,10 @@ public static DomainConfigMessagingServiceResource Fetch(FetchDomainConfigMessag /// Fetch DomainConfigMessagingService parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainConfigMessagingService - public static async System.Threading.Tasks.Task FetchAsync(FetchDomainConfigMessagingServiceOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDomainConfigMessagingServiceOptions 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 DomainConfigMessagingServiceResource Fetch( /// Unique string used to identify the Messaging service that this domain should be associated with. /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainConfigMessagingService - public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchDomainConfigMessagingServiceOptions(pathMessagingServiceSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/DomainConfigResource.cs b/src/Twilio/Rest/Messaging/V1/DomainConfigResource.cs index ddbf141d0..21eb9cd71 100644 --- a/src/Twilio/Rest/Messaging/V1/DomainConfigResource.cs +++ b/src/Twilio/Rest/Messaging/V1/DomainConfigResource.cs @@ -67,10 +67,10 @@ public static DomainConfigResource Fetch(FetchDomainConfigOptions options, ITwil /// Fetch DomainConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainConfig - public static async System.Threading.Tasks.Task FetchAsync(FetchDomainConfigOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDomainConfigOptions 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 DomainConfigResource Fetch( /// Unique string used to identify the domain that this config should be associated with. /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainConfig - public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchDomainConfigOptions(pathDomainSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -132,11 +132,12 @@ public static DomainConfigResource Update(UpdateDomainConfigOptions options, ITw /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainConfig #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateDomainConfigOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateDomainConfigOptions 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 @@ -179,7 +180,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn ITwilioRestClient client = null) { var options = new UpdateDomainConfigOptions(pathDomainSid){ FallbackUrl = fallbackUrl, CallbackUrl = callbackUrl, ContinueOnFailure = continueOnFailure, DisableHttps = disableHttps }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/ExternalCampaignResource.cs b/src/Twilio/Rest/Messaging/V1/ExternalCampaignResource.cs index f624a357e..b7560de21 100644 --- a/src/Twilio/Rest/Messaging/V1/ExternalCampaignResource.cs +++ b/src/Twilio/Rest/Messaging/V1/ExternalCampaignResource.cs @@ -66,10 +66,10 @@ public static ExternalCampaignResource Create(CreateExternalCampaignOptions opti /// Create ExternalCampaign parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ExternalCampaign - public static async System.Threading.Tasks.Task CreateAsync(CreateExternalCampaignOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateExternalCampaignOptions 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 @@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task Create ITwilioRestClient client = null) { var options = new CreateExternalCampaignOptions(campaignId, messagingServiceSid){ CnpMigration = cnpMigration }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationResource.cs b/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationResource.cs index dbd763370..0ad2adbe3 100644 --- a/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationResource.cs +++ b/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationResource.cs @@ -67,10 +67,10 @@ public static LinkshorteningMessagingServiceDomainAssociationResource Fetch(Fetc /// Fetch LinkshorteningMessagingServiceDomainAssociation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of LinkshorteningMessagingServiceDomainAssociation - public static async System.Threading.Tasks.Task FetchAsync(FetchLinkshorteningMessagingServiceDomainAssociationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchLinkshorteningMessagingServiceDomainAssociationOptions 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 LinkshorteningMessagingServiceDomainAssociationResource Fetch( /// Unique string used to identify the Messaging service that this domain should be associated with. /// Client to make requests to Twilio /// Task that resolves to A single instance of LinkshorteningMessagingServiceDomainAssociation - public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchLinkshorteningMessagingServiceDomainAssociationOptions(pathMessagingServiceSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceResource.cs b/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceResource.cs index a3a871265..4117d4cd2 100644 --- a/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceResource.cs +++ b/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceResource.cs @@ -70,10 +70,10 @@ public static LinkshorteningMessagingServiceResource Create(CreateLinkshortening /// Create LinkshorteningMessagingService parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of LinkshorteningMessagingService - public static async System.Threading.Tasks.Task CreateAsync(CreateLinkshorteningMessagingServiceOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateLinkshorteningMessagingServiceOptions 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 @@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task Delete LinkshorteningMessagingService parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of LinkshorteningMessagingService - public static async System.Threading.Tasks.Task DeleteAsync(DeleteLinkshorteningMessagingServiceOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteLinkshorteningMessagingServiceOptions 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 @@ -176,7 +177,7 @@ public static bool Delete(string pathDomainSid, string pathMessagingServiceSid, public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathMessagingServiceSid, ITwilioRestClient client = null) { var options = new DeleteLinkshorteningMessagingServiceOptions(pathDomainSid, pathMessagingServiceSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/RequestManagedCertResource.cs b/src/Twilio/Rest/Messaging/V1/RequestManagedCertResource.cs index 2bd3a332c..fc3277152 100644 --- a/src/Twilio/Rest/Messaging/V1/RequestManagedCertResource.cs +++ b/src/Twilio/Rest/Messaging/V1/RequestManagedCertResource.cs @@ -68,11 +68,12 @@ public static RequestManagedCertResource Update(UpdateRequestManagedCertOptions /// Client to make requests to Twilio /// Task that resolves to A single instance of RequestManagedCert #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateRequestManagedCertOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateRequestManagedCertOptions 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 @@ -99,7 +100,7 @@ public static async System.Threading.Tasks.Task Upda ITwilioRestClient client = null) { var options = new UpdateRequestManagedCertOptions(pathDomainSid){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderResource.cs b/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderResource.cs index cb3b90212..a5e51d624 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderResource.cs +++ b/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderResource.cs @@ -68,10 +68,10 @@ public static AlphaSenderResource Create(CreateAlphaSenderOptions options, ITwil /// Create AlphaSender parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AlphaSender - public static async System.Threading.Tasks.Task CreateAsync(CreateAlphaSenderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAlphaSenderOptions 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 CreateAlphaSenderOptions(pathServiceSid, alphaSender){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteAlphaSenderOptions options, ITwilioRestClient cl /// Delete AlphaSender parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AlphaSender - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAlphaSenderOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAlphaSenderOptions 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 DeleteAlphaSenderOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static AlphaSenderResource Fetch(FetchAlphaSenderOptions options, ITwilio /// Fetch AlphaSender parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AlphaSender - public static async System.Threading.Tasks.Task FetchAsync(FetchAlphaSenderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAlphaSenderOptions 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 AlphaSenderResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchAlphaSenderOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadAlphaSenderOptions optio /// Read AlphaSender parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AlphaSender - public static async System.Threading.Tasks.Task> ReadAsync(ReadAlphaSenderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAlphaSenderOptions 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("alpha_senders", response.Content); return new ResourceSet(page, options, client); @@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadAlphaSenderOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderResource.cs b/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderResource.cs index f4e88e55a..99bb398e3 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderResource.cs +++ b/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderResource.cs @@ -68,10 +68,10 @@ public static ChannelSenderResource Create(CreateChannelSenderOptions options, I /// Create ChannelSender parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ChannelSender - public static async System.Threading.Tasks.Task CreateAsync(CreateChannelSenderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateChannelSenderOptions 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 CreateAsy ITwilioRestClient client = null) { var options = new CreateChannelSenderOptions(pathMessagingServiceSid, sid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteChannelSenderOptions options, ITwilioRestClient /// Delete ChannelSender parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ChannelSender - public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelSenderOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelSenderOptions 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 pathMessagingServiceSid, string pathSid, ITwili public static async System.Threading.Tasks.Task DeleteAsync(string pathMessagingServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteChannelSenderOptions(pathMessagingServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static ChannelSenderResource Fetch(FetchChannelSenderOptions options, ITw /// Fetch ChannelSender parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ChannelSender - public static async System.Threading.Tasks.Task FetchAsync(FetchChannelSenderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchChannelSenderOptions 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 ChannelSenderResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchChannelSenderOptions(pathMessagingServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadChannelSenderOptions o /// Read ChannelSender parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ChannelSender - public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelSenderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelSenderOptions 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("senders", response.Content); return new ResourceSet(page, options, client); @@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task Create PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task CreateAsync(CreatePhoneNumberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreatePhoneNumberOptions 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 CreatePhoneNumberOptions(pathServiceSid, phoneNumberSid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeletePhoneNumberOptions options, ITwilioRestClient cl /// Delete PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task DeleteAsync(DeletePhoneNumberOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeletePhoneNumberOptions 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 DeletePhoneNumberOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,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 @@ -243,7 +244,7 @@ public static PhoneNumberResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchPhoneNumberOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadPhoneNumberOptions optio /// Read PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task> ReadAsync(ReadPhoneNumberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPhoneNumberOptions 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("phone_numbers", response.Content); return new ResourceSet(page, options, client); @@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadPhoneNumberOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/Service/ShortCodeResource.cs b/src/Twilio/Rest/Messaging/V1/Service/ShortCodeResource.cs index 794f354e9..c21c8e690 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/ShortCodeResource.cs +++ b/src/Twilio/Rest/Messaging/V1/Service/ShortCodeResource.cs @@ -68,10 +68,10 @@ public static ShortCodeResource Create(CreateShortCodeOptions options, ITwilioRe /// Create ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task CreateAsync(CreateShortCodeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateShortCodeOptions 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 CreateShortCodeOptions(pathServiceSid, shortCodeSid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteShortCodeOptions options, ITwilioRestClient clie /// Delete ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task DeleteAsync(DeleteShortCodeOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteShortCodeOptions 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 DeleteShortCodeOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static ShortCodeResource Fetch(FetchShortCodeOptions options, ITwilioRest /// Fetch ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task FetchAsync(FetchShortCodeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchShortCodeOptions 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 ShortCodeResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchShortCodeOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadShortCodeOptions options, /// Read ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task> ReadAsync(ReadShortCodeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadShortCodeOptions 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("short_codes", response.Content); return new ResourceSet(page, options, client); @@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadShortCodeOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonResource.cs b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonResource.cs index 5385c1bd1..f601aa69e 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonResource.cs +++ b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonResource.cs @@ -68,10 +68,10 @@ public static UsAppToPersonResource Create(CreateUsAppToPersonOptions options, I /// Create UsAppToPerson parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsAppToPerson - public static async System.Threading.Tasks.Task CreateAsync(CreateUsAppToPersonOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateUsAppToPersonOptions 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 @@ -162,7 +162,7 @@ public static async System.Threading.Tasks.Task CreateAsy ITwilioRestClient client = null) { var options = new CreateUsAppToPersonOptions(pathMessagingServiceSid, brandRegistrationSid, description, messageFlow, messageSamples, usAppToPersonUsecase, hasEmbeddedLinks, hasEmbeddedPhone){ OptInMessage = optInMessage, OptOutMessage = optOutMessage, HelpMessage = helpMessage, OptInKeywords = optInKeywords, OptOutKeywords = optOutKeywords, HelpKeywords = helpKeywords, SubscriberOptIn = subscriberOptIn, AgeGated = ageGated, DirectLending = directLending }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -205,11 +205,12 @@ public static bool Delete(DeleteUsAppToPersonOptions options, ITwilioRestClient /// Delete UsAppToPerson parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsAppToPerson - public static async System.Threading.Tasks.Task DeleteAsync(DeleteUsAppToPersonOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteUsAppToPersonOptions 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 @@ -234,7 +235,7 @@ public static bool Delete(string pathMessagingServiceSid, string pathSid, ITwili public static async System.Threading.Tasks.Task DeleteAsync(string pathMessagingServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteUsAppToPersonOptions(pathMessagingServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -273,10 +274,10 @@ public static UsAppToPersonResource Fetch(FetchUsAppToPersonOptions options, ITw /// Fetch UsAppToPerson parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsAppToPerson - public static async System.Threading.Tasks.Task FetchAsync(FetchUsAppToPersonOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchUsAppToPersonOptions 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 @@ -303,7 +304,7 @@ public static UsAppToPersonResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchUsAppToPersonOptions(pathMessagingServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -340,10 +341,10 @@ public static ResourceSet Read(ReadUsAppToPersonOptions o /// Read UsAppToPerson parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsAppToPerson - public static async System.Threading.Tasks.Task> ReadAsync(ReadUsAppToPersonOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUsAppToPersonOptions 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("compliance", response.Content); return new ResourceSet(page, options, client); @@ -379,7 +380,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of UsAppToPerson #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateUsAppToPersonOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateUsAppToPersonOptions 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 @@ -531,7 +533,7 @@ public static async System.Threading.Tasks.Task UpdateAsy ITwilioRestClient client = null) { var options = new UpdateUsAppToPersonOptions(pathMessagingServiceSid, pathSid, hasEmbeddedLinks, hasEmbeddedPhone, messageSamples, messageFlow, description, ageGated, directLending){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseResource.cs b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseResource.cs index 1dae1619e..8004cdaff 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseResource.cs +++ b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseResource.cs @@ -67,10 +67,10 @@ public static UsAppToPersonUsecaseResource Fetch(FetchUsAppToPersonUsecaseOption /// Fetch UsAppToPersonUsecase parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsAppToPersonUsecase - public static async System.Threading.Tasks.Task FetchAsync(FetchUsAppToPersonUsecaseOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchUsAppToPersonUsecaseOptions 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 @@ -97,7 +97,7 @@ public static UsAppToPersonUsecaseResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, string brandRegistrationSid = null, ITwilioRestClient client = null) { var options = new FetchUsAppToPersonUsecaseOptions(pathMessagingServiceSid){ BrandRegistrationSid = brandRegistrationSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/ServiceResource.cs b/src/Twilio/Rest/Messaging/V1/ServiceResource.cs index ecec72256..f13681cee 100644 --- a/src/Twilio/Rest/Messaging/V1/ServiceResource.cs +++ b/src/Twilio/Rest/Messaging/V1/ServiceResource.cs @@ -80,10 +80,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 @@ -170,7 +170,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateServiceOptions(friendlyName){ InboundRequestUrl = inboundRequestUrl, InboundMethod = inboundMethod, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StickySender = stickySender, MmsConverter = mmsConverter, SmartEncoding = smartEncoding, ScanMessageContent = scanMessageContent, FallbackToLongCode = fallbackToLongCode, AreaCodeGeomatch = areaCodeGeomatch, ValidityPeriod = validityPeriod, SynchronousValidation = synchronousValidation, Usecase = usecase, UseInboundWebhookOnNumber = useInboundWebhookOnNumber }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -211,11 +211,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 @@ -235,10 +236,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID 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 @@ -275,10 +276,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 @@ -299,10 +300,10 @@ public static ServiceResource Fetch( /// The SID 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 @@ -337,10 +338,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); @@ -372,7 +373,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 @@ -459,11 +460,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 @@ -554,7 +556,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, InboundRequestUrl = inboundRequestUrl, InboundMethod = inboundMethod, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StickySender = stickySender, MmsConverter = mmsConverter, SmartEncoding = smartEncoding, ScanMessageContent = scanMessageContent, FallbackToLongCode = fallbackToLongCode, AreaCodeGeomatch = areaCodeGeomatch, ValidityPeriod = validityPeriod, SynchronousValidation = synchronousValidation, Usecase = usecase, UseInboundWebhookOnNumber = useInboundWebhookOnNumber }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs b/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs index 4795bf179..adee6b799 100644 --- a/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs +++ b/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs @@ -98,10 +98,10 @@ public static TollfreeVerificationResource Create(CreateTollfreeVerificationOpti /// Create TollfreeVerification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TollfreeVerification - public static async System.Threading.Tasks.Task CreateAsync(CreateTollfreeVerificationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateTollfreeVerificationOptions 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 @@ -216,7 +216,7 @@ public static async System.Threading.Tasks.Task Cr ITwilioRestClient client = null) { var options = new CreateTollfreeVerificationOptions(businessName, businessWebsite, notificationEmail, useCaseCategories, useCaseSummary, productionMessageSample, optInImageUrls, optInType, messageVolume, tollfreePhoneNumberSid){ CustomerProfileSid = customerProfileSid, BusinessStreetAddress = businessStreetAddress, BusinessStreetAddress2 = businessStreetAddress2, BusinessCity = businessCity, BusinessStateProvinceRegion = businessStateProvinceRegion, BusinessPostalCode = businessPostalCode, BusinessCountry = businessCountry, AdditionalInformation = additionalInformation, BusinessContactFirstName = businessContactFirstName, BusinessContactLastName = businessContactLastName, BusinessContactEmail = businessContactEmail, BusinessContactPhone = businessContactPhone, ExternalReferenceId = externalReferenceId }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -257,11 +257,12 @@ public static bool Delete(DeleteTollfreeVerificationOptions options, ITwilioRest /// Delete TollfreeVerification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TollfreeVerification - public static async System.Threading.Tasks.Task DeleteAsync(DeleteTollfreeVerificationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteTollfreeVerificationOptions 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 @@ -281,10 +282,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string to identify Tollfree Verification. /// Client to make requests to Twilio /// Task that resolves to A single instance of TollfreeVerification - 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 DeleteTollfreeVerificationOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -321,10 +322,10 @@ public static TollfreeVerificationResource Fetch(FetchTollfreeVerificationOption /// Fetch TollfreeVerification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TollfreeVerification - public static async System.Threading.Tasks.Task FetchAsync(FetchTollfreeVerificationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTollfreeVerificationOptions 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 @@ -345,10 +346,10 @@ public static TollfreeVerificationResource Fetch( /// A unique string identifying a Tollfree Verification. /// Client to make requests to Twilio /// Task that resolves to A single instance of TollfreeVerification - 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 FetchTollfreeVerificationOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -383,10 +384,10 @@ public static ResourceSet Read(ReadTollfreeVerific /// Read TollfreeVerification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TollfreeVerification - public static async System.Threading.Tasks.Task> ReadAsync(ReadTollfreeVerificationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTollfreeVerificationOptions 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("verifications", response.Content); return new ResourceSet(page, options, client); @@ -434,7 +435,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of TollfreeVerification #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateTollfreeVerificationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateTollfreeVerificationOptions 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 @@ -636,7 +638,7 @@ public static async System.Threading.Tasks.Task Up ITwilioRestClient client = null) { var options = new UpdateTollfreeVerificationOptions(pathSid){ BusinessName = businessName, BusinessWebsite = businessWebsite, NotificationEmail = notificationEmail, UseCaseCategories = useCaseCategories, UseCaseSummary = useCaseSummary, ProductionMessageSample = productionMessageSample, OptInImageUrls = optInImageUrls, OptInType = optInType, MessageVolume = messageVolume, BusinessStreetAddress = businessStreetAddress, BusinessStreetAddress2 = businessStreetAddress2, BusinessCity = businessCity, BusinessStateProvinceRegion = businessStateProvinceRegion, BusinessPostalCode = businessPostalCode, BusinessCountry = businessCountry, AdditionalInformation = additionalInformation, BusinessContactFirstName = businessContactFirstName, BusinessContactLastName = businessContactLastName, BusinessContactEmail = businessContactEmail, BusinessContactPhone = businessContactPhone, EditReason = editReason }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Messaging/V1/UsecaseResource.cs b/src/Twilio/Rest/Messaging/V1/UsecaseResource.cs index 1d96093df..ae406cdc7 100644 --- a/src/Twilio/Rest/Messaging/V1/UsecaseResource.cs +++ b/src/Twilio/Rest/Messaging/V1/UsecaseResource.cs @@ -65,10 +65,10 @@ public static UsecaseResource Fetch(FetchUsecaseOptions options, ITwilioRestClie /// Fetch Usecase parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Usecase - public static async System.Threading.Tasks.Task FetchAsync(FetchUsecaseOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchUsecaseOptions 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 @@ -86,10 +86,10 @@ public static UsecaseResource Fetch( /// fetch /// Client to make requests to Twilio /// Task that resolves to A single instance of Usecase - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchUsecaseOptions(){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Microvisor/V1/AccountConfigResource.cs b/src/Twilio/Rest/Microvisor/V1/AccountConfigResource.cs index 333420b42..10393808b 100644 --- a/src/Twilio/Rest/Microvisor/V1/AccountConfigResource.cs +++ b/src/Twilio/Rest/Microvisor/V1/AccountConfigResource.cs @@ -66,10 +66,10 @@ public static AccountConfigResource Create(CreateAccountConfigOptions options, I /// Create AccountConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountConfig - public static async System.Threading.Tasks.Task CreateAsync(CreateAccountConfigOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAccountConfigOptions 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 @@ -100,7 +100,7 @@ public static async System.Threading.Tasks.Task CreateAsy ITwilioRestClient client = null) { var options = new CreateAccountConfigOptions(key, value){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -141,11 +141,12 @@ public static bool Delete(DeleteAccountConfigOptions options, ITwilioRestClient /// Delete AccountConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountConfig - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAccountConfigOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAccountConfigOptions 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 @@ -165,10 +166,10 @@ public static bool Delete(string pathKey, ITwilioRestClient client = null) /// The config key; up to 100 characters. /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountConfig - public static async System.Threading.Tasks.Task DeleteAsync(string pathKey, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathKey, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new DeleteAccountConfigOptions(pathKey) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -205,10 +206,10 @@ public static AccountConfigResource Fetch(FetchAccountConfigOptions options, ITw /// Fetch AccountConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountConfig - public static async System.Threading.Tasks.Task FetchAsync(FetchAccountConfigOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAccountConfigOptions 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 @@ -229,10 +230,10 @@ public static AccountConfigResource Fetch( /// The config key; up to 100 characters. /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountConfig - public static async System.Threading.Tasks.Task FetchAsync(string pathKey, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathKey, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchAccountConfigOptions(pathKey){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -267,10 +268,10 @@ public static ResourceSet Read(ReadAccountConfigOptions o /// Read AccountConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountConfig - public static async System.Threading.Tasks.Task> ReadAsync(ReadAccountConfigOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAccountConfigOptions 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("configs", response.Content); return new ResourceSet(page, options, client); @@ -302,7 +303,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of AccountConfig #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAccountConfigOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateAccountConfigOptions 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 @@ -424,7 +426,7 @@ public static async System.Threading.Tasks.Task UpdateAsy ITwilioRestClient client = null) { var options = new UpdateAccountConfigOptions(pathKey, value){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Microvisor/V1/AccountSecretResource.cs b/src/Twilio/Rest/Microvisor/V1/AccountSecretResource.cs index df6dd4c08..88f34a95f 100644 --- a/src/Twilio/Rest/Microvisor/V1/AccountSecretResource.cs +++ b/src/Twilio/Rest/Microvisor/V1/AccountSecretResource.cs @@ -66,10 +66,10 @@ public static AccountSecretResource Create(CreateAccountSecretOptions options, I /// Create AccountSecret parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountSecret - public static async System.Threading.Tasks.Task CreateAsync(CreateAccountSecretOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAccountSecretOptions 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 @@ -100,7 +100,7 @@ public static async System.Threading.Tasks.Task CreateAsy ITwilioRestClient client = null) { var options = new CreateAccountSecretOptions(key, value){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -141,11 +141,12 @@ public static bool Delete(DeleteAccountSecretOptions options, ITwilioRestClient /// Delete AccountSecret parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountSecret - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAccountSecretOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAccountSecretOptions 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 @@ -165,10 +166,10 @@ public static bool Delete(string pathKey, ITwilioRestClient client = null) /// The secret key; up to 100 characters. /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountSecret - public static async System.Threading.Tasks.Task DeleteAsync(string pathKey, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathKey, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new DeleteAccountSecretOptions(pathKey) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -205,10 +206,10 @@ public static AccountSecretResource Fetch(FetchAccountSecretOptions options, ITw /// Fetch AccountSecret parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountSecret - public static async System.Threading.Tasks.Task FetchAsync(FetchAccountSecretOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAccountSecretOptions 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 @@ -229,10 +230,10 @@ public static AccountSecretResource Fetch( /// The secret key; up to 100 characters. /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountSecret - public static async System.Threading.Tasks.Task FetchAsync(string pathKey, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathKey, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchAccountSecretOptions(pathKey){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -267,10 +268,10 @@ public static ResourceSet Read(ReadAccountSecretOptions o /// Read AccountSecret parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountSecret - public static async System.Threading.Tasks.Task> ReadAsync(ReadAccountSecretOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAccountSecretOptions 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("secrets", response.Content); return new ResourceSet(page, options, client); @@ -302,7 +303,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of AccountSecret #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAccountSecretOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateAccountSecretOptions 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 @@ -424,7 +426,7 @@ public static async System.Threading.Tasks.Task UpdateAsy ITwilioRestClient client = null) { var options = new UpdateAccountSecretOptions(pathKey, value){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Microvisor/V1/App/AppManifestResource.cs b/src/Twilio/Rest/Microvisor/V1/App/AppManifestResource.cs index 8ab486cdd..c3422eabd 100644 --- a/src/Twilio/Rest/Microvisor/V1/App/AppManifestResource.cs +++ b/src/Twilio/Rest/Microvisor/V1/App/AppManifestResource.cs @@ -67,10 +67,10 @@ public static AppManifestResource Fetch(FetchAppManifestOptions options, ITwilio /// Fetch AppManifest parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AppManifest - public static async System.Threading.Tasks.Task FetchAsync(FetchAppManifestOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAppManifestOptions 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 AppManifestResource Fetch( /// A 34-character string that uniquely identifies this App. /// Client to make requests to Twilio /// Task that resolves to A single instance of AppManifest - public static async System.Threading.Tasks.Task FetchAsync(string pathAppSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathAppSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchAppManifestOptions(pathAppSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Microvisor/V1/AppResource.cs b/src/Twilio/Rest/Microvisor/V1/AppResource.cs index a5d491e50..3a907c55d 100644 --- a/src/Twilio/Rest/Microvisor/V1/AppResource.cs +++ b/src/Twilio/Rest/Microvisor/V1/AppResource.cs @@ -71,11 +71,12 @@ public static bool Delete(DeleteAppOptions options, ITwilioRestClient client = n /// Delete App parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of App - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAppOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAppOptions 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 @@ -95,10 +96,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34-character string that uniquely identifies this App. /// Client to make requests to Twilio /// Task that resolves to A single instance of App - 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 DeleteAppOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -135,10 +136,10 @@ public static AppResource Fetch(FetchAppOptions options, ITwilioRestClient clien /// Fetch App parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of App - public static async System.Threading.Tasks.Task FetchAsync(FetchAppOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAppOptions 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 @@ -159,10 +160,10 @@ public static AppResource Fetch( /// A 34-character string that uniquely identifies this App. /// Client to make requests to Twilio /// Task that resolves to A single instance of App - 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 FetchAppOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -197,10 +198,10 @@ public static ResourceSet Read(ReadAppOptions options, ITwilioRestC /// Read App parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of App - public static async System.Threading.Tasks.Task> ReadAsync(ReadAppOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAppOptions 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("apps", response.Content); return new ResourceSet(page, options, client); @@ -232,7 +233,7 @@ public static async System.Threading.Tasks.Task> ReadAs ITwilioRestClient client = null) { var options = new ReadAppOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigResource.cs b/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigResource.cs index 2d4ecf094..f89621dc0 100644 --- a/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigResource.cs +++ b/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigResource.cs @@ -68,10 +68,10 @@ public static DeviceConfigResource Create(CreateDeviceConfigOptions options, ITw /// Create DeviceConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceConfig - public static async System.Threading.Tasks.Task CreateAsync(CreateDeviceConfigOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateDeviceConfigOptions 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 CreateAsyn ITwilioRestClient client = null) { var options = new CreateDeviceConfigOptions(pathDeviceSid, key, value){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -149,11 +149,12 @@ public static bool Delete(DeleteDeviceConfigOptions options, ITwilioRestClient c /// Delete DeviceConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceConfig - public static async System.Threading.Tasks.Task DeleteAsync(DeleteDeviceConfigOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteDeviceConfigOptions 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 pathDeviceSid, string pathKey, ITwilioRestClien public static async System.Threading.Tasks.Task DeleteAsync(string pathDeviceSid, string pathKey, ITwilioRestClient client = null) { var options = new DeleteDeviceConfigOptions(pathDeviceSid, pathKey) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -217,10 +218,10 @@ public static DeviceConfigResource Fetch(FetchDeviceConfigOptions options, ITwil /// Fetch DeviceConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceConfig - public static async System.Threading.Tasks.Task FetchAsync(FetchDeviceConfigOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDeviceConfigOptions 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 DeviceConfigResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathDeviceSid, string pathKey, ITwilioRestClient client = null) { var options = new FetchDeviceConfigOptions(pathDeviceSid, pathKey){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +285,10 @@ public static ResourceSet Read(ReadDeviceConfigOptions opt /// Read DeviceConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceConfig - public static async System.Threading.Tasks.Task> ReadAsync(ReadDeviceConfigOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDeviceConfigOptions 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("configs", response.Content); return new ResourceSet(page, options, client); @@ -323,7 +324,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of DeviceConfig #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateDeviceConfigOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateDeviceConfigOptions 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 @@ -451,7 +453,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn ITwilioRestClient client = null) { var options = new UpdateDeviceConfigOptions(pathDeviceSid, pathKey, value){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretResource.cs b/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretResource.cs index 03a37d9f8..a0a2c0136 100644 --- a/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretResource.cs +++ b/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretResource.cs @@ -68,10 +68,10 @@ public static DeviceSecretResource Create(CreateDeviceSecretOptions options, ITw /// Create DeviceSecret parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceSecret - public static async System.Threading.Tasks.Task CreateAsync(CreateDeviceSecretOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateDeviceSecretOptions 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 CreateAsyn ITwilioRestClient client = null) { var options = new CreateDeviceSecretOptions(pathDeviceSid, key, value){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -149,11 +149,12 @@ public static bool Delete(DeleteDeviceSecretOptions options, ITwilioRestClient c /// Delete DeviceSecret parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceSecret - public static async System.Threading.Tasks.Task DeleteAsync(DeleteDeviceSecretOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteDeviceSecretOptions 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 pathDeviceSid, string pathKey, ITwilioRestClien public static async System.Threading.Tasks.Task DeleteAsync(string pathDeviceSid, string pathKey, ITwilioRestClient client = null) { var options = new DeleteDeviceSecretOptions(pathDeviceSid, pathKey) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -217,10 +218,10 @@ public static DeviceSecretResource Fetch(FetchDeviceSecretOptions options, ITwil /// Fetch DeviceSecret parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceSecret - public static async System.Threading.Tasks.Task FetchAsync(FetchDeviceSecretOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDeviceSecretOptions 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 DeviceSecretResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathDeviceSid, string pathKey, ITwilioRestClient client = null) { var options = new FetchDeviceSecretOptions(pathDeviceSid, pathKey){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +285,10 @@ public static ResourceSet Read(ReadDeviceSecretOptions opt /// Read DeviceSecret parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceSecret - public static async System.Threading.Tasks.Task> ReadAsync(ReadDeviceSecretOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDeviceSecretOptions 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("secrets", response.Content); return new ResourceSet(page, options, client); @@ -323,7 +324,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of DeviceSecret #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateDeviceSecretOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateDeviceSecretOptions 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 @@ -451,7 +453,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn ITwilioRestClient client = null) { var options = new UpdateDeviceSecretOptions(pathDeviceSid, pathKey, value){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Microvisor/V1/DeviceResource.cs b/src/Twilio/Rest/Microvisor/V1/DeviceResource.cs index 54097867a..dcae1b63f 100644 --- a/src/Twilio/Rest/Microvisor/V1/DeviceResource.cs +++ b/src/Twilio/Rest/Microvisor/V1/DeviceResource.cs @@ -67,10 +67,10 @@ public static DeviceResource Fetch(FetchDeviceOptions options, ITwilioRestClient /// Fetch Device parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Device - public static async System.Threading.Tasks.Task FetchAsync(FetchDeviceOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDeviceOptions 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 DeviceResource Fetch( /// A 34-character string that uniquely identifies this Device. /// Client to make requests to Twilio /// Task that resolves to A single instance of Device - 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 FetchDeviceOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadDeviceOptions options, ITwili /// Read Device parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Device - public static async System.Threading.Tasks.Task> ReadAsync(ReadDeviceOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDeviceOptions 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("devices", response.Content); return new ResourceSet(page, options, client); @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadDeviceOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -251,11 +251,12 @@ public static DeviceResource Update(UpdateDeviceOptions options, ITwilioRestClie /// Client to make requests to Twilio /// Task that resolves to A single instance of Device #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateDeviceOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateDeviceOptions 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 @@ -298,7 +299,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateDeviceOptions(pathSid){ UniqueName = uniqueName, TargetApp = targetApp, LoggingEnabled = loggingEnabled, RestartApp = restartApp }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Monitor/V1/AlertResource.cs b/src/Twilio/Rest/Monitor/V1/AlertResource.cs index 7173aad70..9b1752718 100644 --- a/src/Twilio/Rest/Monitor/V1/AlertResource.cs +++ b/src/Twilio/Rest/Monitor/V1/AlertResource.cs @@ -67,10 +67,10 @@ public static AlertResource Fetch(FetchAlertOptions options, ITwilioRestClient c /// Fetch Alert parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Alert - public static async System.Threading.Tasks.Task FetchAsync(FetchAlertOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAlertOptions 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 AlertResource Fetch( /// The SID of the Alert resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Alert - 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 FetchAlertOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadAlertOptions options, ITwilioR /// Read Alert parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Alert - public static async System.Threading.Tasks.Task> ReadAsync(ReadAlertOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAlertOptions 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("alerts", response.Content); return new ResourceSet(page, options, client); @@ -176,7 +176,7 @@ public static async System.Threading.Tasks.Task> Read ITwilioRestClient client = null) { var options = new ReadAlertOptions(){ LogLevel = logLevel, 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/Monitor/V1/EventResource.cs b/src/Twilio/Rest/Monitor/V1/EventResource.cs index 488a70ec7..9347c8fc0 100644 --- a/src/Twilio/Rest/Monitor/V1/EventResource.cs +++ b/src/Twilio/Rest/Monitor/V1/EventResource.cs @@ -67,10 +67,10 @@ public static EventResource Fetch(FetchEventOptions options, ITwilioRestClient c /// Fetch Event parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Event - public static async System.Threading.Tasks.Task FetchAsync(FetchEventOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchEventOptions 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 EventResource Fetch( /// The SID of the Event resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Event - 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 FetchEventOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadEventOptions options, ITwilioR /// Read Event parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Event - public static async System.Threading.Tasks.Task> ReadAsync(ReadEventOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEventOptions 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("events", response.Content); return new ResourceSet(page, options, client); @@ -188,7 +188,7 @@ public static async System.Threading.Tasks.Task> Read ITwilioRestClient client = null) { var options = new ReadEventOptions(){ ActorSid = actorSid, EventType = eventType, ResourceSid = resourceSid, SourceIpAddress = sourceIpAddress, 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/Notify/V1/CredentialResource.cs b/src/Twilio/Rest/Notify/V1/CredentialResource.cs index 78041cf90..5d1ce5cf3 100644 --- a/src/Twilio/Rest/Notify/V1/CredentialResource.cs +++ b/src/Twilio/Rest/Notify/V1/CredentialResource.cs @@ -80,10 +80,10 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio /// Create Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions 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 @@ -134,7 +134,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateCredentialOptions(type){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -175,11 +175,12 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli /// Delete Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions 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 @@ -199,10 +200,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the Credential resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - 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 DeleteCredentialOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -239,10 +240,10 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe /// Fetch Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions 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 @@ -263,10 +264,10 @@ public static CredentialResource Fetch( /// The Twilio-provided string that uniquely identifies the Credential resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - 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 FetchCredentialOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadCredentialOptions options /// Read Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions 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("credentials", response.Content); return new ResourceSet(page, options, client); @@ -336,7 +337,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadCredentialOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -423,11 +424,12 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions 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 @@ -478,7 +480,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateCredentialOptions(pathSid){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Notify/V1/Service/BindingResource.cs b/src/Twilio/Rest/Notify/V1/Service/BindingResource.cs index 49effe7dc..61e7505c2 100644 --- a/src/Twilio/Rest/Notify/V1/Service/BindingResource.cs +++ b/src/Twilio/Rest/Notify/V1/Service/BindingResource.cs @@ -84,10 +84,10 @@ public static BindingResource Create(CreateBindingOptions options, ITwilioRestCl /// Create Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task CreateAsync(CreateBindingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateBindingOptions 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 @@ -142,7 +142,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateBindingOptions(pathServiceSid, identity, bindingType, address){ Tag = tag, NotificationProtocolVersion = notificationProtocolVersion, CredentialSid = credentialSid, Endpoint = endpoint }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -185,11 +185,12 @@ public static bool Delete(DeleteBindingOptions options, ITwilioRestClient client /// Delete Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task DeleteAsync(DeleteBindingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteBindingOptions 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 @@ -214,7 +215,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 DeleteBindingOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -253,10 +254,10 @@ public static BindingResource Fetch(FetchBindingOptions options, ITwilioRestClie /// Fetch Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions 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 @@ -283,7 +284,7 @@ public static BindingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchBindingOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -320,10 +321,10 @@ public static ResourceSet Read(ReadBindingOptions options, ITwi /// Read Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions 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("bindings", response.Content); return new ResourceSet(page, options, client); @@ -375,7 +376,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadBindingOptions(pathServiceSid){ StartDate = startDate, EndDate = endDate, Identity = identity, Tag = tag, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Notify/V1/Service/NotificationResource.cs b/src/Twilio/Rest/Notify/V1/Service/NotificationResource.cs index 763ade441..962d0b9e2 100644 --- a/src/Twilio/Rest/Notify/V1/Service/NotificationResource.cs +++ b/src/Twilio/Rest/Notify/V1/Service/NotificationResource.cs @@ -81,10 +81,10 @@ public static NotificationResource Create(CreateNotificationOptions options, ITw /// Create Notification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task CreateAsync(CreateNotificationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateNotificationOptions 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 @@ -183,7 +183,7 @@ public static async System.Threading.Tasks.Task CreateAsyn ITwilioRestClient client = null) { var options = new CreateNotificationOptions(pathServiceSid){ Identity = identity, Tag = tag, Body = body, Priority = priority, Ttl = ttl, Title = title, Sound = sound, Action = action, Data = data, Apn = apn, Gcm = gcm, Sms = sms, FacebookMessenger = facebookMessenger, Fcm = fcm, Segment = segment, Alexa = alexa, ToBinding = toBinding, DeliveryCallbackUrl = deliveryCallbackUrl }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Notify/V1/ServiceResource.cs b/src/Twilio/Rest/Notify/V1/ServiceResource.cs index cd0434927..800b71b9a 100644 --- a/src/Twilio/Rest/Notify/V1/ServiceResource.cs +++ b/src/Twilio/Rest/Notify/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 @@ -148,7 +148,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateServiceOptions(){ FriendlyName = friendlyName, ApnCredentialSid = apnCredentialSid, GcmCredentialSid = gcmCredentialSid, MessagingServiceSid = messagingServiceSid, FacebookMessengerPageId = facebookMessengerPageId, DefaultApnNotificationProtocolVersion = defaultApnNotificationProtocolVersion, DefaultGcmNotificationProtocolVersion = defaultGcmNotificationProtocolVersion, FcmCredentialSid = fcmCredentialSid, DefaultFcmNotificationProtocolVersion = defaultFcmNotificationProtocolVersion, LogEnabled = logEnabled, AlexaSkillId = alexaSkillId, DefaultAlexaNotificationProtocolVersion = defaultAlexaNotificationProtocolVersion, DeliveryCallbackUrl = deliveryCallbackUrl, DeliveryCallbackEnabled = deliveryCallbackEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -189,11 +189,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 @@ -213,10 +214,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies 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 @@ -253,10 +254,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 @@ -277,10 +278,10 @@ public static ServiceResource Fetch( /// The Twilio-provided string that uniquely identifies 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 @@ -315,10 +316,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); @@ -354,7 +355,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadServiceOptions(){ FriendlyName = friendlyName, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -441,11 +442,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 @@ -528,7 +530,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, ApnCredentialSid = apnCredentialSid, GcmCredentialSid = gcmCredentialSid, MessagingServiceSid = messagingServiceSid, FacebookMessengerPageId = facebookMessengerPageId, DefaultApnNotificationProtocolVersion = defaultApnNotificationProtocolVersion, DefaultGcmNotificationProtocolVersion = defaultGcmNotificationProtocolVersion, FcmCredentialSid = fcmCredentialSid, DefaultFcmNotificationProtocolVersion = defaultFcmNotificationProtocolVersion, LogEnabled = logEnabled, AlexaSkillId = alexaSkillId, DefaultAlexaNotificationProtocolVersion = defaultAlexaNotificationProtocolVersion, DeliveryCallbackUrl = deliveryCallbackUrl, DeliveryCallbackEnabled = deliveryCallbackEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V1/BulkEligibilityResource.cs b/src/Twilio/Rest/Numbers/V1/BulkEligibilityResource.cs index 6056c4c02..b1b4da06f 100644 --- a/src/Twilio/Rest/Numbers/V1/BulkEligibilityResource.cs +++ b/src/Twilio/Rest/Numbers/V1/BulkEligibilityResource.cs @@ -67,10 +67,10 @@ public static BulkEligibilityResource Create(CreateBulkEligibilityOptions option /// Create BulkEligibility parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkEligibility - public static async System.Threading.Tasks.Task CreateAsync(CreateBulkEligibilityOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateBulkEligibilityOptions 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 @@ -90,10 +90,11 @@ public static BulkEligibilityResource Create( /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkEligibility public static async System.Threading.Tasks.Task CreateAsync( - ITwilioRestClient client = null) + ITwilioRestClient client = null, + CancellationToken cancellationToken = default) { var options = new CreateBulkEligibilityOptions(){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -130,10 +131,10 @@ public static BulkEligibilityResource Fetch(FetchBulkEligibilityOptions options, /// Fetch BulkEligibility parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkEligibility - public static async System.Threading.Tasks.Task FetchAsync(FetchBulkEligibilityOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchBulkEligibilityOptions 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 @@ -154,10 +155,10 @@ public static BulkEligibilityResource Fetch( /// The SID of the bulk eligibility check that you want to know about. /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkEligibility - public static async System.Threading.Tasks.Task FetchAsync(string pathRequestId, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathRequestId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchBulkEligibilityOptions(pathRequestId){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V1/EligibilityResource.cs b/src/Twilio/Rest/Numbers/V1/EligibilityResource.cs index 4bb3edb19..6c56bcbbc 100644 --- a/src/Twilio/Rest/Numbers/V1/EligibilityResource.cs +++ b/src/Twilio/Rest/Numbers/V1/EligibilityResource.cs @@ -67,10 +67,10 @@ public static EligibilityResource Create(CreateEligibilityOptions options, ITwil /// Create Eligibility parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Eligibility - public static async System.Threading.Tasks.Task CreateAsync(CreateEligibilityOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateEligibilityOptions 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 @@ -90,10 +90,11 @@ public static EligibilityResource Create( /// Client to make requests to Twilio /// Task that resolves to A single instance of Eligibility public static async System.Threading.Tasks.Task CreateAsync( - ITwilioRestClient client = null) + ITwilioRestClient client = null, + CancellationToken cancellationToken = default) { var options = new CreateEligibilityOptions(){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberResource.cs b/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberResource.cs index 825c74367..b66b467d5 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberResource.cs +++ b/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberResource.cs @@ -73,11 +73,12 @@ public static bool Delete(DeletePortingPortInPhoneNumberOptions options, ITwilio /// Delete PortingPortInPhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortInPhoneNumber - public static async System.Threading.Tasks.Task DeleteAsync(DeletePortingPortInPhoneNumberOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeletePortingPortInPhoneNumberOptions 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 @@ -102,7 +103,7 @@ public static bool Delete(string pathPortInRequestSid, string pathPhoneNumberSid public static async System.Threading.Tasks.Task DeleteAsync(string pathPortInRequestSid, string pathPhoneNumberSid, ITwilioRestClient client = null) { var options = new DeletePortingPortInPhoneNumberOptions(pathPortInRequestSid, pathPhoneNumberSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -141,10 +142,10 @@ public static PortingPortInPhoneNumberResource Fetch(FetchPortingPortInPhoneNumb /// Fetch PortingPortInPhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortInPhoneNumber - public static async System.Threading.Tasks.Task FetchAsync(FetchPortingPortInPhoneNumberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchPortingPortInPhoneNumberOptions 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 @@ -171,7 +172,7 @@ public static PortingPortInPhoneNumberResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathPortInRequestSid, string pathPhoneNumberSid, ITwilioRestClient client = null) { var options = new FetchPortingPortInPhoneNumberOptions(pathPortInRequestSid, pathPhoneNumberSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V1/PortingPortInResource.cs b/src/Twilio/Rest/Numbers/V1/PortingPortInResource.cs index dbb791cc2..1e7706218 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingPortInResource.cs +++ b/src/Twilio/Rest/Numbers/V1/PortingPortInResource.cs @@ -67,10 +67,10 @@ public static PortingPortInResource Create(CreatePortingPortInOptions options, I /// Create PortingPortIn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortIn - public static async System.Threading.Tasks.Task CreateAsync(CreatePortingPortInOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreatePortingPortInOptions 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 @@ -90,10 +90,11 @@ public static PortingPortInResource Create( /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortIn public static async System.Threading.Tasks.Task CreateAsync( - ITwilioRestClient client = null) + ITwilioRestClient client = null, + CancellationToken cancellationToken = default) { var options = new CreatePortingPortInOptions(){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -134,11 +135,12 @@ public static bool Delete(DeletePortingPortInOptions options, ITwilioRestClient /// Delete PortingPortIn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortIn - public static async System.Threading.Tasks.Task DeleteAsync(DeletePortingPortInOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeletePortingPortInOptions 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 @@ -158,10 +160,10 @@ public static bool Delete(string pathPortInRequestSid, ITwilioRestClient client /// The SID of the Port In request. This is a unique identifier of the port in request. /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortIn - public static async System.Threading.Tasks.Task DeleteAsync(string pathPortInRequestSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathPortInRequestSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new DeletePortingPortInOptions(pathPortInRequestSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -198,10 +200,10 @@ public static PortingPortInResource Fetch(FetchPortingPortInOptions options, ITw /// Fetch PortingPortIn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortIn - public static async System.Threading.Tasks.Task FetchAsync(FetchPortingPortInOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchPortingPortInOptions 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 @@ -222,10 +224,10 @@ public static PortingPortInResource Fetch( /// The SID of the Port In request. This is a unique identifier of the port in request. /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortIn - public static async System.Threading.Tasks.Task FetchAsync(string pathPortInRequestSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathPortInRequestSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchPortingPortInOptions(pathPortInRequestSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V1/PortingPortabilityResource.cs b/src/Twilio/Rest/Numbers/V1/PortingPortabilityResource.cs index de5b9a3b9..03cca2d90 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingPortabilityResource.cs +++ b/src/Twilio/Rest/Numbers/V1/PortingPortabilityResource.cs @@ -82,10 +82,10 @@ public static PortingPortabilityResource Fetch(FetchPortingPortabilityOptions op /// Fetch PortingPortability parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortability - public static async System.Threading.Tasks.Task FetchAsync(FetchPortingPortabilityOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchPortingPortabilityOptions 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 @@ -115,7 +115,7 @@ public static PortingPortabilityResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(Types.PhoneNumber pathPhoneNumber, string targetAccountSid = null, string addressSid = null, ITwilioRestClient client = null) { var options = new FetchPortingPortabilityOptions(pathPhoneNumber){ TargetAccountSid = targetAccountSid,AddressSid = addressSid }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteResource.cs b/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteResource.cs index 418b33afd..4937b0dd9 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteResource.cs +++ b/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteResource.cs @@ -83,11 +83,12 @@ public static bool Delete(DeletePortingWebhookConfigurationDeleteOptions options /// Delete PortingWebhookConfigurationDelete parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingWebhookConfigurationDelete - public static async System.Threading.Tasks.Task DeleteAsync(DeletePortingWebhookConfigurationDeleteOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeletePortingWebhookConfigurationDeleteOptions 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 @@ -110,7 +111,7 @@ public static bool Delete(PortingWebhookConfigurationDeleteResource.WebhookTypeE public static async System.Threading.Tasks.Task DeleteAsync(PortingWebhookConfigurationDeleteResource.WebhookTypeEnum pathWebhookType, ITwilioRestClient client = null) { var options = new DeletePortingWebhookConfigurationDeleteOptions(pathWebhookType) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationResource.cs b/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationResource.cs index f376a0815..90c5a1b30 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationResource.cs +++ b/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationResource.cs @@ -67,10 +67,10 @@ public static PortingWebhookConfigurationResource Create(CreatePortingWebhookCon /// Create PortingWebhookConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingWebhookConfiguration - public static async System.Threading.Tasks.Task CreateAsync(CreatePortingWebhookConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreatePortingWebhookConfigurationOptions 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 @@ -90,10 +90,11 @@ public static PortingWebhookConfigurationResource Create( /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingWebhookConfiguration public static async System.Threading.Tasks.Task CreateAsync( - ITwilioRestClient client = null) + ITwilioRestClient client = null, + CancellationToken cancellationToken = default) { var options = new CreatePortingWebhookConfigurationOptions(){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationResource.cs b/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationResource.cs index 7905bc2c8..be09bcfd0 100644 --- a/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationResource.cs +++ b/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationResource.cs @@ -67,10 +67,10 @@ public static SigningRequestConfigurationResource Create(CreateSigningRequestCon /// Create SigningRequestConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SigningRequestConfiguration - public static async System.Threading.Tasks.Task CreateAsync(CreateSigningRequestConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSigningRequestConfigurationOptions 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 @@ -90,10 +90,11 @@ public static SigningRequestConfigurationResource Create( /// Client to make requests to Twilio /// Task that resolves to A single instance of SigningRequestConfiguration public static async System.Threading.Tasks.Task CreateAsync( - ITwilioRestClient client = null) + ITwilioRestClient client = null, + CancellationToken cancellationToken = default) { var options = new CreateSigningRequestConfigurationOptions(){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -128,10 +129,10 @@ public static ResourceSet Read(ReadSigningR /// Read SigningRequestConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SigningRequestConfiguration - public static async System.Threading.Tasks.Task> ReadAsync(ReadSigningRequestConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSigningRequestConfigurationOptions 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("configurations", response.Content); return new ResourceSet(page, options, client); @@ -171,7 +172,7 @@ public static async System.Threading.Tasks.Task Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions 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 @@ -86,10 +86,10 @@ public static WebhookResource Fetch( /// Allows to fetch the webhook configuration /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchWebhookOptions(){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderResource.cs b/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderResource.cs index 500a1e38e..b264a4c30 100644 --- a/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderResource.cs +++ b/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderResource.cs @@ -85,10 +85,10 @@ public static ResourceSet Read(ReadDependent /// Read DependentHostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DependentHostedNumberOrder - public static async System.Threading.Tasks.Task> ReadAsync(ReadDependentHostedNumberOrderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDependentHostedNumberOrderOptions 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("items", response.Content); return new ResourceSet(page, options, client); @@ -140,7 +140,7 @@ public static async System.Threading.Tasks.Task Create AuthorizationDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task CreateAsync(CreateAuthorizationDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAuthorizationDocumentOptions 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 @@ -132,7 +132,7 @@ public static async System.Threading.Tasks.Task C ITwilioRestClient client = null) { var options = new CreateAuthorizationDocumentOptions(addressSid, email, contactPhoneNumber, hostedNumberOrderSids){ ContactTitle = contactTitle, CcEmails = ccEmails }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -173,11 +173,12 @@ public static bool Delete(DeleteAuthorizationDocumentOptions options, ITwilioRes /// Delete AuthorizationDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAuthorizationDocumentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteAuthorizationDocumentOptions 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 @@ -197,10 +198,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this AuthorizationDocument. /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - 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 DeleteAuthorizationDocumentOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -237,10 +238,10 @@ public static AuthorizationDocumentResource Fetch(FetchAuthorizationDocumentOpti /// Fetch AuthorizationDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizationDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizationDocumentOptions 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 @@ -261,10 +262,10 @@ public static AuthorizationDocumentResource Fetch( /// A 34 character string that uniquely identifies this AuthorizationDocument. /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - 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 FetchAuthorizationDocumentOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -299,10 +300,10 @@ public static ResourceSet Read(ReadAuthorizationD /// Read AuthorizationDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthorizationDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthorizationDocumentOptions 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("items", response.Content); return new ResourceSet(page, options, client); @@ -342,7 +343,7 @@ public static async System.Threading.Tasks.Task Create BulkHostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkHostedNumberOrder - public static async System.Threading.Tasks.Task CreateAsync(CreateBulkHostedNumberOrderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateBulkHostedNumberOrderOptions 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 @@ -104,10 +104,11 @@ public static BulkHostedNumberOrderResource Create( /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkHostedNumberOrder public static async System.Threading.Tasks.Task CreateAsync( - ITwilioRestClient client = null) + ITwilioRestClient client = null, + CancellationToken cancellationToken = default) { var options = new CreateBulkHostedNumberOrderOptions(){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -144,10 +145,10 @@ public static BulkHostedNumberOrderResource Fetch(FetchBulkHostedNumberOrderOpti /// Fetch BulkHostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkHostedNumberOrder - public static async System.Threading.Tasks.Task FetchAsync(FetchBulkHostedNumberOrderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchBulkHostedNumberOrderOptions 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 @@ -174,7 +175,7 @@ public static BulkHostedNumberOrderResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathBulkHostingSid, string orderStatus = null, ITwilioRestClient client = null) { var options = new FetchBulkHostedNumberOrderOptions(pathBulkHostingSid){ OrderStatus = orderStatus }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V2/BundleCloneResource.cs b/src/Twilio/Rest/Numbers/V2/BundleCloneResource.cs index 1cd92a88f..414df771c 100644 --- a/src/Twilio/Rest/Numbers/V2/BundleCloneResource.cs +++ b/src/Twilio/Rest/Numbers/V2/BundleCloneResource.cs @@ -85,10 +85,10 @@ public static BundleCloneResource Create(CreateBundleCloneOptions options, ITwil /// Create BundleClone parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BundleClone - public static async System.Threading.Tasks.Task CreateAsync(CreateBundleCloneOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateBundleCloneOptions 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 @@ -127,7 +127,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreateBundleCloneOptions(pathBundleSid, targetAccountSid){ MoveToDraft = moveToDraft, FriendlyName = friendlyName }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V2/HostedNumberOrderResource.cs b/src/Twilio/Rest/Numbers/V2/HostedNumberOrderResource.cs index bce028eb5..780db1880 100644 --- a/src/Twilio/Rest/Numbers/V2/HostedNumberOrderResource.cs +++ b/src/Twilio/Rest/Numbers/V2/HostedNumberOrderResource.cs @@ -97,10 +97,10 @@ public static HostedNumberOrderResource Create(CreateHostedNumberOrderOptions op /// Create HostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task CreateAsync(CreateHostedNumberOrderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateHostedNumberOrderOptions 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 @@ -187,7 +187,7 @@ public static async System.Threading.Tasks.Task Creat ITwilioRestClient client = null) { var options = new CreateHostedNumberOrderOptions(phoneNumber, contactPhoneNumber, addressSid, email){ AccountSid = accountSid, FriendlyName = friendlyName, CcEmails = ccEmails, SmsUrl = smsUrl, SmsMethod = smsMethod, SmsFallbackUrl = smsFallbackUrl, SmsCapability = smsCapability, SmsFallbackMethod = smsFallbackMethod, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, SmsApplicationSid = smsApplicationSid, ContactTitle = contactTitle }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -228,11 +228,12 @@ public static bool Delete(DeleteHostedNumberOrderOptions options, ITwilioRestCli /// Delete HostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task DeleteAsync(DeleteHostedNumberOrderOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteHostedNumberOrderOptions 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 @@ -252,10 +253,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this HostedNumberOrder. /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - 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 DeleteHostedNumberOrderOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -292,10 +293,10 @@ public static HostedNumberOrderResource Fetch(FetchHostedNumberOrderOptions opti /// Fetch HostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task FetchAsync(FetchHostedNumberOrderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchHostedNumberOrderOptions 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 @@ -316,10 +317,10 @@ public static HostedNumberOrderResource Fetch( /// A 34 character string that uniquely identifies this HostedNumberOrder. /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - 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 FetchHostedNumberOrderOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -354,10 +355,10 @@ public static ResourceSet Read(ReadHostedNumberOrderO /// Read HostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task> ReadAsync(ReadHostedNumberOrderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadHostedNumberOrderOptions 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("items", response.Content); return new ResourceSet(page, options, client); @@ -409,7 +410,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateHostedNumberOrderOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateHostedNumberOrderOptions 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 @@ -539,7 +541,7 @@ public static async System.Threading.Tasks.Task Updat ITwilioRestClient client = null) { var options = new UpdateHostedNumberOrderOptions(pathSid, status){ VerificationCallDelay = verificationCallDelay, VerificationCallExtension = verificationCallExtension }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyResource.cs index 6309fe22c..5bd890901 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyResource.cs @@ -85,10 +85,10 @@ public static BundleCopyResource Create(CreateBundleCopyOptions options, ITwilio /// Create BundleCopy parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BundleCopy - public static async System.Threading.Tasks.Task CreateAsync(CreateBundleCopyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateBundleCopyOptions 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 @@ -119,7 +119,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateBundleCopyOptions(pathBundleSid){ FriendlyName = friendlyName }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -156,10 +156,10 @@ public static ResourceSet Read(ReadBundleCopyOptions options /// Read BundleCopy parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BundleCopy - public static async System.Threading.Tasks.Task> ReadAsync(ReadBundleCopyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBundleCopyOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -195,7 +195,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadBundleCopyOptions(pathBundleSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationResource.cs index 7c6383615..6a28a7f81 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationResource.cs @@ -81,10 +81,10 @@ public static EvaluationResource Create(CreateEvaluationOptions options, ITwilio /// Create Evaluation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Evaluation - public static async System.Threading.Tasks.Task CreateAsync(CreateEvaluationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateEvaluationOptions 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 @@ -111,7 +111,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateEvaluationOptions(pathBundleSid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -150,10 +150,10 @@ public static EvaluationResource Fetch(FetchEvaluationOptions options, ITwilioRe /// Fetch Evaluation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Evaluation - public static async System.Threading.Tasks.Task FetchAsync(FetchEvaluationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchEvaluationOptions 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 @@ -180,7 +180,7 @@ public static EvaluationResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathBundleSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchEvaluationOptions(pathBundleSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -217,10 +217,10 @@ public static ResourceSet Read(ReadEvaluationOptions options /// Read Evaluation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Evaluation - public static async System.Threading.Tasks.Task> ReadAsync(ReadEvaluationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEvaluationOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -256,7 +256,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadEvaluationOptions(pathBundleSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentResource.cs index ed1a0c8ba..edf6d281b 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentResource.cs @@ -68,10 +68,10 @@ public static ItemAssignmentResource Create(CreateItemAssignmentOptions options, /// Create ItemAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ItemAssignment - public static async System.Threading.Tasks.Task CreateAsync(CreateItemAssignmentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateItemAssignmentOptions 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 CreateAs ITwilioRestClient client = null) { var options = new CreateItemAssignmentOptions(pathBundleSid, objectSid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteItemAssignmentOptions options, ITwilioRestClient /// Delete ItemAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ItemAssignment - public static async System.Threading.Tasks.Task DeleteAsync(DeleteItemAssignmentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteItemAssignmentOptions 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 pathBundleSid, string pathSid, ITwilioRestClien public static async System.Threading.Tasks.Task DeleteAsync(string pathBundleSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteItemAssignmentOptions(pathBundleSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static ItemAssignmentResource Fetch(FetchItemAssignmentOptions options, I /// Fetch ItemAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ItemAssignment - public static async System.Threading.Tasks.Task FetchAsync(FetchItemAssignmentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchItemAssignmentOptions 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 ItemAssignmentResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathBundleSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchItemAssignmentOptions(pathBundleSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadItemAssignmentOptions /// Read ItemAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ItemAssignment - public static async System.Threading.Tasks.Task> ReadAsync(ReadItemAssignmentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadItemAssignmentOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task Create ReplaceItems parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ReplaceItems - public static async System.Threading.Tasks.Task CreateAsync(CreateReplaceItemsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateReplaceItemsOptions 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 @@ -119,7 +119,7 @@ public static async System.Threading.Tasks.Task CreateAsyn ITwilioRestClient client = null) { var options = new CreateReplaceItemsOptions(pathBundleSid, fromBundleSid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleResource.cs index a25ac95e0..7016ecee9 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleResource.cs @@ -119,10 +119,10 @@ public static BundleResource Create(CreateBundleOptions options, ITwilioRestClie /// Create Bundle parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Bundle - public static async System.Threading.Tasks.Task CreateAsync(CreateBundleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateBundleOptions 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 @@ -177,7 +177,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateBundleOptions(friendlyName, email){ StatusCallback = statusCallback, RegulationSid = regulationSid, IsoCountry = isoCountry, EndUserType = endUserType, NumberType = numberType, IsTest = isTest }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -218,11 +218,12 @@ public static bool Delete(DeleteBundleOptions options, ITwilioRestClient client /// Delete Bundle parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Bundle - public static async System.Threading.Tasks.Task DeleteAsync(DeleteBundleOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteBundleOptions 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 @@ -242,10 +243,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string that we created to identify the Bundle resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Bundle - 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 DeleteBundleOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -282,10 +283,10 @@ public static BundleResource Fetch(FetchBundleOptions options, ITwilioRestClient /// Fetch Bundle parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Bundle - public static async System.Threading.Tasks.Task FetchAsync(FetchBundleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchBundleOptions 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 @@ -306,10 +307,10 @@ public static BundleResource Fetch( /// The unique string that we created to identify the Bundle resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Bundle - 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 FetchBundleOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -344,10 +345,10 @@ public static ResourceSet Read(ReadBundleOptions options, ITwili /// Read Bundle parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Bundle - public static async System.Threading.Tasks.Task> ReadAsync(ReadBundleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBundleOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -423,7 +424,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadBundleOptions(){ Status = status, FriendlyName = friendlyName, RegulationSid = regulationSid, IsoCountry = isoCountry, NumberType = numberType, HasValidUntilDate = hasValidUntilDate, SortBy = sortBy, SortDirection = sortDirection, ValidUntilDateBefore = validUntilDateBefore, ValidUntilDate = validUntilDate, ValidUntilDateAfter = validUntilDateAfter, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -510,11 +511,12 @@ public static BundleResource Update(UpdateBundleOptions options, ITwilioRestClie /// Client to make requests to Twilio /// Task that resolves to A single instance of Bundle #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateBundleOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateBundleOptions 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 @@ -557,7 +559,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateBundleOptions(pathSid){ Status = status, StatusCallback = statusCallback, FriendlyName = friendlyName, Email = email }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserResource.cs index 79eeac6d8..6b5995798 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserResource.cs @@ -79,10 +79,10 @@ public static EndUserResource Create(CreateEndUserOptions options, ITwilioRestCl /// Create EndUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task CreateAsync(CreateEndUserOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateEndUserOptions 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 @@ -117,7 +117,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateEndUserOptions(friendlyName, type){ Attributes = attributes }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -158,11 +158,12 @@ public static bool Delete(DeleteEndUserOptions options, ITwilioRestClient client /// Delete EndUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task DeleteAsync(DeleteEndUserOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteEndUserOptions 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 @@ -182,10 +183,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string created by Twilio to identify the End User resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - 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 DeleteEndUserOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -222,10 +223,10 @@ public static EndUserResource Fetch(FetchEndUserOptions options, ITwilioRestClie /// Fetch EndUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserOptions 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 @@ -246,10 +247,10 @@ public static EndUserResource Fetch( /// The unique string created by Twilio to identify the End User resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - 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 FetchEndUserOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +285,10 @@ public static ResourceSet Read(ReadEndUserOptions options, ITwi /// Read EndUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadEndUserOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -406,11 +407,12 @@ public static EndUserResource Update(UpdateEndUserOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateEndUserOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateEndUserOptions 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 @@ -445,7 +447,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateEndUserOptions(pathSid){ FriendlyName = friendlyName, Attributes = attributes }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeResource.cs index 40f587b75..233190886 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeResource.cs @@ -67,10 +67,10 @@ public static EndUserTypeResource Fetch(FetchEndUserTypeOptions options, ITwilio /// Fetch EndUserType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUserType - public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserTypeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserTypeOptions 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 EndUserTypeResource Fetch( /// The unique string that identifies the End-User Type resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUserType - 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 FetchEndUserTypeOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadEndUserTypeOptions optio /// Read EndUserType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUserType - public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserTypeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserTypeOptions 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("end_user_types", response.Content); return new ResourceSet(page, options, client); @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadEndUserTypeOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationResource.cs index 0cdf6082d..255258d99 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationResource.cs @@ -80,10 +80,10 @@ public static RegulationResource Fetch(FetchRegulationOptions options, ITwilioRe /// Fetch Regulation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Regulation - public static async System.Threading.Tasks.Task FetchAsync(FetchRegulationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRegulationOptions 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 @@ -110,7 +110,7 @@ public static RegulationResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, bool? includeConstraints = null, ITwilioRestClient client = null) { var options = new FetchRegulationOptions(pathSid){ IncludeConstraints = includeConstraints }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -145,10 +145,10 @@ public static ResourceSet Read(ReadRegulationOptions options /// Read Regulation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Regulation - public static async System.Threading.Tasks.Task> ReadAsync(ReadRegulationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRegulationOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -196,7 +196,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadRegulationOptions(){ EndUserType = endUserType, IsoCountry = isoCountry, NumberType = numberType, IncludeConstraints = includeConstraints, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentResource.cs index 2aa316da2..b4324ab46 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentResource.cs @@ -83,10 +83,10 @@ public static SupportingDocumentResource Create(CreateSupportingDocumentOptions /// Create SupportingDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task CreateAsync(CreateSupportingDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSupportingDocumentOptions 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 @@ -121,7 +121,7 @@ public static async System.Threading.Tasks.Task Crea ITwilioRestClient client = null) { var options = new CreateSupportingDocumentOptions(friendlyName, type){ Attributes = attributes }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -162,11 +162,12 @@ public static bool Delete(DeleteSupportingDocumentOptions options, ITwilioRestCl /// Delete SupportingDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSupportingDocumentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSupportingDocumentOptions 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 @@ -186,10 +187,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string created by Twilio to identify the Supporting Document resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - 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 DeleteSupportingDocumentOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -226,10 +227,10 @@ public static SupportingDocumentResource Fetch(FetchSupportingDocumentOptions op /// Fetch SupportingDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentOptions 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 @@ -250,10 +251,10 @@ public static SupportingDocumentResource Fetch( /// The unique string created by Twilio to identify the Supporting Document resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - 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 FetchSupportingDocumentOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -288,10 +289,10 @@ public static ResourceSet Read(ReadSupportingDocumen /// Read SupportingDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -323,7 +324,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSupportingDocumentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSupportingDocumentOptions 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 @@ -449,7 +451,7 @@ public static async System.Threading.Tasks.Task Upda ITwilioRestClient client = null) { var options = new UpdateSupportingDocumentOptions(pathSid){ FriendlyName = friendlyName, Attributes = attributes }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeResource.cs index 0e58503c7..cc98b37f4 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeResource.cs @@ -67,10 +67,10 @@ public static SupportingDocumentTypeResource Fetch(FetchSupportingDocumentTypeOp /// Fetch SupportingDocumentType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocumentType - public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentTypeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentTypeOptions 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 SupportingDocumentTypeResource Fetch( /// The unique string that identifies the Supporting Document Type resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocumentType - 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 FetchSupportingDocumentTypeOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadSupportingDoc /// Read SupportingDocumentType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocumentType - public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentTypeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentTypeOptions 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("supporting_document_types", response.Content); return new ResourceSet(page, options, client); @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task 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/Oauth/V1/TokenResource.cs b/src/Twilio/Rest/Oauth/V1/TokenResource.cs index 298070039..04f82baa5 100644 --- a/src/Twilio/Rest/Oauth/V1/TokenResource.cs +++ b/src/Twilio/Rest/Oauth/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/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderResource.cs b/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderResource.cs index 3f99b21af..5f9f16069 100644 --- a/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderResource.cs +++ b/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderResource.cs @@ -100,10 +100,10 @@ public static ResourceSet Read(ReadDependent /// Read DependentHostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DependentHostedNumberOrder - public static async System.Threading.Tasks.Task> ReadAsync(ReadDependentHostedNumberOrderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDependentHostedNumberOrderOptions 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("items", response.Content); return new ResourceSet(page, options, client); @@ -159,7 +159,7 @@ public static async System.Threading.Tasks.Task Create AuthorizationDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task CreateAsync(CreateAuthorizationDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAuthorizationDocumentOptions 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 @@ -132,7 +132,7 @@ public static async System.Threading.Tasks.Task C ITwilioRestClient client = null) { var options = new CreateAuthorizationDocumentOptions(hostedNumberOrderSids, addressSid, email, contactTitle, contactPhoneNumber){ CcEmails = ccEmails }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -169,10 +169,10 @@ public static AuthorizationDocumentResource Fetch(FetchAuthorizationDocumentOpti /// Fetch AuthorizationDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizationDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizationDocumentOptions 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 @@ -193,10 +193,10 @@ public static AuthorizationDocumentResource Fetch( /// A 34 character string that uniquely identifies this AuthorizationDocument. /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - 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 FetchAuthorizationDocumentOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -231,10 +231,10 @@ public static ResourceSet Read(ReadAuthorizationD /// Read AuthorizationDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthorizationDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthorizationDocumentOptions 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("items", response.Content); return new ResourceSet(page, options, client); @@ -274,7 +274,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAuthorizationDocumentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateAuthorizationDocumentOptions 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 @@ -420,7 +421,7 @@ public static async System.Threading.Tasks.Task U ITwilioRestClient client = null) { var options = new UpdateAuthorizationDocumentOptions(pathSid){ HostedNumberOrderSids = hostedNumberOrderSids, AddressSid = addressSid, Email = email, CcEmails = ccEmails, Status = status, ContactTitle = contactTitle, ContactPhoneNumber = contactPhoneNumber }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderResource.cs b/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderResource.cs index ae1ced6e1..14d7eb5a1 100644 --- a/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderResource.cs +++ b/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderResource.cs @@ -99,10 +99,10 @@ public static HostedNumberOrderResource Create(CreateHostedNumberOrderOptions op /// Create HostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task CreateAsync(CreateHostedNumberOrderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateHostedNumberOrderOptions 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 @@ -193,7 +193,7 @@ public static async System.Threading.Tasks.Task Creat ITwilioRestClient client = null) { var options = new CreateHostedNumberOrderOptions(phoneNumber, smsCapability){ AccountSid = accountSid, FriendlyName = friendlyName, UniqueName = uniqueName, CcEmails = ccEmails, SmsUrl = smsUrl, SmsMethod = smsMethod, SmsFallbackUrl = smsFallbackUrl, SmsFallbackMethod = smsFallbackMethod, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, SmsApplicationSid = smsApplicationSid, AddressSid = addressSid, Email = email, VerificationType = verificationType, VerificationDocumentSid = verificationDocumentSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -234,11 +234,12 @@ public static bool Delete(DeleteHostedNumberOrderOptions options, ITwilioRestCli /// Delete HostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task DeleteAsync(DeleteHostedNumberOrderOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteHostedNumberOrderOptions 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 @@ -258,10 +259,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this HostedNumberOrder. /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - 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 DeleteHostedNumberOrderOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -298,10 +299,10 @@ public static HostedNumberOrderResource Fetch(FetchHostedNumberOrderOptions opti /// Fetch HostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task FetchAsync(FetchHostedNumberOrderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchHostedNumberOrderOptions 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 @@ -322,10 +323,10 @@ public static HostedNumberOrderResource Fetch( /// A 34 character string that uniquely identifies this HostedNumberOrder. /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - 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 FetchHostedNumberOrderOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -360,10 +361,10 @@ public static ResourceSet Read(ReadHostedNumberOrderO /// Read HostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task> ReadAsync(ReadHostedNumberOrderOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadHostedNumberOrderOptions 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("items", response.Content); return new ResourceSet(page, options, client); @@ -415,7 +416,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateHostedNumberOrderOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateHostedNumberOrderOptions 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 @@ -573,7 +575,7 @@ public static async System.Threading.Tasks.Task Updat ITwilioRestClient client = null) { var options = new UpdateHostedNumberOrderOptions(pathSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Email = email, CcEmails = ccEmails, Status = status, VerificationCode = verificationCode, VerificationType = verificationType, VerificationDocumentSid = verificationDocumentSid, Extension = extension, CallDelay = callDelay }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionResource.cs b/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionResource.cs index 7ac4e3378..17818afb9 100644 --- a/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionResource.cs +++ b/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionResource.cs @@ -69,10 +69,10 @@ public static AvailableAddOnExtensionResource Fetch(FetchAvailableAddOnExtension /// Fetch AvailableAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnExtensionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnExtensionOptions 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 AvailableAddOnExtensionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathAvailableAddOnSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchAvailableAddOnExtensionOptions(pathAvailableAddOnSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -136,10 +136,10 @@ public static ResourceSet Read(ReadAvailableAdd /// Read AvailableAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOnExtension - public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnExtensionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnExtensionOptions 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("extensions", response.Content); return new ResourceSet(page, options, client); @@ -175,7 +175,7 @@ public static async System.Threading.Tasks.Task Fetch AvailableAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOn - public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnOptions 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 AvailableAddOnResource Fetch( /// The SID of the AvailableAddOn resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOn - 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 FetchAvailableAddOnOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadAvailableAddOnOptions /// Read AvailableAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOn - public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnOptions 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("available_add_ons", response.Content); return new ResourceSet(page, options, client); @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task Fetch InstalledAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnExtensionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnExtensionOptions 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 InstalledAddOnExtensionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathInstalledAddOnSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchInstalledAddOnExtensionOptions(pathInstalledAddOnSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -136,10 +136,10 @@ public static ResourceSet Read(ReadInstalledAdd /// Read InstalledAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOnExtension - public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnExtensionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnExtensionOptions 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("extensions", response.Content); return new ResourceSet(page, options, client); @@ -175,7 +175,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOnExtension #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateInstalledAddOnExtensionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateInstalledAddOnExtensionOptions 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 @@ -303,7 +304,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new UpdateInstalledAddOnExtensionOptions(pathInstalledAddOnSid, pathSid, enabled){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnResource.cs b/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnResource.cs index 0f684a84e..edcb95c44 100644 --- a/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnResource.cs +++ b/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnResource.cs @@ -66,10 +66,10 @@ public static InstalledAddOnResource Create(CreateInstalledAddOnOptions options, /// Create InstalledAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task CreateAsync(CreateInstalledAddOnOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInstalledAddOnOptions 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 CreateAs ITwilioRestClient client = null) { var options = new CreateInstalledAddOnOptions(availableAddOnSid, acceptTermsOfService){ Configuration = configuration, UniqueName = uniqueName }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -149,11 +149,12 @@ public static bool Delete(DeleteInstalledAddOnOptions options, ITwilioRestClient /// Delete InstalledAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task DeleteAsync(DeleteInstalledAddOnOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteInstalledAddOnOptions 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 of the InstalledAddOn resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - 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 DeleteInstalledAddOnOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static InstalledAddOnResource Fetch(FetchInstalledAddOnOptions options, I /// Fetch InstalledAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnOptions 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 InstalledAddOnResource Fetch( /// The SID of the InstalledAddOn resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - 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 FetchInstalledAddOnOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -275,10 +276,10 @@ public static ResourceSet Read(ReadInstalledAddOnOptions /// Read InstalledAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnOptions 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("installed_add_ons", response.Content); return new ResourceSet(page, options, client); @@ -310,7 +311,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateInstalledAddOnOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateInstalledAddOnOptions 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 @@ -436,7 +438,7 @@ public static async System.Threading.Tasks.Task UpdateAs ITwilioRestClient client = null) { var options = new UpdateInstalledAddOnOptions(pathSid){ Configuration = configuration, UniqueName = uniqueName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionResource.cs b/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionResource.cs index 6340637a0..9e7bb303e 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionResource.cs @@ -75,11 +75,12 @@ public static bool Delete(DeleteDocumentPermissionOptions options, ITwilioRestCl /// Delete DocumentPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission - public static async System.Threading.Tasks.Task DeleteAsync(DeleteDocumentPermissionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteDocumentPermissionOptions 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 @@ -106,7 +107,7 @@ public static bool Delete(string pathServiceSid, string pathDocumentSid, string public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathDocumentSid, string pathIdentity, ITwilioRestClient client = null) { var options = new DeleteDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -147,10 +148,10 @@ public static DocumentPermissionResource Fetch(FetchDocumentPermissionOptions op /// Fetch DocumentPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission - public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentPermissionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentPermissionOptions 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 @@ -180,7 +181,7 @@ public static DocumentPermissionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathDocumentSid, string pathIdentity, ITwilioRestClient client = null) { var options = new FetchDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -219,10 +220,10 @@ public static ResourceSet Read(ReadDocumentPermissio /// Read DocumentPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission - public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentPermissionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentPermissionOptions 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("permissions", response.Content); return new ResourceSet(page, options, client); @@ -262,7 +263,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateDocumentPermissionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateDocumentPermissionOptions 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 @@ -404,7 +406,7 @@ public static async System.Threading.Tasks.Task Upda ITwilioRestClient client = null) { var options = new UpdateDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity, read, write, manage){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Sync/Service/DocumentResource.cs b/src/Twilio/Rest/Preview/Sync/Service/DocumentResource.cs index b0d94fff7..ae1c4a3be 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/DocumentResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/DocumentResource.cs @@ -68,10 +68,10 @@ public static DocumentResource Create(CreateDocumentOptions options, ITwilioRest /// Create Document parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task CreateAsync(CreateDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateDocumentOptions 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 CreateDocumentOptions(pathServiceSid){ UniqueName = uniqueName, Data = data }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -149,11 +149,12 @@ public static bool Delete(DeleteDocumentOptions options, ITwilioRestClient clien /// Delete Document parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task DeleteAsync(DeleteDocumentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteDocumentOptions 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 DeleteDocumentOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -217,10 +218,10 @@ public static DocumentResource Fetch(FetchDocumentOptions options, ITwilioRestCl /// Fetch Document parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentOptions 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 DocumentResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchDocumentOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +285,10 @@ public static ResourceSet Read(ReadDocumentOptions options, IT /// Read Document parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentOptions 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("documents", response.Content); return new ResourceSet(page, options, client); @@ -323,7 +324,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadDocumentOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -412,11 +413,12 @@ public static DocumentResource Update(UpdateDocumentOptions options, ITwilioRest /// Client to make requests to Twilio /// Task that resolves to A single instance of Document #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateDocumentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateDocumentOptions 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 @@ -455,7 +457,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateDocumentOptions(pathServiceSid, pathSid, data){ IfMatch = ifMatch }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemResource.cs b/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemResource.cs index 6cf028acd..a42cdae11 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemResource.cs @@ -94,10 +94,10 @@ public static SyncListItemResource Create(CreateSyncListItemOptions options, ITw /// Create SyncListItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListItemOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListItemOptions 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 @@ -132,7 +132,7 @@ public static async System.Threading.Tasks.Task CreateAsyn ITwilioRestClient client = null) { var options = new CreateSyncListItemOptions(pathServiceSid, pathListSid, data){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -177,11 +177,12 @@ public static bool Delete(DeleteSyncListItemOptions options, ITwilioRestClient c /// Delete SyncListItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListItemOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListItemOptions 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 @@ -210,7 +211,7 @@ public static bool Delete(string pathServiceSid, string pathListSid, int? pathIn public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathListSid, int? pathIndex, string ifMatch = null, ITwilioRestClient client = null) { var options = new DeleteSyncListItemOptions(pathServiceSid, pathListSid, pathIndex) { IfMatch = ifMatch }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -251,10 +252,10 @@ public static SyncListItemResource Fetch(FetchSyncListItemOptions options, ITwil /// Fetch SyncListItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListItemOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListItemOptions 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 @@ -284,7 +285,7 @@ public static SyncListItemResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathListSid, int? pathIndex, ITwilioRestClient client = null) { var options = new FetchSyncListItemOptions(pathServiceSid, pathListSid, pathIndex){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -323,10 +324,10 @@ public static ResourceSet Read(ReadSyncListItemOptions opt /// Read SyncListItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListItemOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListItemOptions 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("items", response.Content); return new ResourceSet(page, options, client); @@ -378,7 +379,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListItemOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListItemOptions 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 @@ -516,7 +518,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn ITwilioRestClient client = null) { var options = new UpdateSyncListItemOptions(pathServiceSid, pathListSid, pathIndex, data){ IfMatch = ifMatch }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionResource.cs b/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionResource.cs index aa8e8da45..38d422008 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionResource.cs @@ -75,11 +75,12 @@ public static bool Delete(DeleteSyncListPermissionOptions options, ITwilioRestCl /// Delete SyncListPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListPermissionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListPermissionOptions 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 @@ -106,7 +107,7 @@ public static bool Delete(string pathServiceSid, string pathListSid, string path public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathListSid, string pathIdentity, ITwilioRestClient client = null) { var options = new DeleteSyncListPermissionOptions(pathServiceSid, pathListSid, pathIdentity) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -147,10 +148,10 @@ public static SyncListPermissionResource Fetch(FetchSyncListPermissionOptions op /// Fetch SyncListPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListPermissionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListPermissionOptions 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 @@ -180,7 +181,7 @@ public static SyncListPermissionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathListSid, string pathIdentity, ITwilioRestClient client = null) { var options = new FetchSyncListPermissionOptions(pathServiceSid, pathListSid, pathIdentity){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -219,10 +220,10 @@ public static ResourceSet Read(ReadSyncListPermissio /// Read SyncListPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListPermissionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListPermissionOptions 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("permissions", response.Content); return new ResourceSet(page, options, client); @@ -262,7 +263,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListPermissionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListPermissionOptions 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 @@ -404,7 +406,7 @@ public static async System.Threading.Tasks.Task Upda ITwilioRestClient client = null) { var options = new UpdateSyncListPermissionOptions(pathServiceSid, pathListSid, pathIdentity, read, write, manage){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncListResource.cs b/src/Twilio/Rest/Preview/Sync/Service/SyncListResource.cs index fac3598c2..713af15ba 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncListResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncListResource.cs @@ -68,10 +68,10 @@ public static SyncListResource Create(CreateSyncListOptions options, ITwilioRest /// Create SyncList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListOptions 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 CreateSyncListOptions(pathServiceSid){ UniqueName = uniqueName }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteSyncListOptions options, ITwilioRestClient clien /// Delete SyncList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListOptions 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 DeleteSyncListOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static SyncListResource Fetch(FetchSyncListOptions options, ITwilioRestCl /// Fetch SyncList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListOptions 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 SyncListResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchSyncListOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadSyncListOptions options, IT /// Read SyncList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListOptions 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("lists", 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 ReadSyncListOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemResource.cs b/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemResource.cs index 3ce7baaaf..bf98a3712 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemResource.cs @@ -94,10 +94,10 @@ public static SyncMapItemResource Create(CreateSyncMapItemOptions options, ITwil /// Create SyncMapItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapItemOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapItemOptions 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 @@ -136,7 +136,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreateSyncMapItemOptions(pathServiceSid, pathMapSid, key, data){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -181,11 +181,12 @@ public static bool Delete(DeleteSyncMapItemOptions options, ITwilioRestClient cl /// Delete SyncMapItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapItemOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapItemOptions 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 @@ -214,7 +215,7 @@ public static bool Delete(string pathServiceSid, string pathMapSid, string pathK public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathMapSid, string pathKey, string ifMatch = null, ITwilioRestClient client = null) { var options = new DeleteSyncMapItemOptions(pathServiceSid, pathMapSid, pathKey) { IfMatch = ifMatch }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -255,10 +256,10 @@ public static SyncMapItemResource Fetch(FetchSyncMapItemOptions options, ITwilio /// Fetch SyncMapItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapItemOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapItemOptions 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 @@ -288,7 +289,7 @@ public static SyncMapItemResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathMapSid, string pathKey, ITwilioRestClient client = null) { var options = new FetchSyncMapItemOptions(pathServiceSid, pathMapSid, pathKey){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -327,10 +328,10 @@ public static ResourceSet Read(ReadSyncMapItemOptions optio /// Read SyncMapItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapItemOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapItemOptions 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("items", response.Content); return new ResourceSet(page, options, client); @@ -382,7 +383,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadSyncMapItemOptions(pathServiceSid, pathMapSid){ Order = order, From = from, Bounds = bounds, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -473,11 +474,12 @@ public static SyncMapItemResource Update(UpdateSyncMapItemOptions options, ITwil /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapItemOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapItemOptions 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 @@ -520,7 +522,7 @@ public static async System.Threading.Tasks.Task UpdateAsync ITwilioRestClient client = null) { var options = new UpdateSyncMapItemOptions(pathServiceSid, pathMapSid, pathKey, data){ IfMatch = ifMatch }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionResource.cs b/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionResource.cs index 6c62cfa41..9c330656d 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionResource.cs @@ -75,11 +75,12 @@ public static bool Delete(DeleteSyncMapPermissionOptions options, ITwilioRestCli /// Delete SyncMapPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapPermissionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapPermissionOptions 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 @@ -106,7 +107,7 @@ public static bool Delete(string pathServiceSid, string pathMapSid, string pathI public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathMapSid, string pathIdentity, ITwilioRestClient client = null) { var options = new DeleteSyncMapPermissionOptions(pathServiceSid, pathMapSid, pathIdentity) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -147,10 +148,10 @@ public static SyncMapPermissionResource Fetch(FetchSyncMapPermissionOptions opti /// Fetch SyncMapPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapPermissionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapPermissionOptions 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 @@ -180,7 +181,7 @@ public static SyncMapPermissionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathMapSid, string pathIdentity, ITwilioRestClient client = null) { var options = new FetchSyncMapPermissionOptions(pathServiceSid, pathMapSid, pathIdentity){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -219,10 +220,10 @@ public static ResourceSet Read(ReadSyncMapPermissionO /// Read SyncMapPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapPermissionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapPermissionOptions 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("permissions", response.Content); return new ResourceSet(page, options, client); @@ -262,7 +263,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapPermissionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapPermissionOptions 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 @@ -404,7 +406,7 @@ public static async System.Threading.Tasks.Task Updat ITwilioRestClient client = null) { var options = new UpdateSyncMapPermissionOptions(pathServiceSid, pathMapSid, pathIdentity, read, write, manage){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncMapResource.cs b/src/Twilio/Rest/Preview/Sync/Service/SyncMapResource.cs index 94b4b8451..69982ee60 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncMapResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncMapResource.cs @@ -68,10 +68,10 @@ public static SyncMapResource Create(CreateSyncMapOptions options, ITwilioRestCl /// Create SyncMap parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapOptions 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 CreateSyncMapOptions(pathServiceSid){ UniqueName = uniqueName }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteSyncMapOptions options, ITwilioRestClient client /// Delete SyncMap parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapOptions 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 DeleteSyncMapOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static SyncMapResource Fetch(FetchSyncMapOptions options, ITwilioRestClie /// Fetch SyncMap parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapOptions 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 SyncMapResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchSyncMapOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadSyncMapOptions options, ITwi /// Read SyncMap parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapOptions 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("maps", response.Content); return new ResourceSet(page, options, client); @@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadSyncMapOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Sync/ServiceResource.cs b/src/Twilio/Rest/Preview/Sync/ServiceResource.cs index aa0536ba6..cf4a8bc17 100644 --- a/src/Twilio/Rest/Preview/Sync/ServiceResource.cs +++ b/src/Twilio/Rest/Preview/Sync/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(){ FriendlyName = friendlyName, WebhookUrl = webhookUrl, ReachabilityWebhooksEnabled = reachabilityWebhooksEnabled, AclEnabled = aclEnabled }; - 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) /// /// 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( /// /// 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 @@ -444,7 +446,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid){ WebhookUrl = webhookUrl, FriendlyName = friendlyName, ReachabilityWebhooksEnabled = reachabilityWebhooksEnabled, AclEnabled = aclEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Wireless/CommandResource.cs b/src/Twilio/Rest/Preview/Wireless/CommandResource.cs index 2d2cc492b..7c9e8637b 100644 --- a/src/Twilio/Rest/Preview/Wireless/CommandResource.cs +++ b/src/Twilio/Rest/Preview/Wireless/CommandResource.cs @@ -66,10 +66,10 @@ public static CommandResource Create(CreateCommandOptions options, ITwilioRestCl /// Create Command parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task CreateAsync(CreateCommandOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCommandOptions 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 @@ -120,7 +120,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateCommandOptions(command){ Device = device, Sim = sim, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, CommandMode = commandMode, IncludeSid = includeSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -157,10 +157,10 @@ public static CommandResource Fetch(FetchCommandOptions options, ITwilioRestClie /// Fetch Command parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task FetchAsync(FetchCommandOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCommandOptions 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 @@ -181,10 +181,10 @@ public static CommandResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - 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 FetchCommandOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -219,10 +219,10 @@ public static ResourceSet Read(ReadCommandOptions options, ITwi /// Read Command parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task> ReadAsync(ReadCommandOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCommandOptions 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("commands", response.Content); return new ResourceSet(page, options, client); @@ -270,7 +270,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadCommandOptions(){ Device = device, Sim = sim, Status = status, Direction = direction, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Wireless/RatePlanResource.cs b/src/Twilio/Rest/Preview/Wireless/RatePlanResource.cs index c0d435f8e..6bc70b811 100644 --- a/src/Twilio/Rest/Preview/Wireless/RatePlanResource.cs +++ b/src/Twilio/Rest/Preview/Wireless/RatePlanResource.cs @@ -66,10 +66,10 @@ public static RatePlanResource Create(CreateRatePlanOptions options, ITwilioRest /// Create RatePlan parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task CreateAsync(CreateRatePlanOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateRatePlanOptions 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 @@ -132,7 +132,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateRatePlanOptions(){ UniqueName = uniqueName, FriendlyName = friendlyName, DataEnabled = dataEnabled, DataLimit = dataLimit, DataMetering = dataMetering, MessagingEnabled = messagingEnabled, VoiceEnabled = voiceEnabled, CommandsEnabled = commandsEnabled, NationalRoamingEnabled = nationalRoamingEnabled, InternationalRoaming = internationalRoaming }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -173,11 +173,12 @@ public static bool Delete(DeleteRatePlanOptions options, ITwilioRestClient clien /// Delete RatePlan parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task DeleteAsync(DeleteRatePlanOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteRatePlanOptions 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 @@ -197,10 +198,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - 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 DeleteRatePlanOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -237,10 +238,10 @@ public static RatePlanResource Fetch(FetchRatePlanOptions options, ITwilioRestCl /// Fetch RatePlan parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task FetchAsync(FetchRatePlanOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRatePlanOptions 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 @@ -261,10 +262,10 @@ public static RatePlanResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - 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 FetchRatePlanOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -299,10 +300,10 @@ public static ResourceSet Read(ReadRatePlanOptions options, IT /// Read RatePlan parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task> ReadAsync(ReadRatePlanOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRatePlanOptions 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("rate_plans", response.Content); return new ResourceSet(page, options, client); @@ -334,7 +335,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadRatePlanOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -421,11 +422,12 @@ public static RatePlanResource Update(UpdateRatePlanOptions options, ITwilioRest /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateRatePlanOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateRatePlanOptions 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 @@ -460,7 +462,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateRatePlanOptions(pathSid){ UniqueName = uniqueName, FriendlyName = friendlyName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Wireless/Sim/UsageResource.cs b/src/Twilio/Rest/Preview/Wireless/Sim/UsageResource.cs index 8d44b19db..c0a9daf55 100644 --- a/src/Twilio/Rest/Preview/Wireless/Sim/UsageResource.cs +++ b/src/Twilio/Rest/Preview/Wireless/Sim/UsageResource.cs @@ -67,10 +67,10 @@ public static UsageResource Fetch(FetchUsageOptions options, ITwilioRestClient c /// Fetch Usage parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Usage - public static async System.Threading.Tasks.Task FetchAsync(FetchUsageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchUsageOptions 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 @@ -100,7 +100,7 @@ public static UsageResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSimSid, string end = null, string start = null, ITwilioRestClient client = null) { var options = new FetchUsageOptions(pathSimSid){ End = end,Start = start }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Preview/Wireless/SimResource.cs b/src/Twilio/Rest/Preview/Wireless/SimResource.cs index 3e28af886..ff123c4ec 100644 --- a/src/Twilio/Rest/Preview/Wireless/SimResource.cs +++ b/src/Twilio/Rest/Preview/Wireless/SimResource.cs @@ -67,10 +67,10 @@ public static SimResource Fetch(FetchSimOptions options, ITwilioRestClient clien /// Fetch Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task FetchAsync(FetchSimOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSimOptions 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 SimResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - 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 FetchSimOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadSimOptions options, ITwilioRestC /// Read Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task> ReadAsync(ReadSimOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSimOptions 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("sims", response.Content); return new ResourceSet(page, options, client); @@ -184,7 +184,7 @@ public static async System.Threading.Tasks.Task> ReadAs ITwilioRestClient client = null) { var options = new ReadSimOptions(){ Status = status, Iccid = iccid, RatePlan = ratePlan, EId = eId, SimRegistrationCode = simRegistrationCode, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -271,11 +271,12 @@ public static SimResource Update(UpdateSimOptions options, ITwilioRestClient cli /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSimOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSimOptions 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 @@ -366,7 +367,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateSimOptions(pathSid){ UniqueName = uniqueName, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, FriendlyName = friendlyName, RatePlan = ratePlan, Status = status, CommandsCallbackMethod = commandsCallbackMethod, CommandsCallbackUrl = commandsCallbackUrl, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif 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/Pricing/V1/Messaging/CountryResource.cs b/src/Twilio/Rest/Pricing/V1/Messaging/CountryResource.cs index 610a35179..f4f92b8b0 100644 --- a/src/Twilio/Rest/Pricing/V1/Messaging/CountryResource.cs +++ b/src/Twilio/Rest/Pricing/V1/Messaging/CountryResource.cs @@ -67,10 +67,10 @@ public static CountryResource Fetch(FetchCountryOptions options, ITwilioRestClie /// Fetch Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions 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 CountryResource Fetch( /// The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchCountryOptions(pathIsoCountry){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadCountryOptions options, ITwi /// Read Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions 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("countries", response.Content); return new ResourceSet(page, options, client); @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadCountryOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryResource.cs b/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryResource.cs index bde1e053d..2c03dd43f 100644 --- a/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryResource.cs +++ b/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryResource.cs @@ -67,10 +67,10 @@ public static CountryResource Fetch(FetchCountryOptions options, ITwilioRestClie /// Fetch Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions 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 CountryResource Fetch( /// The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchCountryOptions(pathIsoCountry){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadCountryOptions options, ITwi /// Read Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions 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("countries", response.Content); return new ResourceSet(page, options, client); @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadCountryOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Pricing/V1/Voice/CountryResource.cs b/src/Twilio/Rest/Pricing/V1/Voice/CountryResource.cs index dfef858d0..c8832e3bf 100644 --- a/src/Twilio/Rest/Pricing/V1/Voice/CountryResource.cs +++ b/src/Twilio/Rest/Pricing/V1/Voice/CountryResource.cs @@ -67,10 +67,10 @@ public static CountryResource Fetch(FetchCountryOptions options, ITwilioRestClie /// Fetch Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions 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 CountryResource Fetch( /// The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchCountryOptions(pathIsoCountry){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadCountryOptions options, ITwi /// Read Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions 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("countries", response.Content); return new ResourceSet(page, options, client); @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadCountryOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Pricing/V1/Voice/NumberResource.cs b/src/Twilio/Rest/Pricing/V1/Voice/NumberResource.cs index c2fd2ccdf..2712192e7 100644 --- a/src/Twilio/Rest/Pricing/V1/Voice/NumberResource.cs +++ b/src/Twilio/Rest/Pricing/V1/Voice/NumberResource.cs @@ -67,10 +67,10 @@ public static NumberResource Fetch(FetchNumberOptions options, ITwilioRestClient /// Fetch Number parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Number - public static async System.Threading.Tasks.Task FetchAsync(FetchNumberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchNumberOptions 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 @@ -94,7 +94,7 @@ public static NumberResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(Types.PhoneNumber pathNumber, ITwilioRestClient client = null) { var options = new FetchNumberOptions(pathNumber){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Pricing/V2/CountryResource.cs b/src/Twilio/Rest/Pricing/V2/CountryResource.cs index 20a9b660e..7ccc9a7fb 100644 --- a/src/Twilio/Rest/Pricing/V2/CountryResource.cs +++ b/src/Twilio/Rest/Pricing/V2/CountryResource.cs @@ -67,10 +67,10 @@ public static CountryResource Fetch(FetchCountryOptions options, ITwilioRestClie /// Fetch Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions 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 CountryResource Fetch( /// The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchCountryOptions(pathIsoCountry){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadCountryOptions options, ITwi /// Read Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions 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("countries", response.Content); return new ResourceSet(page, options, client); @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadCountryOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Pricing/V2/NumberResource.cs b/src/Twilio/Rest/Pricing/V2/NumberResource.cs index 7830624a3..1bb3a1f44 100644 --- a/src/Twilio/Rest/Pricing/V2/NumberResource.cs +++ b/src/Twilio/Rest/Pricing/V2/NumberResource.cs @@ -67,10 +67,10 @@ public static NumberResource Fetch(FetchNumberOptions options, ITwilioRestClient /// Fetch Number parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Number - public static async System.Threading.Tasks.Task FetchAsync(FetchNumberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchNumberOptions 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 @@ -97,7 +97,7 @@ public static NumberResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(Types.PhoneNumber pathDestinationNumber, Types.PhoneNumber originationNumber = null, ITwilioRestClient client = null) { var options = new FetchNumberOptions(pathDestinationNumber){ OriginationNumber = originationNumber }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Pricing/V2/Voice/CountryResource.cs b/src/Twilio/Rest/Pricing/V2/Voice/CountryResource.cs index 924aaf982..0feb5d995 100644 --- a/src/Twilio/Rest/Pricing/V2/Voice/CountryResource.cs +++ b/src/Twilio/Rest/Pricing/V2/Voice/CountryResource.cs @@ -67,10 +67,10 @@ public static CountryResource Fetch(FetchCountryOptions options, ITwilioRestClie /// Fetch Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions 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 CountryResource Fetch( /// The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchCountryOptions(pathIsoCountry){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadCountryOptions options, ITwi /// Read Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions 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("countries", response.Content); return new ResourceSet(page, options, client); @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadCountryOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Pricing/V2/Voice/NumberResource.cs b/src/Twilio/Rest/Pricing/V2/Voice/NumberResource.cs index 2e520d4c0..b589efa0d 100644 --- a/src/Twilio/Rest/Pricing/V2/Voice/NumberResource.cs +++ b/src/Twilio/Rest/Pricing/V2/Voice/NumberResource.cs @@ -67,10 +67,10 @@ public static NumberResource Fetch(FetchNumberOptions options, ITwilioRestClient /// Fetch Number parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Number - public static async System.Threading.Tasks.Task FetchAsync(FetchNumberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchNumberOptions 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 @@ -97,7 +97,7 @@ public static NumberResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(Types.PhoneNumber pathDestinationNumber, Types.PhoneNumber originationNumber = null, ITwilioRestClient client = null) { var options = new FetchNumberOptions(pathDestinationNumber){ OriginationNumber = originationNumber }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberResource.cs b/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberResource.cs index d3974ddc3..c71e5e934 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberResource.cs +++ b/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberResource.cs @@ -68,10 +68,10 @@ public static PhoneNumberResource Create(CreatePhoneNumberOptions options, ITwil /// Create PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task CreateAsync(CreatePhoneNumberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreatePhoneNumberOptions 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 @@ -110,7 +110,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreatePhoneNumberOptions(pathServiceSid){ Sid = sid, PhoneNumber = phoneNumber, IsReserved = isReserved }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -153,11 +153,12 @@ public static bool Delete(DeletePhoneNumberOptions options, ITwilioRestClient cl /// Delete PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task DeleteAsync(DeletePhoneNumberOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeletePhoneNumberOptions 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 @@ -182,7 +183,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 DeletePhoneNumberOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -221,10 +222,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 @@ -251,7 +252,7 @@ public static PhoneNumberResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchPhoneNumberOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -288,10 +289,10 @@ public static ResourceSet Read(ReadPhoneNumberOptions optio /// Read PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task> ReadAsync(ReadPhoneNumberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPhoneNumberOptions 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("phone_numbers", response.Content); return new ResourceSet(page, options, client); @@ -327,7 +328,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadPhoneNumberOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -416,11 +417,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 @@ -455,7 +457,7 @@ public static async System.Threading.Tasks.Task UpdateAsync ITwilioRestClient client = null) { var options = new UpdatePhoneNumberOptions(pathServiceSid, pathSid){ IsReserved = isReserved }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionResource.cs b/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionResource.cs index f5ddb9f66..ea84d40b6 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionResource.cs +++ b/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionResource.cs @@ -121,11 +121,12 @@ public static bool Delete(DeleteInteractionOptions options, ITwilioRestClient cl /// Delete Interaction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Interaction - public static async System.Threading.Tasks.Task DeleteAsync(DeleteInteractionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteInteractionOptions 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 @@ -152,7 +153,7 @@ public static bool Delete(string pathServiceSid, string pathSessionSid, string p public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSessionSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteInteractionOptions(pathServiceSid, pathSessionSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -193,10 +194,10 @@ public static InteractionResource Fetch(FetchInteractionOptions options, ITwilio /// Fetch Interaction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Interaction - public static async System.Threading.Tasks.Task FetchAsync(FetchInteractionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInteractionOptions 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 @@ -226,7 +227,7 @@ public static InteractionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSessionSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchInteractionOptions(pathServiceSid, pathSessionSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -265,10 +266,10 @@ public static ResourceSet Read(ReadInteractionOptions optio /// Read Interaction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Interaction - public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionOptions 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("interactions", response.Content); return new ResourceSet(page, options, client); @@ -308,7 +309,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadInteractionOptions(pathServiceSid, pathSessionSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionResource.cs b/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionResource.cs index a22f90f1b..28693ed3f 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionResource.cs +++ b/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionResource.cs @@ -118,10 +118,10 @@ public static MessageInteractionResource Create(CreateMessageInteractionOptions /// Create MessageInteraction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MessageInteraction - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageInteractionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageInteractionOptions 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 @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task Crea ITwilioRestClient client = null) { var options = new CreateMessageInteractionOptions(pathServiceSid, pathSessionSid, pathParticipantSid){ Body = body, MediaUrl = mediaUrl }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -207,10 +207,10 @@ public static MessageInteractionResource Fetch(FetchMessageInteractionOptions op /// Fetch MessageInteraction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MessageInteraction - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageInteractionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageInteractionOptions 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 +243,7 @@ public static MessageInteractionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSessionSid, string pathParticipantSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchMessageInteractionOptions(pathServiceSid, pathSessionSid, pathParticipantSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +284,10 @@ public static ResourceSet Read(ReadMessageInteractio /// Read MessageInteraction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MessageInteraction - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageInteractionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageInteractionOptions 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("interactions", response.Content); return new ResourceSet(page, options, client); @@ -331,7 +331,7 @@ public static async System.Threading.Tasks.Task Create Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions 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 @@ -120,7 +120,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreateParticipantOptions(pathServiceSid, pathSessionSid, identifier){ FriendlyName = friendlyName, ProxyIdentifier = proxyIdentifier, ProxyIdentifierSid = proxyIdentifierSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -165,11 +165,12 @@ public static bool Delete(DeleteParticipantOptions options, ITwilioRestClient cl /// Delete Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task DeleteAsync(DeleteParticipantOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteParticipantOptions 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 @@ -196,7 +197,7 @@ public static bool Delete(string pathServiceSid, string pathSessionSid, string p public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSessionSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteParticipantOptions(pathServiceSid, pathSessionSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -237,10 +238,10 @@ public static ParticipantResource Fetch(FetchParticipantOptions options, ITwilio /// Fetch Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions 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 @@ -270,7 +271,7 @@ public static ParticipantResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSessionSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchParticipantOptions(pathServiceSid, pathSessionSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -309,10 +310,10 @@ public static ResourceSet Read(ReadParticipantOptions optio /// Read Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions 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("participants", response.Content); return new ResourceSet(page, options, client); @@ -352,7 +353,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadParticipantOptions(pathServiceSid, pathSessionSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Proxy/V1/Service/SessionResource.cs b/src/Twilio/Rest/Proxy/V1/Service/SessionResource.cs index 7cb56b5e1..49ab308e1 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/SessionResource.cs +++ b/src/Twilio/Rest/Proxy/V1/Service/SessionResource.cs @@ -98,10 +98,10 @@ public static SessionResource Create(CreateSessionOptions options, ITwilioRestCl /// Create Session parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task CreateAsync(CreateSessionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSessionOptions 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 @@ -152,7 +152,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateSessionOptions(pathServiceSid){ UniqueName = uniqueName, DateExpiry = dateExpiry, Ttl = ttl, Mode = mode, Status = status, Participants = participants }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -195,11 +195,12 @@ public static bool Delete(DeleteSessionOptions options, ITwilioRestClient client /// Delete Session parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSessionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSessionOptions 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 @@ -224,7 +225,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 DeleteSessionOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -263,10 +264,10 @@ public static SessionResource Fetch(FetchSessionOptions options, ITwilioRestClie /// Fetch Session parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task FetchAsync(FetchSessionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSessionOptions 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 @@ -293,7 +294,7 @@ public static SessionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchSessionOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -330,10 +331,10 @@ public static ResourceSet Read(ReadSessionOptions options, ITwi /// Read Session parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task> ReadAsync(ReadSessionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSessionOptions 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("sessions", response.Content); return new ResourceSet(page, options, client); @@ -369,7 +370,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadSessionOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -458,11 +459,12 @@ public static SessionResource Update(UpdateSessionOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Session #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSessionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSessionOptions 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 @@ -505,7 +507,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateSessionOptions(pathServiceSid, pathSid){ DateExpiry = dateExpiry, Ttl = ttl, Status = status }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Proxy/V1/Service/ShortCodeResource.cs b/src/Twilio/Rest/Proxy/V1/Service/ShortCodeResource.cs index e1d5ec5d9..171766e54 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/ShortCodeResource.cs +++ b/src/Twilio/Rest/Proxy/V1/Service/ShortCodeResource.cs @@ -68,10 +68,10 @@ public static ShortCodeResource Create(CreateShortCodeOptions options, ITwilioRe /// Create ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task CreateAsync(CreateShortCodeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateShortCodeOptions 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 CreateShortCodeOptions(pathServiceSid, sid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteShortCodeOptions options, ITwilioRestClient clie /// Delete ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task DeleteAsync(DeleteShortCodeOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteShortCodeOptions 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 DeleteShortCodeOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static ShortCodeResource Fetch(FetchShortCodeOptions options, ITwilioRest /// Fetch ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task FetchAsync(FetchShortCodeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchShortCodeOptions 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 ShortCodeResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchShortCodeOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadShortCodeOptions options, /// Read ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task> ReadAsync(ReadShortCodeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadShortCodeOptions 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("short_codes", response.Content); return new ResourceSet(page, options, client); @@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadShortCodeOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -408,11 +409,12 @@ public static ShortCodeResource Update(UpdateShortCodeOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateShortCodeOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateShortCodeOptions 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 UpdateShortCodeOptions(pathServiceSid, pathSid){ IsReserved = isReserved }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Proxy/V1/ServiceResource.cs b/src/Twilio/Rest/Proxy/V1/ServiceResource.cs index 715232318..3daf430fb 100644 --- a/src/Twilio/Rest/Proxy/V1/ServiceResource.cs +++ b/src/Twilio/Rest/Proxy/V1/ServiceResource.cs @@ -94,10 +94,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 @@ -152,7 +152,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateServiceOptions(uniqueName){ DefaultTtl = defaultTtl, CallbackUrl = callbackUrl, GeoMatchLevel = geoMatchLevel, NumberSelectionBehavior = numberSelectionBehavior, InterceptCallbackUrl = interceptCallbackUrl, OutOfSessionCallbackUrl = outOfSessionCallbackUrl, ChatInstanceSid = chatInstanceSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -193,11 +193,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 @@ -217,10 +218,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies 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 @@ -257,10 +258,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 @@ -281,10 +282,10 @@ public static ServiceResource Fetch( /// The Twilio-provided string that uniquely identifies 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 @@ -319,10 +320,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); @@ -354,7 +355,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 @@ -441,11 +442,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 @@ -504,7 +506,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid){ UniqueName = uniqueName, DefaultTtl = defaultTtl, CallbackUrl = callbackUrl, GeoMatchLevel = geoMatchLevel, NumberSelectionBehavior = numberSelectionBehavior, InterceptCallbackUrl = interceptCallbackUrl, OutOfSessionCallbackUrl = outOfSessionCallbackUrl, ChatInstanceSid = chatInstanceSid }; - return await UpdateAsync(options, client); + return await UpdateAsync(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 Read(ReadExecutionStepOptions o /// Read ExecutionStep parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ExecutionStep - public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionStepOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionStepOptions 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 Create Execution parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task CreateAsync(CreateExecutionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateExecutionOptions 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 CreateExecutionOptions(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(DeleteExecutionOptions options, ITwilioRestClient clie /// Delete Execution parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task DeleteAsync(DeleteExecutionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteExecutionOptions 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 DeleteExecutionOptions(pathFlowSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -234,10 +235,10 @@ public static ExecutionResource Fetch(FetchExecutionOptions options, ITwilioRest /// Fetch Execution parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionOptions 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 ExecutionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchExecutionOptions(pathFlowSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadExecutionOptions options, /// Read Execution parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionOptions 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("executions", response.Content); return new ResourceSet(page, options, client); @@ -348,7 +349,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadExecutionOptions(pathFlowSid){ DateCreatedFrom = dateCreatedFrom, DateCreatedTo = dateCreatedTo, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -437,11 +438,12 @@ public static ExecutionResource Update(UpdateExecutionOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateExecutionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateExecutionOptions 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 @@ -476,7 +478,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateExecutionOptions(pathFlowSid, pathSid, status){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Studio/V1/FlowResource.cs b/src/Twilio/Rest/Studio/V1/FlowResource.cs index bfb8b5e09..81faf6348 100644 --- a/src/Twilio/Rest/Studio/V1/FlowResource.cs +++ b/src/Twilio/Rest/Studio/V1/FlowResource.cs @@ -84,11 +84,12 @@ public static bool Delete(DeleteFlowOptions options, ITwilioRestClient client = /// Delete Flow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task DeleteAsync(DeleteFlowOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteFlowOptions 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 @@ -108,10 +109,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Flow resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - 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 DeleteFlowOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -148,10 +149,10 @@ public static FlowResource Fetch(FetchFlowOptions options, ITwilioRestClient cli /// Fetch Flow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task FetchAsync(FetchFlowOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchFlowOptions 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 @@ -172,10 +173,10 @@ public static FlowResource Fetch( /// The SID of the Flow resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - 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 FetchFlowOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -210,10 +211,10 @@ public static ResourceSet Read(ReadFlowOptions options, ITwilioRes /// Read Flow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task> ReadAsync(ReadFlowOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFlowOptions 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("flows", response.Content); return new ResourceSet(page, options, client); @@ -245,7 +246,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadFlowOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextResource.cs b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextResource.cs index 13360590b..b76bd48fb 100644 --- a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextResource.cs +++ b/src/Twilio/Rest/Studio/V2/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/V2/Flow/Execution/ExecutionStep/ExecutionStepContextResource.cs b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextResource.cs index db3f27390..e10449f79 100644 --- a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextResource.cs +++ b/src/Twilio/Rest/Studio/V2/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/V2/Flow/Execution/ExecutionStepResource.cs b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepResource.cs index d53c414d1..2b3d3c965 100644 --- a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepResource.cs +++ b/src/Twilio/Rest/Studio/V2/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 Read(ReadExecutionStepOptions o /// Read ExecutionStep parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ExecutionStep - public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionStepOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionStepOptions 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 Create Execution parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task CreateAsync(CreateExecutionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateExecutionOptions 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 CreateExecutionOptions(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(DeleteExecutionOptions options, ITwilioRestClient clie /// Delete Execution parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task DeleteAsync(DeleteExecutionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteExecutionOptions 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 DeleteExecutionOptions(pathFlowSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -234,10 +235,10 @@ public static ExecutionResource Fetch(FetchExecutionOptions options, ITwilioRest /// Fetch Execution parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionOptions 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 ExecutionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchExecutionOptions(pathFlowSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadExecutionOptions options, /// Read Execution parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionOptions 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("executions", response.Content); return new ResourceSet(page, options, client); @@ -348,7 +349,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadExecutionOptions(pathFlowSid){ DateCreatedFrom = dateCreatedFrom, DateCreatedTo = dateCreatedTo, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -437,11 +438,12 @@ public static ExecutionResource Update(UpdateExecutionOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateExecutionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateExecutionOptions 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 @@ -476,7 +478,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateExecutionOptions(pathFlowSid, pathSid, status){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionResource.cs b/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionResource.cs index 14de8b753..0f628c3c9 100644 --- a/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionResource.cs +++ b/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionResource.cs @@ -82,10 +82,10 @@ public static FlowRevisionResource Fetch(FetchFlowRevisionOptions options, ITwil /// Fetch FlowRevision parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlowRevision - public static async System.Threading.Tasks.Task FetchAsync(FetchFlowRevisionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchFlowRevisionOptions 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 @@ -112,7 +112,7 @@ public static FlowRevisionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathRevision, ITwilioRestClient client = null) { var options = new FetchFlowRevisionOptions(pathSid, pathRevision){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -149,10 +149,10 @@ public static ResourceSet Read(ReadFlowRevisionOptions opt /// Read FlowRevision parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlowRevision - public static async System.Threading.Tasks.Task> ReadAsync(ReadFlowRevisionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFlowRevisionOptions 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("revisions", response.Content); return new ResourceSet(page, options, client); @@ -188,7 +188,7 @@ public static async System.Threading.Tasks.Task Fetch FlowTestUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlowTestUser - public static async System.Threading.Tasks.Task FetchAsync(FetchFlowTestUserOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchFlowTestUserOptions 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 FlowTestUserResource Fetch( /// Unique identifier of the flow. /// Client to make requests to Twilio /// Task that resolves to A single instance of FlowTestUser - 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 FetchFlowTestUserOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -132,11 +132,12 @@ public static FlowTestUserResource Update(UpdateFlowTestUserOptions options, ITw /// Client to make requests to Twilio /// Task that resolves to A single instance of FlowTestUser #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlowTestUserOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlowTestUserOptions 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 @@ -167,7 +168,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn ITwilioRestClient client = null) { var options = new UpdateFlowTestUserOptions(pathSid, testUsers){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Studio/V2/FlowResource.cs b/src/Twilio/Rest/Studio/V2/FlowResource.cs index ad8648173..f5f27a199 100644 --- a/src/Twilio/Rest/Studio/V2/FlowResource.cs +++ b/src/Twilio/Rest/Studio/V2/FlowResource.cs @@ -79,10 +79,10 @@ public static FlowResource Create(CreateFlowOptions options, ITwilioRestClient c /// Create Flow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task CreateAsync(CreateFlowOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateFlowOptions 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 @@ -121,7 +121,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateFlowOptions(friendlyName, status, definition){ CommitMessage = commitMessage }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -162,11 +162,12 @@ public static bool Delete(DeleteFlowOptions options, ITwilioRestClient client = /// Delete Flow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task DeleteAsync(DeleteFlowOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteFlowOptions 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 @@ -186,10 +187,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Flow resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - 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 DeleteFlowOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -226,10 +227,10 @@ public static FlowResource Fetch(FetchFlowOptions options, ITwilioRestClient cli /// Fetch Flow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task FetchAsync(FetchFlowOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchFlowOptions 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 @@ -250,10 +251,10 @@ public static FlowResource Fetch( /// The SID of the Flow resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - 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 FetchFlowOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -288,10 +289,10 @@ public static ResourceSet Read(ReadFlowOptions options, ITwilioRes /// Read Flow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task> ReadAsync(ReadFlowOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFlowOptions 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("flows", response.Content); return new ResourceSet(page, options, client); @@ -323,7 +324,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadFlowOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -410,11 +411,12 @@ public static FlowResource Update(UpdateFlowOptions options, ITwilioRestClient c /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlowOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlowOptions 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 @@ -457,7 +459,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateFlowOptions(pathSid, status){ FriendlyName = friendlyName, Definition = definition, CommitMessage = commitMessage }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Studio/V2/FlowValidateResource.cs b/src/Twilio/Rest/Studio/V2/FlowValidateResource.cs index 9d547def7..cff6d614f 100644 --- a/src/Twilio/Rest/Studio/V2/FlowValidateResource.cs +++ b/src/Twilio/Rest/Studio/V2/FlowValidateResource.cs @@ -78,11 +78,12 @@ public static FlowValidateResource Update(UpdateFlowValidateOptions options, ITw /// Client to make requests to Twilio /// Task that resolves to A single instance of FlowValidate #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlowValidateOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlowValidateOptions 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 @@ -121,7 +122,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn ITwilioRestClient client = null) { var options = new UpdateFlowValidateOptions(friendlyName, status, definition){ CommitMessage = commitMessage }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Supersim/V1/EsimProfileResource.cs b/src/Twilio/Rest/Supersim/V1/EsimProfileResource.cs index 477df9b9b..dc6a9bae9 100644 --- a/src/Twilio/Rest/Supersim/V1/EsimProfileResource.cs +++ b/src/Twilio/Rest/Supersim/V1/EsimProfileResource.cs @@ -83,10 +83,10 @@ public static EsimProfileResource Create(CreateEsimProfileOptions options, ITwil /// Create EsimProfile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EsimProfile - public static async System.Threading.Tasks.Task CreateAsync(CreateEsimProfileOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateEsimProfileOptions 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 @@ -125,7 +125,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreateEsimProfileOptions(){ CallbackUrl = callbackUrl, CallbackMethod = callbackMethod, GenerateMatchingId = generateMatchingId, Eid = eid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -162,10 +162,10 @@ public static EsimProfileResource Fetch(FetchEsimProfileOptions options, ITwilio /// Fetch EsimProfile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EsimProfile - public static async System.Threading.Tasks.Task FetchAsync(FetchEsimProfileOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchEsimProfileOptions 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,10 +186,10 @@ public static EsimProfileResource Fetch( /// The SID of the eSIM Profile resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of EsimProfile - 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 FetchEsimProfileOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -224,10 +224,10 @@ public static ResourceSet Read(ReadEsimProfileOptions optio /// Read EsimProfile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EsimProfile - public static async System.Threading.Tasks.Task> ReadAsync(ReadEsimProfileOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEsimProfileOptions 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("esim_profiles", response.Content); return new ResourceSet(page, options, client); @@ -271,7 +271,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadEsimProfileOptions(){ Eid = eid, SimSid = simSid, Status = status, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Supersim/V1/FleetResource.cs b/src/Twilio/Rest/Supersim/V1/FleetResource.cs index f469b26cb..aad060c92 100644 --- a/src/Twilio/Rest/Supersim/V1/FleetResource.cs +++ b/src/Twilio/Rest/Supersim/V1/FleetResource.cs @@ -78,10 +78,10 @@ public static FleetResource Create(CreateFleetOptions options, ITwilioRestClient /// Create Fleet parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Fleet - public static async System.Threading.Tasks.Task CreateAsync(CreateFleetOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateFleetOptions 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 @@ -140,7 +140,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateFleetOptions(networkAccessProfile){ UniqueName = uniqueName, DataEnabled = dataEnabled, DataLimit = dataLimit, IpCommandsUrl = ipCommandsUrl, IpCommandsMethod = ipCommandsMethod, SmsCommandsEnabled = smsCommandsEnabled, SmsCommandsUrl = smsCommandsUrl, SmsCommandsMethod = smsCommandsMethod }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -177,10 +177,10 @@ public static FleetResource Fetch(FetchFleetOptions options, ITwilioRestClient c /// Fetch Fleet parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Fleet - public static async System.Threading.Tasks.Task FetchAsync(FetchFleetOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchFleetOptions 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 @@ -201,10 +201,10 @@ public static FleetResource Fetch( /// The SID of the Fleet resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Fleet - 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 FetchFleetOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -239,10 +239,10 @@ public static ResourceSet Read(ReadFleetOptions options, ITwilioR /// Read Fleet parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Fleet - public static async System.Threading.Tasks.Task> ReadAsync(ReadFleetOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFleetOptions 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("fleets", response.Content); return new ResourceSet(page, options, client); @@ -278,7 +278,7 @@ public static async System.Threading.Tasks.Task> Read ITwilioRestClient client = null) { var options = new ReadFleetOptions(){ NetworkAccessProfile = networkAccessProfile, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -365,11 +365,12 @@ public static FleetResource Update(UpdateFleetOptions options, ITwilioRestClient /// Client to make requests to Twilio /// Task that resolves to A single instance of Fleet #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateFleetOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateFleetOptions 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 @@ -424,7 +425,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateFleetOptions(pathSid){ UniqueName = uniqueName, NetworkAccessProfile = networkAccessProfile, IpCommandsUrl = ipCommandsUrl, IpCommandsMethod = ipCommandsMethod, SmsCommandsUrl = smsCommandsUrl, SmsCommandsMethod = smsCommandsMethod, DataLimit = dataLimit }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Supersim/V1/IpCommandResource.cs b/src/Twilio/Rest/Supersim/V1/IpCommandResource.cs index 0fb0b6a7f..810f54e39 100644 --- a/src/Twilio/Rest/Supersim/V1/IpCommandResource.cs +++ b/src/Twilio/Rest/Supersim/V1/IpCommandResource.cs @@ -107,10 +107,10 @@ public static IpCommandResource Create(CreateIpCommandOptions options, ITwilioRe /// Create IpCommand parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpCommand - public static async System.Threading.Tasks.Task CreateAsync(CreateIpCommandOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateIpCommandOptions 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 @@ -157,7 +157,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateIpCommandOptions(sim, payload, devicePort){ PayloadType = payloadType, CallbackUrl = callbackUrl, CallbackMethod = callbackMethod }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -194,10 +194,10 @@ public static IpCommandResource Fetch(FetchIpCommandOptions options, ITwilioRest /// Fetch IpCommand parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpCommand - public static async System.Threading.Tasks.Task FetchAsync(FetchIpCommandOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchIpCommandOptions 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 @@ -218,10 +218,10 @@ public static IpCommandResource Fetch( /// The SID of the IP Command resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of IpCommand - 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 FetchIpCommandOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -256,10 +256,10 @@ public static ResourceSet Read(ReadIpCommandOptions options, /// Read IpCommand parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpCommand - public static async System.Threading.Tasks.Task> ReadAsync(ReadIpCommandOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadIpCommandOptions 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("ip_commands", response.Content); return new ResourceSet(page, options, client); @@ -307,7 +307,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadIpCommandOptions(){ Sim = sim, SimIccid = simIccid, Status = status, Direction = direction, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkResource.cs b/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkResource.cs index e37a75a19..fb4082666 100644 --- a/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkResource.cs +++ b/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkResource.cs @@ -68,10 +68,10 @@ public static NetworkAccessProfileNetworkResource Create(CreateNetworkAccessProf /// Create NetworkAccessProfileNetwork parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfileNetwork - public static async System.Threading.Tasks.Task CreateAsync(CreateNetworkAccessProfileNetworkOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateNetworkAccessProfileNetworkOptions 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 Delete NetworkAccessProfileNetwork parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfileNetwork - public static async System.Threading.Tasks.Task DeleteAsync(DeleteNetworkAccessProfileNetworkOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteNetworkAccessProfileNetworkOptions 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 pathNetworkAccessProfileSid, string pathSid, IT public static async System.Threading.Tasks.Task DeleteAsync(string pathNetworkAccessProfileSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteNetworkAccessProfileNetworkOptions(pathNetworkAccessProfileSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static NetworkAccessProfileNetworkResource Fetch(FetchNetworkAccessProfil /// Fetch NetworkAccessProfileNetwork parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfileNetwork - public static async System.Threading.Tasks.Task FetchAsync(FetchNetworkAccessProfileNetworkOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchNetworkAccessProfileNetworkOptions 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 NetworkAccessProfileNetworkResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathNetworkAccessProfileSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchNetworkAccessProfileNetworkOptions(pathNetworkAccessProfileSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadNetworkA /// Read NetworkAccessProfileNetwork parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfileNetwork - public static async System.Threading.Tasks.Task> ReadAsync(ReadNetworkAccessProfileNetworkOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadNetworkAccessProfileNetworkOptions 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("networks", response.Content); return new ResourceSet(page, options, client); @@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task Create NetworkAccessProfile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfile - public static async System.Threading.Tasks.Task CreateAsync(CreateNetworkAccessProfileOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateNetworkAccessProfileOptions 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 @@ -100,7 +100,7 @@ public static async System.Threading.Tasks.Task Cr ITwilioRestClient client = null) { var options = new CreateNetworkAccessProfileOptions(){ UniqueName = uniqueName, Networks = networks }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -137,10 +137,10 @@ public static NetworkAccessProfileResource Fetch(FetchNetworkAccessProfileOption /// Fetch NetworkAccessProfile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfile - public static async System.Threading.Tasks.Task FetchAsync(FetchNetworkAccessProfileOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchNetworkAccessProfileOptions 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 @@ -161,10 +161,10 @@ public static NetworkAccessProfileResource Fetch( /// The SID of the Network Access Profile resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfile - 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 FetchNetworkAccessProfileOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -199,10 +199,10 @@ public static ResourceSet Read(ReadNetworkAccessPr /// Read NetworkAccessProfile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfile - public static async System.Threading.Tasks.Task> ReadAsync(ReadNetworkAccessProfileOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadNetworkAccessProfileOptions 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("network_access_profiles", response.Content); return new ResourceSet(page, options, client); @@ -234,7 +234,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfile #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateNetworkAccessProfileOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateNetworkAccessProfileOptions 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 @@ -356,7 +357,7 @@ public static async System.Threading.Tasks.Task Up ITwilioRestClient client = null) { var options = new UpdateNetworkAccessProfileOptions(pathSid){ UniqueName = uniqueName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Supersim/V1/NetworkResource.cs b/src/Twilio/Rest/Supersim/V1/NetworkResource.cs index 63343664a..120342c7f 100644 --- a/src/Twilio/Rest/Supersim/V1/NetworkResource.cs +++ b/src/Twilio/Rest/Supersim/V1/NetworkResource.cs @@ -67,10 +67,10 @@ public static NetworkResource Fetch(FetchNetworkOptions options, ITwilioRestClie /// Fetch Network parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Network - public static async System.Threading.Tasks.Task FetchAsync(FetchNetworkOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchNetworkOptions 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 NetworkResource Fetch( /// The SID of the Network resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Network - 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 FetchNetworkOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadNetworkOptions options, ITwi /// Read Network parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Network - public static async System.Threading.Tasks.Task> ReadAsync(ReadNetworkOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadNetworkOptions 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("networks", response.Content); return new ResourceSet(page, options, client); @@ -176,7 +176,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadNetworkOptions(){ IsoCountry = isoCountry, Mcc = mcc, Mnc = mnc, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Supersim/V1/SettingsUpdateResource.cs b/src/Twilio/Rest/Supersim/V1/SettingsUpdateResource.cs index 3bbcee46e..334a26014 100644 --- a/src/Twilio/Rest/Supersim/V1/SettingsUpdateResource.cs +++ b/src/Twilio/Rest/Supersim/V1/SettingsUpdateResource.cs @@ -80,10 +80,10 @@ public static ResourceSet Read(ReadSettingsUpdateOptions /// Read SettingsUpdate parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SettingsUpdate - public static async System.Threading.Tasks.Task> ReadAsync(ReadSettingsUpdateOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSettingsUpdateOptions 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("settings_updates", response.Content); return new ResourceSet(page, options, client); @@ -123,7 +123,7 @@ public static async System.Threading.Tasks.Task Read(ReadBillingPeriodOptions o /// Read BillingPeriod parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BillingPeriod - public static async System.Threading.Tasks.Task> ReadAsync(ReadBillingPeriodOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBillingPeriodOptions 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("billing_periods", response.Content); return new ResourceSet(page, options, client); @@ -119,7 +119,7 @@ public static async System.Threading.Tasks.Task Read(ReadSimIpAddressOptions opt /// Read SimIpAddress parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SimIpAddress - public static async System.Threading.Tasks.Task> ReadAsync(ReadSimIpAddressOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSimIpAddressOptions 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("ip_addresses", response.Content); return new ResourceSet(page, options, client); @@ -119,7 +119,7 @@ public static async System.Threading.Tasks.Task Create Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task CreateAsync(CreateSimOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSimOptions 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 @@ -129,7 +129,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateSimOptions(iccid, registrationCode){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -166,10 +166,10 @@ public static SimResource Fetch(FetchSimOptions options, ITwilioRestClient clien /// Fetch Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task FetchAsync(FetchSimOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSimOptions 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 @@ -190,10 +190,10 @@ public static SimResource Fetch( /// The SID of the Sim resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - 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 FetchSimOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -228,10 +228,10 @@ public static ResourceSet Read(ReadSimOptions options, ITwilioRestC /// Read Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task> ReadAsync(ReadSimOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSimOptions 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("sims", response.Content); return new ResourceSet(page, options, client); @@ -275,7 +275,7 @@ public static async System.Threading.Tasks.Task> ReadAs ITwilioRestClient client = null) { var options = new ReadSimOptions(){ Status = status, Fleet = fleet, Iccid = iccid, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -362,11 +362,12 @@ public static SimResource Update(UpdateSimOptions options, ITwilioRestClient cli /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSimOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSimOptions 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 @@ -417,7 +418,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateSimOptions(pathSid){ UniqueName = uniqueName, Status = status, Fleet = fleet, CallbackUrl = callbackUrl, CallbackMethod = callbackMethod, AccountSid = accountSid }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Supersim/V1/SmsCommandResource.cs b/src/Twilio/Rest/Supersim/V1/SmsCommandResource.cs index e1eaed2cc..379b7c615 100644 --- a/src/Twilio/Rest/Supersim/V1/SmsCommandResource.cs +++ b/src/Twilio/Rest/Supersim/V1/SmsCommandResource.cs @@ -95,10 +95,10 @@ public static SmsCommandResource Create(CreateSmsCommandOptions options, ITwilio /// Create SmsCommand parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SmsCommand - public static async System.Threading.Tasks.Task CreateAsync(CreateSmsCommandOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSmsCommandOptions 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 @@ -137,7 +137,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateSmsCommandOptions(sim, payload){ CallbackMethod = callbackMethod, CallbackUrl = callbackUrl }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -174,10 +174,10 @@ public static SmsCommandResource Fetch(FetchSmsCommandOptions options, ITwilioRe /// Fetch SmsCommand parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SmsCommand - public static async System.Threading.Tasks.Task FetchAsync(FetchSmsCommandOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSmsCommandOptions 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 @@ -198,10 +198,10 @@ public static SmsCommandResource Fetch( /// The SID of the SMS Command resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of SmsCommand - 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 FetchSmsCommandOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -236,10 +236,10 @@ public static ResourceSet Read(ReadSmsCommandOptions options /// Read SmsCommand parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SmsCommand - public static async System.Threading.Tasks.Task> ReadAsync(ReadSmsCommandOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSmsCommandOptions 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("sms_commands", response.Content); return new ResourceSet(page, options, client); @@ -283,7 +283,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadSmsCommandOptions(){ Sim = sim, Status = status, Direction = direction, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Supersim/V1/UsageRecordResource.cs b/src/Twilio/Rest/Supersim/V1/UsageRecordResource.cs index f5e612fd1..02cb8d544 100644 --- a/src/Twilio/Rest/Supersim/V1/UsageRecordResource.cs +++ b/src/Twilio/Rest/Supersim/V1/UsageRecordResource.cs @@ -92,10 +92,10 @@ public static ResourceSet Read(ReadUsageRecordOptions optio /// Read UsageRecord parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsageRecord - public static async System.Threading.Tasks.Task> ReadAsync(ReadUsageRecordOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUsageRecordOptions 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("usage_records", response.Content); return new ResourceSet(page, options, client); @@ -159,7 +159,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadUsageRecordOptions(){ Sim = sim, Fleet = fleet, Network = network, IsoCountry = isoCountry, Group = group, Granularity = granularity, StartTime = startTime, EndTime = endTime, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionResource.cs b/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionResource.cs index 23f640012..0558730b3 100644 --- a/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionResource.cs @@ -75,11 +75,12 @@ public static bool Delete(DeleteDocumentPermissionOptions options, ITwilioRestCl /// Delete DocumentPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission - public static async System.Threading.Tasks.Task DeleteAsync(DeleteDocumentPermissionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteDocumentPermissionOptions 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 @@ -106,7 +107,7 @@ public static bool Delete(string pathServiceSid, string pathDocumentSid, string public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathDocumentSid, string pathIdentity, ITwilioRestClient client = null) { var options = new DeleteDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -147,10 +148,10 @@ public static DocumentPermissionResource Fetch(FetchDocumentPermissionOptions op /// Fetch DocumentPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission - public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentPermissionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentPermissionOptions 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 @@ -180,7 +181,7 @@ public static DocumentPermissionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathDocumentSid, string pathIdentity, ITwilioRestClient client = null) { var options = new FetchDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -219,10 +220,10 @@ public static ResourceSet Read(ReadDocumentPermissio /// Read DocumentPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission - public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentPermissionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentPermissionOptions 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("permissions", response.Content); return new ResourceSet(page, options, client); @@ -262,7 +263,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateDocumentPermissionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateDocumentPermissionOptions 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 @@ -404,7 +406,7 @@ public static async System.Threading.Tasks.Task Upda ITwilioRestClient client = null) { var options = new UpdateDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity, read, write, manage){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Sync/V1/Service/DocumentResource.cs b/src/Twilio/Rest/Sync/V1/Service/DocumentResource.cs index 7e143a879..b0238b501 100644 --- a/src/Twilio/Rest/Sync/V1/Service/DocumentResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/DocumentResource.cs @@ -68,10 +68,10 @@ public static DocumentResource Create(CreateDocumentOptions options, ITwilioRest /// Create Document parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task CreateAsync(CreateDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateDocumentOptions 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 @@ -110,7 +110,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateDocumentOptions(pathServiceSid){ UniqueName = uniqueName, Data = data, Ttl = ttl }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -153,11 +153,12 @@ public static bool Delete(DeleteDocumentOptions options, ITwilioRestClient clien /// Delete Document parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task DeleteAsync(DeleteDocumentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteDocumentOptions 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 @@ -182,7 +183,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 DeleteDocumentOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -221,10 +222,10 @@ public static DocumentResource Fetch(FetchDocumentOptions options, ITwilioRestCl /// Fetch Document parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentOptions 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 @@ -251,7 +252,7 @@ public static DocumentResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchDocumentOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -288,10 +289,10 @@ public static ResourceSet Read(ReadDocumentOptions options, IT /// Read Document parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentOptions 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("documents", response.Content); return new ResourceSet(page, options, client); @@ -327,7 +328,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadDocumentOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -416,11 +417,12 @@ public static DocumentResource Update(UpdateDocumentOptions options, ITwilioRest /// Client to make requests to Twilio /// Task that resolves to A single instance of Document #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateDocumentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateDocumentOptions 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 @@ -463,7 +465,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateDocumentOptions(pathServiceSid, pathSid){ Data = data, Ttl = ttl, IfMatch = ifMatch }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemResource.cs index d924fac79..7b396f355 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemResource.cs @@ -94,10 +94,10 @@ public static SyncListItemResource Create(CreateSyncListItemOptions options, ITw /// Create SyncListItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListItemOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListItemOptions 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 @@ -144,7 +144,7 @@ public static async System.Threading.Tasks.Task CreateAsyn ITwilioRestClient client = null) { var options = new CreateSyncListItemOptions(pathServiceSid, pathListSid, data){ Ttl = ttl, ItemTtl = itemTtl, CollectionTtl = collectionTtl }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -189,11 +189,12 @@ public static bool Delete(DeleteSyncListItemOptions options, ITwilioRestClient c /// Delete SyncListItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListItemOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListItemOptions 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 @@ -222,7 +223,7 @@ public static bool Delete(string pathServiceSid, string pathListSid, int? pathIn public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathListSid, int? pathIndex, string ifMatch = null, ITwilioRestClient client = null) { var options = new DeleteSyncListItemOptions(pathServiceSid, pathListSid, pathIndex) { IfMatch = ifMatch }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -263,10 +264,10 @@ public static SyncListItemResource Fetch(FetchSyncListItemOptions options, ITwil /// Fetch SyncListItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListItemOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListItemOptions 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 @@ -296,7 +297,7 @@ public static SyncListItemResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathListSid, int? pathIndex, ITwilioRestClient client = null) { var options = new FetchSyncListItemOptions(pathServiceSid, pathListSid, pathIndex){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -335,10 +336,10 @@ public static ResourceSet Read(ReadSyncListItemOptions opt /// Read SyncListItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListItemOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListItemOptions 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("items", response.Content); return new ResourceSet(page, options, client); @@ -390,7 +391,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListItemOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListItemOptions 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 @@ -540,7 +542,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn ITwilioRestClient client = null) { var options = new UpdateSyncListItemOptions(pathServiceSid, pathListSid, pathIndex){ Data = data, Ttl = ttl, ItemTtl = itemTtl, CollectionTtl = collectionTtl, IfMatch = ifMatch }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionResource.cs index 7eb2b2c32..4625fadce 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionResource.cs @@ -75,11 +75,12 @@ public static bool Delete(DeleteSyncListPermissionOptions options, ITwilioRestCl /// Delete SyncListPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListPermissionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListPermissionOptions 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 @@ -106,7 +107,7 @@ public static bool Delete(string pathServiceSid, string pathListSid, string path public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathListSid, string pathIdentity, ITwilioRestClient client = null) { var options = new DeleteSyncListPermissionOptions(pathServiceSid, pathListSid, pathIdentity) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -147,10 +148,10 @@ public static SyncListPermissionResource Fetch(FetchSyncListPermissionOptions op /// Fetch SyncListPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListPermissionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListPermissionOptions 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 @@ -180,7 +181,7 @@ public static SyncListPermissionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathListSid, string pathIdentity, ITwilioRestClient client = null) { var options = new FetchSyncListPermissionOptions(pathServiceSid, pathListSid, pathIdentity){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -219,10 +220,10 @@ public static ResourceSet Read(ReadSyncListPermissio /// Read SyncListPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListPermissionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListPermissionOptions 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("permissions", response.Content); return new ResourceSet(page, options, client); @@ -262,7 +263,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListPermissionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListPermissionOptions 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 @@ -404,7 +406,7 @@ public static async System.Threading.Tasks.Task Upda ITwilioRestClient client = null) { var options = new UpdateSyncListPermissionOptions(pathServiceSid, pathListSid, pathIdentity, read, write, manage){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncListResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncListResource.cs index 61cc128ca..14af2633f 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncListResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncListResource.cs @@ -68,10 +68,10 @@ public static SyncListResource Create(CreateSyncListOptions options, ITwilioRest /// Create SyncList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListOptions 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 @@ -110,7 +110,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateSyncListOptions(pathServiceSid){ UniqueName = uniqueName, Ttl = ttl, CollectionTtl = collectionTtl }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -153,11 +153,12 @@ public static bool Delete(DeleteSyncListOptions options, ITwilioRestClient clien /// Delete SyncList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListOptions 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 @@ -182,7 +183,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 DeleteSyncListOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -221,10 +222,10 @@ public static SyncListResource Fetch(FetchSyncListOptions options, ITwilioRestCl /// Fetch SyncList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListOptions 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 @@ -251,7 +252,7 @@ public static SyncListResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchSyncListOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -288,10 +289,10 @@ public static ResourceSet Read(ReadSyncListOptions options, IT /// Read SyncList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListOptions 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("lists", response.Content); return new ResourceSet(page, options, client); @@ -327,7 +328,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadSyncListOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -416,11 +417,12 @@ public static SyncListResource Update(UpdateSyncListOptions options, ITwilioRest /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListOptions 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 @@ -459,7 +461,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateSyncListOptions(pathServiceSid, pathSid){ Ttl = ttl, CollectionTtl = collectionTtl }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemResource.cs index 523232c75..760b27b0b 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemResource.cs @@ -94,10 +94,10 @@ public static SyncMapItemResource Create(CreateSyncMapItemOptions options, ITwil /// Create SyncMapItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapItemOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapItemOptions 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 @@ -148,7 +148,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreateSyncMapItemOptions(pathServiceSid, pathMapSid, key, data){ Ttl = ttl, ItemTtl = itemTtl, CollectionTtl = collectionTtl }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -193,11 +193,12 @@ public static bool Delete(DeleteSyncMapItemOptions options, ITwilioRestClient cl /// Delete SyncMapItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapItemOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapItemOptions 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 @@ -226,7 +227,7 @@ public static bool Delete(string pathServiceSid, string pathMapSid, string pathK public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathMapSid, string pathKey, string ifMatch = null, ITwilioRestClient client = null) { var options = new DeleteSyncMapItemOptions(pathServiceSid, pathMapSid, pathKey) { IfMatch = ifMatch }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -267,10 +268,10 @@ public static SyncMapItemResource Fetch(FetchSyncMapItemOptions options, ITwilio /// Fetch SyncMapItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapItemOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapItemOptions 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 @@ -300,7 +301,7 @@ public static SyncMapItemResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathMapSid, string pathKey, ITwilioRestClient client = null) { var options = new FetchSyncMapItemOptions(pathServiceSid, pathMapSid, pathKey){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -339,10 +340,10 @@ public static ResourceSet Read(ReadSyncMapItemOptions optio /// Read SyncMapItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapItemOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapItemOptions 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("items", response.Content); return new ResourceSet(page, options, client); @@ -394,7 +395,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadSyncMapItemOptions(pathServiceSid, pathMapSid){ Order = order, From = from, Bounds = bounds, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -485,11 +486,12 @@ public static SyncMapItemResource Update(UpdateSyncMapItemOptions options, ITwil /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapItemOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapItemOptions 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 @@ -544,7 +546,7 @@ public static async System.Threading.Tasks.Task UpdateAsync ITwilioRestClient client = null) { var options = new UpdateSyncMapItemOptions(pathServiceSid, pathMapSid, pathKey){ Data = data, Ttl = ttl, ItemTtl = itemTtl, CollectionTtl = collectionTtl, IfMatch = ifMatch }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionResource.cs index f6d3ace6d..9646ada23 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionResource.cs @@ -75,11 +75,12 @@ public static bool Delete(DeleteSyncMapPermissionOptions options, ITwilioRestCli /// Delete SyncMapPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapPermissionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapPermissionOptions 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 @@ -106,7 +107,7 @@ public static bool Delete(string pathServiceSid, string pathMapSid, string pathI public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathMapSid, string pathIdentity, ITwilioRestClient client = null) { var options = new DeleteSyncMapPermissionOptions(pathServiceSid, pathMapSid, pathIdentity) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -147,10 +148,10 @@ public static SyncMapPermissionResource Fetch(FetchSyncMapPermissionOptions opti /// Fetch SyncMapPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapPermissionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapPermissionOptions 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 @@ -180,7 +181,7 @@ public static SyncMapPermissionResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathMapSid, string pathIdentity, ITwilioRestClient client = null) { var options = new FetchSyncMapPermissionOptions(pathServiceSid, pathMapSid, pathIdentity){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -219,10 +220,10 @@ public static ResourceSet Read(ReadSyncMapPermissionO /// Read SyncMapPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapPermissionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapPermissionOptions 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("permissions", response.Content); return new ResourceSet(page, options, client); @@ -262,7 +263,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapPermissionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapPermissionOptions 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 @@ -404,7 +406,7 @@ public static async System.Threading.Tasks.Task Updat ITwilioRestClient client = null) { var options = new UpdateSyncMapPermissionOptions(pathServiceSid, pathMapSid, pathIdentity, read, write, manage){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncMapResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncMapResource.cs index afb4be3c2..a07dd63f6 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncMapResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncMapResource.cs @@ -68,10 +68,10 @@ public static SyncMapResource Create(CreateSyncMapOptions options, ITwilioRestCl /// Create SyncMap parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapOptions 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 @@ -110,7 +110,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateSyncMapOptions(pathServiceSid){ UniqueName = uniqueName, Ttl = ttl, CollectionTtl = collectionTtl }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -153,11 +153,12 @@ public static bool Delete(DeleteSyncMapOptions options, ITwilioRestClient client /// Delete SyncMap parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapOptions 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 @@ -182,7 +183,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 DeleteSyncMapOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -221,10 +222,10 @@ public static SyncMapResource Fetch(FetchSyncMapOptions options, ITwilioRestClie /// Fetch SyncMap parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapOptions 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 @@ -251,7 +252,7 @@ public static SyncMapResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchSyncMapOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -288,10 +289,10 @@ public static ResourceSet Read(ReadSyncMapOptions options, ITwi /// Read SyncMap parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapOptions 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("maps", response.Content); return new ResourceSet(page, options, client); @@ -327,7 +328,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadSyncMapOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -416,11 +417,12 @@ public static SyncMapResource Update(UpdateSyncMapOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapOptions 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 @@ -459,7 +461,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateSyncMapOptions(pathServiceSid, pathSid){ Ttl = ttl, CollectionTtl = collectionTtl }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageResource.cs index b5a33f3d8..b25d4ffd5 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageResource.cs @@ -70,10 +70,10 @@ public static StreamMessageResource Create(CreateStreamMessageOptions options, I /// Create StreamMessage parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of StreamMessage - public static async System.Threading.Tasks.Task CreateAsync(CreateStreamMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateStreamMessageOptions 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 CreateAsy ITwilioRestClient client = null) { var options = new CreateStreamMessageOptions(pathServiceSid, pathStreamSid, data){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncStreamResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncStreamResource.cs index 1392ca5e9..3db535502 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncStreamResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncStreamResource.cs @@ -68,10 +68,10 @@ public static SyncStreamResource Create(CreateSyncStreamOptions options, ITwilio /// Create SyncStream parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncStream - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncStreamOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncStreamOptions 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 CreateSyncStreamOptions(pathServiceSid){ UniqueName = uniqueName, Ttl = ttl }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -149,11 +149,12 @@ public static bool Delete(DeleteSyncStreamOptions options, ITwilioRestClient cli /// Delete SyncStream parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncStream - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncStreamOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncStreamOptions 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 DeleteSyncStreamOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -217,10 +218,10 @@ public static SyncStreamResource Fetch(FetchSyncStreamOptions options, ITwilioRe /// Fetch SyncStream parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncStream - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncStreamOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncStreamOptions 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 SyncStreamResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchSyncStreamOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +285,10 @@ public static ResourceSet Read(ReadSyncStreamOptions options /// Read SyncStream parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncStream - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncStreamOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncStreamOptions 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("streams", 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 ReadSyncStreamOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -412,11 +413,12 @@ public static SyncStreamResource Update(UpdateSyncStreamOptions options, ITwilio /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncStream #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncStreamOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncStreamOptions 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 @@ -451,7 +453,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateSyncStreamOptions(pathServiceSid, pathSid){ Ttl = ttl }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Sync/V1/ServiceResource.cs b/src/Twilio/Rest/Sync/V1/ServiceResource.cs index c45098787..4de1cde12 100644 --- a/src/Twilio/Rest/Sync/V1/ServiceResource.cs +++ b/src/Twilio/Rest/Sync/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 @@ -120,7 +120,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateServiceOptions(){ FriendlyName = friendlyName, WebhookUrl = webhookUrl, ReachabilityWebhooksEnabled = reachabilityWebhooksEnabled, AclEnabled = aclEnabled, ReachabilityDebouncingEnabled = reachabilityDebouncingEnabled, ReachabilityDebouncingWindow = reachabilityDebouncingWindow, WebhooksFromRestEnabled = webhooksFromRestEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -161,11 +161,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 @@ -185,10 +186,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID 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 @@ -225,10 +226,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 @@ -249,10 +250,10 @@ public static ServiceResource Fetch( /// The SID 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 @@ -287,10 +288,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); @@ -322,7 +323,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 @@ -409,11 +410,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 @@ -468,7 +470,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid){ WebhookUrl = webhookUrl, FriendlyName = friendlyName, ReachabilityWebhooksEnabled = reachabilityWebhooksEnabled, AclEnabled = aclEnabled, ReachabilityDebouncingEnabled = reachabilityDebouncingEnabled, ReachabilityDebouncingWindow = reachabilityDebouncingWindow, WebhooksFromRestEnabled = webhooksFromRestEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityResource.cs index 305eb4f57..0939d6a36 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityResource.cs @@ -68,10 +68,10 @@ public static ActivityResource Create(CreateActivityOptions options, ITwilioRest /// Create Activity parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Activity - public static async System.Threading.Tasks.Task CreateAsync(CreateActivityOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateActivityOptions 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 CreateActivityOptions(pathWorkspaceSid, friendlyName){ Available = available }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -149,11 +149,12 @@ public static bool Delete(DeleteActivityOptions options, ITwilioRestClient clien /// Delete Activity parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Activity - public static async System.Threading.Tasks.Task DeleteAsync(DeleteActivityOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteActivityOptions 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 pathWorkspaceSid, string pathSid, ITwilioRestCl public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteActivityOptions(pathWorkspaceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -217,10 +218,10 @@ public static ActivityResource Fetch(FetchActivityOptions options, ITwilioRestCl /// Fetch Activity parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Activity - public static async System.Threading.Tasks.Task FetchAsync(FetchActivityOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchActivityOptions 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 ActivityResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchActivityOptions(pathWorkspaceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +285,10 @@ public static ResourceSet Read(ReadActivityOptions options, IT /// Read Activity parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Activity - public static async System.Threading.Tasks.Task> ReadAsync(ReadActivityOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadActivityOptions 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("activities", response.Content); return new ResourceSet(page, options, client); @@ -331,7 +332,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadActivityOptions(pathWorkspaceSid){ FriendlyName = friendlyName, Available = available, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -420,11 +421,12 @@ public static ActivityResource Update(UpdateActivityOptions options, ITwilioRest /// Client to make requests to Twilio /// Task that resolves to A single instance of Activity #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateActivityOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateActivityOptions 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 @@ -459,7 +461,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateActivityOptions(pathWorkspaceSid, pathSid){ FriendlyName = friendlyName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/EventResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/EventResource.cs index 0116441e8..b0f3f4910 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/EventResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/EventResource.cs @@ -69,10 +69,10 @@ public static EventResource Fetch(FetchEventOptions options, ITwilioRestClient c /// Fetch Event parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Event - public static async System.Threading.Tasks.Task FetchAsync(FetchEventOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchEventOptions 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 EventResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchEventOptions(pathWorkspaceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -136,10 +136,10 @@ public static ResourceSet Read(ReadEventOptions options, ITwilioR /// Read Event parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Event - public static async System.Threading.Tasks.Task> ReadAsync(ReadEventOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEventOptions 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("events", response.Content); return new ResourceSet(page, options, client); @@ -219,7 +219,7 @@ public static async System.Threading.Tasks.Task> Read ITwilioRestClient client = null) { var options = new ReadEventOptions(pathWorkspaceSid){ EndDate = endDate, EventType = eventType, Minutes = minutes, ReservationSid = reservationSid, StartDate = startDate, TaskQueueSid = taskQueueSid, TaskSid = taskSid, WorkerSid = workerSid, WorkflowSid = workflowSid, TaskChannel = taskChannel, Sid = sid, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationResource.cs index d0d5323c9..dc4a016de 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationResource.cs @@ -134,10 +134,10 @@ public static ReservationResource Fetch(FetchReservationOptions options, ITwilio /// Fetch Reservation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Reservation - public static async System.Threading.Tasks.Task FetchAsync(FetchReservationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchReservationOptions 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 @@ -167,7 +167,7 @@ public static ReservationResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathTaskSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchReservationOptions(pathWorkspaceSid, pathTaskSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -206,10 +206,10 @@ public static ResourceSet Read(ReadReservationOptions optio /// Read Reservation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Reservation - public static async System.Threading.Tasks.Task> ReadAsync(ReadReservationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadReservationOptions 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("reservations", response.Content); return new ResourceSet(page, options, client); @@ -257,7 +257,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadReservationOptions(pathWorkspaceSid, pathTaskSid){ ReservationStatus = reservationStatus, WorkerSid = workerSid, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -348,11 +348,12 @@ public static ReservationResource Update(UpdateReservationOptions options, ITwil /// Client to make requests to Twilio /// Task that resolves to A single instance of Reservation #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateReservationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateReservationOptions 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 @@ -607,7 +608,7 @@ public static async System.Threading.Tasks.Task UpdateAsync ITwilioRestClient client = null) { var options = new UpdateReservationOptions(pathWorkspaceSid, pathTaskSid, pathSid){ ReservationStatus = reservationStatus, WorkerActivitySid = workerActivitySid, Instruction = instruction, DequeuePostWorkActivitySid = dequeuePostWorkActivitySid, DequeueFrom = dequeueFrom, DequeueRecord = dequeueRecord, DequeueTimeout = dequeueTimeout, DequeueTo = dequeueTo, DequeueStatusCallbackUrl = dequeueStatusCallbackUrl, CallFrom = callFrom, CallRecord = callRecord, CallTimeout = callTimeout, CallTo = callTo, CallUrl = callUrl, CallStatusCallbackUrl = callStatusCallbackUrl, CallAccept = callAccept, RedirectCallSid = redirectCallSid, RedirectAccept = redirectAccept, RedirectUrl = redirectUrl, To = to, From = from, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, Region = region, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, DequeueStatusCallbackEvent = dequeueStatusCallbackEvent, PostWorkActivitySid = postWorkActivitySid, SupervisorMode = supervisorMode, Supervisor = supervisor, EndConferenceOnCustomerExit = endConferenceOnCustomerExit, BeepOnCustomerEntrance = beepOnCustomerEntrance, JitterBufferSize = jitterBufferSize, IfMatch = ifMatch }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelResource.cs index 9abf127a1..3b6a8a7c0 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelResource.cs @@ -68,10 +68,10 @@ public static TaskChannelResource Create(CreateTaskChannelOptions options, ITwil /// Create TaskChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskChannel - public static async System.Threading.Tasks.Task CreateAsync(CreateTaskChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateTaskChannelOptions 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 @@ -110,7 +110,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreateTaskChannelOptions(pathWorkspaceSid, friendlyName, uniqueName){ ChannelOptimizedRouting = channelOptimizedRouting }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -153,11 +153,12 @@ public static bool Delete(DeleteTaskChannelOptions options, ITwilioRestClient cl /// Delete TaskChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskChannel - public static async System.Threading.Tasks.Task DeleteAsync(DeleteTaskChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteTaskChannelOptions 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 @@ -182,7 +183,7 @@ public static bool Delete(string pathWorkspaceSid, string pathSid, ITwilioRestCl public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteTaskChannelOptions(pathWorkspaceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -221,10 +222,10 @@ public static TaskChannelResource Fetch(FetchTaskChannelOptions options, ITwilio /// Fetch TaskChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskChannel - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTaskChannelOptions 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 @@ -251,7 +252,7 @@ public static TaskChannelResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchTaskChannelOptions(pathWorkspaceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -288,10 +289,10 @@ public static ResourceSet Read(ReadTaskChannelOptions optio /// Read TaskChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskChannelOptions 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("channels", response.Content); return new ResourceSet(page, options, client); @@ -327,7 +328,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadTaskChannelOptions(pathWorkspaceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -416,11 +417,12 @@ public static TaskChannelResource Update(UpdateTaskChannelOptions options, ITwil /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskChannel #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateTaskChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateTaskChannelOptions 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 @@ -459,7 +461,7 @@ public static async System.Threading.Tasks.Task UpdateAsync ITwilioRestClient client = null) { var options = new UpdateTaskChannelOptions(pathWorkspaceSid, pathSid){ FriendlyName = friendlyName, ChannelOptimizedRouting = channelOptimizedRouting }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsResource.cs index 30895d2f5..b482781dd 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsResource.cs @@ -69,10 +69,10 @@ public static TaskQueueBulkRealTimeStatisticsResource Create(CreateTaskQueueBulk /// Create TaskQueueBulkRealTimeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueueBulkRealTimeStatistics - public static async System.Threading.Tasks.Task CreateAsync(CreateTaskQueueBulkRealTimeStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateTaskQueueBulkRealTimeStatisticsOptions 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 @@ -99,7 +99,7 @@ public static async System.Threading.Tasks.Task Fetch TaskQueueCumulativeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueueCumulativeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueCumulativeStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueCumulativeStatisticsOptions 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 TaskQueueCumulativeStatisticsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathTaskQueueSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null) { var options = new FetchTaskQueueCumulativeStatisticsOptions(pathWorkspaceSid, pathTaskQueueSid){ EndDate = endDate,Minutes = minutes,StartDate = startDate,TaskChannel = taskChannel,SplitByWaitTime = splitByWaitTime }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsResource.cs index 09d44030d..6cfc912b5 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsResource.cs @@ -69,10 +69,10 @@ public static TaskQueueRealTimeStatisticsResource Fetch(FetchTaskQueueRealTimeSt /// Fetch TaskQueueRealTimeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueueRealTimeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueRealTimeStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueRealTimeStatisticsOptions 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 @@ -102,7 +102,7 @@ public static TaskQueueRealTimeStatisticsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathTaskQueueSid, string taskChannel = null, ITwilioRestClient client = null) { var options = new FetchTaskQueueRealTimeStatisticsOptions(pathWorkspaceSid, pathTaskQueueSid){ TaskChannel = taskChannel }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsResource.cs index 24967937e..f6ae4166c 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsResource.cs @@ -69,10 +69,10 @@ public static TaskQueueStatisticsResource Fetch(FetchTaskQueueStatisticsOptions /// Fetch TaskQueueStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueueStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueStatisticsOptions 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 TaskQueueStatisticsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathTaskQueueSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null) { var options = new FetchTaskQueueStatisticsOptions(pathWorkspaceSid, pathTaskQueueSid){ EndDate = endDate,Minutes = minutes,StartDate = startDate,TaskChannel = taskChannel,SplitByWaitTime = splitByWaitTime }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsResource.cs index 3f23d3a0a..9a5c7fff2 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsResource.cs @@ -67,10 +67,10 @@ public static ResourceSet Read(ReadTaskQueuesStati /// Read TaskQueuesStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueuesStatistics - public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskQueuesStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskQueuesStatisticsOptions 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("task_queues_statistics", response.Content); return new ResourceSet(page, options, client); @@ -130,7 +130,7 @@ public static async System.Threading.Tasks.Task Create TaskQueue parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueue - public static async System.Threading.Tasks.Task CreateAsync(CreateTaskQueueOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateTaskQueueOptions 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 @@ -135,7 +135,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateTaskQueueOptions(pathWorkspaceSid, friendlyName){ TargetWorkers = targetWorkers, MaxReservedWorkers = maxReservedWorkers, TaskOrder = taskOrder, ReservationActivitySid = reservationActivitySid, AssignmentActivitySid = assignmentActivitySid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -178,11 +178,12 @@ public static bool Delete(DeleteTaskQueueOptions options, ITwilioRestClient clie /// Delete TaskQueue parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueue - public static async System.Threading.Tasks.Task DeleteAsync(DeleteTaskQueueOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteTaskQueueOptions 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 @@ -207,7 +208,7 @@ public static bool Delete(string pathWorkspaceSid, string pathSid, ITwilioRestCl public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteTaskQueueOptions(pathWorkspaceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -246,10 +247,10 @@ public static TaskQueueResource Fetch(FetchTaskQueueOptions options, ITwilioRest /// Fetch TaskQueue parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueue - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueOptions 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 @@ -276,7 +277,7 @@ public static TaskQueueResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchTaskQueueOptions(pathWorkspaceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -313,10 +314,10 @@ public static ResourceSet Read(ReadTaskQueueOptions options, /// Read TaskQueue parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueue - public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskQueueOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskQueueOptions 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("task_queues", response.Content); return new ResourceSet(page, options, client); @@ -368,7 +369,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadTaskQueueOptions(pathWorkspaceSid){ FriendlyName = friendlyName, EvaluateWorkerAttributes = evaluateWorkerAttributes, WorkerSid = workerSid, Ordering = ordering, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -457,11 +458,12 @@ public static TaskQueueResource Update(UpdateTaskQueueOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueue #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateTaskQueueOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateTaskQueueOptions 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 @@ -516,7 +518,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateTaskQueueOptions(pathWorkspaceSid, pathSid){ FriendlyName = friendlyName, TargetWorkers = targetWorkers, ReservationActivitySid = reservationActivitySid, AssignmentActivitySid = assignmentActivitySid, MaxReservedWorkers = maxReservedWorkers, TaskOrder = taskOrder }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskResource.cs index 306641a06..d20ab2193 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskResource.cs @@ -85,10 +85,10 @@ public static TaskResource Create(CreateTaskOptions options, ITwilioRestClient c /// Create Task parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task CreateAsync(CreateTaskOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateTaskOptions 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 @@ -151,7 +151,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateTaskOptions(pathWorkspaceSid){ Timeout = timeout, Priority = priority, TaskChannel = taskChannel, WorkflowSid = workflowSid, Attributes = attributes, VirtualStartTime = virtualStartTime, RoutingTarget = routingTarget, IgnoreCapacity = ignoreCapacity, TaskQueueSid = taskQueueSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -194,11 +194,12 @@ public static bool Delete(DeleteTaskOptions options, ITwilioRestClient client = /// Delete Task parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task DeleteAsync(DeleteTaskOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteTaskOptions 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 @@ -225,7 +226,7 @@ public static bool Delete(string pathWorkspaceSid, string pathSid, string ifMatc public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, string ifMatch = null, ITwilioRestClient client = null) { var options = new DeleteTaskOptions(pathWorkspaceSid, pathSid) { IfMatch = ifMatch }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -264,10 +265,10 @@ public static TaskResource Fetch(FetchTaskOptions options, ITwilioRestClient cli /// Fetch Task parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTaskOptions 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 @@ -294,7 +295,7 @@ public static TaskResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchTaskOptions(pathWorkspaceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -331,10 +332,10 @@ public static ResourceSet Read(ReadTaskOptions options, ITwilioRes /// Read Task parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskOptions 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("tasks", response.Content); return new ResourceSet(page, options, client); @@ -410,7 +411,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadTaskOptions(pathWorkspaceSid){ Priority = priority, AssignmentStatus = assignmentStatus, WorkflowSid = workflowSid, WorkflowName = workflowName, TaskQueueSid = taskQueueSid, TaskQueueName = taskQueueName, EvaluateTaskAttributes = evaluateTaskAttributes, RoutingTarget = routingTarget, Ordering = ordering, HasAddons = hasAddons, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -499,11 +500,12 @@ public static TaskResource Update(UpdateTaskOptions options, ITwilioRestClient c /// Client to make requests to Twilio /// Task that resolves to A single instance of Task #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateTaskOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateTaskOptions 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 @@ -562,7 +564,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateTaskOptions(pathWorkspaceSid, pathSid){ Attributes = attributes, AssignmentStatus = assignmentStatus, Reason = reason, Priority = priority, TaskChannel = taskChannel, VirtualStartTime = virtualStartTime, IfMatch = ifMatch }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationResource.cs index 1093973bf..00c2290b6 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationResource.cs @@ -121,10 +121,10 @@ public static ReservationResource Fetch(FetchReservationOptions options, ITwilio /// Fetch Reservation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Reservation - public static async System.Threading.Tasks.Task FetchAsync(FetchReservationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchReservationOptions 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 @@ -154,7 +154,7 @@ public static ReservationResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkerSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchReservationOptions(pathWorkspaceSid, pathWorkerSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -193,10 +193,10 @@ public static ResourceSet Read(ReadReservationOptions optio /// Read Reservation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Reservation - public static async System.Threading.Tasks.Task> ReadAsync(ReadReservationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadReservationOptions 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("reservations", response.Content); return new ResourceSet(page, options, client); @@ -240,7 +240,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadReservationOptions(pathWorkspaceSid, pathWorkerSid){ ReservationStatus = reservationStatus, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -331,11 +331,12 @@ public static ReservationResource Update(UpdateReservationOptions options, ITwil /// Client to make requests to Twilio /// Task that resolves to A single instance of Reservation #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateReservationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateReservationOptions 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 @@ -582,7 +583,7 @@ public static async System.Threading.Tasks.Task UpdateAsync ITwilioRestClient client = null) { var options = new UpdateReservationOptions(pathWorkspaceSid, pathWorkerSid, pathSid){ ReservationStatus = reservationStatus, WorkerActivitySid = workerActivitySid, Instruction = instruction, DequeuePostWorkActivitySid = dequeuePostWorkActivitySid, DequeueFrom = dequeueFrom, DequeueRecord = dequeueRecord, DequeueTimeout = dequeueTimeout, DequeueTo = dequeueTo, DequeueStatusCallbackUrl = dequeueStatusCallbackUrl, CallFrom = callFrom, CallRecord = callRecord, CallTimeout = callTimeout, CallTo = callTo, CallUrl = callUrl, CallStatusCallbackUrl = callStatusCallbackUrl, CallAccept = callAccept, RedirectCallSid = redirectCallSid, RedirectAccept = redirectAccept, RedirectUrl = redirectUrl, To = to, From = from, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, Region = region, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, DequeueStatusCallbackEvent = dequeueStatusCallbackEvent, PostWorkActivitySid = postWorkActivitySid, EndConferenceOnCustomerExit = endConferenceOnCustomerExit, BeepOnCustomerEntrance = beepOnCustomerEntrance, JitterBufferSize = jitterBufferSize, IfMatch = ifMatch }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelResource.cs index 7167cae1c..41fa7ae7c 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelResource.cs @@ -71,10 +71,10 @@ public static WorkerChannelResource Fetch(FetchWorkerChannelOptions options, ITw /// Fetch WorkerChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkerChannel - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkerChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkerChannelOptions 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 WorkerChannelResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkerSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchWorkerChannelOptions(pathWorkspaceSid, pathWorkerSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -143,10 +143,10 @@ public static ResourceSet Read(ReadWorkerChannelOptions o /// Read WorkerChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkerChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkerChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkerChannelOptions 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("channels", response.Content); return new ResourceSet(page, options, client); @@ -186,7 +186,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of WorkerChannel #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateWorkerChannelOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateWorkerChannelOptions 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 @@ -324,7 +325,7 @@ public static async System.Threading.Tasks.Task UpdateAsy ITwilioRestClient client = null) { var options = new UpdateWorkerChannelOptions(pathWorkspaceSid, pathWorkerSid, pathSid){ Capacity = capacity, Available = available }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsResource.cs index bdeffe5e6..b0744c560 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsResource.cs @@ -69,10 +69,10 @@ public static WorkerStatisticsResource Fetch(FetchWorkerStatisticsOptions option /// Fetch WorkerStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkerStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkerStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkerStatisticsOptions 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 @@ -111,7 +111,7 @@ public static WorkerStatisticsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkerSid, int? minutes = null, DateTime? startDate = null, DateTime? endDate = null, string taskChannel = null, ITwilioRestClient client = null) { var options = new FetchWorkerStatisticsOptions(pathWorkspaceSid, pathWorkerSid){ Minutes = minutes,StartDate = startDate,EndDate = endDate,TaskChannel = taskChannel }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsResource.cs index fb6cb3a70..d30bcfd92 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsResource.cs @@ -67,10 +67,10 @@ public static WorkersCumulativeStatisticsResource Fetch(FetchWorkersCumulativeSt /// Fetch WorkersCumulativeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkersCumulativeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkersCumulativeStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkersCumulativeStatisticsOptions 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 @@ -106,7 +106,7 @@ public static WorkersCumulativeStatisticsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, ITwilioRestClient client = null) { var options = new FetchWorkersCumulativeStatisticsOptions(pathWorkspaceSid){ EndDate = endDate,Minutes = minutes,StartDate = startDate,TaskChannel = taskChannel }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsResource.cs index dc95ecebb..7f3aa7ebf 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsResource.cs @@ -67,10 +67,10 @@ public static WorkersRealTimeStatisticsResource Fetch(FetchWorkersRealTimeStatis /// Fetch WorkersRealTimeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkersRealTimeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkersRealTimeStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkersRealTimeStatisticsOptions 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 @@ -97,7 +97,7 @@ public static WorkersRealTimeStatisticsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string taskChannel = null, ITwilioRestClient client = null) { var options = new FetchWorkersRealTimeStatisticsOptions(pathWorkspaceSid){ TaskChannel = taskChannel }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsResource.cs index ce8e87392..070a115cc 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsResource.cs @@ -67,10 +67,10 @@ public static WorkersStatisticsResource Fetch(FetchWorkersStatisticsOptions opti /// Fetch WorkersStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkersStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkersStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkersStatisticsOptions 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 @@ -115,7 +115,7 @@ public static WorkersStatisticsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, int? minutes = null, DateTime? startDate = null, DateTime? endDate = null, string taskQueueSid = null, string taskQueueName = null, string friendlyName = null, string taskChannel = null, ITwilioRestClient client = null) { var options = new FetchWorkersStatisticsOptions(pathWorkspaceSid){ Minutes = minutes,StartDate = startDate,EndDate = endDate,TaskQueueSid = taskQueueSid,TaskQueueName = taskQueueName,FriendlyName = friendlyName,TaskChannel = taskChannel }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerResource.cs index 0c576e748..50cf06fe0 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerResource.cs @@ -68,10 +68,10 @@ public static WorkerResource Create(CreateWorkerOptions options, ITwilioRestClie /// Create Worker parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Worker - public static async System.Threading.Tasks.Task CreateAsync(CreateWorkerOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateWorkerOptions 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 @@ -110,7 +110,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateWorkerOptions(pathWorkspaceSid, friendlyName){ ActivitySid = activitySid, Attributes = attributes }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -153,11 +153,12 @@ public static bool Delete(DeleteWorkerOptions options, ITwilioRestClient client /// Delete Worker parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Worker - public static async System.Threading.Tasks.Task DeleteAsync(DeleteWorkerOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteWorkerOptions 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 @@ -184,7 +185,7 @@ public static bool Delete(string pathWorkspaceSid, string pathSid, string ifMatc public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, string ifMatch = null, ITwilioRestClient client = null) { var options = new DeleteWorkerOptions(pathWorkspaceSid, pathSid) { IfMatch = ifMatch }; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -223,10 +224,10 @@ public static WorkerResource Fetch(FetchWorkerOptions options, ITwilioRestClient /// Fetch Worker parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Worker - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkerOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkerOptions 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 @@ -253,7 +254,7 @@ public static WorkerResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchWorkerOptions(pathWorkspaceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -290,10 +291,10 @@ public static ResourceSet Read(ReadWorkerOptions options, ITwili /// Read Worker parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Worker - public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkerOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkerOptions 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("workers", response.Content); return new ResourceSet(page, options, client); @@ -361,7 +362,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadWorkerOptions(pathWorkspaceSid){ ActivityName = activityName, ActivitySid = activitySid, Available = available, FriendlyName = friendlyName, TargetWorkersExpression = targetWorkersExpression, TaskQueueName = taskQueueName, TaskQueueSid = taskQueueSid, Ordering = ordering, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -450,11 +451,12 @@ public static WorkerResource Update(UpdateWorkerOptions options, ITwilioRestClie /// Client to make requests to Twilio /// Task that resolves to A single instance of Worker #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateWorkerOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateWorkerOptions 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 @@ -505,7 +507,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateWorkerOptions(pathWorkspaceSid, pathSid){ ActivitySid = activitySid, Attributes = attributes, FriendlyName = friendlyName, RejectPendingReservations = rejectPendingReservations, IfMatch = ifMatch }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsResource.cs index dbd08cee3..4199eec1c 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsResource.cs @@ -69,10 +69,10 @@ public static WorkflowCumulativeStatisticsResource Fetch(FetchWorkflowCumulative /// Fetch WorkflowCumulativeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkflowCumulativeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowCumulativeStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowCumulativeStatisticsOptions 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 WorkflowCumulativeStatisticsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkflowSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null) { var options = new FetchWorkflowCumulativeStatisticsOptions(pathWorkspaceSid, pathWorkflowSid){ EndDate = endDate,Minutes = minutes,StartDate = startDate,TaskChannel = taskChannel,SplitByWaitTime = splitByWaitTime }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsResource.cs index c0682d4e7..7acff04ba 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsResource.cs @@ -69,10 +69,10 @@ public static WorkflowRealTimeStatisticsResource Fetch(FetchWorkflowRealTimeStat /// Fetch WorkflowRealTimeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkflowRealTimeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowRealTimeStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowRealTimeStatisticsOptions 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 @@ -102,7 +102,7 @@ public static WorkflowRealTimeStatisticsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkflowSid, string taskChannel = null, ITwilioRestClient client = null) { var options = new FetchWorkflowRealTimeStatisticsOptions(pathWorkspaceSid, pathWorkflowSid){ TaskChannel = taskChannel }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsResource.cs index 56ca7dcc2..124c18759 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsResource.cs @@ -69,10 +69,10 @@ public static WorkflowStatisticsResource Fetch(FetchWorkflowStatisticsOptions op /// Fetch WorkflowStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkflowStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowStatisticsOptions 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 WorkflowStatisticsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkflowSid, int? minutes = null, DateTime? startDate = null, DateTime? endDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null) { var options = new FetchWorkflowStatisticsOptions(pathWorkspaceSid, pathWorkflowSid){ Minutes = minutes,StartDate = startDate,EndDate = endDate,TaskChannel = taskChannel,SplitByWaitTime = splitByWaitTime }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowResource.cs index 9feff7572..00d2775fd 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowResource.cs @@ -68,10 +68,10 @@ public static WorkflowResource Create(CreateWorkflowOptions options, ITwilioRest /// Create Workflow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Workflow - public static async System.Threading.Tasks.Task CreateAsync(CreateWorkflowOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateWorkflowOptions 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 @@ -118,7 +118,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateWorkflowOptions(pathWorkspaceSid, friendlyName, configuration){ AssignmentCallbackUrl = assignmentCallbackUrl, FallbackAssignmentCallbackUrl = fallbackAssignmentCallbackUrl, TaskReservationTimeout = taskReservationTimeout }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -161,11 +161,12 @@ public static bool Delete(DeleteWorkflowOptions options, ITwilioRestClient clien /// Delete Workflow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Workflow - public static async System.Threading.Tasks.Task DeleteAsync(DeleteWorkflowOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteWorkflowOptions 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 @@ -190,7 +191,7 @@ public static bool Delete(string pathWorkspaceSid, string pathSid, ITwilioRestCl public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteWorkflowOptions(pathWorkspaceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -229,10 +230,10 @@ public static WorkflowResource Fetch(FetchWorkflowOptions options, ITwilioRestCl /// Fetch Workflow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Workflow - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowOptions 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 @@ -259,7 +260,7 @@ public static WorkflowResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchWorkflowOptions(pathWorkspaceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -296,10 +297,10 @@ public static ResourceSet Read(ReadWorkflowOptions options, IT /// Read Workflow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Workflow - public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkflowOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkflowOptions 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("workflows", response.Content); return new ResourceSet(page, options, client); @@ -339,7 +340,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadWorkflowOptions(pathWorkspaceSid){ FriendlyName = friendlyName, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -428,11 +429,12 @@ public static WorkflowResource Update(UpdateWorkflowOptions options, ITwilioRest /// Client to make requests to Twilio /// Task that resolves to A single instance of Workflow #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateWorkflowOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateWorkflowOptions 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 @@ -487,7 +489,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateWorkflowOptions(pathWorkspaceSid, pathSid){ FriendlyName = friendlyName, AssignmentCallbackUrl = assignmentCallbackUrl, FallbackAssignmentCallbackUrl = fallbackAssignmentCallbackUrl, Configuration = configuration, TaskReservationTimeout = taskReservationTimeout, ReEvaluateTasks = reEvaluateTasks }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsResource.cs index ff57ebe0b..5efd1d418 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsResource.cs @@ -67,10 +67,10 @@ public static WorkspaceCumulativeStatisticsResource Fetch(FetchWorkspaceCumulati /// Fetch WorkspaceCumulativeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkspaceCumulativeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceCumulativeStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceCumulativeStatisticsOptions 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 @@ -109,7 +109,7 @@ public static WorkspaceCumulativeStatisticsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null) { var options = new FetchWorkspaceCumulativeStatisticsOptions(pathWorkspaceSid){ EndDate = endDate,Minutes = minutes,StartDate = startDate,TaskChannel = taskChannel,SplitByWaitTime = splitByWaitTime }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsResource.cs index 5218b1944..fc8a24e8a 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsResource.cs @@ -67,10 +67,10 @@ public static WorkspaceRealTimeStatisticsResource Fetch(FetchWorkspaceRealTimeSt /// Fetch WorkspaceRealTimeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkspaceRealTimeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceRealTimeStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceRealTimeStatisticsOptions 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 @@ -97,7 +97,7 @@ public static WorkspaceRealTimeStatisticsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string taskChannel = null, ITwilioRestClient client = null) { var options = new FetchWorkspaceRealTimeStatisticsOptions(pathWorkspaceSid){ TaskChannel = taskChannel }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsResource.cs index 01cd3c30d..12f456d92 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsResource.cs @@ -67,10 +67,10 @@ public static WorkspaceStatisticsResource Fetch(FetchWorkspaceStatisticsOptions /// Fetch WorkspaceStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkspaceStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceStatisticsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceStatisticsOptions 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 @@ -109,7 +109,7 @@ public static WorkspaceStatisticsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, int? minutes = null, DateTime? startDate = null, DateTime? endDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null) { var options = new FetchWorkspaceStatisticsOptions(pathWorkspaceSid){ Minutes = minutes,StartDate = startDate,EndDate = endDate,TaskChannel = taskChannel,SplitByWaitTime = splitByWaitTime }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/WorkspaceResource.cs b/src/Twilio/Rest/Taskrouter/V1/WorkspaceResource.cs index 7ed13fef8..0452c6ef9 100644 --- a/src/Twilio/Rest/Taskrouter/V1/WorkspaceResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/WorkspaceResource.cs @@ -79,10 +79,10 @@ public static WorkspaceResource Create(CreateWorkspaceOptions options, ITwilioRe /// Create Workspace parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Workspace - public static async System.Threading.Tasks.Task CreateAsync(CreateWorkspaceOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateWorkspaceOptions 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 @@ -129,7 +129,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateWorkspaceOptions(friendlyName){ EventCallbackUrl = eventCallbackUrl, EventsFilter = eventsFilter, MultiTaskEnabled = multiTaskEnabled, Template = template, PrioritizeQueueOrder = prioritizeQueueOrder }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -170,11 +170,12 @@ public static bool Delete(DeleteWorkspaceOptions options, ITwilioRestClient clie /// Delete Workspace parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Workspace - public static async System.Threading.Tasks.Task DeleteAsync(DeleteWorkspaceOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteWorkspaceOptions 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 @@ -194,10 +195,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Workspace resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Workspace - 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 DeleteWorkspaceOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -234,10 +235,10 @@ public static WorkspaceResource Fetch(FetchWorkspaceOptions options, ITwilioRest /// Fetch Workspace parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Workspace - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceOptions 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 @@ -258,10 +259,10 @@ public static WorkspaceResource Fetch( /// The SID of the Workspace resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Workspace - 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 FetchWorkspaceOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -296,10 +297,10 @@ public static ResourceSet Read(ReadWorkspaceOptions options, /// Read Workspace parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Workspace - public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkspaceOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkspaceOptions 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("workspaces", response.Content); return new ResourceSet(page, options, client); @@ -335,7 +336,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadWorkspaceOptions(){ FriendlyName = friendlyName, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -422,11 +423,12 @@ public static WorkspaceResource Update(UpdateWorkspaceOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of Workspace #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateWorkspaceOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateWorkspaceOptions 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 @@ -481,7 +483,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateWorkspaceOptions(pathSid){ DefaultActivitySid = defaultActivitySid, EventCallbackUrl = eventCallbackUrl, EventsFilter = eventsFilter, FriendlyName = friendlyName, MultiTaskEnabled = multiTaskEnabled, TimeoutActivitySid = timeoutActivitySid, PrioritizeQueueOrder = prioritizeQueueOrder }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListResource.cs b/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListResource.cs index d9be4552c..83ea3522a 100644 --- a/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListResource.cs +++ b/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListResource.cs @@ -68,10 +68,10 @@ public static CredentialListResource Create(CreateCredentialListOptions options, /// Create CredentialList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialListOptions 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 CreateAs ITwilioRestClient client = null) { var options = new CreateCredentialListOptions(pathTrunkSid, credentialListSid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteCredentialListOptions options, ITwilioRestClient /// Delete CredentialList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialListOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialListOptions 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 pathTrunkSid, string pathSid, ITwilioRestClient public static async System.Threading.Tasks.Task DeleteAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteCredentialListOptions(pathTrunkSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static CredentialListResource Fetch(FetchCredentialListOptions options, I /// Fetch CredentialList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialListOptions 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 CredentialListResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchCredentialListOptions(pathTrunkSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadCredentialListOptions /// Read CredentialList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialListOptions 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("credential_lists", response.Content); return new ResourceSet(page, options, client); @@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task Create IpAccessControlList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task CreateAsync(CreateIpAccessControlListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateIpAccessControlListOptions 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 Cre ITwilioRestClient client = null) { var options = new CreateIpAccessControlListOptions(pathTrunkSid, ipAccessControlListSid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteIpAccessControlListOptions options, ITwilioRestC /// Delete IpAccessControlList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpAccessControlListOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpAccessControlListOptions 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 pathTrunkSid, string pathSid, ITwilioRestClient public static async System.Threading.Tasks.Task DeleteAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteIpAccessControlListOptions(pathTrunkSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static IpAccessControlListResource Fetch(FetchIpAccessControlListOptions /// Fetch IpAccessControlList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task FetchAsync(FetchIpAccessControlListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchIpAccessControlListOptions 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 IpAccessControlListResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchIpAccessControlListOptions(pathTrunkSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadIpAccessControlL /// Read IpAccessControlList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAccessControlListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAccessControlListOptions 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("ip_access_control_lists", response.Content); return new ResourceSet(page, options, client); @@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task Create OriginationUrl parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OriginationUrl - public static async System.Threading.Tasks.Task CreateAsync(CreateOriginationUrlOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateOriginationUrlOptions 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 @@ -118,7 +118,7 @@ public static async System.Threading.Tasks.Task CreateAs ITwilioRestClient client = null) { var options = new CreateOriginationUrlOptions(pathTrunkSid, weight, priority, enabled, friendlyName, sipUrl){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -161,11 +161,12 @@ public static bool Delete(DeleteOriginationUrlOptions options, ITwilioRestClient /// Delete OriginationUrl parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OriginationUrl - public static async System.Threading.Tasks.Task DeleteAsync(DeleteOriginationUrlOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteOriginationUrlOptions 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 @@ -190,7 +191,7 @@ public static bool Delete(string pathTrunkSid, string pathSid, ITwilioRestClient public static async System.Threading.Tasks.Task DeleteAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteOriginationUrlOptions(pathTrunkSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -229,10 +230,10 @@ public static OriginationUrlResource Fetch(FetchOriginationUrlOptions options, I /// Fetch OriginationUrl parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OriginationUrl - public static async System.Threading.Tasks.Task FetchAsync(FetchOriginationUrlOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchOriginationUrlOptions 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 @@ -259,7 +260,7 @@ public static OriginationUrlResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchOriginationUrlOptions(pathTrunkSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -296,10 +297,10 @@ public static ResourceSet Read(ReadOriginationUrlOptions /// Read OriginationUrl parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OriginationUrl - public static async System.Threading.Tasks.Task> ReadAsync(ReadOriginationUrlOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadOriginationUrlOptions 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("origination_urls", response.Content); return new ResourceSet(page, options, client); @@ -335,7 +336,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of OriginationUrl #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateOriginationUrlOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateOriginationUrlOptions 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 @@ -479,7 +481,7 @@ public static async System.Threading.Tasks.Task UpdateAs ITwilioRestClient client = null) { var options = new UpdateOriginationUrlOptions(pathTrunkSid, pathSid){ Weight = weight, Priority = priority, Enabled = enabled, FriendlyName = friendlyName, SipUrl = sipUrl }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberResource.cs b/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberResource.cs index fad91644b..8112908b7 100644 --- a/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberResource.cs +++ b/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberResource.cs @@ -83,10 +83,10 @@ public static PhoneNumberResource Create(CreatePhoneNumberOptions options, ITwil /// Create PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task CreateAsync(CreatePhoneNumberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreatePhoneNumberOptions 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 @@ -117,7 +117,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreatePhoneNumberOptions(pathTrunkSid, phoneNumberSid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -160,11 +160,12 @@ public static bool Delete(DeletePhoneNumberOptions options, ITwilioRestClient cl /// Delete PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task DeleteAsync(DeletePhoneNumberOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeletePhoneNumberOptions 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 @@ -189,7 +190,7 @@ public static bool Delete(string pathTrunkSid, string pathSid, ITwilioRestClient public static async System.Threading.Tasks.Task DeleteAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) { var options = new DeletePhoneNumberOptions(pathTrunkSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -228,10 +229,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 @@ -258,7 +259,7 @@ public static PhoneNumberResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchPhoneNumberOptions(pathTrunkSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -295,10 +296,10 @@ public static ResourceSet Read(ReadPhoneNumberOptions optio /// Read PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task> ReadAsync(ReadPhoneNumberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPhoneNumberOptions 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("phone_numbers", response.Content); return new ResourceSet(page, options, client); @@ -334,7 +335,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadPhoneNumberOptions(pathTrunkSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Trunking/V1/Trunk/RecordingResource.cs b/src/Twilio/Rest/Trunking/V1/Trunk/RecordingResource.cs index dd1a2720a..ebb2333ce 100644 --- a/src/Twilio/Rest/Trunking/V1/Trunk/RecordingResource.cs +++ b/src/Twilio/Rest/Trunking/V1/Trunk/RecordingResource.cs @@ -96,10 +96,10 @@ public static RecordingResource Fetch(FetchRecordingOptions options, ITwilioRest /// Fetch Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions 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 @@ -120,10 +120,10 @@ public static RecordingResource Fetch( /// The SID of the Trunk from which to fetch the recording settings. /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchRecordingOptions(pathTrunkSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -161,11 +161,12 @@ public static RecordingResource Update(UpdateRecordingOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateRecordingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateRecordingOptions 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 @@ -200,7 +201,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateRecordingOptions(pathTrunkSid){ Mode = mode, Trim = trim }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Trunking/V1/TrunkResource.cs b/src/Twilio/Rest/Trunking/V1/TrunkResource.cs index 4da815862..8708186c9 100644 --- a/src/Twilio/Rest/Trunking/V1/TrunkResource.cs +++ b/src/Twilio/Rest/Trunking/V1/TrunkResource.cs @@ -93,10 +93,10 @@ public static TrunkResource Create(CreateTrunkOptions options, ITwilioRestClient /// Create Trunk parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Trunk - public static async System.Threading.Tasks.Task CreateAsync(CreateTrunkOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateTrunkOptions 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 @@ -151,7 +151,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateTrunkOptions(){ FriendlyName = friendlyName, DomainName = domainName, DisasterRecoveryUrl = disasterRecoveryUrl, DisasterRecoveryMethod = disasterRecoveryMethod, TransferMode = transferMode, Secure = secure, CnamLookupEnabled = cnamLookupEnabled, TransferCallerId = transferCallerId }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -192,11 +192,12 @@ public static bool Delete(DeleteTrunkOptions options, ITwilioRestClient client = /// Delete Trunk parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Trunk - public static async System.Threading.Tasks.Task DeleteAsync(DeleteTrunkOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteTrunkOptions 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 @@ -216,10 +217,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string that we created to identify the Trunk resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Trunk - 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 DeleteTrunkOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -256,10 +257,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 @@ -280,10 +281,10 @@ public static TrunkResource Fetch( /// The unique string that we created to identify the Trunk resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Trunk - 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 FetchTrunkOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -318,10 +319,10 @@ public static ResourceSet Read(ReadTrunkOptions options, ITwilioR /// Read Trunk parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Trunk - public static async System.Threading.Tasks.Task> ReadAsync(ReadTrunkOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTrunkOptions 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("trunks", response.Content); return new ResourceSet(page, options, client); @@ -353,7 +354,7 @@ public static async System.Threading.Tasks.Task> Read ITwilioRestClient client = null) { var options = new ReadTrunkOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -440,11 +441,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 @@ -503,7 +505,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateTrunkOptions(pathSid){ FriendlyName = friendlyName, DomainName = domainName, DisasterRecoveryUrl = disasterRecoveryUrl, DisasterRecoveryMethod = disasterRecoveryMethod, TransferMode = transferMode, Secure = secure, CnamLookupEnabled = cnamLookupEnabled, TransferCallerId = transferCallerId }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesResource.cs b/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesResource.cs index 831b0580a..14aa30362 100644 --- a/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesResource.cs @@ -66,10 +66,10 @@ public static ComplianceInquiriesResource Create(CreateComplianceInquiriesOption /// Create ComplianceInquiries parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ComplianceInquiries - public static async System.Threading.Tasks.Task CreateAsync(CreateComplianceInquiriesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateComplianceInquiriesOptions 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 @@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task Cre ITwilioRestClient client = null) { var options = new CreateComplianceInquiriesOptions(primaryProfileSid){ NotificationEmail = notificationEmail, ThemeSetId = themeSetId }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -142,11 +142,12 @@ public static ComplianceInquiriesResource Update(UpdateComplianceInquiriesOption /// Client to make requests to Twilio /// Task that resolves to A single instance of ComplianceInquiries #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateComplianceInquiriesOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateComplianceInquiriesOptions 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 @@ -181,7 +182,7 @@ public static async System.Threading.Tasks.Task Upd ITwilioRestClient client = null) { var options = new UpdateComplianceInquiriesOptions(pathCustomerId, primaryProfileSid){ ThemeSetId = themeSetId }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs index 489dd007c..3fe83010e 100644 --- a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs @@ -120,10 +120,10 @@ public static ComplianceRegistrationInquiriesResource Create(CreateComplianceReg /// Create ComplianceRegistrationInquiries parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ComplianceRegistrationInquiries - public static async System.Threading.Tasks.Task CreateAsync(CreateComplianceRegistrationInquiriesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateComplianceRegistrationInquiriesOptions 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 @@ -302,7 +302,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of ComplianceRegistrationInquiries #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateComplianceRegistrationInquiriesOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateComplianceRegistrationInquiriesOptions 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 @@ -379,7 +380,7 @@ public static async System.Threading.Tasks.Task Create ComplianceTollfreeInquiries parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ComplianceTollfreeInquiries - public static async System.Threading.Tasks.Task CreateAsync(CreateComplianceTollfreeInquiriesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateComplianceTollfreeInquiriesOptions 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 @@ -199,7 +199,7 @@ public static async System.Threading.Tasks.Task Create CustomerProfilesChannelEndpointAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesChannelEndpointAssignment - public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesChannelEndpointAssignmentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesChannelEndpointAssignmentOptions 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 Delete CustomerProfilesChannelEndpointAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesChannelEndpointAssignment - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCustomerProfilesChannelEndpointAssignmentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCustomerProfilesChannelEndpointAssignmentOptions 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 pathCustomerProfileSid, string pathSid, ITwilio public static async System.Threading.Tasks.Task DeleteAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteCustomerProfilesChannelEndpointAssignmentOptions(pathCustomerProfileSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -217,10 +218,10 @@ public static CustomerProfilesChannelEndpointAssignmentResource Fetch(FetchCusto /// Fetch CustomerProfilesChannelEndpointAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesChannelEndpointAssignment - public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesChannelEndpointAssignmentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesChannelEndpointAssignmentOptions 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 CustomerProfilesChannelEndpointAssignmentResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchCustomerProfilesChannelEndpointAssignmentOptions(pathCustomerProfileSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +285,10 @@ public static ResourceSet Rea /// Read CustomerProfilesChannelEndpointAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesChannelEndpointAssignment - public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesChannelEndpointAssignmentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesChannelEndpointAssignmentOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -331,7 +332,7 @@ public static async System.Threading.Tasks.Task Create CustomerProfilesEntityAssignments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEntityAssignments - public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesEntityAssignmentsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesEntityAssignmentsOptions 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 Delete CustomerProfilesEntityAssignments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEntityAssignments - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCustomerProfilesEntityAssignmentsOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCustomerProfilesEntityAssignmentsOptions 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 pathCustomerProfileSid, string pathSid, ITwilio public static async System.Threading.Tasks.Task DeleteAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteCustomerProfilesEntityAssignmentsOptions(pathCustomerProfileSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static CustomerProfilesEntityAssignmentsResource Fetch(FetchCustomerProfi /// Fetch CustomerProfilesEntityAssignments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEntityAssignments - public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesEntityAssignmentsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesEntityAssignmentsOptions 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 CustomerProfilesEntityAssignmentsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchCustomerProfilesEntityAssignmentsOptions(pathCustomerProfileSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadCu /// Read CustomerProfilesEntityAssignments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEntityAssignments - public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesEntityAssignmentsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesEntityAssignmentsOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -323,7 +324,7 @@ public static async System.Threading.Tasks.Task Create CustomerProfilesEvaluations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEvaluations - public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesEvaluationsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesEvaluationsOptions 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 @@ -115,7 +115,7 @@ public static async System.Threading.Tasks.Task Fetch CustomerProfilesEvaluations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEvaluations - public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesEvaluationsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesEvaluationsOptions 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 @@ -184,7 +184,7 @@ public static CustomerProfilesEvaluationsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchCustomerProfilesEvaluationsOptions(pathCustomerProfileSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -221,10 +221,10 @@ public static ResourceSet Read(ReadCustomer /// Read CustomerProfilesEvaluations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEvaluations - public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesEvaluationsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesEvaluationsOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -260,7 +260,7 @@ public static async System.Threading.Tasks.Task Create CustomerProfiles parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfiles - public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesOptions 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 @@ -124,7 +124,7 @@ public static async System.Threading.Tasks.Task Create ITwilioRestClient client = null) { var options = new CreateCustomerProfilesOptions(friendlyName, email, policySid){ StatusCallback = statusCallback }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -165,11 +165,12 @@ public static bool Delete(DeleteCustomerProfilesOptions options, ITwilioRestClie /// Delete CustomerProfiles parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfiles - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCustomerProfilesOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCustomerProfilesOptions 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 @@ -189,10 +190,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string that we created to identify the Customer-Profile resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfiles - 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 DeleteCustomerProfilesOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -229,10 +230,10 @@ public static CustomerProfilesResource Fetch(FetchCustomerProfilesOptions option /// Fetch CustomerProfiles parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfiles - public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesOptions 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 @@ -253,10 +254,10 @@ public static CustomerProfilesResource Fetch( /// The unique string that we created to identify the Customer-Profile resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfiles - 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 FetchCustomerProfilesOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -291,10 +292,10 @@ public static ResourceSet Read(ReadCustomerProfilesOpt /// Read CustomerProfiles parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfiles - public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -338,7 +339,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfiles #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateCustomerProfilesOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateCustomerProfilesOptions 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 @@ -472,7 +474,7 @@ public static async System.Threading.Tasks.Task Update ITwilioRestClient client = null) { var options = new UpdateCustomerProfilesOptions(pathSid){ Status = status, StatusCallback = statusCallback, FriendlyName = friendlyName, Email = email }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Trusthub/V1/EndUserResource.cs b/src/Twilio/Rest/Trusthub/V1/EndUserResource.cs index 793de1a35..c862c5fa7 100644 --- a/src/Twilio/Rest/Trusthub/V1/EndUserResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/EndUserResource.cs @@ -66,10 +66,10 @@ public static EndUserResource Create(CreateEndUserOptions options, ITwilioRestCl /// Create EndUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task CreateAsync(CreateEndUserOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateEndUserOptions 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 @@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateEndUserOptions(friendlyName, type){ Attributes = attributes }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteEndUserOptions options, ITwilioRestClient client /// Delete EndUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task DeleteAsync(DeleteEndUserOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteEndUserOptions 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 @@ -169,10 +170,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string created by Twilio to identify the End User resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - 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 DeleteEndUserOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -209,10 +210,10 @@ public static EndUserResource Fetch(FetchEndUserOptions options, ITwilioRestClie /// Fetch EndUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserOptions 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 @@ -233,10 +234,10 @@ public static EndUserResource Fetch( /// The unique string created by Twilio to identify the End User resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - 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 FetchEndUserOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -271,10 +272,10 @@ public static ResourceSet Read(ReadEndUserOptions options, ITwi /// Read EndUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -306,7 +307,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadEndUserOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -393,11 +394,12 @@ public static EndUserResource Update(UpdateEndUserOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateEndUserOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateEndUserOptions 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 @@ -432,7 +434,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateEndUserOptions(pathSid){ FriendlyName = friendlyName, Attributes = attributes }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Trusthub/V1/EndUserTypeResource.cs b/src/Twilio/Rest/Trusthub/V1/EndUserTypeResource.cs index 6f4772fbf..454ed95f5 100644 --- a/src/Twilio/Rest/Trusthub/V1/EndUserTypeResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/EndUserTypeResource.cs @@ -67,10 +67,10 @@ public static EndUserTypeResource Fetch(FetchEndUserTypeOptions options, ITwilio /// Fetch EndUserType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUserType - public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserTypeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserTypeOptions 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 EndUserTypeResource Fetch( /// The unique string that identifies the End-User Type resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUserType - 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 FetchEndUserTypeOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadEndUserTypeOptions optio /// Read EndUserType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUserType - public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserTypeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserTypeOptions 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("end_user_types", response.Content); return new ResourceSet(page, options, client); @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadEndUserTypeOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Trusthub/V1/PoliciesResource.cs b/src/Twilio/Rest/Trusthub/V1/PoliciesResource.cs index 96bc44f6f..2c179bce0 100644 --- a/src/Twilio/Rest/Trusthub/V1/PoliciesResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/PoliciesResource.cs @@ -67,10 +67,10 @@ public static PoliciesResource Fetch(FetchPoliciesOptions options, ITwilioRestCl /// Fetch Policies parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Policies - public static async System.Threading.Tasks.Task FetchAsync(FetchPoliciesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchPoliciesOptions 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 PoliciesResource Fetch( /// The unique string that identifies the Policy resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Policies - 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 FetchPoliciesOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadPoliciesOptions options, IT /// Read Policies parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Policies - public static async System.Threading.Tasks.Task> ReadAsync(ReadPoliciesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPoliciesOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadPoliciesOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Trusthub/V1/SupportingDocumentResource.cs b/src/Twilio/Rest/Trusthub/V1/SupportingDocumentResource.cs index 3e27923f4..3d8bce383 100644 --- a/src/Twilio/Rest/Trusthub/V1/SupportingDocumentResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/SupportingDocumentResource.cs @@ -83,10 +83,10 @@ public static SupportingDocumentResource Create(CreateSupportingDocumentOptions /// Create SupportingDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task CreateAsync(CreateSupportingDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSupportingDocumentOptions 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 @@ -121,7 +121,7 @@ public static async System.Threading.Tasks.Task Crea ITwilioRestClient client = null) { var options = new CreateSupportingDocumentOptions(friendlyName, type){ Attributes = attributes }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -162,11 +162,12 @@ public static bool Delete(DeleteSupportingDocumentOptions options, ITwilioRestCl /// Delete SupportingDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSupportingDocumentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSupportingDocumentOptions 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 @@ -186,10 +187,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string created by Twilio to identify the Supporting Document resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - 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 DeleteSupportingDocumentOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -226,10 +227,10 @@ public static SupportingDocumentResource Fetch(FetchSupportingDocumentOptions op /// Fetch SupportingDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentOptions 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 @@ -250,10 +251,10 @@ public static SupportingDocumentResource Fetch( /// The unique string created by Twilio to identify the Supporting Document resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - 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 FetchSupportingDocumentOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -288,10 +289,10 @@ public static ResourceSet Read(ReadSupportingDocumen /// Read SupportingDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -323,7 +324,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSupportingDocumentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSupportingDocumentOptions 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 @@ -449,7 +451,7 @@ public static async System.Threading.Tasks.Task Upda ITwilioRestClient client = null) { var options = new UpdateSupportingDocumentOptions(pathSid){ FriendlyName = friendlyName, Attributes = attributes }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeResource.cs b/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeResource.cs index 2d40c316d..a06620688 100644 --- a/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeResource.cs @@ -67,10 +67,10 @@ public static SupportingDocumentTypeResource Fetch(FetchSupportingDocumentTypeOp /// Fetch SupportingDocumentType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocumentType - public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentTypeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentTypeOptions 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 SupportingDocumentTypeResource Fetch( /// The unique string that identifies the Supporting Document Type resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocumentType - 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 FetchSupportingDocumentTypeOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadSupportingDoc /// Read SupportingDocumentType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocumentType - public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentTypeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentTypeOptions 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("supporting_document_types", response.Content); return new ResourceSet(page, options, client); @@ -164,7 +164,7 @@ public static async System.Threading.Tasks.Task Create TrustProductsChannelEndpointAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsChannelEndpointAssignment - public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsChannelEndpointAssignmentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsChannelEndpointAssignmentOptions 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 Delete TrustProductsChannelEndpointAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsChannelEndpointAssignment - public static async System.Threading.Tasks.Task DeleteAsync(DeleteTrustProductsChannelEndpointAssignmentOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteTrustProductsChannelEndpointAssignmentOptions 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 pathTrustProductSid, string pathSid, ITwilioRes public static async System.Threading.Tasks.Task DeleteAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteTrustProductsChannelEndpointAssignmentOptions(pathTrustProductSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -217,10 +218,10 @@ public static TrustProductsChannelEndpointAssignmentResource Fetch(FetchTrustPro /// Fetch TrustProductsChannelEndpointAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsChannelEndpointAssignment - public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsChannelEndpointAssignmentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsChannelEndpointAssignmentOptions 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 TrustProductsChannelEndpointAssignmentResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchTrustProductsChannelEndpointAssignmentOptions(pathTrustProductSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +285,10 @@ public static ResourceSet Read(R /// Read TrustProductsChannelEndpointAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsChannelEndpointAssignment - public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsChannelEndpointAssignmentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsChannelEndpointAssignmentOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -331,7 +332,7 @@ public static async System.Threading.Tasks.Task Create TrustProductsEntityAssignments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEntityAssignments - public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsEntityAssignmentsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsEntityAssignmentsOptions 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 Delete TrustProductsEntityAssignments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEntityAssignments - public static async System.Threading.Tasks.Task DeleteAsync(DeleteTrustProductsEntityAssignmentsOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteTrustProductsEntityAssignmentsOptions 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 pathTrustProductSid, string pathSid, ITwilioRes public static async System.Threading.Tasks.Task DeleteAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteTrustProductsEntityAssignmentsOptions(pathTrustProductSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static TrustProductsEntityAssignmentsResource Fetch(FetchTrustProductsEnt /// Fetch TrustProductsEntityAssignments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEntityAssignments - public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsEntityAssignmentsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsEntityAssignmentsOptions 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 TrustProductsEntityAssignmentsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchTrustProductsEntityAssignmentsOptions(pathTrustProductSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadTrust /// Read TrustProductsEntityAssignments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEntityAssignments - public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsEntityAssignmentsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsEntityAssignmentsOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -323,7 +324,7 @@ public static async System.Threading.Tasks.Task Create TrustProductsEvaluations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEvaluations - public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsEvaluationsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsEvaluationsOptions 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 @@ -115,7 +115,7 @@ public static async System.Threading.Tasks.Task Fetch TrustProductsEvaluations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEvaluations - public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsEvaluationsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsEvaluationsOptions 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 @@ -184,7 +184,7 @@ public static TrustProductsEvaluationsResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchTrustProductsEvaluationsOptions(pathTrustProductSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -221,10 +221,10 @@ public static ResourceSet Read(ReadTrustProduc /// Read TrustProductsEvaluations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEvaluations - public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsEvaluationsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsEvaluationsOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -260,7 +260,7 @@ public static async System.Threading.Tasks.Task Create TrustProducts parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProducts - public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsOptions 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 @@ -124,7 +124,7 @@ public static async System.Threading.Tasks.Task CreateAsy ITwilioRestClient client = null) { var options = new CreateTrustProductsOptions(friendlyName, email, policySid){ StatusCallback = statusCallback }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -165,11 +165,12 @@ public static bool Delete(DeleteTrustProductsOptions options, ITwilioRestClient /// Delete TrustProducts parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProducts - public static async System.Threading.Tasks.Task DeleteAsync(DeleteTrustProductsOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteTrustProductsOptions 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 @@ -189,10 +190,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string that we created to identify the Trust Product resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProducts - 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 DeleteTrustProductsOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -229,10 +230,10 @@ public static TrustProductsResource Fetch(FetchTrustProductsOptions options, ITw /// Fetch TrustProducts parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProducts - public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsOptions 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 @@ -253,10 +254,10 @@ public static TrustProductsResource Fetch( /// The unique string that we created to identify the Trust Product resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProducts - 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 FetchTrustProductsOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -291,10 +292,10 @@ public static ResourceSet Read(ReadTrustProductsOptions o /// Read TrustProducts parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProducts - public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsOptions 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("results", response.Content); return new ResourceSet(page, options, client); @@ -338,7 +339,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of TrustProducts #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateTrustProductsOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateTrustProductsOptions 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 @@ -472,7 +474,7 @@ public static async System.Threading.Tasks.Task UpdateAsy ITwilioRestClient client = null) { var options = new UpdateTrustProductsOptions(pathSid){ Status = status, StatusCallback = statusCallback, FriendlyName = friendlyName, Email = email }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/FormResource.cs b/src/Twilio/Rest/Verify/V2/FormResource.cs index ecaf897e9..273bf3a8c 100644 --- a/src/Twilio/Rest/Verify/V2/FormResource.cs +++ b/src/Twilio/Rest/Verify/V2/FormResource.cs @@ -79,10 +79,10 @@ public static FormResource Fetch(FetchFormOptions options, ITwilioRestClient cli /// Fetch Form parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Form - public static async System.Threading.Tasks.Task FetchAsync(FetchFormOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchFormOptions 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 @@ -106,7 +106,7 @@ public static FormResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(FormResource.FormTypesEnum pathFormType, ITwilioRestClient client = null) { var options = new FetchFormOptions(pathFormType){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/SafelistResource.cs b/src/Twilio/Rest/Verify/V2/SafelistResource.cs index d403cfd1f..1146a0788 100644 --- a/src/Twilio/Rest/Verify/V2/SafelistResource.cs +++ b/src/Twilio/Rest/Verify/V2/SafelistResource.cs @@ -66,10 +66,10 @@ public static SafelistResource Create(CreateSafelistOptions options, ITwilioRest /// Create Safelist parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task CreateAsync(CreateSafelistOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSafelistOptions 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 @@ -96,7 +96,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateSafelistOptions(phoneNumber){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -137,11 +137,12 @@ public static bool Delete(DeleteSafelistOptions options, ITwilioRestClient clien /// Delete Safelist parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSafelistOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSafelistOptions 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 @@ -161,10 +162,10 @@ public static bool Delete(string pathPhoneNumber, ITwilioRestClient client = nul /// The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task DeleteAsync(string pathPhoneNumber, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathPhoneNumber, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new DeleteSafelistOptions(pathPhoneNumber) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -201,10 +202,10 @@ public static SafelistResource Fetch(FetchSafelistOptions options, ITwilioRestCl /// Fetch Safelist parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task FetchAsync(FetchSafelistOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSafelistOptions 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 @@ -225,10 +226,10 @@ public static SafelistResource Fetch( /// The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - 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 FetchSafelistOptions(pathPhoneNumber){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/Service/AccessTokenResource.cs b/src/Twilio/Rest/Verify/V2/Service/AccessTokenResource.cs index e1302904a..019f32c54 100644 --- a/src/Twilio/Rest/Verify/V2/Service/AccessTokenResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/AccessTokenResource.cs @@ -80,10 +80,10 @@ public static AccessTokenResource Create(CreateAccessTokenOptions options, ITwil /// Create AccessToken parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccessToken - public static async System.Threading.Tasks.Task CreateAsync(CreateAccessTokenOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateAccessTokenOptions 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 @@ -126,7 +126,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreateAccessTokenOptions(pathServiceSid, identity, factorType){ FactorFriendlyName = factorFriendlyName, Ttl = ttl }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -165,10 +165,10 @@ public static AccessTokenResource Fetch(FetchAccessTokenOptions options, ITwilio /// Fetch AccessToken parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccessToken - public static async System.Threading.Tasks.Task FetchAsync(FetchAccessTokenOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAccessTokenOptions 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 @@ -195,7 +195,7 @@ public static AccessTokenResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchAccessTokenOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationResource.cs b/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationResource.cs index 10ac7524f..4ad566aa3 100644 --- a/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationResource.cs @@ -72,10 +72,10 @@ public static NotificationResource Create(CreateNotificationOptions options, ITw /// Create Notification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task CreateAsync(CreateNotificationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateNotificationOptions 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 @@ -114,7 +114,7 @@ public static async System.Threading.Tasks.Task CreateAsyn ITwilioRestClient client = null) { var options = new CreateNotificationOptions(pathServiceSid, pathIdentity, pathChallengeSid){ Ttl = ttl }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeResource.cs b/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeResource.cs index 300a97c01..bf56b2fb5 100644 --- a/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeResource.cs @@ -124,10 +124,10 @@ public static ChallengeResource Create(CreateChallengeOptions options, ITwilioRe /// Create Challenge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Challenge - public static async System.Threading.Tasks.Task CreateAsync(CreateChallengeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateChallengeOptions 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 @@ -182,7 +182,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateChallengeOptions(pathServiceSid, pathIdentity, factorSid){ ExpirationDate = expirationDate, DetailsMessage = detailsMessage, DetailsFields = detailsFields, HiddenDetails = hiddenDetails, AuthPayload = authPayload }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -223,10 +223,10 @@ public static ChallengeResource Fetch(FetchChallengeOptions options, ITwilioRest /// Fetch Challenge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Challenge - public static async System.Threading.Tasks.Task FetchAsync(FetchChallengeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchChallengeOptions 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 @@ -256,7 +256,7 @@ public static ChallengeResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathIdentity, string pathSid, ITwilioRestClient client = null) { var options = new FetchChallengeOptions(pathServiceSid, pathIdentity, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -295,10 +295,10 @@ public static ResourceSet Read(ReadChallengeOptions options, /// Read Challenge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Challenge - public static async System.Threading.Tasks.Task> ReadAsync(ReadChallengeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChallengeOptions 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("challenges", response.Content); return new ResourceSet(page, options, client); @@ -350,7 +350,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadChallengeOptions(pathServiceSid, pathIdentity){ FactorSid = factorSid, Status = status, Order = order, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -441,11 +441,12 @@ public static ChallengeResource Update(UpdateChallengeOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of Challenge #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateChallengeOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateChallengeOptions 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 @@ -488,7 +489,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateChallengeOptions(pathServiceSid, pathIdentity, pathSid){ AuthPayload = authPayload, Metadata = metadata }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/Service/Entity/FactorResource.cs b/src/Twilio/Rest/Verify/V2/Service/Entity/FactorResource.cs index ebe964a9b..1f4348304 100644 --- a/src/Twilio/Rest/Verify/V2/Service/Entity/FactorResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/Entity/FactorResource.cs @@ -114,11 +114,12 @@ public static bool Delete(DeleteFactorOptions options, ITwilioRestClient client /// Delete Factor parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Factor - public static async System.Threading.Tasks.Task DeleteAsync(DeleteFactorOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteFactorOptions 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 @@ -145,7 +146,7 @@ public static bool Delete(string pathServiceSid, string pathIdentity, string pat public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathIdentity, string pathSid, ITwilioRestClient client = null) { var options = new DeleteFactorOptions(pathServiceSid, pathIdentity, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -186,10 +187,10 @@ public static FactorResource Fetch(FetchFactorOptions options, ITwilioRestClient /// Fetch Factor parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Factor - public static async System.Threading.Tasks.Task FetchAsync(FetchFactorOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchFactorOptions 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 @@ -219,7 +220,7 @@ public static FactorResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathIdentity, string pathSid, ITwilioRestClient client = null) { var options = new FetchFactorOptions(pathServiceSid, pathIdentity, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -258,10 +259,10 @@ public static ResourceSet Read(ReadFactorOptions options, ITwili /// Read Factor parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Factor - public static async System.Threading.Tasks.Task> ReadAsync(ReadFactorOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFactorOptions 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("factors", response.Content); return new ResourceSet(page, options, client); @@ -301,7 +302,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadFactorOptions(pathServiceSid, pathIdentity){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -392,11 +393,12 @@ public static FactorResource Update(UpdateFactorOptions options, ITwilioRestClie /// Client to make requests to Twilio /// Task that resolves to A single instance of Factor #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateFactorOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateFactorOptions 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 @@ -467,7 +469,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateFactorOptions(pathServiceSid, pathIdentity, pathSid){ AuthPayload = authPayload, FriendlyName = friendlyName, ConfigNotificationToken = configNotificationToken, ConfigSdkVersion = configSdkVersion, ConfigTimeStep = configTimeStep, ConfigSkew = configSkew, ConfigCodeLength = configCodeLength, ConfigAlg = configAlg, ConfigNotificationPlatform = configNotificationPlatform }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorResource.cs b/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorResource.cs index 9c4967d3a..7e5e2feac 100644 --- a/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorResource.cs @@ -122,10 +122,10 @@ public static NewFactorResource Create(CreateNewFactorOptions options, ITwilioRe /// Create NewFactor parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NewFactor - public static async System.Threading.Tasks.Task CreateAsync(CreateNewFactorOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateNewFactorOptions 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 @@ -212,7 +212,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateNewFactorOptions(pathServiceSid, pathIdentity, friendlyName, factorType){ BindingAlg = bindingAlg, BindingPublicKey = bindingPublicKey, ConfigAppId = configAppId, ConfigNotificationPlatform = configNotificationPlatform, ConfigNotificationToken = configNotificationToken, ConfigSdkVersion = configSdkVersion, BindingSecret = bindingSecret, ConfigTimeStep = configTimeStep, ConfigSkew = configSkew, ConfigCodeLength = configCodeLength, ConfigAlg = configAlg, Metadata = metadata }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/Service/EntityResource.cs b/src/Twilio/Rest/Verify/V2/Service/EntityResource.cs index eddc90569..04fd669f3 100644 --- a/src/Twilio/Rest/Verify/V2/Service/EntityResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/EntityResource.cs @@ -68,10 +68,10 @@ public static EntityResource Create(CreateEntityOptions options, ITwilioRestClie /// Create Entity parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Entity - public static async System.Threading.Tasks.Task CreateAsync(CreateEntityOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateEntityOptions 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 CreateEntityOptions(pathServiceSid, identity){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteEntityOptions options, ITwilioRestClient client /// Delete Entity parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Entity - public static async System.Threading.Tasks.Task DeleteAsync(DeleteEntityOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteEntityOptions 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 pathIdentity, ITwilioRes public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathIdentity, ITwilioRestClient client = null) { var options = new DeleteEntityOptions(pathServiceSid, pathIdentity) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -213,10 +214,10 @@ public static EntityResource Fetch(FetchEntityOptions options, ITwilioRestClient /// Fetch Entity parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Entity - public static async System.Threading.Tasks.Task FetchAsync(FetchEntityOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchEntityOptions 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 EntityResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathIdentity, ITwilioRestClient client = null) { var options = new FetchEntityOptions(pathServiceSid, pathIdentity){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static ResourceSet Read(ReadEntityOptions options, ITwili /// Read Entity parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Entity - public static async System.Threading.Tasks.Task> ReadAsync(ReadEntityOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEntityOptions 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("entities", response.Content); return new ResourceSet(page, options, client); @@ -319,7 +320,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadEntityOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationResource.cs b/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationResource.cs index 60b4f4617..3a6dc330e 100644 --- a/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationResource.cs @@ -68,10 +68,10 @@ public static MessagingConfigurationResource Create(CreateMessagingConfiguration /// Create MessagingConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MessagingConfiguration - public static async System.Threading.Tasks.Task CreateAsync(CreateMessagingConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessagingConfigurationOptions 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 ITwilioRestClient client = null) { var options = new CreateMessagingConfigurationOptions(pathServiceSid, country, messagingServiceSid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -149,11 +149,12 @@ public static bool Delete(DeleteMessagingConfigurationOptions options, ITwilioRe /// Delete MessagingConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MessagingConfiguration - public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessagingConfigurationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessagingConfigurationOptions 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 pathCountry, ITwilioRest public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathCountry, ITwilioRestClient client = null) { var options = new DeleteMessagingConfigurationOptions(pathServiceSid, pathCountry) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -217,10 +218,10 @@ public static MessagingConfigurationResource Fetch(FetchMessagingConfigurationOp /// Fetch MessagingConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MessagingConfiguration - public static async System.Threading.Tasks.Task FetchAsync(FetchMessagingConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessagingConfigurationOptions 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 MessagingConfigurationResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathCountry, ITwilioRestClient client = null) { var options = new FetchMessagingConfigurationOptions(pathServiceSid, pathCountry){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +285,10 @@ public static ResourceSet Read(ReadMessagingConf /// Read MessagingConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MessagingConfiguration - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessagingConfigurationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessagingConfigurationOptions 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("messaging_configurations", response.Content); return new ResourceSet(page, options, client); @@ -323,7 +324,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of MessagingConfiguration #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessagingConfigurationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessagingConfigurationOptions 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 @@ -451,7 +453,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new UpdateMessagingConfigurationOptions(pathServiceSid, pathCountry, messagingServiceSid){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketResource.cs b/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketResource.cs index 90ec228ef..d336d5443 100644 --- a/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketResource.cs @@ -70,10 +70,10 @@ public static BucketResource Create(CreateBucketOptions options, ITwilioRestClie /// Create Bucket parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Bucket - public static async System.Threading.Tasks.Task CreateAsync(CreateBucketOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateBucketOptions 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 CreateBucketOptions(pathServiceSid, pathRateLimitSid, max, interval){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -157,11 +157,12 @@ public static bool Delete(DeleteBucketOptions options, ITwilioRestClient client /// Delete Bucket parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Bucket - public static async System.Threading.Tasks.Task DeleteAsync(DeleteBucketOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteBucketOptions 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 pathRateLimitSid, string public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathRateLimitSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteBucketOptions(pathServiceSid, pathRateLimitSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -229,10 +230,10 @@ public static BucketResource Fetch(FetchBucketOptions options, ITwilioRestClient /// Fetch Bucket parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Bucket - public static async System.Threading.Tasks.Task FetchAsync(FetchBucketOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchBucketOptions 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 BucketResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathRateLimitSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchBucketOptions(pathServiceSid, pathRateLimitSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -301,10 +302,10 @@ public static ResourceSet Read(ReadBucketOptions options, ITwili /// Read Bucket parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Bucket - public static async System.Threading.Tasks.Task> ReadAsync(ReadBucketOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBucketOptions 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("buckets", response.Content); return new ResourceSet(page, options, client); @@ -344,7 +345,7 @@ public static async System.Threading.Tasks.Task> Rea ITwilioRestClient client = null) { var options = new ReadBucketOptions(pathServiceSid, pathRateLimitSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -435,11 +436,12 @@ public static BucketResource Update(UpdateBucketOptions options, ITwilioRestClie /// Client to make requests to Twilio /// Task that resolves to A single instance of Bucket #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateBucketOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateBucketOptions 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 UpdateBucketOptions(pathServiceSid, pathRateLimitSid, pathSid){ Max = max, Interval = interval }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/Service/RateLimitResource.cs b/src/Twilio/Rest/Verify/V2/Service/RateLimitResource.cs index 64ba48162..02e2fbb73 100644 --- a/src/Twilio/Rest/Verify/V2/Service/RateLimitResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/RateLimitResource.cs @@ -68,10 +68,10 @@ public static RateLimitResource Create(CreateRateLimitOptions options, ITwilioRe /// Create RateLimit parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RateLimit - public static async System.Threading.Tasks.Task CreateAsync(CreateRateLimitOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateRateLimitOptions 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 CreateRateLimitOptions(pathServiceSid, uniqueName){ Description = description }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -149,11 +149,12 @@ public static bool Delete(DeleteRateLimitOptions options, ITwilioRestClient clie /// Delete RateLimit parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RateLimit - public static async System.Threading.Tasks.Task DeleteAsync(DeleteRateLimitOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteRateLimitOptions 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 DeleteRateLimitOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -217,10 +218,10 @@ public static RateLimitResource Fetch(FetchRateLimitOptions options, ITwilioRest /// Fetch RateLimit parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RateLimit - public static async System.Threading.Tasks.Task FetchAsync(FetchRateLimitOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRateLimitOptions 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 RateLimitResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchRateLimitOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -284,10 +285,10 @@ public static ResourceSet Read(ReadRateLimitOptions options, /// Read RateLimit parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RateLimit - public static async System.Threading.Tasks.Task> ReadAsync(ReadRateLimitOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRateLimitOptions 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("rate_limits", 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 ReadRateLimitOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -412,11 +413,12 @@ public static RateLimitResource Update(UpdateRateLimitOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of RateLimit #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateRateLimitOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateRateLimitOptions 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 @@ -451,7 +453,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateRateLimitOptions(pathServiceSid, pathSid){ Description = description }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/Service/VerificationCheckResource.cs b/src/Twilio/Rest/Verify/V2/Service/VerificationCheckResource.cs index 25d7cac21..8f22a0725 100644 --- a/src/Twilio/Rest/Verify/V2/Service/VerificationCheckResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/VerificationCheckResource.cs @@ -84,10 +84,10 @@ public static VerificationCheckResource Create(CreateVerificationCheckOptions op /// Create VerificationCheck parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of VerificationCheck - public static async System.Threading.Tasks.Task CreateAsync(CreateVerificationCheckOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateVerificationCheckOptions 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 @@ -138,7 +138,7 @@ public static async System.Threading.Tasks.Task Creat ITwilioRestClient client = null) { var options = new CreateVerificationCheckOptions(pathServiceSid){ Code = code, To = to, VerificationSid = verificationSid, Amount = amount, Payee = payee, SnaClientToken = snaClientToken }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/Service/VerificationResource.cs b/src/Twilio/Rest/Verify/V2/Service/VerificationResource.cs index 51ddd2a49..ab0ab8ed0 100644 --- a/src/Twilio/Rest/Verify/V2/Service/VerificationResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/VerificationResource.cs @@ -108,10 +108,10 @@ public static VerificationResource Create(CreateVerificationOptions options, ITw /// Create Verification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Verification - public static async System.Threading.Tasks.Task CreateAsync(CreateVerificationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateVerificationOptions 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 @@ -210,7 +210,7 @@ public static async System.Threading.Tasks.Task CreateAsyn ITwilioRestClient client = null) { var options = new CreateVerificationOptions(pathServiceSid, to, channel){ CustomFriendlyName = customFriendlyName, CustomMessage = customMessage, SendDigits = sendDigits, Locale = locale, CustomCode = customCode, Amount = amount, Payee = payee, RateLimits = rateLimits, ChannelConfiguration = channelConfiguration, AppHash = appHash, TemplateSid = templateSid, TemplateCustomSubstitutions = templateCustomSubstitutions, DeviceIp = deviceIp, EnableSnaClientToken = enableSnaClientToken, RiskCheck = riskCheck, Tags = tags }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -249,10 +249,10 @@ public static VerificationResource Fetch(FetchVerificationOptions options, ITwil /// Fetch Verification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Verification - public static async System.Threading.Tasks.Task FetchAsync(FetchVerificationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchVerificationOptions 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 @@ -279,7 +279,7 @@ public static VerificationResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchVerificationOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -319,11 +319,12 @@ public static VerificationResource Update(UpdateVerificationOptions options, ITw /// Client to make requests to Twilio /// Task that resolves to A single instance of Verification #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateVerificationOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateVerificationOptions 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 @@ -358,7 +359,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn ITwilioRestClient client = null) { var options = new UpdateVerificationOptions(pathServiceSid, pathSid, status){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/Service/WebhookResource.cs b/src/Twilio/Rest/Verify/V2/Service/WebhookResource.cs index 14b90c636..2597acc24 100644 --- a/src/Twilio/Rest/Verify/V2/Service/WebhookResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/WebhookResource.cs @@ -107,10 +107,10 @@ public static WebhookResource Create(CreateWebhookOptions options, ITwilioRestCl /// Create Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions 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 @@ -157,7 +157,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateWebhookOptions(pathServiceSid, friendlyName, eventTypes, webhookUrl){ Status = status, Version = version }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -200,11 +200,12 @@ public static bool Delete(DeleteWebhookOptions options, ITwilioRestClient client /// Delete Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebhookOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebhookOptions 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 @@ -229,7 +230,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 DeleteWebhookOptions(pathServiceSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -268,10 +269,10 @@ public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClie /// Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions 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 @@ -298,7 +299,7 @@ public static WebhookResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchWebhookOptions(pathServiceSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -335,10 +336,10 @@ public static ResourceSet Read(ReadWebhookOptions options, ITwi /// Read Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions 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("webhooks", response.Content); return new ResourceSet(page, options, client); @@ -374,7 +375,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadWebhookOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -463,11 +464,12 @@ public static WebhookResource Update(UpdateWebhookOptions options, ITwilioRestCl /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions 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 @@ -518,7 +520,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateWebhookOptions(pathServiceSid, pathSid){ FriendlyName = friendlyName, EventTypes = eventTypes, WebhookUrl = webhookUrl, Status = status, Version = version }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/ServiceResource.cs b/src/Twilio/Rest/Verify/V2/ServiceResource.cs index 040d9d153..e9aabd7f2 100644 --- a/src/Twilio/Rest/Verify/V2/ServiceResource.cs +++ b/src/Twilio/Rest/Verify/V2/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 @@ -172,7 +172,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateServiceOptions(friendlyName){ CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled, DoNotShareWarningEnabled = doNotShareWarningEnabled, CustomCodeEnabled = customCodeEnabled, PushIncludeDate = pushIncludeDate, PushApnCredentialSid = pushApnCredentialSid, PushFcmCredentialSid = pushFcmCredentialSid, TotpIssuer = totpIssuer, TotpTimeStep = totpTimeStep, TotpCodeLength = totpCodeLength, TotpSkew = totpSkew, DefaultTemplateSid = defaultTemplateSid, WhatsappMsgServiceSid = whatsappMsgServiceSid, WhatsappFrom = whatsappFrom, VerifyEventSubscriptionEnabled = verifyEventSubscriptionEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -213,11 +213,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 @@ -237,10 +238,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the Verification 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 @@ -277,10 +278,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 @@ -301,10 +302,10 @@ public static ServiceResource Fetch( /// The Twilio-provided string that uniquely identifies the Verification 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 @@ -339,10 +340,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); @@ -374,7 +375,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 @@ -461,11 +462,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 @@ -572,7 +574,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled, DoNotShareWarningEnabled = doNotShareWarningEnabled, CustomCodeEnabled = customCodeEnabled, PushIncludeDate = pushIncludeDate, PushApnCredentialSid = pushApnCredentialSid, PushFcmCredentialSid = pushFcmCredentialSid, TotpIssuer = totpIssuer, TotpTimeStep = totpTimeStep, TotpCodeLength = totpCodeLength, TotpSkew = totpSkew, DefaultTemplateSid = defaultTemplateSid, WhatsappMsgServiceSid = whatsappMsgServiceSid, WhatsappFrom = whatsappFrom, VerifyEventSubscriptionEnabled = verifyEventSubscriptionEnabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/TemplateResource.cs b/src/Twilio/Rest/Verify/V2/TemplateResource.cs index 2d0fdbe23..9c9539e79 100644 --- a/src/Twilio/Rest/Verify/V2/TemplateResource.cs +++ b/src/Twilio/Rest/Verify/V2/TemplateResource.cs @@ -65,10 +65,10 @@ public static ResourceSet Read(ReadTemplateOptions options, IT /// Read Template parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Template - public static async System.Threading.Tasks.Task> ReadAsync(ReadTemplateOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTemplateOptions 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("templates", response.Content); return new ResourceSet(page, options, client); @@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadTemplateOptions(){ FriendlyName = friendlyName, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Verify/V2/VerificationAttemptResource.cs b/src/Twilio/Rest/Verify/V2/VerificationAttemptResource.cs index 30ed34d8e..14e9fcd62 100644 --- a/src/Twilio/Rest/Verify/V2/VerificationAttemptResource.cs +++ b/src/Twilio/Rest/Verify/V2/VerificationAttemptResource.cs @@ -95,10 +95,10 @@ public static VerificationAttemptResource Fetch(FetchVerificationAttemptOptions /// Fetch VerificationAttempt parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of VerificationAttempt - public static async System.Threading.Tasks.Task FetchAsync(FetchVerificationAttemptOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchVerificationAttemptOptions 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 @@ -119,10 +119,10 @@ public static VerificationAttemptResource Fetch( /// The unique SID identifier of a Verification Attempt /// Client to make requests to Twilio /// Task that resolves to A single instance of VerificationAttempt - 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 FetchVerificationAttemptOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -157,10 +157,10 @@ public static ResourceSet Read(ReadVerificationAtte /// Read VerificationAttempt parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of VerificationAttempt - public static async System.Threading.Tasks.Task> ReadAsync(ReadVerificationAttemptOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadVerificationAttemptOptions 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("attempts", response.Content); return new ResourceSet(page, options, client); @@ -224,7 +224,7 @@ public static async System.Threading.Tasks.Task Fetch VerificationAttemptsSummary parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of VerificationAttemptsSummary - public static async System.Threading.Tasks.Task FetchAsync(FetchVerificationAttemptsSummaryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchVerificationAttemptsSummaryOptions 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 @@ -121,7 +121,7 @@ public static VerificationAttemptsSummaryResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string verifyServiceSid = null, DateTime? dateCreatedAfter = null, DateTime? dateCreatedBefore = null, string country = null, VerificationAttemptsSummaryResource.ChannelsEnum channel = null, string destinationPrefix = null, ITwilioRestClient client = null) { var options = new FetchVerificationAttemptsSummaryOptions(){ VerifyServiceSid = verifyServiceSid,DateCreatedAfter = dateCreatedAfter,DateCreatedBefore = dateCreatedBefore,Country = country,Channel = channel,DestinationPrefix = destinationPrefix }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Video/V1/CompositionHookResource.cs b/src/Twilio/Rest/Video/V1/CompositionHookResource.cs index 8491b7caa..db59b3b82 100644 --- a/src/Twilio/Rest/Video/V1/CompositionHookResource.cs +++ b/src/Twilio/Rest/Video/V1/CompositionHookResource.cs @@ -79,10 +79,10 @@ public static CompositionHookResource Create(CreateCompositionHookOptions option /// Create CompositionHook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionHook - public static async System.Threading.Tasks.Task CreateAsync(CreateCompositionHookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCompositionHookOptions 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 CreateA ITwilioRestClient client = null) { var options = new CreateCompositionHookOptions(friendlyName){ Enabled = enabled, VideoLayout = videoLayout, AudioSources = audioSources, AudioSourcesExcluded = audioSourcesExcluded, Resolution = resolution, Format = format, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, Trim = trim }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -186,11 +186,12 @@ public static bool Delete(DeleteCompositionHookOptions options, ITwilioRestClien /// Delete CompositionHook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionHook - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCompositionHookOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCompositionHookOptions 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 @@ -210,10 +211,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the CompositionHook resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionHook - 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 DeleteCompositionHookOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -250,10 +251,10 @@ public static CompositionHookResource Fetch(FetchCompositionHookOptions options, /// Fetch CompositionHook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionHook - public static async System.Threading.Tasks.Task FetchAsync(FetchCompositionHookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCompositionHookOptions 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 @@ -274,10 +275,10 @@ public static CompositionHookResource Fetch( /// The SID of the CompositionHook resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionHook - 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 FetchCompositionHookOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -312,10 +313,10 @@ public static ResourceSet Read(ReadCompositionHookOptio /// Read CompositionHook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionHook - public static async System.Threading.Tasks.Task> ReadAsync(ReadCompositionHookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCompositionHookOptions 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("composition_hooks", response.Content); return new ResourceSet(page, options, client); @@ -363,7 +364,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of CompositionHook #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateCompositionHookOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateCompositionHookOptions 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 @@ -521,7 +523,7 @@ public static async System.Threading.Tasks.Task UpdateA ITwilioRestClient client = null) { var options = new UpdateCompositionHookOptions(pathSid, friendlyName){ Enabled = enabled, VideoLayout = videoLayout, AudioSources = audioSources, AudioSourcesExcluded = audioSourcesExcluded, Trim = trim, Format = format, Resolution = resolution, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Video/V1/CompositionResource.cs b/src/Twilio/Rest/Video/V1/CompositionResource.cs index e2e40ed65..94a99f3cd 100644 --- a/src/Twilio/Rest/Video/V1/CompositionResource.cs +++ b/src/Twilio/Rest/Video/V1/CompositionResource.cs @@ -95,10 +95,10 @@ public static CompositionResource Create(CreateCompositionOptions options, ITwil /// Create Composition parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Composition - public static async System.Threading.Tasks.Task CreateAsync(CreateCompositionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCompositionOptions 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 @@ -157,7 +157,7 @@ public static async System.Threading.Tasks.Task CreateAsync ITwilioRestClient client = null) { var options = new CreateCompositionOptions(roomSid){ VideoLayout = videoLayout, AudioSources = audioSources, AudioSourcesExcluded = audioSourcesExcluded, Resolution = resolution, Format = format, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, Trim = trim }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -198,11 +198,12 @@ public static bool Delete(DeleteCompositionOptions options, ITwilioRestClient cl /// Delete Composition parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Composition - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCompositionOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCompositionOptions 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 @@ -222,10 +223,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Composition resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Composition - 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 DeleteCompositionOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -262,10 +263,10 @@ public static CompositionResource Fetch(FetchCompositionOptions options, ITwilio /// Fetch Composition parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Composition - public static async System.Threading.Tasks.Task FetchAsync(FetchCompositionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCompositionOptions 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,10 +287,10 @@ public static CompositionResource Fetch( /// The SID of the Composition resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Composition - 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 FetchCompositionOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -324,10 +325,10 @@ public static ResourceSet Read(ReadCompositionOptions optio /// Read Composition parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Composition - public static async System.Threading.Tasks.Task> ReadAsync(ReadCompositionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCompositionOptions 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("compositions", response.Content); return new ResourceSet(page, options, client); @@ -375,7 +376,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadCompositionOptions(){ Status = status, DateCreatedAfter = dateCreatedAfter, DateCreatedBefore = dateCreatedBefore, RoomSid = roomSid, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Video/V1/CompositionSettingsResource.cs b/src/Twilio/Rest/Video/V1/CompositionSettingsResource.cs index 1745f6fe3..4cd16f9f7 100644 --- a/src/Twilio/Rest/Video/V1/CompositionSettingsResource.cs +++ b/src/Twilio/Rest/Video/V1/CompositionSettingsResource.cs @@ -66,10 +66,10 @@ public static CompositionSettingsResource Create(CreateCompositionSettingsOption /// Create CompositionSettings parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionSettings - public static async System.Threading.Tasks.Task CreateAsync(CreateCompositionSettingsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCompositionSettingsOptions 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 @@ -116,7 +116,7 @@ public static async System.Threading.Tasks.Task Cre ITwilioRestClient client = null) { var options = new CreateCompositionSettingsOptions(friendlyName){ AwsCredentialsSid = awsCredentialsSid, EncryptionKeySid = encryptionKeySid, AwsS3Url = awsS3Url, AwsStorageEnabled = awsStorageEnabled, EncryptionEnabled = encryptionEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -151,10 +151,10 @@ public static CompositionSettingsResource Fetch(FetchCompositionSettingsOptions /// Fetch CompositionSettings parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionSettings - public static async System.Threading.Tasks.Task FetchAsync(FetchCompositionSettingsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCompositionSettingsOptions 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 @@ -172,10 +172,10 @@ public static CompositionSettingsResource Fetch( /// fetch /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionSettings - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchCompositionSettingsOptions(){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Video/V1/RecordingResource.cs b/src/Twilio/Rest/Video/V1/RecordingResource.cs index 215e52390..b06451fc1 100644 --- a/src/Twilio/Rest/Video/V1/RecordingResource.cs +++ b/src/Twilio/Rest/Video/V1/RecordingResource.cs @@ -128,11 +128,12 @@ public static bool Delete(DeleteRecordingOptions options, ITwilioRestClient clie /// Delete Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task DeleteAsync(DeleteRecordingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteRecordingOptions 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 @@ -152,10 +153,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Recording resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - 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 DeleteRecordingOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -192,10 +193,10 @@ public static RecordingResource Fetch(FetchRecordingOptions options, ITwilioRest /// Fetch Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions 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 @@ -216,10 +217,10 @@ public static RecordingResource Fetch( /// The SID of the Recording resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - 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 FetchRecordingOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -254,10 +255,10 @@ public static ResourceSet Read(ReadRecordingOptions options, /// Read Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordingOptions 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("recordings", response.Content); return new ResourceSet(page, options, client); @@ -313,7 +314,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadRecordingOptions(){ Status = status, SourceSid = sourceSid, GroupingSid = groupingSid, DateCreatedAfter = dateCreatedAfter, DateCreatedBefore = dateCreatedBefore, MediaType = mediaType, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Video/V1/RecordingSettingsResource.cs b/src/Twilio/Rest/Video/V1/RecordingSettingsResource.cs index 1a922eb7e..7df052e0f 100644 --- a/src/Twilio/Rest/Video/V1/RecordingSettingsResource.cs +++ b/src/Twilio/Rest/Video/V1/RecordingSettingsResource.cs @@ -66,10 +66,10 @@ public static RecordingSettingsResource Create(CreateRecordingSettingsOptions op /// Create RecordingSettings parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RecordingSettings - public static async System.Threading.Tasks.Task CreateAsync(CreateRecordingSettingsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateRecordingSettingsOptions 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 @@ -116,7 +116,7 @@ public static async System.Threading.Tasks.Task Creat ITwilioRestClient client = null) { var options = new CreateRecordingSettingsOptions(friendlyName){ AwsCredentialsSid = awsCredentialsSid, EncryptionKeySid = encryptionKeySid, AwsS3Url = awsS3Url, AwsStorageEnabled = awsStorageEnabled, EncryptionEnabled = encryptionEnabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -151,10 +151,10 @@ public static RecordingSettingsResource Fetch(FetchRecordingSettingsOptions opti /// Fetch RecordingSettings parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RecordingSettings - public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingSettingsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingSettingsOptions 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 @@ -172,10 +172,10 @@ public static RecordingSettingsResource Fetch( /// fetch /// Client to make requests to Twilio /// Task that resolves to A single instance of RecordingSettings - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchRecordingSettingsOptions(){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeResource.cs b/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeResource.cs index 7e93fe425..456b59647 100644 --- a/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeResource.cs +++ b/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeResource.cs @@ -83,11 +83,12 @@ public static AnonymizeResource Update(UpdateAnonymizeOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of Anonymize #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAnonymizeOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateAnonymizeOptions 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 @@ -118,7 +119,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateAnonymizeOptions(pathRoomSid, pathSid){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackResource.cs b/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackResource.cs index 9e0ed3f97..c02553627 100644 --- a/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackResource.cs +++ b/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackResource.cs @@ -85,10 +85,10 @@ public static PublishedTrackResource Fetch(FetchPublishedTrackOptions options, I /// Fetch PublishedTrack parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PublishedTrack - public static async System.Threading.Tasks.Task FetchAsync(FetchPublishedTrackOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchPublishedTrackOptions 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 PublishedTrackResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathParticipantSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchPublishedTrackOptions(pathRoomSid, pathParticipantSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -157,10 +157,10 @@ public static ResourceSet Read(ReadPublishedTrackOptions /// Read PublishedTrack parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PublishedTrack - public static async System.Threading.Tasks.Task> ReadAsync(ReadPublishedTrackOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPublishedTrackOptions 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("published_tracks", response.Content); return new ResourceSet(page, options, client); @@ -200,7 +200,7 @@ public static async System.Threading.Tasks.Task Fetch SubscribeRules parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribeRules - public static async System.Threading.Tasks.Task FetchAsync(FetchSubscribeRulesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSubscribeRulesOptions 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 SubscribeRulesResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathParticipantSid, ITwilioRestClient client = null) { var options = new FetchSubscribeRulesOptions(pathRoomSid, pathParticipantSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -139,11 +139,12 @@ public static SubscribeRulesResource Update(UpdateSubscribeRulesOptions options, /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribeRules #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSubscribeRulesOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSubscribeRulesOptions 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 @@ -178,7 +179,7 @@ public static async System.Threading.Tasks.Task UpdateAs ITwilioRestClient client = null) { var options = new UpdateSubscribeRulesOptions(pathRoomSid, pathParticipantSid){ Rules = rules }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackResource.cs b/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackResource.cs index 5ff832175..0cf4b351b 100644 --- a/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackResource.cs +++ b/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackResource.cs @@ -85,10 +85,10 @@ public static SubscribedTrackResource Fetch(FetchSubscribedTrackOptions options, /// Fetch SubscribedTrack parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedTrack - public static async System.Threading.Tasks.Task FetchAsync(FetchSubscribedTrackOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSubscribedTrackOptions 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 SubscribedTrackResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathParticipantSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchSubscribedTrackOptions(pathRoomSid, pathParticipantSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -157,10 +157,10 @@ public static ResourceSet Read(ReadSubscribedTrackOptio /// Read SubscribedTrack parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedTrack - public static async System.Threading.Tasks.Task> ReadAsync(ReadSubscribedTrackOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSubscribedTrackOptions 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("subscribed_tracks", response.Content); return new ResourceSet(page, options, client); @@ -200,7 +200,7 @@ public static async System.Threading.Tasks.Task Fetch Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions 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 @@ -112,7 +112,7 @@ public static ParticipantResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchParticipantOptions(pathRoomSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -149,10 +149,10 @@ public static ResourceSet Read(ReadParticipantOptions optio /// Read Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions 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("participants", response.Content); return new ResourceSet(page, options, client); @@ -204,7 +204,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadParticipantOptions(pathRoomSid){ Status = status, Identity = identity, DateCreatedAfter = dateCreatedAfter, DateCreatedBefore = dateCreatedBefore, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -293,11 +293,12 @@ public static ParticipantResource Update(UpdateParticipantOptions options, ITwil /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateParticipantOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateParticipantOptions 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 @@ -332,7 +333,7 @@ public static async System.Threading.Tasks.Task UpdateAsync ITwilioRestClient client = null) { var options = new UpdateParticipantOptions(pathRoomSid, pathSid){ Status = status }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Video/V1/Room/RecordingRulesResource.cs b/src/Twilio/Rest/Video/V1/Room/RecordingRulesResource.cs index ed2ff0b80..f885a248d 100644 --- a/src/Twilio/Rest/Video/V1/Room/RecordingRulesResource.cs +++ b/src/Twilio/Rest/Video/V1/Room/RecordingRulesResource.cs @@ -67,10 +67,10 @@ public static RecordingRulesResource Fetch(FetchRecordingRulesOptions options, I /// Fetch RecordingRules parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RecordingRules - public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingRulesOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingRulesOptions 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 RecordingRulesResource Fetch( /// The SID of the Room resource where the recording rules to fetch apply. /// Client to make requests to Twilio /// Task that resolves to A single instance of RecordingRules - public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchRecordingRulesOptions(pathRoomSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -132,11 +132,12 @@ public static RecordingRulesResource Update(UpdateRecordingRulesOptions options, /// Client to make requests to Twilio /// Task that resolves to A single instance of RecordingRules #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateRecordingRulesOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateRecordingRulesOptions 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 @@ -167,7 +168,7 @@ public static async System.Threading.Tasks.Task UpdateAs ITwilioRestClient client = null) { var options = new UpdateRecordingRulesOptions(pathRoomSid){ Rules = rules }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Video/V1/Room/RoomRecordingResource.cs b/src/Twilio/Rest/Video/V1/Room/RoomRecordingResource.cs index 90b183228..80e16062a 100644 --- a/src/Twilio/Rest/Video/V1/Room/RoomRecordingResource.cs +++ b/src/Twilio/Rest/Video/V1/Room/RoomRecordingResource.cs @@ -130,11 +130,12 @@ public static bool Delete(DeleteRoomRecordingOptions options, ITwilioRestClient /// Delete RoomRecording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RoomRecording - public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoomRecordingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoomRecordingOptions 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 @@ -159,7 +160,7 @@ public static bool Delete(string pathRoomSid, string pathSid, ITwilioRestClient public static async System.Threading.Tasks.Task DeleteAsync(string pathRoomSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteRoomRecordingOptions(pathRoomSid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -198,10 +199,10 @@ public static RoomRecordingResource Fetch(FetchRoomRecordingOptions options, ITw /// Fetch RoomRecording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RoomRecording - public static async System.Threading.Tasks.Task FetchAsync(FetchRoomRecordingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoomRecordingOptions 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 @@ -228,7 +229,7 @@ public static RoomRecordingResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchRoomRecordingOptions(pathRoomSid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -265,10 +266,10 @@ public static ResourceSet Read(ReadRoomRecordingOptions o /// Read RoomRecording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RoomRecording - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoomRecordingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoomRecordingOptions 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("recordings", response.Content); return new ResourceSet(page, options, client); @@ -320,7 +321,7 @@ public static async System.Threading.Tasks.Task Create Room parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Room - public static async System.Threading.Tasks.Task CreateAsync(CreateRoomOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateRoomOptions 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 @@ -194,7 +194,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateRoomOptions(){ EnableTurn = enableTurn, Type = type, UniqueName = uniqueName, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, MaxParticipants = maxParticipants, RecordParticipantsOnConnect = recordParticipantsOnConnect, VideoCodecs = videoCodecs, MediaRegion = mediaRegion, RecordingRules = recordingRules, AudioOnly = audioOnly, MaxParticipantDuration = maxParticipantDuration, EmptyRoomTimeout = emptyRoomTimeout, UnusedRoomTimeout = unusedRoomTimeout, LargeRoom = largeRoom }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -231,10 +231,10 @@ public static RoomResource Fetch(FetchRoomOptions options, ITwilioRestClient cli /// Fetch Room parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Room - public static async System.Threading.Tasks.Task FetchAsync(FetchRoomOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoomOptions 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 @@ -255,10 +255,10 @@ public static RoomResource Fetch( /// The SID of the Room resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Room - 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 FetchRoomOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -293,10 +293,10 @@ public static ResourceSet Read(ReadRoomOptions options, ITwilioRes /// Read Room parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Room - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoomOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoomOptions 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("rooms", response.Content); return new ResourceSet(page, options, client); @@ -344,7 +344,7 @@ public static async System.Threading.Tasks.Task> ReadA ITwilioRestClient client = null) { var options = new ReadRoomOptions(){ Status = status, UniqueName = uniqueName, DateCreatedAfter = dateCreatedAfter, DateCreatedBefore = dateCreatedBefore, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -431,11 +431,12 @@ public static RoomResource Update(UpdateRoomOptions options, ITwilioRestClient c /// Client to make requests to Twilio /// Task that resolves to A single instance of Room #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoomOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoomOptions 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 @@ -466,7 +467,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateRoomOptions(pathSid, status){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Voice/V1/ArchivedCallResource.cs b/src/Twilio/Rest/Voice/V1/ArchivedCallResource.cs index 2e4c4f419..86399e984 100644 --- a/src/Twilio/Rest/Voice/V1/ArchivedCallResource.cs +++ b/src/Twilio/Rest/Voice/V1/ArchivedCallResource.cs @@ -73,11 +73,12 @@ public static bool Delete(DeleteArchivedCallOptions options, ITwilioRestClient c /// Delete ArchivedCall parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ArchivedCall - public static async System.Threading.Tasks.Task DeleteAsync(DeleteArchivedCallOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteArchivedCallOptions 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 @@ -102,7 +103,7 @@ public static bool Delete(DateTime? pathDate, string pathSid, ITwilioRestClient public static async System.Threading.Tasks.Task DeleteAsync(DateTime? pathDate, string pathSid, ITwilioRestClient client = null) { var options = new DeleteArchivedCallOptions(pathDate, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Voice/V1/ByocTrunkResource.cs b/src/Twilio/Rest/Voice/V1/ByocTrunkResource.cs index b104f0397..190f44372 100644 --- a/src/Twilio/Rest/Voice/V1/ByocTrunkResource.cs +++ b/src/Twilio/Rest/Voice/V1/ByocTrunkResource.cs @@ -66,10 +66,10 @@ public static ByocTrunkResource Create(CreateByocTrunkOptions options, ITwilioRe /// Create ByocTrunk parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ByocTrunk - public static async System.Threading.Tasks.Task CreateAsync(CreateByocTrunkOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateByocTrunkOptions 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 @@ -132,7 +132,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateByocTrunkOptions(){ FriendlyName = friendlyName, VoiceUrl = voiceUrl, VoiceMethod = voiceMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceFallbackMethod = voiceFallbackMethod, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, CnamLookupEnabled = cnamLookupEnabled, ConnectionPolicySid = connectionPolicySid, FromDomainSid = fromDomainSid }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -173,11 +173,12 @@ public static bool Delete(DeleteByocTrunkOptions options, ITwilioRestClient clie /// Delete ByocTrunk parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ByocTrunk - public static async System.Threading.Tasks.Task DeleteAsync(DeleteByocTrunkOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteByocTrunkOptions 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 @@ -197,10 +198,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the BYOC Trunk resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of ByocTrunk - 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 DeleteByocTrunkOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -237,10 +238,10 @@ public static ByocTrunkResource Fetch(FetchByocTrunkOptions options, ITwilioRest /// Fetch ByocTrunk parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ByocTrunk - public static async System.Threading.Tasks.Task FetchAsync(FetchByocTrunkOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchByocTrunkOptions 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 @@ -261,10 +262,10 @@ public static ByocTrunkResource Fetch( /// The Twilio-provided string that uniquely identifies the BYOC Trunk resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ByocTrunk - 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 FetchByocTrunkOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -299,10 +300,10 @@ public static ResourceSet Read(ReadByocTrunkOptions options, /// Read ByocTrunk parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ByocTrunk - public static async System.Threading.Tasks.Task> ReadAsync(ReadByocTrunkOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadByocTrunkOptions 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("byoc_trunks", response.Content); return new ResourceSet(page, options, client); @@ -334,7 +335,7 @@ public static async System.Threading.Tasks.Task> ITwilioRestClient client = null) { var options = new ReadByocTrunkOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -421,11 +422,12 @@ public static ByocTrunkResource Update(UpdateByocTrunkOptions options, ITwilioRe /// Client to make requests to Twilio /// Task that resolves to A single instance of ByocTrunk #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateByocTrunkOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateByocTrunkOptions 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 @@ -492,7 +494,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateByocTrunkOptions(pathSid){ FriendlyName = friendlyName, VoiceUrl = voiceUrl, VoiceMethod = voiceMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceFallbackMethod = voiceFallbackMethod, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, CnamLookupEnabled = cnamLookupEnabled, ConnectionPolicySid = connectionPolicySid, FromDomainSid = fromDomainSid }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetResource.cs b/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetResource.cs index 58f495222..7215145f5 100644 --- a/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetResource.cs +++ b/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetResource.cs @@ -68,10 +68,10 @@ public static ConnectionPolicyTargetResource Create(CreateConnectionPolicyTarget /// Create ConnectionPolicyTarget parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicyTarget - public static async System.Threading.Tasks.Task CreateAsync(CreateConnectionPolicyTargetOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateConnectionPolicyTargetOptions 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 @@ -118,7 +118,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new CreateConnectionPolicyTargetOptions(pathConnectionPolicySid, target){ FriendlyName = friendlyName, Priority = priority, Weight = weight, Enabled = enabled }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -161,11 +161,12 @@ public static bool Delete(DeleteConnectionPolicyTargetOptions options, ITwilioRe /// Delete ConnectionPolicyTarget parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicyTarget - public static async System.Threading.Tasks.Task DeleteAsync(DeleteConnectionPolicyTargetOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteConnectionPolicyTargetOptions 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 @@ -190,7 +191,7 @@ public static bool Delete(string pathConnectionPolicySid, string pathSid, ITwili public static async System.Threading.Tasks.Task DeleteAsync(string pathConnectionPolicySid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteConnectionPolicyTargetOptions(pathConnectionPolicySid, pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -229,10 +230,10 @@ public static ConnectionPolicyTargetResource Fetch(FetchConnectionPolicyTargetOp /// Fetch ConnectionPolicyTarget parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicyTarget - public static async System.Threading.Tasks.Task FetchAsync(FetchConnectionPolicyTargetOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchConnectionPolicyTargetOptions 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 @@ -259,7 +260,7 @@ public static ConnectionPolicyTargetResource Fetch( public static async System.Threading.Tasks.Task FetchAsync(string pathConnectionPolicySid, string pathSid, ITwilioRestClient client = null) { var options = new FetchConnectionPolicyTargetOptions(pathConnectionPolicySid, pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -296,10 +297,10 @@ public static ResourceSet Read(ReadConnectionPol /// Read ConnectionPolicyTarget parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicyTarget - public static async System.Threading.Tasks.Task> ReadAsync(ReadConnectionPolicyTargetOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConnectionPolicyTargetOptions 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("targets", response.Content); return new ResourceSet(page, options, client); @@ -335,7 +336,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicyTarget #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateConnectionPolicyTargetOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateConnectionPolicyTargetOptions 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 @@ -479,7 +481,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new UpdateConnectionPolicyTargetOptions(pathConnectionPolicySid, pathSid){ FriendlyName = friendlyName, Target = target, Priority = priority, Weight = weight, Enabled = enabled }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Voice/V1/ConnectionPolicyResource.cs b/src/Twilio/Rest/Voice/V1/ConnectionPolicyResource.cs index 12d20ec61..82268922b 100644 --- a/src/Twilio/Rest/Voice/V1/ConnectionPolicyResource.cs +++ b/src/Twilio/Rest/Voice/V1/ConnectionPolicyResource.cs @@ -66,10 +66,10 @@ public static ConnectionPolicyResource Create(CreateConnectionPolicyOptions opti /// Create ConnectionPolicy parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicy - public static async System.Threading.Tasks.Task CreateAsync(CreateConnectionPolicyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateConnectionPolicyOptions 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 @@ -96,7 +96,7 @@ public static async System.Threading.Tasks.Task Create ITwilioRestClient client = null) { var options = new CreateConnectionPolicyOptions(){ FriendlyName = friendlyName }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -137,11 +137,12 @@ public static bool Delete(DeleteConnectionPolicyOptions options, ITwilioRestClie /// Delete ConnectionPolicy parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicy - public static async System.Threading.Tasks.Task DeleteAsync(DeleteConnectionPolicyOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteConnectionPolicyOptions 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 @@ -161,10 +162,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string that we created to identify the Connection Policy resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicy - 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 DeleteConnectionPolicyOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -201,10 +202,10 @@ public static ConnectionPolicyResource Fetch(FetchConnectionPolicyOptions option /// Fetch ConnectionPolicy parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicy - public static async System.Threading.Tasks.Task FetchAsync(FetchConnectionPolicyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchConnectionPolicyOptions 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 @@ -225,10 +226,10 @@ public static ConnectionPolicyResource Fetch( /// The unique string that we created to identify the Connection Policy resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicy - 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 FetchConnectionPolicyOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -263,10 +264,10 @@ public static ResourceSet Read(ReadConnectionPolicyOpt /// Read ConnectionPolicy parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicy - public static async System.Threading.Tasks.Task> ReadAsync(ReadConnectionPolicyOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConnectionPolicyOptions 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("connection_policies", response.Content); return new ResourceSet(page, options, client); @@ -298,7 +299,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicy #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateConnectionPolicyOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateConnectionPolicyOptions 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 @@ -420,7 +422,7 @@ public static async System.Threading.Tasks.Task Update ITwilioRestClient client = null) { var options = new UpdateConnectionPolicyOptions(pathSid){ FriendlyName = friendlyName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateResource.cs b/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateResource.cs index 83907ca7f..b7ecef5d0 100644 --- a/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateResource.cs +++ b/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateResource.cs @@ -66,10 +66,10 @@ public static BulkCountryUpdateResource Create(CreateBulkCountryUpdateOptions op /// Create BulkCountryUpdate parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkCountryUpdate - public static async System.Threading.Tasks.Task CreateAsync(CreateBulkCountryUpdateOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateBulkCountryUpdateOptions 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 @@ -96,7 +96,7 @@ public static async System.Threading.Tasks.Task Creat ITwilioRestClient client = null) { var options = new CreateBulkCountryUpdateOptions(updateRequest){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixResource.cs b/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixResource.cs index 3b6e98d30..12b8d94e0 100644 --- a/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixResource.cs +++ b/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixResource.cs @@ -67,10 +67,10 @@ public static ResourceSet Read(ReadHighriskSpecia /// Read HighriskSpecialPrefix parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HighriskSpecialPrefix - public static async System.Threading.Tasks.Task> ReadAsync(ReadHighriskSpecialPrefixOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadHighriskSpecialPrefixOptions 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); @@ -106,7 +106,7 @@ public static async System.Threading.Tasks.Task Fetch Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions 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 CountryResource Fetch( /// The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the DialingPermissions Country resource to fetch /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCode, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCode, ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchCountryOptions(pathIsoCode){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -129,10 +129,10 @@ public static ResourceSet Read(ReadCountryOptions options, ITwi /// Read Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions 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); @@ -188,7 +188,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadCountryOptions(){ IsoCode = isoCode, Continent = continent, CountryCode = countryCode, LowRiskNumbersEnabled = lowRiskNumbersEnabled, HighRiskSpecialNumbersEnabled = highRiskSpecialNumbersEnabled, HighRiskTollfraudNumbersEnabled = highRiskTollfraudNumbersEnabled, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsResource.cs b/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsResource.cs index df8863b5c..b649cf480 100644 --- a/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsResource.cs +++ b/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsResource.cs @@ -65,10 +65,10 @@ public static SettingsResource Fetch(FetchSettingsOptions options, ITwilioRestCl /// Fetch Settings parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Settings - public static async System.Threading.Tasks.Task FetchAsync(FetchSettingsOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSettingsOptions 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 @@ -86,10 +86,10 @@ public static SettingsResource Fetch( /// Retrieve voice dialing permissions inheritance for the sub-account /// Client to make requests to Twilio /// Task that resolves to A single instance of Settings - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) { var options = new FetchSettingsOptions(){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -125,11 +125,12 @@ public static SettingsResource Update(UpdateSettingsOptions options, ITwilioRest /// Client to make requests to Twilio /// Task that resolves to A single instance of Settings #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSettingsOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSettingsOptions 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 @@ -156,7 +157,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateSettingsOptions(){ DialingPermissionsInheritance = dialingPermissionsInheritance }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Voice/V1/IpRecordResource.cs b/src/Twilio/Rest/Voice/V1/IpRecordResource.cs index f45a66699..f9e73fca2 100644 --- a/src/Twilio/Rest/Voice/V1/IpRecordResource.cs +++ b/src/Twilio/Rest/Voice/V1/IpRecordResource.cs @@ -66,10 +66,10 @@ public static IpRecordResource Create(CreateIpRecordOptions options, ITwilioRest /// Create IpRecord parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpRecord - public static async System.Threading.Tasks.Task CreateAsync(CreateIpRecordOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateIpRecordOptions 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 @@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateIpRecordOptions(ipAddress){ FriendlyName = friendlyName, CidrPrefixLength = cidrPrefixLength }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -145,11 +145,12 @@ public static bool Delete(DeleteIpRecordOptions options, ITwilioRestClient clien /// Delete IpRecord parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpRecord - public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpRecordOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpRecordOptions 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 @@ -169,10 +170,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the IP Record resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of IpRecord - 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 DeleteIpRecordOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -209,10 +210,10 @@ public static IpRecordResource Fetch(FetchIpRecordOptions options, ITwilioRestCl /// Fetch IpRecord parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpRecord - public static async System.Threading.Tasks.Task FetchAsync(FetchIpRecordOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchIpRecordOptions 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 @@ -233,10 +234,10 @@ public static IpRecordResource Fetch( /// The Twilio-provided string that uniquely identifies the IP Record resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of IpRecord - 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 FetchIpRecordOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -271,10 +272,10 @@ public static ResourceSet Read(ReadIpRecordOptions options, IT /// Read IpRecord parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpRecord - public static async System.Threading.Tasks.Task> ReadAsync(ReadIpRecordOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadIpRecordOptions 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("ip_records", response.Content); return new ResourceSet(page, options, client); @@ -306,7 +307,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadIpRecordOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -393,11 +394,12 @@ public static IpRecordResource Update(UpdateIpRecordOptions options, ITwilioRest /// Client to make requests to Twilio /// Task that resolves to A single instance of IpRecord #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateIpRecordOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateIpRecordOptions 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 @@ -428,7 +430,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateIpRecordOptions(pathSid){ FriendlyName = friendlyName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Voice/V1/SourceIpMappingResource.cs b/src/Twilio/Rest/Voice/V1/SourceIpMappingResource.cs index 32df8385f..12cdcf99a 100644 --- a/src/Twilio/Rest/Voice/V1/SourceIpMappingResource.cs +++ b/src/Twilio/Rest/Voice/V1/SourceIpMappingResource.cs @@ -66,10 +66,10 @@ public static SourceIpMappingResource Create(CreateSourceIpMappingOptions option /// Create SourceIpMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SourceIpMapping - public static async System.Threading.Tasks.Task CreateAsync(CreateSourceIpMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSourceIpMappingOptions 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 @@ -100,7 +100,7 @@ public static async System.Threading.Tasks.Task CreateA ITwilioRestClient client = null) { var options = new CreateSourceIpMappingOptions(ipRecordSid, sipDomainSid){ }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -141,11 +141,12 @@ public static bool Delete(DeleteSourceIpMappingOptions options, ITwilioRestClien /// Delete SourceIpMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SourceIpMapping - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSourceIpMappingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSourceIpMappingOptions 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 @@ -165,10 +166,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the IP Record resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of SourceIpMapping - 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 DeleteSourceIpMappingOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -205,10 +206,10 @@ public static SourceIpMappingResource Fetch(FetchSourceIpMappingOptions options, /// Fetch SourceIpMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SourceIpMapping - public static async System.Threading.Tasks.Task FetchAsync(FetchSourceIpMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSourceIpMappingOptions 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 @@ -229,10 +230,10 @@ public static SourceIpMappingResource Fetch( /// The Twilio-provided string that uniquely identifies the IP Record resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of SourceIpMapping - 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 FetchSourceIpMappingOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -267,10 +268,10 @@ public static ResourceSet Read(ReadSourceIpMappingOptio /// Read SourceIpMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SourceIpMapping - public static async System.Threading.Tasks.Task> ReadAsync(ReadSourceIpMappingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSourceIpMappingOptions 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("source_ip_mappings", response.Content); return new ResourceSet(page, options, client); @@ -302,7 +303,7 @@ public static async System.Threading.Tasks.Task Client to make requests to Twilio /// Task that resolves to A single instance of SourceIpMapping #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSourceIpMappingOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSourceIpMappingOptions 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 @@ -424,7 +426,7 @@ public static async System.Threading.Tasks.Task UpdateA ITwilioRestClient client = null) { var options = new UpdateSourceIpMappingOptions(pathSid, sipDomainSid){ }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Wireless/V1/CommandResource.cs b/src/Twilio/Rest/Wireless/V1/CommandResource.cs index 70603c5ba..6c3ad1978 100644 --- a/src/Twilio/Rest/Wireless/V1/CommandResource.cs +++ b/src/Twilio/Rest/Wireless/V1/CommandResource.cs @@ -121,10 +121,10 @@ public static CommandResource Create(CreateCommandOptions options, ITwilioRestCl /// Create Command parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task CreateAsync(CreateCommandOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCommandOptions 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 @@ -175,7 +175,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateCommandOptions(command){ Sim = sim, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, CommandMode = commandMode, IncludeSid = includeSid, DeliveryReceiptRequested = deliveryReceiptRequested }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -216,11 +216,12 @@ public static bool Delete(DeleteCommandOptions options, ITwilioRestClient client /// Delete Command parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task DeleteAsync(DeleteCommandOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteCommandOptions 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 @@ -240,10 +241,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Command resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - 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 DeleteCommandOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -280,10 +281,10 @@ public static CommandResource Fetch(FetchCommandOptions options, ITwilioRestClie /// Fetch Command parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task FetchAsync(FetchCommandOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCommandOptions 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 @@ -304,10 +305,10 @@ public static CommandResource Fetch( /// The SID of the Command resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - 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 FetchCommandOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -342,10 +343,10 @@ public static ResourceSet Read(ReadCommandOptions options, ITwi /// Read Command parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task> ReadAsync(ReadCommandOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCommandOptions 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("commands", response.Content); return new ResourceSet(page, options, client); @@ -393,7 +394,7 @@ public static async System.Threading.Tasks.Task> Re ITwilioRestClient client = null) { var options = new ReadCommandOptions(){ Sim = sim, Status = status, Direction = direction, Transport = transport, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Wireless/V1/RatePlanResource.cs b/src/Twilio/Rest/Wireless/V1/RatePlanResource.cs index 8ba8ac304..4022c66c9 100644 --- a/src/Twilio/Rest/Wireless/V1/RatePlanResource.cs +++ b/src/Twilio/Rest/Wireless/V1/RatePlanResource.cs @@ -66,10 +66,10 @@ public static RatePlanResource Create(CreateRatePlanOptions options, ITwilioRest /// Create RatePlan parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task CreateAsync(CreateRatePlanOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateRatePlanOptions 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 @@ -136,7 +136,7 @@ public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null) { var options = new CreateRatePlanOptions(){ UniqueName = uniqueName, FriendlyName = friendlyName, DataEnabled = dataEnabled, DataLimit = dataLimit, DataMetering = dataMetering, MessagingEnabled = messagingEnabled, VoiceEnabled = voiceEnabled, NationalRoamingEnabled = nationalRoamingEnabled, InternationalRoaming = internationalRoaming, NationalRoamingDataLimit = nationalRoamingDataLimit, InternationalRoamingDataLimit = internationalRoamingDataLimit }; - return await CreateAsync(options, client); + return await CreateAsync(options, client, cancellationToken); } #endif @@ -177,11 +177,12 @@ public static bool Delete(DeleteRatePlanOptions options, ITwilioRestClient clien /// Delete RatePlan parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task DeleteAsync(DeleteRatePlanOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteRatePlanOptions 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 @@ -201,10 +202,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the RatePlan resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - 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 DeleteRatePlanOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -241,10 +242,10 @@ public static RatePlanResource Fetch(FetchRatePlanOptions options, ITwilioRestCl /// Fetch RatePlan parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task FetchAsync(FetchRatePlanOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRatePlanOptions 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 @@ -265,10 +266,10 @@ public static RatePlanResource Fetch( /// The SID of the RatePlan resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - 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 FetchRatePlanOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -303,10 +304,10 @@ public static ResourceSet Read(ReadRatePlanOptions options, IT /// Read RatePlan parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task> ReadAsync(ReadRatePlanOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRatePlanOptions 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("rate_plans", response.Content); return new ResourceSet(page, options, client); @@ -338,7 +339,7 @@ public static async System.Threading.Tasks.Task> R ITwilioRestClient client = null) { var options = new ReadRatePlanOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -425,11 +426,12 @@ public static RatePlanResource Update(UpdateRatePlanOptions options, ITwilioRest /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateRatePlanOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateRatePlanOptions 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 @@ -464,7 +466,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateRatePlanOptions(pathSid){ UniqueName = uniqueName, FriendlyName = friendlyName }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Wireless/V1/Sim/DataSessionResource.cs b/src/Twilio/Rest/Wireless/V1/Sim/DataSessionResource.cs index 613a0319e..ba250e815 100644 --- a/src/Twilio/Rest/Wireless/V1/Sim/DataSessionResource.cs +++ b/src/Twilio/Rest/Wireless/V1/Sim/DataSessionResource.cs @@ -67,10 +67,10 @@ public static ResourceSet Read(ReadDataSessionOptions optio /// Read DataSession parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DataSession - public static async System.Threading.Tasks.Task> ReadAsync(ReadDataSessionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDataSessionOptions 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("data_sessions", response.Content); return new ResourceSet(page, options, client); @@ -106,7 +106,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadDataSessionOptions(pathSimSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordResource.cs b/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordResource.cs index 8d0ca7093..0e7fe6cce 100644 --- a/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordResource.cs +++ b/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordResource.cs @@ -80,10 +80,10 @@ public static ResourceSet Read(ReadUsageRecordOptions optio /// Read UsageRecord parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsageRecord - public static async System.Threading.Tasks.Task> ReadAsync(ReadUsageRecordOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUsageRecordOptions 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("usage_records", response.Content); return new ResourceSet(page, options, client); @@ -131,7 +131,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadUsageRecordOptions(pathSimSid){ End = end, Start = start, Granularity = granularity, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Wireless/V1/SimResource.cs b/src/Twilio/Rest/Wireless/V1/SimResource.cs index 1206a8345..26cc0a850 100644 --- a/src/Twilio/Rest/Wireless/V1/SimResource.cs +++ b/src/Twilio/Rest/Wireless/V1/SimResource.cs @@ -102,11 +102,12 @@ public static bool Delete(DeleteSimOptions options, ITwilioRestClient client = n /// Delete Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSimOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DeleteSimOptions 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 @@ -126,10 +127,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID or the `unique_name` of the Sim resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - 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 DeleteSimOptions(pathSid) ; - return await DeleteAsync(options, client); + return await DeleteAsync(options, client, cancellationToken); } #endif @@ -166,10 +167,10 @@ public static SimResource Fetch(FetchSimOptions options, ITwilioRestClient clien /// Fetch Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task FetchAsync(FetchSimOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchSimOptions 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 @@ -190,10 +191,10 @@ public static SimResource Fetch( /// The SID or the `unique_name` of the Sim resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - 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 FetchSimOptions(pathSid){ }; - return await FetchAsync(options, client); + return await FetchAsync(options, client, cancellationToken); } #endif @@ -228,10 +229,10 @@ public static ResourceSet Read(ReadSimOptions options, ITwilioRestC /// Read Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task> ReadAsync(ReadSimOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSimOptions 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("sims", response.Content); return new ResourceSet(page, options, client); @@ -283,7 +284,7 @@ public static async System.Threading.Tasks.Task> ReadAs ITwilioRestClient client = null) { var options = new ReadSimOptions(){ Status = status, Iccid = iccid, RatePlan = ratePlan, EId = eId, SimRegistrationCode = simRegistrationCode, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif @@ -370,11 +371,12 @@ public static SimResource Update(UpdateSimOptions options, ITwilioRestClient cli /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSimOptions options, - ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task UpdateAsync(UpdateSimOptions 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 @@ -473,7 +475,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null) { var options = new UpdateSimOptions(pathSid){ UniqueName = uniqueName, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, FriendlyName = friendlyName, RatePlan = ratePlan, Status = status, CommandsCallbackMethod = commandsCallbackMethod, CommandsCallbackUrl = commandsCallbackUrl, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl, ResetStatus = resetStatus, AccountSid = accountSid }; - return await UpdateAsync(options, client); + return await UpdateAsync(options, client, cancellationToken); } #endif diff --git a/src/Twilio/Rest/Wireless/V1/UsageRecordResource.cs b/src/Twilio/Rest/Wireless/V1/UsageRecordResource.cs index 6c432adec..4572c3e92 100644 --- a/src/Twilio/Rest/Wireless/V1/UsageRecordResource.cs +++ b/src/Twilio/Rest/Wireless/V1/UsageRecordResource.cs @@ -78,10 +78,10 @@ public static ResourceSet Read(ReadUsageRecordOptions optio /// Read UsageRecord parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsageRecord - public static async System.Threading.Tasks.Task> ReadAsync(ReadUsageRecordOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUsageRecordOptions 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("usage_records", response.Content); return new ResourceSet(page, options, client); @@ -125,7 +125,7 @@ public static async System.Threading.Tasks.Task ITwilioRestClient client = null) { var options = new ReadUsageRecordOptions(){ End = end, Start = start, Granularity = granularity, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); + return await ReadAsync(options, client, cancellationToken); } #endif From 5a3c4800b7bd51af341b87c09c48a2c6f2c21be8 Mon Sep 17 00:00:00 2001 From: Joseph Livecchi Date: Mon, 13 Jan 2025 09:30:06 -0500 Subject: [PATCH 4/8] Added passthrough cancellationTokens --- .../BearerToken/TwilioOrgsTokenRestClient.cs | 2 +- src/Twilio/Clients/ITwilioRestClient.cs | 2 +- src/Twilio/Clients/TwilioRestClient.cs | 2 +- .../BearerToken/SystemNetTokenHttpClient.cs | 4 +-- .../Http/BearerToken/TokenHttpClient.cs | 2 +- src/Twilio/Http/HttpClient.cs | 2 +- src/Twilio/Http/SystemNetHttpClient.cs | 4 +-- .../Accounts/V1/AuthTokenPromotionResource.cs | 4 +-- .../Rest/Accounts/V1/BulkConsentsResource.cs | 5 +-- .../Rest/Accounts/V1/BulkContactsResource.cs | 5 +-- .../Accounts/V1/Credential/AwsResource.cs | 23 ++++++------ .../V1/Credential/PublicKeyResource.cs | 23 ++++++------ .../Rest/Accounts/V1/SafelistResource.cs | 14 ++++---- .../Accounts/V1/SecondaryAuthTokenResource.cs | 8 ++--- .../Address/DependentPhoneNumberResource.cs | 5 +-- .../Rest/Api/V2010/Account/AddressResource.cs | 36 ++++++++++--------- .../Api/V2010/Account/ApplicationResource.cs | 25 +++++++------ .../Account/AuthorizedConnectAppResource.cs | 10 +++--- .../LocalResource.cs | 5 +-- .../MachineToMachineResource.cs | 5 +-- .../MobileResource.cs | 5 +-- .../NationalResource.cs | 5 +-- .../SharedCostResource.cs | 5 +-- .../TollFreeResource.cs | 4 +-- .../VoipResource.cs | 4 +-- .../AvailablePhoneNumberCountryResource.cs | 10 +++--- .../Rest/Api/V2010/Account/BalanceResource.cs | 4 +-- .../Api/V2010/Account/Call/EventResource.cs | 4 +-- .../Account/Call/NotificationResource.cs | 8 ++--- .../Api/V2010/Account/Call/PaymentResource.cs | 8 ++--- .../V2010/Account/Call/RecordingResource.cs | 20 +++++------ .../Api/V2010/Account/Call/SiprecResource.cs | 8 ++--- .../Api/V2010/Account/Call/StreamResource.cs | 8 ++--- .../Account/Call/TranscriptionResource.cs | 8 ++--- .../Call/UserDefinedMessageResource.cs | 4 +-- .../UserDefinedMessageSubscriptionResource.cs | 8 ++--- .../Rest/Api/V2010/Account/CallResource.cs | 20 +++++------ .../Account/Conference/ParticipantResource.cs | 20 +++++------ .../Account/Conference/RecordingResource.cs | 16 ++++----- .../Api/V2010/Account/ConferenceResource.cs | 12 +++---- .../Api/V2010/Account/ConnectAppResource.cs | 16 ++++----- .../AssignedAddOnExtensionResource.cs | 8 ++--- .../AssignedAddOnResource.cs | 16 ++++----- .../IncomingPhoneNumber/LocalResource.cs | 8 ++--- .../IncomingPhoneNumber/MobileResource.cs | 8 ++--- .../IncomingPhoneNumber/TollFreeResource.cs | 8 ++--- .../Account/IncomingPhoneNumberResource.cs | 20 +++++------ .../Rest/Api/V2010/Account/KeyResource.cs | 16 ++++----- .../V2010/Account/Message/FeedbackResource.cs | 4 +-- .../V2010/Account/Message/MediaResource.cs | 12 +++---- .../Rest/Api/V2010/Account/MessageResource.cs | 20 +++++------ .../Rest/Api/V2010/Account/NewKeyResource.cs | 4 +-- .../V2010/Account/NewSigningKeyResource.cs | 4 +-- .../Api/V2010/Account/NotificationResource.cs | 8 ++--- .../V2010/Account/OutgoingCallerIdResource.cs | 16 ++++----- .../Api/V2010/Account/Queue/MemberResource.cs | 12 +++---- .../Rest/Api/V2010/Account/QueueResource.cs | 20 +++++------ .../AddOnResult/Payload/DataResource.cs | 4 +-- .../Recording/AddOnResult/PayloadResource.cs | 12 +++---- .../Account/Recording/AddOnResultResource.cs | 12 +++---- .../Recording/TranscriptionResource.cs | 12 +++---- .../Api/V2010/Account/RecordingResource.cs | 12 +++---- .../Api/V2010/Account/ShortCodeResource.cs | 12 +++---- .../Api/V2010/Account/SigningKeyResource.cs | 16 ++++----- .../Sip/CredentialList/CredentialResource.cs | 20 +++++------ .../Account/Sip/CredentialListResource.cs | 20 +++++------ .../AuthCallsCredentialListMappingResource.cs | 16 ++++----- ...CallsIpAccessControlListMappingResource.cs | 16 ++++----- ...istrationsCredentialListMappingResource.cs | 16 ++++----- .../Domain/CredentialListMappingResource.cs | 16 ++++----- .../IpAccessControlListMappingResource.cs | 16 ++++----- .../Api/V2010/Account/Sip/DomainResource.cs | 20 +++++------ .../IpAccessControlList/IpAddressResource.cs | 20 +++++------ .../Sip/IpAccessControlListResource.cs | 20 +++++------ .../Rest/Api/V2010/Account/TokenResource.cs | 4 +-- .../V2010/Account/TranscriptionResource.cs | 12 +++---- .../Account/Usage/Record/AllTimeResource.cs | 4 +-- .../Account/Usage/Record/DailyResource.cs | 4 +-- .../Account/Usage/Record/LastMonthResource.cs | 4 +-- .../Account/Usage/Record/MonthlyResource.cs | 4 +-- .../Account/Usage/Record/ThisMonthResource.cs | 4 +-- .../Account/Usage/Record/TodayResource.cs | 4 +-- .../Account/Usage/Record/YearlyResource.cs | 4 +-- .../Account/Usage/Record/YesterdayResource.cs | 4 +-- .../Api/V2010/Account/Usage/RecordResource.cs | 4 +-- .../V2010/Account/Usage/TriggerResource.cs | 20 +++++------ .../Account/ValidationRequestResource.cs | 4 +-- src/Twilio/Rest/Api/V2010/AccountResource.cs | 21 ++++++----- .../Assistant/AssistantsKnowledgeResource.cs | 12 +++---- .../V1/Assistant/AssistantsToolResource.cs | 12 +++---- .../V1/Assistant/FeedbackResource.cs | 8 ++--- .../V1/Assistant/MessageResource.cs | 4 +-- .../Rest/Assistants/V1/AssistantResource.cs | 20 +++++------ .../Assistants/V1/Knowledge/ChunkResource.cs | 4 +-- .../V1/Knowledge/KnowledgeStatusResource.cs | 4 +-- .../Rest/Assistants/V1/KnowledgeResource.cs | 20 +++++------ .../Rest/Assistants/V1/PolicyResource.cs | 4 +-- .../Assistants/V1/Session/MessageResource.cs | 4 +-- .../Rest/Assistants/V1/SessionResource.cs | 8 ++--- src/Twilio/Rest/Assistants/V1/ToolResource.cs | 20 +++++------ .../Rest/Bulkexports/V1/Export/DayResource.cs | 8 ++--- .../V1/Export/ExportCustomJobResource.cs | 8 ++--- .../Rest/Bulkexports/V1/Export/JobResource.cs | 8 ++--- .../V1/ExportConfigurationResource.cs | 8 ++--- .../Rest/Bulkexports/V1/ExportResource.cs | 4 +-- src/Twilio/Rest/Chat/V1/CredentialResource.cs | 20 +++++------ .../Chat/V1/Service/Channel/InviteResource.cs | 16 ++++----- .../Chat/V1/Service/Channel/MemberResource.cs | 20 +++++------ .../V1/Service/Channel/MessageResource.cs | 20 +++++------ .../Rest/Chat/V1/Service/ChannelResource.cs | 20 +++++------ .../Rest/Chat/V1/Service/RoleResource.cs | 20 +++++------ .../V1/Service/User/UserChannelResource.cs | 4 +-- .../Rest/Chat/V1/Service/UserResource.cs | 20 +++++------ src/Twilio/Rest/Chat/V1/ServiceResource.cs | 20 +++++------ src/Twilio/Rest/Chat/V2/CredentialResource.cs | 20 +++++------ .../Rest/Chat/V2/Service/BindingResource.cs | 12 +++---- .../Chat/V2/Service/Channel/InviteResource.cs | 16 ++++----- .../Chat/V2/Service/Channel/MemberResource.cs | 20 +++++------ .../V2/Service/Channel/MessageResource.cs | 20 +++++------ .../V2/Service/Channel/WebhookResource.cs | 20 +++++------ .../Rest/Chat/V2/Service/ChannelResource.cs | 20 +++++------ .../Rest/Chat/V2/Service/RoleResource.cs | 20 +++++------ .../V2/Service/User/UserBindingResource.cs | 12 +++---- .../V2/Service/User/UserChannelResource.cs | 16 ++++----- .../Rest/Chat/V2/Service/UserResource.cs | 20 +++++------ src/Twilio/Rest/Chat/V2/ServiceResource.cs | 20 +++++------ src/Twilio/Rest/Chat/V3/ChannelResource.cs | 4 +-- .../V1/Content/ApprovalCreateResource.cs | 4 +-- .../V1/Content/ApprovalFetchResource.cs | 4 +-- .../Content/V1/ContentAndApprovalsResource.cs | 4 +-- src/Twilio/Rest/Content/V1/ContentResource.cs | 16 ++++----- .../Rest/Content/V1/LegacyContentResource.cs | 4 +-- .../Content/V2/ContentAndApprovalsResource.cs | 4 +-- src/Twilio/Rest/Content/V2/ContentResource.cs | 4 +-- .../V1/AddressConfigurationResource.cs | 20 +++++------ .../V1/Configuration/WebhookResource.cs | 8 ++--- .../Conversations/V1/ConfigurationResource.cs | 8 ++--- .../Message/DeliveryReceiptResource.cs | 8 ++--- .../V1/Conversation/MessageResource.cs | 20 +++++------ .../V1/Conversation/ParticipantResource.cs | 20 +++++------ .../V1/Conversation/WebhookResource.cs | 20 +++++------ .../Conversations/V1/ConversationResource.cs | 20 +++++------ .../ConversationWithParticipantsResource.cs | 4 +-- .../Conversations/V1/CredentialResource.cs | 20 +++++------ .../V1/ParticipantConversationResource.cs | 4 +-- .../Rest/Conversations/V1/RoleResource.cs | 20 +++++------ .../V1/Service/BindingResource.cs | 12 +++---- .../Configuration/NotificationResource.cs | 8 ++--- .../Service/Configuration/WebhookResource.cs | 8 ++--- .../V1/Service/ConfigurationResource.cs | 8 ++--- .../Message/DeliveryReceiptResource.cs | 8 ++--- .../Service/Conversation/MessageResource.cs | 20 +++++------ .../Conversation/ParticipantResource.cs | 20 +++++------ .../Service/Conversation/WebhookResource.cs | 20 +++++------ .../V1/Service/ConversationResource.cs | 20 +++++------ .../ConversationWithParticipantsResource.cs | 4 +-- .../ParticipantConversationResource.cs | 4 +-- .../Conversations/V1/Service/RoleResource.cs | 20 +++++------ .../Service/User/UserConversationResource.cs | 16 ++++----- .../Conversations/V1/Service/UserResource.cs | 20 +++++------ .../Rest/Conversations/V1/ServiceResource.cs | 16 ++++----- .../V1/User/UserConversationResource.cs | 16 ++++----- .../Rest/Conversations/V1/UserResource.cs | 20 +++++------ .../Rest/Events/V1/EventTypeResource.cs | 8 ++--- .../Events/V1/Schema/SchemaVersionResource.cs | 8 ++--- src/Twilio/Rest/Events/V1/SchemaResource.cs | 4 +-- .../Rest/Events/V1/Sink/SinkTestResource.cs | 4 +-- .../Events/V1/Sink/SinkValidateResource.cs | 4 +-- src/Twilio/Rest/Events/V1/SinkResource.cs | 20 +++++------ .../Subscription/SubscribedEventResource.cs | 20 +++++------ .../Rest/Events/V1/SubscriptionResource.cs | 20 +++++------ .../Rest/FlexApi/V1/AssessmentsResource.cs | 12 +++---- src/Twilio/Rest/FlexApi/V1/ChannelResource.cs | 16 ++++----- .../Rest/FlexApi/V1/ConfigurationResource.cs | 8 ++--- .../Rest/FlexApi/V1/FlexFlowResource.cs | 20 +++++------ .../V1/InsightsAssessmentsCommentResource.cs | 8 ++--- .../V1/InsightsConversationsResource.cs | 4 +-- .../InsightsQuestionnairesCategoryResource.cs | 16 ++++----- .../InsightsQuestionnairesQuestionResource.cs | 16 ++++----- .../V1/InsightsQuestionnairesResource.cs | 20 +++++------ .../FlexApi/V1/InsightsSegmentsResource.cs | 4 +-- .../FlexApi/V1/InsightsSessionResource.cs | 4 +-- .../V1/InsightsSettingsAnswerSetsResource.cs | 4 +-- .../V1/InsightsSettingsCommentResource.cs | 4 +-- .../FlexApi/V1/InsightsUserRolesResource.cs | 4 +-- .../InteractionChannelInviteResource.cs | 8 ++--- .../InteractionChannelParticipantResource.cs | 12 +++---- .../Interaction/InteractionChannelResource.cs | 12 +++---- .../Rest/FlexApi/V1/InteractionResource.cs | 8 ++--- .../V1/Plugin/PluginVersionsResource.cs | 12 +++---- .../Rest/FlexApi/V1/PluginArchiveResource.cs | 4 +-- .../ConfiguredPluginResource.cs | 8 ++--- .../V1/PluginConfigurationArchiveResource.cs | 4 +-- .../FlexApi/V1/PluginConfigurationResource.cs | 12 +++---- .../Rest/FlexApi/V1/PluginReleaseResource.cs | 12 +++---- src/Twilio/Rest/FlexApi/V1/PluginResource.cs | 16 ++++----- .../V1/PluginVersionArchiveResource.cs | 4 +-- .../FlexApi/V1/ProvisioningStatusResource.cs | 4 +-- .../Rest/FlexApi/V1/WebChannelResource.cs | 20 +++++------ .../Rest/FlexApi/V2/FlexUserResource.cs | 8 ++--- .../Rest/FlexApi/V2/WebChannelsResource.cs | 4 +-- .../Rest/FrontlineApi/V1/UserResource.cs | 8 ++--- src/Twilio/Rest/Iam/V1/ApiKeyResource.cs | 12 +++---- src/Twilio/Rest/Iam/V1/GetApiKeysResource.cs | 4 +-- src/Twilio/Rest/Iam/V1/KeyResource.cs | 4 +-- .../Insights/V1/Call/AnnotationResource.cs | 8 ++--- .../Insights/V1/Call/CallSummaryResource.cs | 4 +-- .../Rest/Insights/V1/Call/EventResource.cs | 4 +-- .../Rest/Insights/V1/Call/MetricResource.cs | 4 +-- src/Twilio/Rest/Insights/V1/CallResource.cs | 4 +-- .../Rest/Insights/V1/CallSummariesResource.cs | 4 +-- .../ConferenceParticipantResource.cs | 8 ++--- .../Rest/Insights/V1/ConferenceResource.cs | 8 ++--- .../Insights/V1/Room/ParticipantResource.cs | 8 ++--- src/Twilio/Rest/Insights/V1/RoomResource.cs | 8 ++--- .../Rest/Insights/V1/SettingResource.cs | 8 ++--- .../Intelligence/V2/CustomOperatorResource.cs | 20 +++++------ .../V2/OperatorAttachmentResource.cs | 8 ++--- .../V2/OperatorAttachmentsResource.cs | 4 +-- .../Rest/Intelligence/V2/OperatorResource.cs | 8 ++--- .../Intelligence/V2/OperatorTypeResource.cs | 8 ++--- .../V2/PrebuiltOperatorResource.cs | 8 ++--- .../Rest/Intelligence/V2/ServiceResource.cs | 20 +++++------ .../V2/Transcript/MediaResource.cs | 4 +-- .../V2/Transcript/OperatorResultResource.cs | 8 ++--- .../V2/Transcript/SentenceResource.cs | 4 +-- .../Intelligence/V2/TranscriptResource.cs | 16 ++++----- .../Rest/IpMessaging/V1/CredentialResource.cs | 20 +++++------ .../V1/Service/Channel/InviteResource.cs | 16 ++++----- .../V1/Service/Channel/MemberResource.cs | 20 +++++------ .../V1/Service/Channel/MessageResource.cs | 20 +++++------ .../IpMessaging/V1/Service/ChannelResource.cs | 20 +++++------ .../IpMessaging/V1/Service/RoleResource.cs | 20 +++++------ .../V1/Service/User/UserChannelResource.cs | 4 +-- .../IpMessaging/V1/Service/UserResource.cs | 20 +++++------ .../Rest/IpMessaging/V1/ServiceResource.cs | 20 +++++------ .../Rest/IpMessaging/V2/CredentialResource.cs | 20 +++++------ .../IpMessaging/V2/Service/BindingResource.cs | 12 +++---- .../V2/Service/Channel/InviteResource.cs | 16 ++++----- .../V2/Service/Channel/MemberResource.cs | 20 +++++------ .../V2/Service/Channel/MessageResource.cs | 20 +++++------ .../V2/Service/Channel/WebhookResource.cs | 20 +++++------ .../IpMessaging/V2/Service/ChannelResource.cs | 20 +++++------ .../IpMessaging/V2/Service/RoleResource.cs | 20 +++++------ .../V2/Service/User/UserBindingResource.cs | 12 +++---- .../V2/Service/User/UserChannelResource.cs | 16 ++++----- .../IpMessaging/V2/Service/UserResource.cs | 20 +++++------ .../Rest/IpMessaging/V2/ServiceResource.cs | 20 +++++------ .../Rest/Lookups/V1/PhoneNumberResource.cs | 4 +-- .../Rest/Lookups/V2/PhoneNumberResource.cs | 4 +-- .../AvailableAddOnExtensionResource.cs | 8 ++--- .../Marketplace/V1/AvailableAddOnResource.cs | 8 ++--- .../InstalledAddOnExtensionResource.cs | 12 +++---- .../InstalledAddOnUsageResource.cs | 4 +-- .../Marketplace/V1/InstalledAddOnResource.cs | 20 +++++------ .../V1/ModuleDataManagementResource.cs | 8 ++--- .../V1/ReferralConversionResource.cs | 4 +-- .../BrandRegistrationOtpResource.cs | 4 +-- .../BrandRegistration/BrandVettingResource.cs | 12 +++---- .../Messaging/V1/BrandRegistrationResource.cs | 16 ++++----- .../Messaging/V1/DeactivationsResource.cs | 4 +-- .../Rest/Messaging/V1/DomainCertsResource.cs | 12 +++---- .../DomainConfigMessagingServiceResource.cs | 4 +-- .../Rest/Messaging/V1/DomainConfigResource.cs | 8 ++--- .../Messaging/V1/ExternalCampaignResource.cs | 4 +-- ...ssagingServiceDomainAssociationResource.cs | 4 +-- .../LinkshorteningMessagingServiceResource.cs | 8 ++--- .../V1/RequestManagedCertResource.cs | 4 +-- .../V1/Service/AlphaSenderResource.cs | 16 ++++----- .../V1/Service/ChannelSenderResource.cs | 16 ++++----- .../V1/Service/PhoneNumberResource.cs | 16 ++++----- .../Messaging/V1/Service/ShortCodeResource.cs | 16 ++++----- .../V1/Service/UsAppToPersonResource.cs | 20 +++++------ .../Service/UsAppToPersonUsecaseResource.cs | 4 +-- .../Rest/Messaging/V1/ServiceResource.cs | 20 +++++------ .../V1/TollfreeVerificationResource.cs | 20 +++++------ .../Rest/Messaging/V1/UsecaseResource.cs | 4 +-- .../Microvisor/V1/AccountConfigResource.cs | 20 +++++------ .../Microvisor/V1/AccountSecretResource.cs | 20 +++++------ .../Microvisor/V1/App/AppManifestResource.cs | 4 +-- src/Twilio/Rest/Microvisor/V1/AppResource.cs | 12 +++---- .../V1/Device/DeviceConfigResource.cs | 20 +++++------ .../V1/Device/DeviceSecretResource.cs | 20 +++++------ .../Rest/Microvisor/V1/DeviceResource.cs | 12 +++---- src/Twilio/Rest/Monitor/V1/AlertResource.cs | 8 ++--- src/Twilio/Rest/Monitor/V1/EventResource.cs | 8 ++--- .../Rest/Notify/V1/CredentialResource.cs | 20 +++++------ .../Rest/Notify/V1/Service/BindingResource.cs | 16 ++++----- .../Notify/V1/Service/NotificationResource.cs | 4 +-- src/Twilio/Rest/Notify/V1/ServiceResource.cs | 20 +++++------ .../Numbers/V1/BulkEligibilityResource.cs | 8 ++--- .../Rest/Numbers/V1/EligibilityResource.cs | 4 +-- .../V1/PortingPortInPhoneNumberResource.cs | 8 ++--- .../Rest/Numbers/V1/PortingPortInResource.cs | 12 +++---- .../Numbers/V1/PortingPortabilityResource.cs | 4 +-- ...rtingWebhookConfigurationDeleteResource.cs | 4 +-- .../V1/PortingWebhookConfigurationResource.cs | 4 +-- .../V1/SigningRequestConfigurationResource.cs | 8 ++--- src/Twilio/Rest/Numbers/V1/WebhookResource.cs | 4 +-- .../DependentHostedNumberOrderResource.cs | 4 +-- .../V2/AuthorizationDocumentResource.cs | 16 ++++----- .../V2/BulkHostedNumberOrderResource.cs | 8 ++--- .../Rest/Numbers/V2/BundleCloneResource.cs | 4 +-- .../Numbers/V2/HostedNumberOrderResource.cs | 20 +++++------ .../Bundle/BundleCopyResource.cs | 8 ++--- .../Bundle/EvaluationResource.cs | 12 +++---- .../Bundle/ItemAssignmentResource.cs | 16 ++++----- .../Bundle/ReplaceItemsResource.cs | 4 +-- .../V2/RegulatoryCompliance/BundleResource.cs | 20 +++++------ .../RegulatoryCompliance/EndUserResource.cs | 20 +++++------ .../EndUserTypeResource.cs | 8 ++--- .../RegulationResource.cs | 8 ++--- .../SupportingDocumentResource.cs | 20 +++++------ .../SupportingDocumentTypeResource.cs | 8 ++--- src/Twilio/Rest/Oauth/V1/AuthorizeResource.cs | 4 +-- src/Twilio/Rest/Oauth/V1/TokenResource.cs | 4 +-- .../DependentHostedNumberOrderResource.cs | 4 +-- .../AuthorizationDocumentResource.cs | 16 ++++----- .../HostedNumberOrderResource.cs | 20 +++++------ .../AvailableAddOnExtensionResource.cs | 8 ++--- .../Marketplace/AvailableAddOnResource.cs | 8 ++--- .../InstalledAddOnExtensionResource.cs | 12 +++---- .../Marketplace/InstalledAddOnResource.cs | 20 +++++------ .../Document/DocumentPermissionResource.cs | 16 ++++----- .../Preview/Sync/Service/DocumentResource.cs | 20 +++++------ .../Service/SyncList/SyncListItemResource.cs | 20 +++++------ .../SyncList/SyncListPermissionResource.cs | 16 ++++----- .../Preview/Sync/Service/SyncListResource.cs | 16 ++++----- .../Service/SyncMap/SyncMapItemResource.cs | 20 +++++------ .../SyncMap/SyncMapPermissionResource.cs | 16 ++++----- .../Preview/Sync/Service/SyncMapResource.cs | 16 ++++----- .../Rest/Preview/Sync/ServiceResource.cs | 20 +++++------ .../Rest/Preview/Wireless/CommandResource.cs | 12 +++---- .../Rest/Preview/Wireless/RatePlanResource.cs | 20 +++++------ .../Preview/Wireless/Sim/UsageResource.cs | 4 +-- .../Rest/Preview/Wireless/SimResource.cs | 12 +++---- .../Organizations/AccountResource.cs | 8 ++--- .../Organizations/RoleAssignmentResource.cs | 12 +++---- .../PreviewIam/Organizations/UserResource.cs | 20 +++++------ .../Rest/PreviewIam/V1/AuthorizeResource.cs | 4 +-- .../Rest/PreviewIam/V1/TokenResource.cs | 4 +-- .../Pricing/V1/Messaging/CountryResource.cs | 8 ++--- .../Pricing/V1/PhoneNumber/CountryResource.cs | 8 ++--- .../Rest/Pricing/V1/Voice/CountryResource.cs | 8 ++--- .../Rest/Pricing/V1/Voice/NumberResource.cs | 4 +-- src/Twilio/Rest/Pricing/V2/CountryResource.cs | 8 ++--- src/Twilio/Rest/Pricing/V2/NumberResource.cs | 4 +-- .../Rest/Pricing/V2/Voice/CountryResource.cs | 8 ++--- .../Rest/Pricing/V2/Voice/NumberResource.cs | 4 +-- .../Proxy/V1/Service/PhoneNumberResource.cs | 20 +++++------ .../V1/Service/Session/InteractionResource.cs | 12 +++---- .../Participant/MessageInteractionResource.cs | 12 +++---- .../V1/Service/Session/ParticipantResource.cs | 16 ++++----- .../Rest/Proxy/V1/Service/SessionResource.cs | 20 +++++------ .../Proxy/V1/Service/ShortCodeResource.cs | 20 +++++------ src/Twilio/Rest/Proxy/V1/ServiceResource.cs | 20 +++++------ .../Rest/Routes/V2/PhoneNumberResource.cs | 8 ++--- .../Rest/Routes/V2/SipDomainResource.cs | 8 ++--- src/Twilio/Rest/Routes/V2/TrunkResource.cs | 8 ++--- .../V1/Service/Asset/AssetVersionResource.cs | 8 ++--- .../Serverless/V1/Service/AssetResource.cs | 20 +++++------ .../V1/Service/Build/BuildStatusResource.cs | 4 +-- .../Serverless/V1/Service/BuildResource.cs | 16 ++++----- .../Service/Environment/DeploymentResource.cs | 12 +++---- .../V1/Service/Environment/LogResource.cs | 8 ++--- .../Service/Environment/VariableResource.cs | 20 +++++------ .../V1/Service/EnvironmentResource.cs | 16 ++++----- .../FunctionVersionContentResource.cs | 4 +-- .../Function/FunctionVersionResource.cs | 8 ++--- .../Serverless/V1/Service/FunctionResource.cs | 20 +++++------ .../Rest/Serverless/V1/ServiceResource.cs | 20 +++++------ .../Engagement/EngagementContextResource.cs | 4 +-- .../Engagement/Step/StepContextResource.cs | 4 +-- .../Studio/V1/Flow/Engagement/StepResource.cs | 8 ++--- .../Rest/Studio/V1/Flow/EngagementResource.cs | 16 ++++----- .../Execution/ExecutionContextResource.cs | 4 +-- .../ExecutionStepContextResource.cs | 4 +-- .../Flow/Execution/ExecutionStepResource.cs | 8 ++--- .../Rest/Studio/V1/Flow/ExecutionResource.cs | 20 +++++------ src/Twilio/Rest/Studio/V1/FlowResource.cs | 12 +++---- .../Execution/ExecutionContextResource.cs | 4 +-- .../ExecutionStepContextResource.cs | 4 +-- .../Flow/Execution/ExecutionStepResource.cs | 8 ++--- .../Rest/Studio/V2/Flow/ExecutionResource.cs | 20 +++++------ .../Studio/V2/Flow/FlowRevisionResource.cs | 8 ++--- .../Studio/V2/Flow/FlowTestUserResource.cs | 8 ++--- src/Twilio/Rest/Studio/V2/FlowResource.cs | 20 +++++------ .../Rest/Studio/V2/FlowValidateResource.cs | 4 +-- .../Rest/Supersim/V1/EsimProfileResource.cs | 12 +++---- src/Twilio/Rest/Supersim/V1/FleetResource.cs | 16 ++++----- .../Rest/Supersim/V1/IpCommandResource.cs | 12 +++---- .../NetworkAccessProfileNetworkResource.cs | 16 ++++----- .../V1/NetworkAccessProfileResource.cs | 16 ++++----- .../Rest/Supersim/V1/NetworkResource.cs | 8 ++--- .../Supersim/V1/SettingsUpdateResource.cs | 4 +-- .../Supersim/V1/Sim/BillingPeriodResource.cs | 4 +-- .../Supersim/V1/Sim/SimIpAddressResource.cs | 4 +-- src/Twilio/Rest/Supersim/V1/SimResource.cs | 16 ++++----- .../Rest/Supersim/V1/SmsCommandResource.cs | 12 +++---- .../Rest/Supersim/V1/UsageRecordResource.cs | 4 +-- .../Document/DocumentPermissionResource.cs | 16 ++++----- .../Rest/Sync/V1/Service/DocumentResource.cs | 20 +++++------ .../Service/SyncList/SyncListItemResource.cs | 20 +++++------ .../SyncList/SyncListPermissionResource.cs | 16 ++++----- .../Rest/Sync/V1/Service/SyncListResource.cs | 20 +++++------ .../V1/Service/SyncMap/SyncMapItemResource.cs | 20 +++++------ .../SyncMap/SyncMapPermissionResource.cs | 16 ++++----- .../Rest/Sync/V1/Service/SyncMapResource.cs | 20 +++++------ .../SyncStream/StreamMessageResource.cs | 4 +-- .../Sync/V1/Service/SyncStreamResource.cs | 20 +++++------ src/Twilio/Rest/Sync/V1/ServiceResource.cs | 20 +++++------ .../V1/Workspace/ActivityResource.cs | 20 +++++------ .../Taskrouter/V1/Workspace/EventResource.cs | 8 ++--- .../V1/Workspace/Task/ReservationResource.cs | 12 +++---- .../V1/Workspace/TaskChannelResource.cs | 20 +++++------ ...TaskQueueBulkRealTimeStatisticsResource.cs | 4 +-- .../TaskQueueCumulativeStatisticsResource.cs | 4 +-- .../TaskQueueRealTimeStatisticsResource.cs | 4 +-- .../TaskQueue/TaskQueueStatisticsResource.cs | 4 +-- .../TaskQueue/TaskQueuesStatisticsResource.cs | 4 +-- .../V1/Workspace/TaskQueueResource.cs | 20 +++++------ .../Taskrouter/V1/Workspace/TaskResource.cs | 20 +++++------ .../Workspace/Worker/ReservationResource.cs | 12 +++---- .../Workspace/Worker/WorkerChannelResource.cs | 12 +++---- .../Worker/WorkerStatisticsResource.cs | 4 +-- .../WorkersCumulativeStatisticsResource.cs | 4 +-- .../WorkersRealTimeStatisticsResource.cs | 4 +-- .../Worker/WorkersStatisticsResource.cs | 4 +-- .../Taskrouter/V1/Workspace/WorkerResource.cs | 20 +++++------ .../WorkflowCumulativeStatisticsResource.cs | 4 +-- .../WorkflowRealTimeStatisticsResource.cs | 4 +-- .../Workflow/WorkflowStatisticsResource.cs | 4 +-- .../V1/Workspace/WorkflowResource.cs | 20 +++++------ .../WorkspaceCumulativeStatisticsResource.cs | 4 +-- .../WorkspaceRealTimeStatisticsResource.cs | 4 +-- .../Workspace/WorkspaceStatisticsResource.cs | 4 +-- .../Rest/Taskrouter/V1/WorkspaceResource.cs | 20 +++++------ .../V1/Trunk/CredentialListResource.cs | 16 ++++----- .../V1/Trunk/IpAccessControlListResource.cs | 16 ++++----- .../V1/Trunk/OriginationUrlResource.cs | 20 +++++------ .../Trunking/V1/Trunk/PhoneNumberResource.cs | 16 ++++----- .../Trunking/V1/Trunk/RecordingResource.cs | 8 ++--- src/Twilio/Rest/Trunking/V1/TrunkResource.cs | 20 +++++------ .../V1/ComplianceInquiriesResource.cs | 8 ++--- ...ComplianceRegistrationInquiriesResource.cs | 8 ++--- .../V1/ComplianceTollfreeInquiriesResource.cs | 4 +-- ...ofilesChannelEndpointAssignmentResource.cs | 16 ++++----- ...stomerProfilesEntityAssignmentsResource.cs | 16 ++++----- .../CustomerProfilesEvaluationsResource.cs | 12 +++---- .../Trusthub/V1/CustomerProfilesResource.cs | 20 +++++------ .../Rest/Trusthub/V1/EndUserResource.cs | 20 +++++------ .../Rest/Trusthub/V1/EndUserTypeResource.cs | 8 ++--- .../Rest/Trusthub/V1/PoliciesResource.cs | 8 ++--- .../Trusthub/V1/SupportingDocumentResource.cs | 20 +++++------ .../V1/SupportingDocumentTypeResource.cs | 8 ++--- ...oductsChannelEndpointAssignmentResource.cs | 16 ++++----- .../TrustProductsEntityAssignmentsResource.cs | 16 ++++----- .../TrustProductsEvaluationsResource.cs | 12 +++---- .../Rest/Trusthub/V1/TrustProductsResource.cs | 20 +++++------ src/Twilio/Rest/Verify/V2/FormResource.cs | 4 +-- src/Twilio/Rest/Verify/V2/SafelistResource.cs | 12 +++---- .../Verify/V2/Service/AccessTokenResource.cs | 8 ++--- .../Entity/Challenge/NotificationResource.cs | 4 +-- .../V2/Service/Entity/ChallengeResource.cs | 16 ++++----- .../V2/Service/Entity/FactorResource.cs | 16 ++++----- .../V2/Service/Entity/NewFactorResource.cs | 4 +-- .../Rest/Verify/V2/Service/EntityResource.cs | 16 ++++----- .../Service/MessagingConfigurationResource.cs | 20 +++++------ .../V2/Service/RateLimit/BucketResource.cs | 20 +++++------ .../Verify/V2/Service/RateLimitResource.cs | 20 +++++------ .../V2/Service/VerificationCheckResource.cs | 4 +-- .../Verify/V2/Service/VerificationResource.cs | 12 +++---- .../Rest/Verify/V2/Service/WebhookResource.cs | 20 +++++------ src/Twilio/Rest/Verify/V2/ServiceResource.cs | 20 +++++------ src/Twilio/Rest/Verify/V2/TemplateResource.cs | 4 +-- .../Verify/V2/VerificationAttemptResource.cs | 8 ++--- .../V2/VerificationAttemptsSummaryResource.cs | 4 +-- .../Rest/Video/V1/CompositionHookResource.cs | 20 +++++------ .../Rest/Video/V1/CompositionResource.cs | 16 ++++----- .../Video/V1/CompositionSettingsResource.cs | 8 ++--- src/Twilio/Rest/Video/V1/RecordingResource.cs | 12 +++---- .../Video/V1/RecordingSettingsResource.cs | 8 ++--- .../V1/Room/Participant/AnonymizeResource.cs | 4 +-- .../Participant/PublishedTrackResource.cs | 8 ++--- .../Participant/SubscribeRulesResource.cs | 8 ++--- .../Participant/SubscribedTrackResource.cs | 8 ++--- .../Rest/Video/V1/Room/ParticipantResource.cs | 12 +++---- .../Video/V1/Room/RecordingRulesResource.cs | 8 ++--- .../Video/V1/Room/RoomRecordingResource.cs | 12 +++---- src/Twilio/Rest/Video/V1/RoomResource.cs | 16 ++++----- .../Rest/Voice/V1/ArchivedCallResource.cs | 4 +-- src/Twilio/Rest/Voice/V1/ByocTrunkResource.cs | 20 +++++------ .../ConnectionPolicyTargetResource.cs | 20 +++++------ .../Rest/Voice/V1/ConnectionPolicyResource.cs | 20 +++++------ .../BulkCountryUpdateResource.cs | 4 +-- .../Country/HighriskSpecialPrefixResource.cs | 4 +-- .../V1/DialingPermissions/CountryResource.cs | 8 ++--- .../V1/DialingPermissions/SettingsResource.cs | 8 ++--- src/Twilio/Rest/Voice/V1/IpRecordResource.cs | 20 +++++------ .../Rest/Voice/V1/SourceIpMappingResource.cs | 20 +++++------ .../Rest/Wireless/V1/CommandResource.cs | 16 ++++----- .../Rest/Wireless/V1/RatePlanResource.cs | 23 ++++++------ .../Wireless/V1/Sim/DataSessionResource.cs | 5 +-- .../Wireless/V1/Sim/UsageRecordResource.cs | 5 +-- src/Twilio/Rest/Wireless/V1/SimResource.cs | 18 +++++----- .../Rest/Wireless/V1/UsageRecordResource.cs | 5 +-- .../Http/SystemNetHttpClientTest.cs | 2 +- 507 files changed, 2946 insertions(+), 2904 deletions(-) diff --git a/src/Twilio/Clients/BearerToken/TwilioOrgsTokenRestClient.cs b/src/Twilio/Clients/BearerToken/TwilioOrgsTokenRestClient.cs index 619db31cb..62d981f64 100644 --- a/src/Twilio/Clients/BearerToken/TwilioOrgsTokenRestClient.cs +++ b/src/Twilio/Clients/BearerToken/TwilioOrgsTokenRestClient.cs @@ -236,7 +236,7 @@ public bool isTokenExpired(string token){ /// /// request to make /// Task that resolves to the response of the request - public async Task RequestAsync(TokenRequest request, CancellationToken cancellationToken = default) + public async Task RequestAsync(TokenRequest request, System.Threading.CancellationToken cancellationToken = default) { request.SetAuth(_accessToken); diff --git a/src/Twilio/Clients/ITwilioRestClient.cs b/src/Twilio/Clients/ITwilioRestClient.cs index 5af06dbef..aaf318cc3 100644 --- a/src/Twilio/Clients/ITwilioRestClient.cs +++ b/src/Twilio/Clients/ITwilioRestClient.cs @@ -37,7 +37,7 @@ public interface ITwilioRestClient /// /// Request to make /// response of the request - System.Threading.Tasks.Task RequestAsync(Request request, CancellationToken cancellationToken = default); + System.Threading.Tasks.Task RequestAsync(Request request, System.Threading.CancellationToken cancellationToken = default); #endif } } diff --git a/src/Twilio/Clients/TwilioRestClient.cs b/src/Twilio/Clients/TwilioRestClient.cs index c31823c98..bcf9d6614 100644 --- a/src/Twilio/Clients/TwilioRestClient.cs +++ b/src/Twilio/Clients/TwilioRestClient.cs @@ -169,7 +169,7 @@ public Response Request(Request request) /// /// request to make /// Task that resolves to the response of the request - public async Task RequestAsync(Request request, CancellationToken cancellationToken = default) + public async Task RequestAsync(Request request, System.Threading.CancellationToken cancellationToken = default) { if(_username != null && _password != null){ request.SetAuth(_username, _password); diff --git a/src/Twilio/Http/BearerToken/SystemNetTokenHttpClient.cs b/src/Twilio/Http/BearerToken/SystemNetTokenHttpClient.cs index 81f1a54e0..05e90e4db 100644 --- a/src/Twilio/Http/BearerToken/SystemNetTokenHttpClient.cs +++ b/src/Twilio/Http/BearerToken/SystemNetTokenHttpClient.cs @@ -60,7 +60,7 @@ public override Response MakeRequest(TokenRequest request) /// /// Twilio response /// Task that resolves to the response - public override async Task MakeRequestAsync(TokenRequest request, CancellationToken cancellationToken = default) + public override async Task MakeRequestAsync(TokenRequest request, System.Threading.CancellationToken cancellationToken = default) { var httpRequest = BuildHttpRequest(request); if (!Equals(request.Method, HttpMethod.Get)) @@ -87,7 +87,7 @@ public override async Task MakeRequestAsync(TokenRequest request, Canc // Create and return a new Response. Keep a reference to the last // response for debugging, but don't return it as it may be shared // among threads. - var response = new Response(httpResponse.StatusCode, await reader.ReadToEndAsync(cancellationToken).ConfigureAwait(false), httpResponse.Headers); + var response = new Response(httpResponse.StatusCode, await reader.ReadToEndAsync().ConfigureAwait(false), httpResponse.Headers); this.LastResponse = response; return response; } diff --git a/src/Twilio/Http/BearerToken/TokenHttpClient.cs b/src/Twilio/Http/BearerToken/TokenHttpClient.cs index 8482b8cc8..ded49ca83 100644 --- a/src/Twilio/Http/BearerToken/TokenHttpClient.cs +++ b/src/Twilio/Http/BearerToken/TokenHttpClient.cs @@ -36,7 +36,7 @@ public abstract class TokenHttpClient /// request to make /// throws exception on network or connection errors. /// response of the request - public abstract System.Threading.Tasks.Task MakeRequestAsync(TokenRequest request, CancellationToken cancellationToken = Default); + public abstract System.Threading.Tasks.Task MakeRequestAsync(TokenRequest request, System.Threading.CancellationToken cancellationToken = default); #endif } diff --git a/src/Twilio/Http/HttpClient.cs b/src/Twilio/Http/HttpClient.cs index 0f811b5dc..aa6089d7e 100644 --- a/src/Twilio/Http/HttpClient.cs +++ b/src/Twilio/Http/HttpClient.cs @@ -34,7 +34,7 @@ public abstract class HttpClient /// request to make /// throws exception on network or connection errors. /// response of the request - public abstract System.Threading.Tasks.Task MakeRequestAsync(Request request, CancellationToken cancellationToken = default); + public abstract System.Threading.Tasks.Task MakeRequestAsync(Request request, System.Threading.CancellationToken cancellationToken = default); #endif /// diff --git a/src/Twilio/Http/SystemNetHttpClient.cs b/src/Twilio/Http/SystemNetHttpClient.cs index eb45beef9..dee407143 100644 --- a/src/Twilio/Http/SystemNetHttpClient.cs +++ b/src/Twilio/Http/SystemNetHttpClient.cs @@ -58,7 +58,7 @@ public override Response MakeRequest(Request request) /// /// Twilio response /// Task that resolves to the response - public override async Task MakeRequestAsync(Request request, CancellationToken cancellationToken = default) + public override async Task MakeRequestAsync(Request request, System.Threading.CancellationToken cancellationToken = default) { var httpRequest = BuildHttpRequest(request); if (!Equals(request.Method, HttpMethod.Get)) @@ -82,7 +82,7 @@ public override async Task MakeRequestAsync(Request request, Cancellat // Create and return a new Response. Keep a reference to the last // response for debugging, but don't return it as it may be shared // among threads. - var response = new Response(httpResponse.StatusCode, await reader.ReadToEndAsync(cancellationToken).ConfigureAwait(false), httpResponse.Headers); + var response = new Response(httpResponse.StatusCode, await reader.ReadToEndAsync().ConfigureAwait(false), httpResponse.Headers); this.LastResponse = response; return response; } diff --git a/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionResource.cs b/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionResource.cs index bf307e3e1..452cd6136 100644 --- a/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionResource.cs +++ b/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionResource.cs @@ -68,7 +68,7 @@ public static AuthTokenPromotionResource Update(UpdateAuthTokenPromotionOptions #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateAuthTokenPromotionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -92,7 +92,7 @@ public static AuthTokenPromotionResource Update( /// Task that resolves to A single instance of AuthTokenPromotion public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateAuthTokenPromotionOptions(){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Accounts/V1/BulkConsentsResource.cs b/src/Twilio/Rest/Accounts/V1/BulkConsentsResource.cs index 3c90dbde6..29d1879d6 100644 --- a/src/Twilio/Rest/Accounts/V1/BulkConsentsResource.cs +++ b/src/Twilio/Rest/Accounts/V1/BulkConsentsResource.cs @@ -66,7 +66,7 @@ public static BulkConsentsResource Create(CreateBulkConsentsOptions options, ITw /// Create BulkConsents parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkConsents - public static async System.Threading.Tasks.Task CreateAsync(CreateBulkConsentsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateBulkConsentsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -93,7 +93,8 @@ public static BulkConsentsResource Create( /// Task that resolves to A single instance of BulkConsents public static async System.Threading.Tasks.Task CreateAsync( List items, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new CreateBulkConsentsOptions(items){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Accounts/V1/BulkContactsResource.cs b/src/Twilio/Rest/Accounts/V1/BulkContactsResource.cs index f549c7617..e88750e0f 100644 --- a/src/Twilio/Rest/Accounts/V1/BulkContactsResource.cs +++ b/src/Twilio/Rest/Accounts/V1/BulkContactsResource.cs @@ -66,7 +66,7 @@ public static BulkContactsResource Create(CreateBulkContactsOptions options, ITw /// Create BulkContacts parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkContacts - public static async System.Threading.Tasks.Task CreateAsync(CreateBulkContactsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateBulkContactsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -93,7 +93,8 @@ public static BulkContactsResource Create( /// Task that resolves to A single instance of BulkContacts public static async System.Threading.Tasks.Task CreateAsync( List items, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new CreateBulkContactsOptions(items){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Accounts/V1/Credential/AwsResource.cs b/src/Twilio/Rest/Accounts/V1/Credential/AwsResource.cs index 33264cad3..e9d51541a 100644 --- a/src/Twilio/Rest/Accounts/V1/Credential/AwsResource.cs +++ b/src/Twilio/Rest/Accounts/V1/Credential/AwsResource.cs @@ -66,7 +66,7 @@ public static AwsResource Create(CreateAwsOptions options, ITwilioRestClient cli /// Create Aws parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Aws - public static async System.Threading.Tasks.Task CreateAsync(CreateAwsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAwsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -101,7 +101,8 @@ public static async System.Threading.Tasks.Task CreateAsync( string credentials, string friendlyName = null, string accountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAwsOptions(credentials){ FriendlyName = friendlyName, AccountSid = accountSid }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +148,7 @@ public static bool Delete(DeleteAwsOptions options, ITwilioRestClient client = n /// Task that resolves to A single instance of Aws public static async System.Threading.Tasks.Task DeleteAsync(DeleteAwsOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -170,7 +171,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the AWS resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Aws - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAwsOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -210,7 +211,7 @@ public static AwsResource Fetch(FetchAwsOptions options, ITwilioRestClient clien /// Fetch Aws parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Aws - public static async System.Threading.Tasks.Task FetchAsync(FetchAwsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAwsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -234,7 +235,7 @@ public static AwsResource Fetch( /// The Twilio-provided string that uniquely identifies the AWS resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Aws - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAwsOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -272,7 +273,7 @@ public static ResourceSet Read(ReadAwsOptions options, ITwilioRestC /// Read Aws parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Aws - public static async System.Threading.Tasks.Task> ReadAsync(ReadAwsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAwsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -304,7 +305,8 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAwsOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -396,7 +398,7 @@ public static AwsResource Update(UpdateAwsOptions options, ITwilioRestClient cli #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateAwsOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -427,7 +429,8 @@ public static AwsResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateAwsOptions(pathSid){ FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyResource.cs b/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyResource.cs index 6ff6c4119..0011284a3 100644 --- a/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyResource.cs +++ b/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyResource.cs @@ -66,7 +66,7 @@ public static PublicKeyResource Create(CreatePublicKeyOptions options, ITwilioRe /// Create PublicKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PublicKey - public static async System.Threading.Tasks.Task CreateAsync(CreatePublicKeyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreatePublicKeyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -101,7 +101,8 @@ public static async System.Threading.Tasks.Task CreateAsync( string publicKey, string friendlyName = null, string accountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new CreatePublicKeyOptions(publicKey){ FriendlyName = friendlyName, AccountSid = accountSid }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +148,7 @@ public static bool Delete(DeletePublicKeyOptions options, ITwilioRestClient clie /// Task that resolves to A single instance of PublicKey public static async System.Threading.Tasks.Task DeleteAsync(DeletePublicKeyOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -170,7 +171,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the PublicKey resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of PublicKey - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeletePublicKeyOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -210,7 +211,7 @@ public static PublicKeyResource Fetch(FetchPublicKeyOptions options, ITwilioRest /// Fetch PublicKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PublicKey - public static async System.Threading.Tasks.Task FetchAsync(FetchPublicKeyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPublicKeyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -234,7 +235,7 @@ public static PublicKeyResource Fetch( /// The Twilio-provided string that uniquely identifies the PublicKey resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of PublicKey - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPublicKeyOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -272,7 +273,7 @@ public static ResourceSet Read(ReadPublicKeyOptions options, /// Read PublicKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PublicKey - public static async System.Threading.Tasks.Task> ReadAsync(ReadPublicKeyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPublicKeyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -304,7 +305,8 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new ReadPublicKeyOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -396,7 +398,7 @@ public static PublicKeyResource Update(UpdatePublicKeyOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdatePublicKeyOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -427,7 +429,8 @@ public static PublicKeyResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new UpdatePublicKeyOptions(pathSid){ FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Accounts/V1/SafelistResource.cs b/src/Twilio/Rest/Accounts/V1/SafelistResource.cs index 89176cb59..ead5fb820 100644 --- a/src/Twilio/Rest/Accounts/V1/SafelistResource.cs +++ b/src/Twilio/Rest/Accounts/V1/SafelistResource.cs @@ -66,7 +66,7 @@ public static SafelistResource Create(CreateSafelistOptions options, ITwilioRest /// Create Safelist parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task CreateAsync(CreateSafelistOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSafelistOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -93,7 +93,8 @@ public static SafelistResource Create( /// Task that resolves to A single instance of Safelist public static async System.Threading.Tasks.Task CreateAsync( string phoneNumber, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSafelistOptions(phoneNumber){ }; return await CreateAsync(options, client, cancellationToken); @@ -137,7 +138,7 @@ public static bool Delete(DeleteSafelistOptions options, ITwilioRestClient clien /// Task that resolves to A single instance of Safelist public static async System.Threading.Tasks.Task DeleteAsync(DeleteSafelistOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -158,7 +159,7 @@ public static bool Delete(ITwilioRestClient client = null) /// Remove a phone number from SafeList. /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task DeleteAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSafelistOptions() ; return await DeleteAsync(options, client, cancellationToken); @@ -196,7 +197,7 @@ public static SafelistResource Fetch(FetchSafelistOptions options, ITwilioRestCl /// Fetch Safelist parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task FetchAsync(FetchSafelistOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSafelistOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -220,7 +221,8 @@ public static SafelistResource Fetch( /// The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task FetchAsync(string phoneNumber = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string phoneNumber = null, ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSafelistOptions(){ PhoneNumber = phoneNumber }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenResource.cs b/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenResource.cs index 92d8d8dbc..45c3bfb9d 100644 --- a/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenResource.cs +++ b/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenResource.cs @@ -66,7 +66,7 @@ public static SecondaryAuthTokenResource Create(CreateSecondaryAuthTokenOptions /// Create SecondaryAuthToken parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SecondaryAuthToken - public static async System.Threading.Tasks.Task CreateAsync(CreateSecondaryAuthTokenOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSecondaryAuthTokenOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -90,7 +90,7 @@ public static SecondaryAuthTokenResource Create( /// Task that resolves to A single instance of SecondaryAuthToken public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSecondaryAuthTokenOptions(){ }; return await CreateAsync(options, client, cancellationToken); @@ -134,7 +134,7 @@ public static bool Delete(DeleteSecondaryAuthTokenOptions options, ITwilioRestCl /// Task that resolves to A single instance of SecondaryAuthToken public static async System.Threading.Tasks.Task DeleteAsync(DeleteSecondaryAuthTokenOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -155,7 +155,7 @@ public static bool Delete(ITwilioRestClient client = null) /// Delete the secondary Auth Token from your account /// Client to make requests to Twilio /// Task that resolves to A single instance of SecondaryAuthToken - public static async System.Threading.Tasks.Task DeleteAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSecondaryAuthTokenOptions() ; return await DeleteAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberResource.cs b/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberResource.cs index f7284edb6..15f46cf7f 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberResource.cs @@ -97,7 +97,7 @@ public static ResourceSet Read(ReadDependentPhoneN /// Read DependentPhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DependentPhoneNumber - public static async System.Threading.Tasks.Task> ReadAsync(ReadDependentPhoneNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDependentPhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -137,7 +137,8 @@ public static async System.Threading.Tasks.Task Create Address parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Address - public static async System.Threading.Tasks.Task CreateAsync(CreateAddressOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAddressOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -102,7 +102,7 @@ public static AddressResource Create( bool? emergencyEnabled = null, bool? autoCorrectAddress = null, string streetSecondary = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAddressOptions(customerName, street, city, region, postalCode, isoCountry){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, EmergencyEnabled = emergencyEnabled, AutoCorrectAddress = autoCorrectAddress, StreetSecondary = streetSecondary }; return Create(options, client); @@ -135,7 +135,8 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? emergencyEnabled = null, bool? autoCorrectAddress = null, string streetSecondary = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAddressOptions(customerName, street, city, region, postalCode, isoCountry){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, EmergencyEnabled = emergencyEnabled, AutoCorrectAddress = autoCorrectAddress, StreetSecondary = streetSecondary }; return await CreateAsync(options, client, cancellationToken); @@ -183,7 +184,7 @@ public static bool Delete(DeleteAddressOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Address public static async System.Threading.Tasks.Task DeleteAsync(DeleteAddressOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -196,7 +197,7 @@ public static async System.Threading.Tasks.Task DeleteAsync(DeleteAddressO /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is responsible for the Address resource to delete. /// Client to make requests to Twilio /// A single instance of Address - public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAddressOptions(pathSid) { PathAccountSid = pathAccountSid } ; return Delete(options, client); @@ -208,7 +209,8 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is responsible for the Address resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Address - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAddressOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -250,7 +252,7 @@ public static AddressResource Fetch(FetchAddressOptions options, ITwilioRestClie /// Fetch Address parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Address - public static async System.Threading.Tasks.Task FetchAsync(FetchAddressOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAddressOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -265,7 +267,7 @@ public static async System.Threading.Tasks.Task FetchAsync(Fetc public static AddressResource Fetch( string pathSid, string pathAccountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAddressOptions(pathSid){ PathAccountSid = pathAccountSid }; return Fetch(options, client); @@ -277,7 +279,8 @@ public static AddressResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is responsible for the Address resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Address - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAddressOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -317,7 +320,7 @@ public static ResourceSet Read(ReadAddressOptions options, ITwi /// Read Address parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Address - public static async System.Threading.Tasks.Task> ReadAsync(ReadAddressOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAddressOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -342,7 +345,7 @@ public static ResourceSet Read( string isoCountry = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAddressOptions(){ PathAccountSid = pathAccountSid, CustomerName = customerName, FriendlyName = friendlyName, IsoCountry = isoCountry, PageSize = pageSize, Limit = limit}; return Read(options, client); @@ -365,7 +368,8 @@ public static async System.Threading.Tasks.Task> Re string isoCountry = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAddressOptions(){ PathAccountSid = pathAccountSid, CustomerName = customerName, FriendlyName = friendlyName, IsoCountry = isoCountry, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -377,7 +381,7 @@ public static async System.Threading.Tasks.Task> Re /// API-generated URL for the requested results page /// Client to make requests to Twilio /// The target page of records - public static Page GetPage(string targetUrl, ITwilioRestClient client) + public static Page GetPage(string targetUrl, ITwilioRestClient client, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); @@ -459,7 +463,7 @@ public static AddressResource Update(UpdateAddressOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateAddressOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -493,7 +497,7 @@ public static AddressResource Update( bool? emergencyEnabled = null, bool? autoCorrectAddress = null, string streetSecondary = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateAddressOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, CustomerName = customerName, Street = street, City = city, Region = region, PostalCode = postalCode, EmergencyEnabled = emergencyEnabled, AutoCorrectAddress = autoCorrectAddress, StreetSecondary = streetSecondary }; return Update(options, client); @@ -526,7 +530,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? emergencyEnabled = null, bool? autoCorrectAddress = null, string streetSecondary = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateAddressOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, CustomerName = customerName, Street = street, City = city, Region = region, PostalCode = postalCode, EmergencyEnabled = emergencyEnabled, AutoCorrectAddress = autoCorrectAddress, StreetSecondary = streetSecondary }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/ApplicationResource.cs b/src/Twilio/Rest/Api/V2010/Account/ApplicationResource.cs index 9af66b7b7..55c464a09 100644 --- a/src/Twilio/Rest/Api/V2010/Account/ApplicationResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/ApplicationResource.cs @@ -68,7 +68,7 @@ public static ApplicationResource Create(CreateApplicationOptions options, ITwil /// Create Application parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Application - public static async System.Threading.Tasks.Task CreateAsync(CreateApplicationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateApplicationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -159,7 +159,8 @@ public static async System.Threading.Tasks.Task CreateAsync Uri messageStatusCallback = null, string friendlyName = null, bool? publicApplicationConnectEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new CreateApplicationOptions(){ PathAccountSid = pathAccountSid, ApiVersion = apiVersion, VoiceUrl = voiceUrl, VoiceMethod = voiceMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceFallbackMethod = voiceFallbackMethod, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceCallerIdLookup = voiceCallerIdLookup, SmsUrl = smsUrl, SmsMethod = smsMethod, SmsFallbackUrl = smsFallbackUrl, SmsFallbackMethod = smsFallbackMethod, SmsStatusCallback = smsStatusCallback, MessageStatusCallback = messageStatusCallback, FriendlyName = friendlyName, PublicApplicationConnectEnabled = publicApplicationConnectEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -207,7 +208,7 @@ public static bool Delete(DeleteApplicationOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of Application public static async System.Threading.Tasks.Task DeleteAsync(DeleteApplicationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -232,7 +233,8 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Application resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Application - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteApplicationOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -274,7 +276,7 @@ public static ApplicationResource Fetch(FetchApplicationOptions options, ITwilio /// Fetch Application parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Application - public static async System.Threading.Tasks.Task FetchAsync(FetchApplicationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchApplicationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -301,7 +303,8 @@ public static ApplicationResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Application resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Application - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new FetchApplicationOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -341,7 +344,7 @@ public static ResourceSet Read(ReadApplicationOptions optio /// Read Application parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Application - public static async System.Threading.Tasks.Task> ReadAsync(ReadApplicationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadApplicationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -381,7 +384,8 @@ public static async System.Threading.Tasks.Task string friendlyName = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new ReadApplicationOptions(){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -475,7 +479,7 @@ public static ApplicationResource Update(UpdateApplicationOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateApplicationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -570,7 +574,8 @@ public static async System.Threading.Tasks.Task UpdateAsync Uri smsStatusCallback = null, Uri messageStatusCallback = null, bool? publicApplicationConnectEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateApplicationOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, ApiVersion = apiVersion, VoiceUrl = voiceUrl, VoiceMethod = voiceMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceFallbackMethod = voiceFallbackMethod, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceCallerIdLookup = voiceCallerIdLookup, SmsUrl = smsUrl, SmsMethod = smsMethod, SmsFallbackUrl = smsFallbackUrl, SmsFallbackMethod = smsFallbackMethod, SmsStatusCallback = smsStatusCallback, MessageStatusCallback = messageStatusCallback, PublicApplicationConnectEnabled = publicApplicationConnectEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppResource.cs b/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppResource.cs index de1202dde..6bfe27bd1 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppResource.cs @@ -82,7 +82,7 @@ public static AuthorizedConnectAppResource Fetch(FetchAuthorizedConnectAppOption /// Fetch AuthorizedConnectApp parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizedConnectApp - public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizedConnectAppOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizedConnectAppOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -109,7 +109,8 @@ public static AuthorizedConnectAppResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AuthorizedConnectApp resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizedConnectApp - public static async System.Threading.Tasks.Task FetchAsync(string pathConnectAppSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathConnectAppSid, string pathAccountSid = null, ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAuthorizedConnectAppOptions(pathConnectAppSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -149,7 +150,7 @@ public static ResourceSet Read(ReadAuthorizedConne /// Read AuthorizedConnectApp parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizedConnectApp - public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthorizedConnectAppOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthorizedConnectAppOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -185,7 +186,8 @@ public static async System.Threading.Tasks.Task Read(ReadLocalOptions options, ITwilioR /// Read Local parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Local - public static async System.Threading.Tasks.Task> ReadAsync(ReadLocalOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadLocalOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -181,7 +181,8 @@ public static async System.Threading.Tasks.Task> Read bool? faxEnabled = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new ReadLocalOptions(pathCountryCode){ PathAccountSid = pathAccountSid, AreaCode = areaCode, Contains = contains, SmsEnabled = smsEnabled, MmsEnabled = mmsEnabled, VoiceEnabled = voiceEnabled, ExcludeAllAddressRequired = excludeAllAddressRequired, ExcludeLocalAddressRequired = excludeLocalAddressRequired, ExcludeForeignAddressRequired = excludeForeignAddressRequired, Beta = beta, NearNumber = nearNumber, NearLatLong = nearLatLong, Distance = distance, InPostalCode = inPostalCode, InRegion = inRegion, InRateCenter = inRateCenter, InLata = inLata, InLocality = inLocality, FaxEnabled = faxEnabled, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineResource.cs b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineResource.cs index 069a86a85..d5dd670d8 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineResource.cs @@ -69,7 +69,7 @@ public static ResourceSet Read(ReadMachineToMachineOpt /// Read MachineToMachine parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MachineToMachine - public static async System.Threading.Tasks.Task> ReadAsync(ReadMachineToMachineOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMachineToMachineOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -181,7 +181,8 @@ public static async System.Threading.Tasks.Task Read(ReadMobileOptions options, ITwili /// Read Mobile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Mobile - public static async System.Threading.Tasks.Task> ReadAsync(ReadMobileOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMobileOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -181,7 +181,8 @@ public static async System.Threading.Tasks.Task> Rea bool? faxEnabled = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMobileOptions(pathCountryCode){ PathAccountSid = pathAccountSid, AreaCode = areaCode, Contains = contains, SmsEnabled = smsEnabled, MmsEnabled = mmsEnabled, VoiceEnabled = voiceEnabled, ExcludeAllAddressRequired = excludeAllAddressRequired, ExcludeLocalAddressRequired = excludeLocalAddressRequired, ExcludeForeignAddressRequired = excludeForeignAddressRequired, Beta = beta, NearNumber = nearNumber, NearLatLong = nearLatLong, Distance = distance, InPostalCode = inPostalCode, InRegion = inRegion, InRateCenter = inRateCenter, InLata = inLata, InLocality = inLocality, FaxEnabled = faxEnabled, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalResource.cs b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalResource.cs index bd4ee4013..643976465 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalResource.cs @@ -69,7 +69,7 @@ public static ResourceSet Read(ReadNationalOptions options, IT /// Read National parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of National - public static async System.Threading.Tasks.Task> ReadAsync(ReadNationalOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadNationalOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -181,7 +181,8 @@ public static async System.Threading.Tasks.Task> R bool? faxEnabled = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new ReadNationalOptions(pathCountryCode){ PathAccountSid = pathAccountSid, AreaCode = areaCode, Contains = contains, SmsEnabled = smsEnabled, MmsEnabled = mmsEnabled, VoiceEnabled = voiceEnabled, ExcludeAllAddressRequired = excludeAllAddressRequired, ExcludeLocalAddressRequired = excludeLocalAddressRequired, ExcludeForeignAddressRequired = excludeForeignAddressRequired, Beta = beta, NearNumber = nearNumber, NearLatLong = nearLatLong, Distance = distance, InPostalCode = inPostalCode, InRegion = inRegion, InRateCenter = inRateCenter, InLata = inLata, InLocality = inLocality, FaxEnabled = faxEnabled, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostResource.cs b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostResource.cs index eb8269dbd..9c98ba0e3 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostResource.cs @@ -69,7 +69,7 @@ public static ResourceSet Read(ReadSharedCostOptions options /// Read SharedCost parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SharedCost - public static async System.Threading.Tasks.Task> ReadAsync(ReadSharedCostOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSharedCostOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -181,7 +181,8 @@ public static async System.Threading.Tasks.Task> bool? faxEnabled = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSharedCostOptions(pathCountryCode){ PathAccountSid = pathAccountSid, AreaCode = areaCode, Contains = contains, SmsEnabled = smsEnabled, MmsEnabled = mmsEnabled, VoiceEnabled = voiceEnabled, ExcludeAllAddressRequired = excludeAllAddressRequired, ExcludeLocalAddressRequired = excludeLocalAddressRequired, ExcludeForeignAddressRequired = excludeForeignAddressRequired, Beta = beta, NearNumber = nearNumber, NearLatLong = nearLatLong, Distance = distance, InPostalCode = inPostalCode, InRegion = inRegion, InRateCenter = inRateCenter, InLata = inLata, InLocality = inLocality, FaxEnabled = faxEnabled, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeResource.cs b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeResource.cs index 5a04f650d..3885c9f38 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeResource.cs @@ -69,7 +69,7 @@ public static ResourceSet Read(ReadTollFreeOptions options, IT /// Read TollFree parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TollFree - public static async System.Threading.Tasks.Task> ReadAsync(ReadTollFreeOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTollFreeOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -181,7 +181,7 @@ public static async System.Threading.Tasks.Task> R bool? faxEnabled = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadTollFreeOptions(pathCountryCode){ PathAccountSid = pathAccountSid, AreaCode = areaCode, Contains = contains, SmsEnabled = smsEnabled, MmsEnabled = mmsEnabled, VoiceEnabled = voiceEnabled, ExcludeAllAddressRequired = excludeAllAddressRequired, ExcludeLocalAddressRequired = excludeLocalAddressRequired, ExcludeForeignAddressRequired = excludeForeignAddressRequired, Beta = beta, NearNumber = nearNumber, NearLatLong = nearLatLong, Distance = distance, InPostalCode = inPostalCode, InRegion = inRegion, InRateCenter = inRateCenter, InLata = inLata, InLocality = inLocality, FaxEnabled = faxEnabled, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipResource.cs b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipResource.cs index 9ac50a802..86154f8bc 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipResource.cs @@ -69,7 +69,7 @@ public static ResourceSet Read(ReadVoipOptions options, ITwilioRes /// Read Voip parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Voip - public static async System.Threading.Tasks.Task> ReadAsync(ReadVoipOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadVoipOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -181,7 +181,7 @@ public static async System.Threading.Tasks.Task> ReadA bool? faxEnabled = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadVoipOptions(pathCountryCode){ PathAccountSid = pathAccountSid, AreaCode = areaCode, Contains = contains, SmsEnabled = smsEnabled, MmsEnabled = mmsEnabled, VoiceEnabled = voiceEnabled, ExcludeAllAddressRequired = excludeAllAddressRequired, ExcludeLocalAddressRequired = excludeLocalAddressRequired, ExcludeForeignAddressRequired = excludeForeignAddressRequired, Beta = beta, NearNumber = nearNumber, NearLatLong = nearLatLong, Distance = distance, InPostalCode = inPostalCode, InRegion = inRegion, InRateCenter = inRateCenter, InLata = inLata, InLocality = inLocality, FaxEnabled = faxEnabled, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryResource.cs b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryResource.cs index cc6e11fb3..ff7757017 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryResource.cs @@ -69,7 +69,7 @@ public static AvailablePhoneNumberCountryResource Fetch(FetchAvailablePhoneNumbe /// Fetch AvailablePhoneNumberCountry parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailablePhoneNumberCountry - public static async System.Threading.Tasks.Task FetchAsync(FetchAvailablePhoneNumberCountryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAvailablePhoneNumberCountryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,8 @@ public static AvailablePhoneNumberCountryResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the available phone number Country resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailablePhoneNumberCountry - public static async System.Threading.Tasks.Task FetchAsync(string pathCountryCode, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathCountryCode, string pathAccountSid = null, ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAvailablePhoneNumberCountryOptions(pathCountryCode){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -136,7 +137,7 @@ public static ResourceSet Read(ReadAvailabl /// Read AvailablePhoneNumberCountry parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailablePhoneNumberCountry - public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailablePhoneNumberCountryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailablePhoneNumberCountryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -172,7 +173,8 @@ public static async System.Threading.Tasks.Task Fetch Balance parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Balance - public static async System.Threading.Tasks.Task FetchAsync(FetchBalanceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchBalanceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static BalanceResource Fetch( /// The unique SID identifier of the Account. /// Client to make requests to Twilio /// Task that resolves to A single instance of Balance - public static async System.Threading.Tasks.Task FetchAsync(string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchBalanceOptions(){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/EventResource.cs b/src/Twilio/Rest/Api/V2010/Account/Call/EventResource.cs index f50c2e4fb..6945d4e32 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Call/EventResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Call/EventResource.cs @@ -69,7 +69,7 @@ public static ResourceSet Read(ReadEventOptions options, ITwilioR /// Read Event parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Event - public static async System.Threading.Tasks.Task> ReadAsync(ReadEventOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEventOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task> Read string pathAccountSid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadEventOptions(pathCallSid){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/NotificationResource.cs b/src/Twilio/Rest/Api/V2010/Account/Call/NotificationResource.cs index c559883ac..706eb827d 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Call/NotificationResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Call/NotificationResource.cs @@ -71,7 +71,7 @@ public static NotificationResource Fetch(FetchNotificationOptions options, ITwil /// Fetch Notification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task FetchAsync(FetchNotificationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchNotificationOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -101,7 +101,7 @@ public static NotificationResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call Notification resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task FetchAsync(string pathCallSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathCallSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchNotificationOptions(pathCallSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client); @@ -143,7 +143,7 @@ public static ResourceSet Read(ReadNotificationOptions opt /// Read Notification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task> ReadAsync(ReadNotificationOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadNotificationOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -199,7 +199,7 @@ public static async System.Threading.Tasks.Task Create Payment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Payment - public static async System.Threading.Tasks.Task CreateAsync(CreatePaymentOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreatePaymentOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); @@ -231,7 +231,7 @@ public static async System.Threading.Tasks.Task CreateAsync( int? timeout = null, PaymentResource.TokenTypeEnum tokenType = null, string validCardTypes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreatePaymentOptions(pathCallSid, idempotencyKey, statusCallback){ PathAccountSid = pathAccountSid, BankAccountType = bankAccountType, ChargeAmount = chargeAmount, Currency = currency, Description = description, Input = input, MinPostalCodeLength = minPostalCodeLength, Parameter = parameter, PaymentConnector = paymentConnector, PaymentMethod = paymentMethod, PostalCode = postalCode, SecurityCode = securityCode, Timeout = timeout, TokenType = tokenType, ValidCardTypes = validCardTypes }; return await CreateAsync(options, client); @@ -277,7 +277,7 @@ public static PaymentResource Update(UpdatePaymentOptions options, ITwilioRestCl /// Task that resolves to A single instance of Payment #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdatePaymentOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -328,7 +328,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathAccountSid = null, PaymentResource.CaptureEnum capture = null, PaymentResource.StatusEnum status = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdatePaymentOptions(pathCallSid, pathSid, idempotencyKey, statusCallback){ PathAccountSid = pathAccountSid, Capture = capture, Status = status }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/RecordingResource.cs b/src/Twilio/Rest/Api/V2010/Account/Call/RecordingResource.cs index 3d7eec2e7..6272a97b9 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Call/RecordingResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Call/RecordingResource.cs @@ -105,7 +105,7 @@ public static RecordingResource Create(CreateRecordingOptions options, ITwilioRe /// Create Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task CreateAsync(CreateRecordingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateRecordingOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); @@ -160,7 +160,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string trim = null, string recordingChannels = null, string recordingTrack = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateRecordingOptions(pathCallSid){ PathAccountSid = pathAccountSid, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, Trim = trim, RecordingChannels = recordingChannels, RecordingTrack = recordingTrack }; return await CreateAsync(options, client); @@ -209,7 +209,7 @@ public static bool Delete(DeleteRecordingOptions options, ITwilioRestClient clie /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording public static async System.Threading.Tasks.Task DeleteAsync(DeleteRecordingOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); @@ -236,7 +236,7 @@ public static bool Delete(string pathCallSid, string pathSid, string pathAccount /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task DeleteAsync(string pathCallSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathCallSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRecordingOptions(pathCallSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client); @@ -280,7 +280,7 @@ public static RecordingResource Fetch(FetchRecordingOptions options, ITwilioRest /// Fetch Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -310,7 +310,7 @@ public static RecordingResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(string pathCallSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathCallSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRecordingOptions(pathCallSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client); @@ -352,7 +352,7 @@ public static ResourceSet Read(ReadRecordingOptions options, /// Read Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordingOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -404,7 +404,7 @@ public static async System.Threading.Tasks.Task> DateTime? dateCreatedAfter = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRecordingOptions(pathCallSid){ PathAccountSid = pathAccountSid, DateCreatedBefore = dateCreatedBefore, DateCreated = dateCreated, DateCreatedAfter = dateCreatedAfter, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); @@ -499,7 +499,7 @@ public static RecordingResource Update(UpdateRecordingOptions options, ITwilioRe /// Task that resolves to A single instance of Recording #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRecordingOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -542,7 +542,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( RecordingResource.StatusEnum status, string pathAccountSid = null, string pauseBehavior = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRecordingOptions(pathCallSid, pathSid, status){ PathAccountSid = pathAccountSid, PauseBehavior = pauseBehavior }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/SiprecResource.cs b/src/Twilio/Rest/Api/V2010/Account/Call/SiprecResource.cs index 30d52fb04..b3d19148a 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Call/SiprecResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Call/SiprecResource.cs @@ -107,7 +107,7 @@ public static SiprecResource Create(CreateSiprecOptions options, ITwilioRestClie /// Create Siprec parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Siprec - public static async System.Threading.Tasks.Task CreateAsync(CreateSiprecOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateSiprecOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); @@ -950,7 +950,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string parameter98Value = null, string parameter99Name = null, string parameter99Value = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSiprecOptions(pathCallSid){ PathAccountSid = pathAccountSid, Name = name, ConnectorName = connectorName, Track = track, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, Parameter1Name = parameter1Name, Parameter1Value = parameter1Value, Parameter2Name = parameter2Name, Parameter2Value = parameter2Value, Parameter3Name = parameter3Name, Parameter3Value = parameter3Value, Parameter4Name = parameter4Name, Parameter4Value = parameter4Value, Parameter5Name = parameter5Name, Parameter5Value = parameter5Value, Parameter6Name = parameter6Name, Parameter6Value = parameter6Value, Parameter7Name = parameter7Name, Parameter7Value = parameter7Value, Parameter8Name = parameter8Name, Parameter8Value = parameter8Value, Parameter9Name = parameter9Name, Parameter9Value = parameter9Value, Parameter10Name = parameter10Name, Parameter10Value = parameter10Value, Parameter11Name = parameter11Name, Parameter11Value = parameter11Value, Parameter12Name = parameter12Name, Parameter12Value = parameter12Value, Parameter13Name = parameter13Name, Parameter13Value = parameter13Value, Parameter14Name = parameter14Name, Parameter14Value = parameter14Value, Parameter15Name = parameter15Name, Parameter15Value = parameter15Value, Parameter16Name = parameter16Name, Parameter16Value = parameter16Value, Parameter17Name = parameter17Name, Parameter17Value = parameter17Value, Parameter18Name = parameter18Name, Parameter18Value = parameter18Value, Parameter19Name = parameter19Name, Parameter19Value = parameter19Value, Parameter20Name = parameter20Name, Parameter20Value = parameter20Value, Parameter21Name = parameter21Name, Parameter21Value = parameter21Value, Parameter22Name = parameter22Name, Parameter22Value = parameter22Value, Parameter23Name = parameter23Name, Parameter23Value = parameter23Value, Parameter24Name = parameter24Name, Parameter24Value = parameter24Value, Parameter25Name = parameter25Name, Parameter25Value = parameter25Value, Parameter26Name = parameter26Name, Parameter26Value = parameter26Value, Parameter27Name = parameter27Name, Parameter27Value = parameter27Value, Parameter28Name = parameter28Name, Parameter28Value = parameter28Value, Parameter29Name = parameter29Name, Parameter29Value = parameter29Value, Parameter30Name = parameter30Name, Parameter30Value = parameter30Value, Parameter31Name = parameter31Name, Parameter31Value = parameter31Value, Parameter32Name = parameter32Name, Parameter32Value = parameter32Value, Parameter33Name = parameter33Name, Parameter33Value = parameter33Value, Parameter34Name = parameter34Name, Parameter34Value = parameter34Value, Parameter35Name = parameter35Name, Parameter35Value = parameter35Value, Parameter36Name = parameter36Name, Parameter36Value = parameter36Value, Parameter37Name = parameter37Name, Parameter37Value = parameter37Value, Parameter38Name = parameter38Name, Parameter38Value = parameter38Value, Parameter39Name = parameter39Name, Parameter39Value = parameter39Value, Parameter40Name = parameter40Name, Parameter40Value = parameter40Value, Parameter41Name = parameter41Name, Parameter41Value = parameter41Value, Parameter42Name = parameter42Name, Parameter42Value = parameter42Value, Parameter43Name = parameter43Name, Parameter43Value = parameter43Value, Parameter44Name = parameter44Name, Parameter44Value = parameter44Value, Parameter45Name = parameter45Name, Parameter45Value = parameter45Value, Parameter46Name = parameter46Name, Parameter46Value = parameter46Value, Parameter47Name = parameter47Name, Parameter47Value = parameter47Value, Parameter48Name = parameter48Name, Parameter48Value = parameter48Value, Parameter49Name = parameter49Name, Parameter49Value = parameter49Value, Parameter50Name = parameter50Name, Parameter50Value = parameter50Value, Parameter51Name = parameter51Name, Parameter51Value = parameter51Value, Parameter52Name = parameter52Name, Parameter52Value = parameter52Value, Parameter53Name = parameter53Name, Parameter53Value = parameter53Value, Parameter54Name = parameter54Name, Parameter54Value = parameter54Value, Parameter55Name = parameter55Name, Parameter55Value = parameter55Value, Parameter56Name = parameter56Name, Parameter56Value = parameter56Value, Parameter57Name = parameter57Name, Parameter57Value = parameter57Value, Parameter58Name = parameter58Name, Parameter58Value = parameter58Value, Parameter59Name = parameter59Name, Parameter59Value = parameter59Value, Parameter60Name = parameter60Name, Parameter60Value = parameter60Value, Parameter61Name = parameter61Name, Parameter61Value = parameter61Value, Parameter62Name = parameter62Name, Parameter62Value = parameter62Value, Parameter63Name = parameter63Name, Parameter63Value = parameter63Value, Parameter64Name = parameter64Name, Parameter64Value = parameter64Value, Parameter65Name = parameter65Name, Parameter65Value = parameter65Value, Parameter66Name = parameter66Name, Parameter66Value = parameter66Value, Parameter67Name = parameter67Name, Parameter67Value = parameter67Value, Parameter68Name = parameter68Name, Parameter68Value = parameter68Value, Parameter69Name = parameter69Name, Parameter69Value = parameter69Value, Parameter70Name = parameter70Name, Parameter70Value = parameter70Value, Parameter71Name = parameter71Name, Parameter71Value = parameter71Value, Parameter72Name = parameter72Name, Parameter72Value = parameter72Value, Parameter73Name = parameter73Name, Parameter73Value = parameter73Value, Parameter74Name = parameter74Name, Parameter74Value = parameter74Value, Parameter75Name = parameter75Name, Parameter75Value = parameter75Value, Parameter76Name = parameter76Name, Parameter76Value = parameter76Value, Parameter77Name = parameter77Name, Parameter77Value = parameter77Value, Parameter78Name = parameter78Name, Parameter78Value = parameter78Value, Parameter79Name = parameter79Name, Parameter79Value = parameter79Value, Parameter80Name = parameter80Name, Parameter80Value = parameter80Value, Parameter81Name = parameter81Name, Parameter81Value = parameter81Value, Parameter82Name = parameter82Name, Parameter82Value = parameter82Value, Parameter83Name = parameter83Name, Parameter83Value = parameter83Value, Parameter84Name = parameter84Name, Parameter84Value = parameter84Value, Parameter85Name = parameter85Name, Parameter85Value = parameter85Value, Parameter86Name = parameter86Name, Parameter86Value = parameter86Value, Parameter87Name = parameter87Name, Parameter87Value = parameter87Value, Parameter88Name = parameter88Name, Parameter88Value = parameter88Value, Parameter89Name = parameter89Name, Parameter89Value = parameter89Value, Parameter90Name = parameter90Name, Parameter90Value = parameter90Value, Parameter91Name = parameter91Name, Parameter91Value = parameter91Value, Parameter92Name = parameter92Name, Parameter92Value = parameter92Value, Parameter93Name = parameter93Name, Parameter93Value = parameter93Value, Parameter94Name = parameter94Name, Parameter94Value = parameter94Value, Parameter95Name = parameter95Name, Parameter95Value = parameter95Value, Parameter96Name = parameter96Name, Parameter96Value = parameter96Value, Parameter97Name = parameter97Name, Parameter97Value = parameter97Value, Parameter98Name = parameter98Name, Parameter98Value = parameter98Value, Parameter99Name = parameter99Name, Parameter99Value = parameter99Value }; return await CreateAsync(options, client); @@ -996,7 +996,7 @@ public static SiprecResource Update(UpdateSiprecOptions options, ITwilioRestClie /// Task that resolves to A single instance of Siprec #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSiprecOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -1035,7 +1035,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, SiprecResource.UpdateStatusEnum status, string pathAccountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSiprecOptions(pathCallSid, pathSid, status){ PathAccountSid = pathAccountSid }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/StreamResource.cs b/src/Twilio/Rest/Api/V2010/Account/Call/StreamResource.cs index f68c8f616..bce5bbcce 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Call/StreamResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Call/StreamResource.cs @@ -107,7 +107,7 @@ public static StreamResource Create(CreateStreamOptions options, ITwilioRestClie /// Create Stream parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Stream - public static async System.Threading.Tasks.Task CreateAsync(CreateStreamOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateStreamOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); @@ -950,7 +950,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string parameter98Value = null, string parameter99Name = null, string parameter99Value = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateStreamOptions(pathCallSid, url){ PathAccountSid = pathAccountSid, Name = name, Track = track, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, Parameter1Name = parameter1Name, Parameter1Value = parameter1Value, Parameter2Name = parameter2Name, Parameter2Value = parameter2Value, Parameter3Name = parameter3Name, Parameter3Value = parameter3Value, Parameter4Name = parameter4Name, Parameter4Value = parameter4Value, Parameter5Name = parameter5Name, Parameter5Value = parameter5Value, Parameter6Name = parameter6Name, Parameter6Value = parameter6Value, Parameter7Name = parameter7Name, Parameter7Value = parameter7Value, Parameter8Name = parameter8Name, Parameter8Value = parameter8Value, Parameter9Name = parameter9Name, Parameter9Value = parameter9Value, Parameter10Name = parameter10Name, Parameter10Value = parameter10Value, Parameter11Name = parameter11Name, Parameter11Value = parameter11Value, Parameter12Name = parameter12Name, Parameter12Value = parameter12Value, Parameter13Name = parameter13Name, Parameter13Value = parameter13Value, Parameter14Name = parameter14Name, Parameter14Value = parameter14Value, Parameter15Name = parameter15Name, Parameter15Value = parameter15Value, Parameter16Name = parameter16Name, Parameter16Value = parameter16Value, Parameter17Name = parameter17Name, Parameter17Value = parameter17Value, Parameter18Name = parameter18Name, Parameter18Value = parameter18Value, Parameter19Name = parameter19Name, Parameter19Value = parameter19Value, Parameter20Name = parameter20Name, Parameter20Value = parameter20Value, Parameter21Name = parameter21Name, Parameter21Value = parameter21Value, Parameter22Name = parameter22Name, Parameter22Value = parameter22Value, Parameter23Name = parameter23Name, Parameter23Value = parameter23Value, Parameter24Name = parameter24Name, Parameter24Value = parameter24Value, Parameter25Name = parameter25Name, Parameter25Value = parameter25Value, Parameter26Name = parameter26Name, Parameter26Value = parameter26Value, Parameter27Name = parameter27Name, Parameter27Value = parameter27Value, Parameter28Name = parameter28Name, Parameter28Value = parameter28Value, Parameter29Name = parameter29Name, Parameter29Value = parameter29Value, Parameter30Name = parameter30Name, Parameter30Value = parameter30Value, Parameter31Name = parameter31Name, Parameter31Value = parameter31Value, Parameter32Name = parameter32Name, Parameter32Value = parameter32Value, Parameter33Name = parameter33Name, Parameter33Value = parameter33Value, Parameter34Name = parameter34Name, Parameter34Value = parameter34Value, Parameter35Name = parameter35Name, Parameter35Value = parameter35Value, Parameter36Name = parameter36Name, Parameter36Value = parameter36Value, Parameter37Name = parameter37Name, Parameter37Value = parameter37Value, Parameter38Name = parameter38Name, Parameter38Value = parameter38Value, Parameter39Name = parameter39Name, Parameter39Value = parameter39Value, Parameter40Name = parameter40Name, Parameter40Value = parameter40Value, Parameter41Name = parameter41Name, Parameter41Value = parameter41Value, Parameter42Name = parameter42Name, Parameter42Value = parameter42Value, Parameter43Name = parameter43Name, Parameter43Value = parameter43Value, Parameter44Name = parameter44Name, Parameter44Value = parameter44Value, Parameter45Name = parameter45Name, Parameter45Value = parameter45Value, Parameter46Name = parameter46Name, Parameter46Value = parameter46Value, Parameter47Name = parameter47Name, Parameter47Value = parameter47Value, Parameter48Name = parameter48Name, Parameter48Value = parameter48Value, Parameter49Name = parameter49Name, Parameter49Value = parameter49Value, Parameter50Name = parameter50Name, Parameter50Value = parameter50Value, Parameter51Name = parameter51Name, Parameter51Value = parameter51Value, Parameter52Name = parameter52Name, Parameter52Value = parameter52Value, Parameter53Name = parameter53Name, Parameter53Value = parameter53Value, Parameter54Name = parameter54Name, Parameter54Value = parameter54Value, Parameter55Name = parameter55Name, Parameter55Value = parameter55Value, Parameter56Name = parameter56Name, Parameter56Value = parameter56Value, Parameter57Name = parameter57Name, Parameter57Value = parameter57Value, Parameter58Name = parameter58Name, Parameter58Value = parameter58Value, Parameter59Name = parameter59Name, Parameter59Value = parameter59Value, Parameter60Name = parameter60Name, Parameter60Value = parameter60Value, Parameter61Name = parameter61Name, Parameter61Value = parameter61Value, Parameter62Name = parameter62Name, Parameter62Value = parameter62Value, Parameter63Name = parameter63Name, Parameter63Value = parameter63Value, Parameter64Name = parameter64Name, Parameter64Value = parameter64Value, Parameter65Name = parameter65Name, Parameter65Value = parameter65Value, Parameter66Name = parameter66Name, Parameter66Value = parameter66Value, Parameter67Name = parameter67Name, Parameter67Value = parameter67Value, Parameter68Name = parameter68Name, Parameter68Value = parameter68Value, Parameter69Name = parameter69Name, Parameter69Value = parameter69Value, Parameter70Name = parameter70Name, Parameter70Value = parameter70Value, Parameter71Name = parameter71Name, Parameter71Value = parameter71Value, Parameter72Name = parameter72Name, Parameter72Value = parameter72Value, Parameter73Name = parameter73Name, Parameter73Value = parameter73Value, Parameter74Name = parameter74Name, Parameter74Value = parameter74Value, Parameter75Name = parameter75Name, Parameter75Value = parameter75Value, Parameter76Name = parameter76Name, Parameter76Value = parameter76Value, Parameter77Name = parameter77Name, Parameter77Value = parameter77Value, Parameter78Name = parameter78Name, Parameter78Value = parameter78Value, Parameter79Name = parameter79Name, Parameter79Value = parameter79Value, Parameter80Name = parameter80Name, Parameter80Value = parameter80Value, Parameter81Name = parameter81Name, Parameter81Value = parameter81Value, Parameter82Name = parameter82Name, Parameter82Value = parameter82Value, Parameter83Name = parameter83Name, Parameter83Value = parameter83Value, Parameter84Name = parameter84Name, Parameter84Value = parameter84Value, Parameter85Name = parameter85Name, Parameter85Value = parameter85Value, Parameter86Name = parameter86Name, Parameter86Value = parameter86Value, Parameter87Name = parameter87Name, Parameter87Value = parameter87Value, Parameter88Name = parameter88Name, Parameter88Value = parameter88Value, Parameter89Name = parameter89Name, Parameter89Value = parameter89Value, Parameter90Name = parameter90Name, Parameter90Value = parameter90Value, Parameter91Name = parameter91Name, Parameter91Value = parameter91Value, Parameter92Name = parameter92Name, Parameter92Value = parameter92Value, Parameter93Name = parameter93Name, Parameter93Value = parameter93Value, Parameter94Name = parameter94Name, Parameter94Value = parameter94Value, Parameter95Name = parameter95Name, Parameter95Value = parameter95Value, Parameter96Name = parameter96Name, Parameter96Value = parameter96Value, Parameter97Name = parameter97Name, Parameter97Value = parameter97Value, Parameter98Name = parameter98Name, Parameter98Value = parameter98Value, Parameter99Name = parameter99Name, Parameter99Value = parameter99Value }; return await CreateAsync(options, client); @@ -996,7 +996,7 @@ public static StreamResource Update(UpdateStreamOptions options, ITwilioRestClie /// Task that resolves to A single instance of Stream #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateStreamOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -1035,7 +1035,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, StreamResource.UpdateStatusEnum status, string pathAccountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateStreamOptions(pathCallSid, pathSid, status){ PathAccountSid = pathAccountSid }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionResource.cs b/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionResource.cs index 2d1c13fc1..64a24009d 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionResource.cs @@ -107,7 +107,7 @@ public static TranscriptionResource Create(CreateTranscriptionOptions options, I /// Create Transcription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcription - public static async System.Threading.Tasks.Task CreateAsync(CreateTranscriptionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateTranscriptionOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); @@ -194,7 +194,7 @@ public static async System.Threading.Tasks.Task CreateAsy string hints = null, bool? enableAutomaticPunctuation = null, string intelligenceService = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTranscriptionOptions(pathCallSid){ PathAccountSid = pathAccountSid, Name = name, Track = track, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, InboundTrackLabel = inboundTrackLabel, OutboundTrackLabel = outboundTrackLabel, PartialResults = partialResults, LanguageCode = languageCode, TranscriptionEngine = transcriptionEngine, ProfanityFilter = profanityFilter, SpeechModel = speechModel, Hints = hints, EnableAutomaticPunctuation = enableAutomaticPunctuation, IntelligenceService = intelligenceService }; return await CreateAsync(options, client); @@ -240,7 +240,7 @@ public static TranscriptionResource Update(UpdateTranscriptionOptions options, I /// Task that resolves to A single instance of Transcription #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateTranscriptionOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -279,7 +279,7 @@ public static async System.Threading.Tasks.Task UpdateAsy string pathSid, TranscriptionResource.UpdateStatusEnum status, string pathAccountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateTranscriptionOptions(pathCallSid, pathSid, status){ PathAccountSid = pathAccountSid }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageResource.cs b/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageResource.cs index 673c0bb9a..5fd86bb00 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageResource.cs @@ -70,7 +70,7 @@ public static UserDefinedMessageResource Create(CreateUserDefinedMessageOptions /// Create UserDefinedMessage parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserDefinedMessage - public static async System.Threading.Tasks.Task CreateAsync(CreateUserDefinedMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateUserDefinedMessageOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task Crea string content, string pathAccountSid = null, string idempotencyKey = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateUserDefinedMessageOptions(pathCallSid, content){ PathAccountSid = pathAccountSid, IdempotencyKey = idempotencyKey }; return await CreateAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionResource.cs b/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionResource.cs index d7fa883b5..c968346c7 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionResource.cs @@ -70,7 +70,7 @@ public static UserDefinedMessageSubscriptionResource Create(CreateUserDefinedMes /// Create UserDefinedMessageSubscription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserDefinedMessageSubscription - public static async System.Threading.Tasks.Task CreateAsync(CreateUserDefinedMessageSubscriptionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateUserDefinedMessageSubscriptionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -113,7 +113,7 @@ public static async System.Threading.Tasks.Task Task that resolves to A single instance of UserDefinedMessageSubscription public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserDefinedMessageSubscriptionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -190,7 +190,7 @@ public static bool Delete(string pathCallSid, string pathSid, string pathAccount /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that subscribed to the User Defined Messages. /// Client to make requests to Twilio /// Task that resolves to A single instance of UserDefinedMessageSubscription - public static async System.Threading.Tasks.Task DeleteAsync(string pathCallSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathCallSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUserDefinedMessageSubscriptionOptions(pathCallSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/CallResource.cs b/src/Twilio/Rest/Api/V2010/Account/CallResource.cs index f355582d9..f46907cdb 100644 --- a/src/Twilio/Rest/Api/V2010/Account/CallResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/CallResource.cs @@ -99,7 +99,7 @@ public static CallResource Create(CreateCallOptions options, ITwilioRestClient c /// Create Call parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Call - public static async System.Threading.Tasks.Task CreateAsync(CreateCallOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCallOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -266,7 +266,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string callToken = null, string recordingTrack = null, int? timeLimit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCallOptions(to, from){ PathAccountSid = pathAccountSid, Url = url, Twiml = twiml, ApplicationSid = applicationSid, Method = method, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StatusCallbackEvent = statusCallbackEvent, StatusCallbackMethod = statusCallbackMethod, SendDigits = sendDigits, Timeout = timeout, Record = record, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, MachineDetection = machineDetection, MachineDetectionTimeout = machineDetectionTimeout, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, Trim = trim, CallerId = callerId, MachineDetectionSpeechThreshold = machineDetectionSpeechThreshold, MachineDetectionSpeechEndThreshold = machineDetectionSpeechEndThreshold, MachineDetectionSilenceTimeout = machineDetectionSilenceTimeout, AsyncAmd = asyncAmd, AsyncAmdStatusCallback = asyncAmdStatusCallback, AsyncAmdStatusCallbackMethod = asyncAmdStatusCallbackMethod, Byoc = byoc, CallReason = callReason, CallToken = callToken, RecordingTrack = recordingTrack, TimeLimit = timeLimit }; return await CreateAsync(options, client, cancellationToken); @@ -314,7 +314,7 @@ public static bool Delete(DeleteCallOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Call public static async System.Threading.Tasks.Task DeleteAsync(DeleteCallOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -339,7 +339,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call resource(s) to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Call - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCallOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -381,7 +381,7 @@ public static CallResource Fetch(FetchCallOptions options, ITwilioRestClient cli /// Fetch Call parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Call - public static async System.Threading.Tasks.Task FetchAsync(FetchCallOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCallOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -408,7 +408,7 @@ public static CallResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call resource(s) to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Call - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCallOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -448,7 +448,7 @@ public static ResourceSet Read(ReadCallOptions options, ITwilioRes /// Read Call parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Call - public static async System.Threading.Tasks.Task> ReadAsync(ReadCallOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCallOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -524,7 +524,7 @@ public static async System.Threading.Tasks.Task> ReadA DateTime? endTimeAfter = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCallOptions(){ PathAccountSid = pathAccountSid, To = to, From = from, ParentCallSid = parentCallSid, Status = status, StartTimeBefore = startTimeBefore, StartTime = startTime, StartTimeAfter = startTimeAfter, EndTimeBefore = endTimeBefore, EndTime = endTime, EndTimeAfter = endTimeAfter, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -618,7 +618,7 @@ public static CallResource Update(UpdateCallOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateCallOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -685,7 +685,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( Twilio.Http.HttpMethod statusCallbackMethod = null, Types.Twiml twiml = null, int? timeLimit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateCallOptions(pathSid){ PathAccountSid = pathAccountSid, Url = url, Method = method, Status = status, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, Twiml = twiml, TimeLimit = timeLimit }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs index a3058687c..2ee86fdd0 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs @@ -87,7 +87,7 @@ public static ParticipantResource Create(CreateParticipantOptions options, ITwil /// Create Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -310,7 +310,7 @@ public static async System.Threading.Tasks.Task CreateAsync Twilio.Http.HttpMethod amdStatusCallbackMethod = null, string trim = null, string callToken = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateParticipantOptions(pathConferenceSid, from, to){ PathAccountSid = pathAccountSid, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Label = label, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, Region = region, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, ConferenceRecordingStatusCallbackEvent = conferenceRecordingStatusCallbackEvent, Coaching = coaching, CallSidToCoach = callSidToCoach, JitterBufferSize = jitterBufferSize, Byoc = byoc, CallerId = callerId, CallReason = callReason, RecordingTrack = recordingTrack, TimeLimit = timeLimit, MachineDetection = machineDetection, MachineDetectionTimeout = machineDetectionTimeout, MachineDetectionSpeechThreshold = machineDetectionSpeechThreshold, MachineDetectionSpeechEndThreshold = machineDetectionSpeechEndThreshold, MachineDetectionSilenceTimeout = machineDetectionSilenceTimeout, AmdStatusCallback = amdStatusCallback, AmdStatusCallbackMethod = amdStatusCallbackMethod, Trim = trim, CallToken = callToken }; return await CreateAsync(options, client, cancellationToken); @@ -360,7 +360,7 @@ public static bool Delete(DeleteParticipantOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of Participant public static async System.Threading.Tasks.Task DeleteAsync(DeleteParticipantOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -387,7 +387,7 @@ public static bool Delete(string pathConferenceSid, string pathCallSid, string p /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Participant resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task DeleteAsync(string pathConferenceSid, string pathCallSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathConferenceSid, string pathCallSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteParticipantOptions(pathConferenceSid, pathCallSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -431,7 +431,7 @@ public static ParticipantResource Fetch(FetchParticipantOptions options, ITwilio /// Fetch Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -461,7 +461,7 @@ public static ParticipantResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Participant resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(string pathConferenceSid, string pathCallSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathConferenceSid, string pathCallSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchParticipantOptions(pathConferenceSid, pathCallSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -503,7 +503,7 @@ public static ResourceSet Read(ReadParticipantOptions optio /// Read Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -555,7 +555,7 @@ public static async System.Threading.Tasks.Task bool? coaching = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadParticipantOptions(pathConferenceSid){ PathAccountSid = pathAccountSid, Muted = muted, Hold = hold, Coaching = coaching, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -651,7 +651,7 @@ public static ParticipantResource Update(UpdateParticipantOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateParticipantOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -734,7 +734,7 @@ public static async System.Threading.Tasks.Task UpdateAsync bool? endConferenceOnExit = null, bool? coaching = null, string callSidToCoach = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateParticipantOptions(pathConferenceSid, pathCallSid){ PathAccountSid = pathAccountSid, Muted = muted, Hold = hold, HoldUrl = holdUrl, HoldMethod = holdMethod, AnnounceUrl = announceUrl, AnnounceMethod = announceMethod, WaitUrl = waitUrl, WaitMethod = waitMethod, BeepOnExit = beepOnExit, EndConferenceOnExit = endConferenceOnExit, Coaching = coaching, CallSidToCoach = callSidToCoach }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingResource.cs b/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingResource.cs index 45803354c..96ed07e28 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingResource.cs @@ -112,7 +112,7 @@ public static bool Delete(DeleteRecordingOptions options, ITwilioRestClient clie /// Task that resolves to A single instance of Recording public static async System.Threading.Tasks.Task DeleteAsync(DeleteRecordingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -139,7 +139,7 @@ public static bool Delete(string pathConferenceSid, string pathSid, string pathA /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference Recording resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task DeleteAsync(string pathConferenceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathConferenceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRecordingOptions(pathConferenceSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -183,7 +183,7 @@ public static RecordingResource Fetch(FetchRecordingOptions options, ITwilioRest /// Fetch Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -213,7 +213,7 @@ public static RecordingResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference Recording resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(string pathConferenceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathConferenceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRecordingOptions(pathConferenceSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -255,7 +255,7 @@ public static ResourceSet Read(ReadRecordingOptions options, /// Read Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -307,7 +307,7 @@ public static async System.Threading.Tasks.Task> DateTime? dateCreatedAfter = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRecordingOptions(pathConferenceSid){ PathAccountSid = pathAccountSid, DateCreatedBefore = dateCreatedBefore, DateCreated = dateCreated, DateCreatedAfter = dateCreatedAfter, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -403,7 +403,7 @@ public static RecordingResource Update(UpdateRecordingOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRecordingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -446,7 +446,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( RecordingResource.StatusEnum status, string pathAccountSid = null, string pauseBehavior = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRecordingOptions(pathConferenceSid, pathSid, status){ PathAccountSid = pathAccountSid, PauseBehavior = pauseBehavior }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/ConferenceResource.cs b/src/Twilio/Rest/Api/V2010/Account/ConferenceResource.cs index 424575c2a..193b0f0f2 100644 --- a/src/Twilio/Rest/Api/V2010/Account/ConferenceResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/ConferenceResource.cs @@ -110,7 +110,7 @@ public static ConferenceResource Fetch(FetchConferenceOptions options, ITwilioRe /// Fetch Conference parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conference - public static async System.Threading.Tasks.Task FetchAsync(FetchConferenceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchConferenceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -137,7 +137,7 @@ public static ConferenceResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference resource(s) to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Conference - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchConferenceOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -177,7 +177,7 @@ public static ResourceSet Read(ReadConferenceOptions options /// Read Conference parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conference - public static async System.Threading.Tasks.Task> ReadAsync(ReadConferenceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConferenceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static async System.Threading.Tasks.Task> ConferenceResource.StatusEnum status = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadConferenceOptions(){ PathAccountSid = pathAccountSid, DateCreatedBefore = dateCreatedBefore, DateCreated = dateCreated, DateCreatedAfter = dateCreatedAfter, DateUpdatedBefore = dateUpdatedBefore, DateUpdated = dateUpdated, DateUpdatedAfter = dateUpdatedAfter, FriendlyName = friendlyName, Status = status, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -339,7 +339,7 @@ public static ConferenceResource Update(UpdateConferenceOptions options, ITwilio #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateConferenceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -382,7 +382,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ConferenceResource.UpdateStatusEnum status = null, Uri announceUrl = null, Twilio.Http.HttpMethod announceMethod = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateConferenceOptions(pathSid){ PathAccountSid = pathAccountSid, Status = status, AnnounceUrl = announceUrl, AnnounceMethod = announceMethod }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/ConnectAppResource.cs b/src/Twilio/Rest/Api/V2010/Account/ConnectAppResource.cs index 26b9d023d..091e54673 100644 --- a/src/Twilio/Rest/Api/V2010/Account/ConnectAppResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/ConnectAppResource.cs @@ -88,7 +88,7 @@ public static bool Delete(DeleteConnectAppOptions options, ITwilioRestClient cli /// Task that resolves to A single instance of ConnectApp public static async System.Threading.Tasks.Task DeleteAsync(DeleteConnectAppOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -113,7 +113,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ConnectApp resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectApp - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteConnectAppOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -155,7 +155,7 @@ public static ConnectAppResource Fetch(FetchConnectAppOptions options, ITwilioRe /// Fetch ConnectApp parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectApp - public static async System.Threading.Tasks.Task FetchAsync(FetchConnectAppOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchConnectAppOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -182,7 +182,7 @@ public static ConnectAppResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ConnectApp resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectApp - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchConnectAppOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -222,7 +222,7 @@ public static ResourceSet Read(ReadConnectAppOptions options /// Read ConnectApp parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectApp - public static async System.Threading.Tasks.Task> ReadAsync(ReadConnectAppOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConnectAppOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -258,7 +258,7 @@ public static async System.Threading.Tasks.Task> string pathAccountSid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadConnectAppOptions(){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -352,7 +352,7 @@ public static ConnectAppResource Update(UpdateConnectAppOptions options, ITwilio #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateConnectAppOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -415,7 +415,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string friendlyName = null, Uri homepageUrl = null, List permissions = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateConnectAppOptions(pathSid){ PathAccountSid = pathAccountSid, AuthorizeRedirectUrl = authorizeRedirectUrl, CompanyName = companyName, DeauthorizeCallbackMethod = deauthorizeCallbackMethod, DeauthorizeCallbackUrl = deauthorizeCallbackUrl, Description = description, FriendlyName = friendlyName, HomepageUrl = homepageUrl, Permissions = permissions }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionResource.cs b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionResource.cs index 213a3707d..bba81a9ec 100644 --- a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionResource.cs @@ -73,7 +73,7 @@ public static AssignedAddOnExtensionResource Fetch(FetchAssignedAddOnExtensionOp /// Fetch AssignedAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssignedAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(FetchAssignedAddOnExtensionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAssignedAddOnExtensionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -106,7 +106,7 @@ public static AssignedAddOnExtensionResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AssignedAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(string pathResourceSid, string pathAssignedAddOnSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathResourceSid, string pathAssignedAddOnSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAssignedAddOnExtensionOptions(pathResourceSid, pathAssignedAddOnSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -150,7 +150,7 @@ public static ResourceSet Read(ReadAssignedAddOn /// Read AssignedAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssignedAddOnExtension - public static async System.Threading.Tasks.Task> ReadAsync(ReadAssignedAddOnExtensionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAssignedAddOnExtensionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -194,7 +194,7 @@ public static async System.Threading.Tasks.Task Create AssignedAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssignedAddOn - public static async System.Threading.Tasks.Task CreateAsync(CreateAssignedAddOnOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAssignedAddOnOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task CreateAsy string pathResourceSid, string installedAddOnSid, string pathAccountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAssignedAddOnOptions(pathResourceSid, installedAddOnSid){ PathAccountSid = pathAccountSid }; return await CreateAsync(options, client, cancellationToken); @@ -155,7 +155,7 @@ public static bool Delete(DeleteAssignedAddOnOptions options, ITwilioRestClient /// Task that resolves to A single instance of AssignedAddOn public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssignedAddOnOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -182,7 +182,7 @@ public static bool Delete(string pathResourceSid, string pathSid, string pathAcc /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of AssignedAddOn - public static async System.Threading.Tasks.Task DeleteAsync(string pathResourceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathResourceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAssignedAddOnOptions(pathResourceSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -226,7 +226,7 @@ public static AssignedAddOnResource Fetch(FetchAssignedAddOnOptions options, ITw /// Fetch AssignedAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssignedAddOn - public static async System.Threading.Tasks.Task FetchAsync(FetchAssignedAddOnOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAssignedAddOnOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -256,7 +256,7 @@ public static AssignedAddOnResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AssignedAddOn - public static async System.Threading.Tasks.Task FetchAsync(string pathResourceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathResourceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAssignedAddOnOptions(pathResourceSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -298,7 +298,7 @@ public static ResourceSet Read(ReadAssignedAddOnOptions o /// Read AssignedAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssignedAddOn - public static async System.Threading.Tasks.Task> ReadAsync(ReadAssignedAddOnOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAssignedAddOnOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -338,7 +338,7 @@ public static async System.Threading.Tasks.Task Create Local parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Local - public static async System.Threading.Tasks.Task CreateAsync(CreateLocalOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateLocalOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string trunkSid = null, LocalResource.VoiceReceiveModeEnum voiceReceiveMode = null, string bundleSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateLocalOptions(phoneNumber){ PathAccountSid = pathAccountSid, ApiVersion = apiVersion, FriendlyName = friendlyName, SmsApplicationSid = smsApplicationSid, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceApplicationSid = voiceApplicationSid, VoiceCallerIdLookup = voiceCallerIdLookup, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl, IdentitySid = identitySid, AddressSid = addressSid, EmergencyStatus = emergencyStatus, EmergencyAddressSid = emergencyAddressSid, TrunkSid = trunkSid, VoiceReceiveMode = voiceReceiveMode, BundleSid = bundleSid }; return await CreateAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadLocalOptions options, ITwilioR /// Read Local parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Local - public static async System.Threading.Tasks.Task> ReadAsync(ReadLocalOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadLocalOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -337,7 +337,7 @@ public static async System.Threading.Tasks.Task> Read string origin = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadLocalOptions(){ PathAccountSid = pathAccountSid, Beta = beta, FriendlyName = friendlyName, PhoneNumber = phoneNumber, Origin = origin, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileResource.cs b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileResource.cs index 2d175c816..1eeb4ac3b 100644 --- a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileResource.cs @@ -126,7 +126,7 @@ public static MobileResource Create(CreateMobileOptions options, ITwilioRestClie /// Create Mobile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Mobile - public static async System.Threading.Tasks.Task CreateAsync(CreateMobileOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateMobileOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string trunkSid = null, MobileResource.VoiceReceiveModeEnum voiceReceiveMode = null, string bundleSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMobileOptions(phoneNumber){ PathAccountSid = pathAccountSid, ApiVersion = apiVersion, FriendlyName = friendlyName, SmsApplicationSid = smsApplicationSid, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceApplicationSid = voiceApplicationSid, VoiceCallerIdLookup = voiceCallerIdLookup, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl, IdentitySid = identitySid, AddressSid = addressSid, EmergencyStatus = emergencyStatus, EmergencyAddressSid = emergencyAddressSid, TrunkSid = trunkSid, VoiceReceiveMode = voiceReceiveMode, BundleSid = bundleSid }; return await CreateAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadMobileOptions options, ITwili /// Read Mobile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Mobile - public static async System.Threading.Tasks.Task> ReadAsync(ReadMobileOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMobileOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -337,7 +337,7 @@ public static async System.Threading.Tasks.Task> Rea string origin = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMobileOptions(){ PathAccountSid = pathAccountSid, Beta = beta, FriendlyName = friendlyName, PhoneNumber = phoneNumber, Origin = origin, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeResource.cs b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeResource.cs index 5205739db..552e7ad42 100644 --- a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeResource.cs @@ -126,7 +126,7 @@ public static TollFreeResource Create(CreateTollFreeOptions options, ITwilioRest /// Create TollFree parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TollFree - public static async System.Threading.Tasks.Task CreateAsync(CreateTollFreeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTollFreeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string trunkSid = null, TollFreeResource.VoiceReceiveModeEnum voiceReceiveMode = null, string bundleSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTollFreeOptions(phoneNumber){ PathAccountSid = pathAccountSid, ApiVersion = apiVersion, FriendlyName = friendlyName, SmsApplicationSid = smsApplicationSid, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceApplicationSid = voiceApplicationSid, VoiceCallerIdLookup = voiceCallerIdLookup, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl, IdentitySid = identitySid, AddressSid = addressSid, EmergencyStatus = emergencyStatus, EmergencyAddressSid = emergencyAddressSid, TrunkSid = trunkSid, VoiceReceiveMode = voiceReceiveMode, BundleSid = bundleSid }; return await CreateAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadTollFreeOptions options, IT /// Read TollFree parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TollFree - public static async System.Threading.Tasks.Task> ReadAsync(ReadTollFreeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTollFreeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -337,7 +337,7 @@ public static async System.Threading.Tasks.Task> R string origin = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadTollFreeOptions(){ PathAccountSid = pathAccountSid, Beta = beta, FriendlyName = friendlyName, PhoneNumber = phoneNumber, Origin = origin, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberResource.cs b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberResource.cs index a422a4486..d014d3647 100644 --- a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberResource.cs @@ -126,7 +126,7 @@ public static IncomingPhoneNumberResource Create(CreateIncomingPhoneNumberOption /// Create IncomingPhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IncomingPhoneNumber - public static async System.Threading.Tasks.Task CreateAsync(CreateIncomingPhoneNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateIncomingPhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -249,7 +249,7 @@ public static async System.Threading.Tasks.Task Cre string addressSid = null, IncomingPhoneNumberResource.VoiceReceiveModeEnum voiceReceiveMode = null, string bundleSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateIncomingPhoneNumberOptions(){ PathAccountSid = pathAccountSid, PhoneNumber = phoneNumber, AreaCode = areaCode, ApiVersion = apiVersion, FriendlyName = friendlyName, SmsApplicationSid = smsApplicationSid, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceApplicationSid = voiceApplicationSid, VoiceCallerIdLookup = voiceCallerIdLookup, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl, EmergencyStatus = emergencyStatus, EmergencyAddressSid = emergencyAddressSid, TrunkSid = trunkSid, IdentitySid = identitySid, AddressSid = addressSid, VoiceReceiveMode = voiceReceiveMode, BundleSid = bundleSid }; return await CreateAsync(options, client, cancellationToken); @@ -297,7 +297,7 @@ public static bool Delete(DeleteIncomingPhoneNumberOptions options, ITwilioRestC /// Task that resolves to A single instance of IncomingPhoneNumber public static async System.Threading.Tasks.Task DeleteAsync(DeleteIncomingPhoneNumberOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -322,7 +322,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of IncomingPhoneNumber - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteIncomingPhoneNumberOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -364,7 +364,7 @@ public static IncomingPhoneNumberResource Fetch(FetchIncomingPhoneNumberOptions /// Fetch IncomingPhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IncomingPhoneNumber - public static async System.Threading.Tasks.Task FetchAsync(FetchIncomingPhoneNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchIncomingPhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -391,7 +391,7 @@ public static IncomingPhoneNumberResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of IncomingPhoneNumber - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchIncomingPhoneNumberOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -431,7 +431,7 @@ public static ResourceSet Read(ReadIncomingPhoneNum /// Read IncomingPhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IncomingPhoneNumber - public static async System.Threading.Tasks.Task> ReadAsync(ReadIncomingPhoneNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadIncomingPhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -483,7 +483,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateIncomingPhoneNumberOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -700,7 +700,7 @@ public static async System.Threading.Tasks.Task Upd string identitySid = null, string addressSid = null, string bundleSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateIncomingPhoneNumberOptions(pathSid){ PathAccountSid = pathAccountSid, AccountSid = accountSid, ApiVersion = apiVersion, FriendlyName = friendlyName, SmsApplicationSid = smsApplicationSid, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceApplicationSid = voiceApplicationSid, VoiceCallerIdLookup = voiceCallerIdLookup, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl, EmergencyStatus = emergencyStatus, EmergencyAddressSid = emergencyAddressSid, TrunkSid = trunkSid, VoiceReceiveMode = voiceReceiveMode, IdentitySid = identitySid, AddressSid = addressSid, BundleSid = bundleSid }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/KeyResource.cs b/src/Twilio/Rest/Api/V2010/Account/KeyResource.cs index f2007bf9d..49800a64e 100644 --- a/src/Twilio/Rest/Api/V2010/Account/KeyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/KeyResource.cs @@ -75,7 +75,7 @@ public static bool Delete(DeleteKeyOptions options, ITwilioRestClient client = n /// Task that resolves to A single instance of Key public static async System.Threading.Tasks.Task DeleteAsync(DeleteKeyOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -100,7 +100,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Key resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Key - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteKeyOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -142,7 +142,7 @@ public static KeyResource Fetch(FetchKeyOptions options, ITwilioRestClient clien /// Fetch Key parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Key - public static async System.Threading.Tasks.Task FetchAsync(FetchKeyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchKeyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -169,7 +169,7 @@ public static KeyResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Key resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Key - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchKeyOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -209,7 +209,7 @@ public static ResourceSet Read(ReadKeyOptions options, ITwilioRestC /// Read Key parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Key - public static async System.Threading.Tasks.Task> ReadAsync(ReadKeyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadKeyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static async System.Threading.Tasks.Task> ReadAs string pathAccountSid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadKeyOptions(){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -339,7 +339,7 @@ public static KeyResource Update(UpdateKeyOptions options, ITwilioRestClient cli #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateKeyOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -374,7 +374,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string pathAccountSid = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateKeyOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackResource.cs b/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackResource.cs index 789ac0ab1..658b45c34 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackResource.cs @@ -83,7 +83,7 @@ public static FeedbackResource Create(CreateFeedbackOptions options, ITwilioRest /// Create Feedback parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Feedback - public static async System.Threading.Tasks.Task CreateAsync(CreateFeedbackOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateFeedbackOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -118,7 +118,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string pathMessageSid, string pathAccountSid = null, FeedbackResource.OutcomeEnum outcome = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateFeedbackOptions(pathMessageSid){ PathAccountSid = pathAccountSid, Outcome = outcome }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Message/MediaResource.cs b/src/Twilio/Rest/Api/V2010/Account/Message/MediaResource.cs index bd9912494..5604acd51 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Message/MediaResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Message/MediaResource.cs @@ -77,7 +77,7 @@ public static bool Delete(DeleteMediaOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Media public static async System.Threading.Tasks.Task DeleteAsync(DeleteMediaOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -104,7 +104,7 @@ public static bool Delete(string pathMessageSid, string pathSid, string pathAcco /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is associated with the Media resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Media - public static async System.Threading.Tasks.Task DeleteAsync(string pathMessageSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathMessageSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteMediaOptions(pathMessageSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -148,7 +148,7 @@ public static MediaResource Fetch(FetchMediaOptions options, ITwilioRestClient c /// Fetch Media parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Media - public static async System.Threading.Tasks.Task FetchAsync(FetchMediaOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchMediaOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -178,7 +178,7 @@ public static MediaResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with the Media resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Media - public static async System.Threading.Tasks.Task FetchAsync(string pathMessageSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathMessageSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMediaOptions(pathMessageSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -220,7 +220,7 @@ public static ResourceSet Read(ReadMediaOptions options, ITwilioR /// Read Media parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Media - public static async System.Threading.Tasks.Task> ReadAsync(ReadMediaOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMediaOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -272,7 +272,7 @@ public static async System.Threading.Tasks.Task> Read DateTime? dateCreatedAfter = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMediaOptions(pathMessageSid){ PathAccountSid = pathAccountSid, DateCreatedBefore = dateCreatedBefore, DateCreated = dateCreated, DateCreatedAfter = dateCreatedAfter, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/MessageResource.cs b/src/Twilio/Rest/Api/V2010/Account/MessageResource.cs index acf1f3f9d..0f00f0679 100644 --- a/src/Twilio/Rest/Api/V2010/Account/MessageResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/MessageResource.cs @@ -165,7 +165,7 @@ public static MessageResource Create(CreateMessageOptions options, ITwilioRestCl /// Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -284,7 +284,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? sendAsMms = null, string contentVariables = null, MessageResource.RiskCheckEnum riskCheck = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMessageOptions(to){ PathAccountSid = pathAccountSid, From = from, MessagingServiceSid = messagingServiceSid, Body = body, MediaUrl = mediaUrl, ContentSid = contentSid, StatusCallback = statusCallback, ApplicationSid = applicationSid, MaxPrice = maxPrice, ProvideFeedback = provideFeedback, Attempt = attempt, ValidityPeriod = validityPeriod, ForceDelivery = forceDelivery, ContentRetention = contentRetention, AddressRetention = addressRetention, SmartEncoded = smartEncoded, PersistentAction = persistentAction, ShortenUrls = shortenUrls, ScheduleType = scheduleType, SendAt = sendAt, SendAsMms = sendAsMms, ContentVariables = contentVariables, RiskCheck = riskCheck }; return await CreateAsync(options, client, cancellationToken); @@ -332,7 +332,7 @@ public static bool Delete(DeleteMessageOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Message public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -357,7 +357,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with the Message resource /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteMessageOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -399,7 +399,7 @@ public static MessageResource Fetch(FetchMessageOptions options, ITwilioRestClie /// Fetch Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -426,7 +426,7 @@ public static MessageResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with the Message resource /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMessageOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -466,7 +466,7 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -522,7 +522,7 @@ public static async System.Threading.Tasks.Task> Re DateTime? dateSentAfter = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMessageOptions(){ PathAccountSid = pathAccountSid, To = to, From = from, DateSentBefore = dateSentBefore, DateSent = dateSent, DateSentAfter = dateSentAfter, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -616,7 +616,7 @@ public static MessageResource Update(UpdateMessageOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -655,7 +655,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathAccountSid = null, string body = null, MessageResource.UpdateStatusEnum status = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateMessageOptions(pathSid){ PathAccountSid = pathAccountSid, Body = body, Status = status }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/NewKeyResource.cs b/src/Twilio/Rest/Api/V2010/Account/NewKeyResource.cs index da508ca28..85308f35a 100644 --- a/src/Twilio/Rest/Api/V2010/Account/NewKeyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/NewKeyResource.cs @@ -68,7 +68,7 @@ public static NewKeyResource Create(CreateNewKeyOptions options, ITwilioRestClie /// Create NewKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NewKey - public static async System.Threading.Tasks.Task CreateAsync(CreateNewKeyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateNewKeyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static NewKeyResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathAccountSid = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateNewKeyOptions(){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyResource.cs b/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyResource.cs index e7f81bdb6..eafe5e330 100644 --- a/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyResource.cs @@ -68,7 +68,7 @@ public static NewSigningKeyResource Create(CreateNewSigningKeyOptions options, I /// Create NewSigningKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NewSigningKey - public static async System.Threading.Tasks.Task CreateAsync(CreateNewSigningKeyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateNewSigningKeyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static NewSigningKeyResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathAccountSid = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateNewSigningKeyOptions(){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/NotificationResource.cs b/src/Twilio/Rest/Api/V2010/Account/NotificationResource.cs index 582229df5..1b4187608 100644 --- a/src/Twilio/Rest/Api/V2010/Account/NotificationResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/NotificationResource.cs @@ -69,7 +69,7 @@ public static NotificationResource Fetch(FetchNotificationOptions options, ITwil /// Fetch Notification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task FetchAsync(FetchNotificationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchNotificationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static NotificationResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Notification resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchNotificationOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -136,7 +136,7 @@ public static ResourceSet Read(ReadNotificationOptions opt /// Read Notification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task> ReadAsync(ReadNotificationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadNotificationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -188,7 +188,7 @@ public static async System.Threading.Tasks.Task Task that resolves to A single instance of OutgoingCallerId public static async System.Threading.Tasks.Task DeleteAsync(DeleteOutgoingCallerIdOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -100,7 +100,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the OutgoingCallerId resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of OutgoingCallerId - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteOutgoingCallerIdOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -142,7 +142,7 @@ public static OutgoingCallerIdResource Fetch(FetchOutgoingCallerIdOptions option /// Fetch OutgoingCallerId parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OutgoingCallerId - public static async System.Threading.Tasks.Task FetchAsync(FetchOutgoingCallerIdOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchOutgoingCallerIdOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -169,7 +169,7 @@ public static OutgoingCallerIdResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the OutgoingCallerId resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of OutgoingCallerId - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchOutgoingCallerIdOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -209,7 +209,7 @@ public static ResourceSet Read(ReadOutgoingCallerIdOpt /// Read OutgoingCallerId parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OutgoingCallerId - public static async System.Threading.Tasks.Task> ReadAsync(ReadOutgoingCallerIdOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadOutgoingCallerIdOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -253,7 +253,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateOutgoingCallerIdOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -382,7 +382,7 @@ public static async System.Threading.Tasks.Task Update string pathSid, string pathAccountSid = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateOutgoingCallerIdOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Queue/MemberResource.cs b/src/Twilio/Rest/Api/V2010/Account/Queue/MemberResource.cs index 1ff07807d..56ef93e9e 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Queue/MemberResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Queue/MemberResource.cs @@ -71,7 +71,7 @@ public static MemberResource Fetch(FetchMemberOptions options, ITwilioRestClient /// Fetch Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -101,7 +101,7 @@ public static MemberResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Member resource(s) to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task FetchAsync(string pathQueueSid, string pathCallSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathQueueSid, string pathCallSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMemberOptions(pathQueueSid, pathCallSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client); @@ -143,7 +143,7 @@ public static ResourceSet Read(ReadMemberOptions options, ITwili /// Read Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -183,7 +183,7 @@ public static async System.Threading.Tasks.Task> Rea string pathAccountSid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMemberOptions(pathQueueSid){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); @@ -278,7 +278,7 @@ public static MemberResource Update(UpdateMemberOptions options, ITwilioRestClie /// Task that resolves to A single instance of Member #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateMemberOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -321,7 +321,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( Uri url, string pathAccountSid = null, Twilio.Http.HttpMethod method = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateMemberOptions(pathQueueSid, pathCallSid, url){ PathAccountSid = pathAccountSid, Method = method }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/QueueResource.cs b/src/Twilio/Rest/Api/V2010/Account/QueueResource.cs index 13f8a6f49..2ae2172c9 100644 --- a/src/Twilio/Rest/Api/V2010/Account/QueueResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/QueueResource.cs @@ -68,7 +68,7 @@ public static QueueResource Create(CreateQueueOptions options, ITwilioRestClient /// Create Queue parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Queue - public static async System.Threading.Tasks.Task CreateAsync(CreateQueueOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateQueueOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, string pathAccountSid = null, int? maxSize = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateQueueOptions(friendlyName){ PathAccountSid = pathAccountSid, MaxSize = maxSize }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static bool Delete(DeleteQueueOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Queue public static async System.Threading.Tasks.Task DeleteAsync(DeleteQueueOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -176,7 +176,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Queue resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Queue - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteQueueOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -218,7 +218,7 @@ public static QueueResource Fetch(FetchQueueOptions options, ITwilioRestClient c /// Fetch Queue parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Queue - public static async System.Threading.Tasks.Task FetchAsync(FetchQueueOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchQueueOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static QueueResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Queue resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Queue - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchQueueOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadQueueOptions options, ITwilioR /// Read Queue parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Queue - public static async System.Threading.Tasks.Task> ReadAsync(ReadQueueOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadQueueOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static async System.Threading.Tasks.Task> Read string pathAccountSid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadQueueOptions(){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -415,7 +415,7 @@ public static QueueResource Update(UpdateQueueOptions options, ITwilioRestClient #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateQueueOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -454,7 +454,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathAccountSid = null, string friendlyName = null, int? maxSize = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateQueueOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, MaxSize = maxSize }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/Payload/DataResource.cs b/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/Payload/DataResource.cs index fbbd7c286..bf912b07c 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/Payload/DataResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/Payload/DataResource.cs @@ -73,7 +73,7 @@ public static DataResource Fetch(FetchDataOptions options, ITwilioRestClient cli /// Fetch Data parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Data - public static async System.Threading.Tasks.Task FetchAsync(FetchDataOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDataOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -106,7 +106,7 @@ public static DataResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult Payload resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Data - public static async System.Threading.Tasks.Task FetchAsync(string pathReferenceSid, string pathAddOnResultSid, string pathPayloadSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathReferenceSid, string pathAddOnResultSid, string pathPayloadSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDataOptions(pathReferenceSid, pathAddOnResultSid, pathPayloadSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadResource.cs b/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadResource.cs index 87d5470f9..793f58a5e 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadResource.cs @@ -78,7 +78,7 @@ public static bool Delete(DeletePayloadOptions options, ITwilioRestClient client /// Client to make requests to Twilio /// Task that resolves to A single instance of Payload public static async System.Threading.Tasks.Task DeleteAsync(DeletePayloadOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); @@ -107,7 +107,7 @@ public static bool Delete(string pathReferenceSid, string pathAddOnResultSid, st /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult Payload resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Payload - public static async System.Threading.Tasks.Task DeleteAsync(string pathReferenceSid, string pathAddOnResultSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathReferenceSid, string pathAddOnResultSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeletePayloadOptions(pathReferenceSid, pathAddOnResultSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client); @@ -153,7 +153,7 @@ public static PayloadResource Fetch(FetchPayloadOptions options, ITwilioRestClie /// Fetch Payload parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Payload - public static async System.Threading.Tasks.Task FetchAsync(FetchPayloadOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchPayloadOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -186,7 +186,7 @@ public static PayloadResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult Payload resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Payload - public static async System.Threading.Tasks.Task FetchAsync(string pathReferenceSid, string pathAddOnResultSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathReferenceSid, string pathAddOnResultSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPayloadOptions(pathReferenceSid, pathAddOnResultSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client); @@ -230,7 +230,7 @@ public static ResourceSet Read(ReadPayloadOptions options, ITwi /// Read Payload parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Payload - public static async System.Threading.Tasks.Task> ReadAsync(ReadPayloadOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPayloadOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -274,7 +274,7 @@ public static async System.Threading.Tasks.Task> Re string pathAccountSid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadPayloadOptions(pathReferenceSid, pathAddOnResultSid){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultResource.cs b/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultResource.cs index 8d407604b..fe9f1810b 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultResource.cs @@ -95,7 +95,7 @@ public static bool Delete(DeleteAddOnResultOptions options, ITwilioRestClient cl /// Client to make requests to Twilio /// Task that resolves to A single instance of AddOnResult public static async System.Threading.Tasks.Task DeleteAsync(DeleteAddOnResultOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); @@ -122,7 +122,7 @@ public static bool Delete(string pathReferenceSid, string pathSid, string pathAc /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of AddOnResult - public static async System.Threading.Tasks.Task DeleteAsync(string pathReferenceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathReferenceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAddOnResultOptions(pathReferenceSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client); @@ -166,7 +166,7 @@ public static AddOnResultResource Fetch(FetchAddOnResultOptions options, ITwilio /// Fetch AddOnResult parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AddOnResult - public static async System.Threading.Tasks.Task FetchAsync(FetchAddOnResultOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchAddOnResultOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -196,7 +196,7 @@ public static AddOnResultResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AddOnResult - public static async System.Threading.Tasks.Task FetchAsync(string pathReferenceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathReferenceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAddOnResultOptions(pathReferenceSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client); @@ -238,7 +238,7 @@ public static ResourceSet Read(ReadAddOnResultOptions optio /// Read AddOnResult parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AddOnResult - public static async System.Threading.Tasks.Task> ReadAsync(ReadAddOnResultOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAddOnResultOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -278,7 +278,7 @@ public static async System.Threading.Tasks.Task string pathAccountSid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAddOnResultOptions(pathReferenceSid){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionResource.cs b/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionResource.cs index d3a51164e..0e290119a 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionResource.cs @@ -90,7 +90,7 @@ public static bool Delete(DeleteTranscriptionOptions options, ITwilioRestClient /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcription public static async System.Threading.Tasks.Task DeleteAsync(DeleteTranscriptionOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); @@ -117,7 +117,7 @@ public static bool Delete(string pathRecordingSid, string pathSid, string pathAc /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcription - public static async System.Threading.Tasks.Task DeleteAsync(string pathRecordingSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathRecordingSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteTranscriptionOptions(pathRecordingSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client); @@ -161,7 +161,7 @@ public static TranscriptionResource Fetch(FetchTranscriptionOptions options, ITw /// Fetch Transcription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcription - public static async System.Threading.Tasks.Task FetchAsync(FetchTranscriptionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchTranscriptionOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -191,7 +191,7 @@ public static TranscriptionResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcription - public static async System.Threading.Tasks.Task FetchAsync(string pathRecordingSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathRecordingSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTranscriptionOptions(pathRecordingSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client); @@ -233,7 +233,7 @@ public static ResourceSet Read(ReadTranscriptionOptions o /// Read Transcription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcription - public static async System.Threading.Tasks.Task> ReadAsync(ReadTranscriptionOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTranscriptionOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -273,7 +273,7 @@ public static async System.Threading.Tasks.Task Task that resolves to A single instance of Recording public static async System.Threading.Tasks.Task DeleteAsync(DeleteRecordingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -136,7 +136,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRecordingOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -178,7 +178,7 @@ public static RecordingResource Fetch(FetchRecordingOptions options, ITwilioRest /// Fetch Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -208,7 +208,7 @@ public static RecordingResource Fetch( /// A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, bool? includeSoftDeleted = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, bool? includeSoftDeleted = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRecordingOptions(pathSid){ PathAccountSid = pathAccountSid,IncludeSoftDeleted = includeSoftDeleted }; return await FetchAsync(options, client, cancellationToken); @@ -248,7 +248,7 @@ public static ResourceSet Read(ReadRecordingOptions options, /// Read Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -308,7 +308,7 @@ public static async System.Threading.Tasks.Task> bool? includeSoftDeleted = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRecordingOptions(){ PathAccountSid = pathAccountSid, DateCreatedBefore = dateCreatedBefore, DateCreated = dateCreated, DateCreatedAfter = dateCreatedAfter, CallSid = callSid, ConferenceSid = conferenceSid, IncludeSoftDeleted = includeSoftDeleted, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/ShortCodeResource.cs b/src/Twilio/Rest/Api/V2010/Account/ShortCodeResource.cs index c3d0bf007..eec9667a0 100644 --- a/src/Twilio/Rest/Api/V2010/Account/ShortCodeResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/ShortCodeResource.cs @@ -69,7 +69,7 @@ public static ShortCodeResource Fetch(FetchShortCodeOptions options, ITwilioRest /// Fetch ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task FetchAsync(FetchShortCodeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchShortCodeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static ShortCodeResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ShortCode resource(s) to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchShortCodeOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -136,7 +136,7 @@ public static ResourceSet Read(ReadShortCodeOptions options, /// Read ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task> ReadAsync(ReadShortCodeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadShortCodeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -180,7 +180,7 @@ public static async System.Threading.Tasks.Task> string shortCode = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadShortCodeOptions(){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, ShortCode = shortCode, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -274,7 +274,7 @@ public static ShortCodeResource Update(UpdateShortCodeOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateShortCodeOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -329,7 +329,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( Twilio.Http.HttpMethod smsMethod = null, Uri smsFallbackUrl = null, Twilio.Http.HttpMethod smsFallbackMethod = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateShortCodeOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, ApiVersion = apiVersion, SmsUrl = smsUrl, SmsMethod = smsMethod, SmsFallbackUrl = smsFallbackUrl, SmsFallbackMethod = smsFallbackMethod }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/SigningKeyResource.cs b/src/Twilio/Rest/Api/V2010/Account/SigningKeyResource.cs index 47b5d316a..e1a59d20a 100644 --- a/src/Twilio/Rest/Api/V2010/Account/SigningKeyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/SigningKeyResource.cs @@ -75,7 +75,7 @@ public static bool Delete(DeleteSigningKeyOptions options, ITwilioRestClient cli /// Task that resolves to A single instance of SigningKey public static async System.Threading.Tasks.Task DeleteAsync(DeleteSigningKeyOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -100,7 +100,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// /// Client to make requests to Twilio /// Task that resolves to A single instance of SigningKey - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSigningKeyOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -142,7 +142,7 @@ public static SigningKeyResource Fetch(FetchSigningKeyOptions options, ITwilioRe /// Fetch SigningKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SigningKey - public static async System.Threading.Tasks.Task FetchAsync(FetchSigningKeyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSigningKeyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -169,7 +169,7 @@ public static SigningKeyResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of SigningKey - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSigningKeyOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -209,7 +209,7 @@ public static ResourceSet Read(ReadSigningKeyOptions options /// Read SigningKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SigningKey - public static async System.Threading.Tasks.Task> ReadAsync(ReadSigningKeyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSigningKeyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static async System.Threading.Tasks.Task> string pathAccountSid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSigningKeyOptions(){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -339,7 +339,7 @@ public static SigningKeyResource Update(UpdateSigningKeyOptions options, ITwilio #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSigningKeyOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -374,7 +374,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string pathAccountSid = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSigningKeyOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialResource.cs b/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialResource.cs index 935c89aba..61a43e0c2 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialResource.cs @@ -70,7 +70,7 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio /// Create Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string username, string password, string pathAccountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCredentialOptions(pathCredentialListSid, username, password){ PathAccountSid = pathAccountSid }; return await CreateAsync(options, client, cancellationToken); @@ -159,7 +159,7 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli /// Task that resolves to A single instance of Credential public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -186,7 +186,7 @@ public static bool Delete(string pathCredentialListSid, string pathSid, string p /// The unique id of the Account that is responsible for this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task DeleteAsync(string pathCredentialListSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathCredentialListSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCredentialOptions(pathCredentialListSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe /// Fetch Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -260,7 +260,7 @@ public static CredentialResource Fetch( /// The unique id of the Account that is responsible for this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(string pathCredentialListSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathCredentialListSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCredentialOptions(pathCredentialListSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadCredentialOptions options /// Read Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -342,7 +342,7 @@ public static async System.Threading.Tasks.Task> string pathAccountSid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCredentialOptions(pathCredentialListSid){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -438,7 +438,7 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -477,7 +477,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string pathAccountSid = null, string password = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateCredentialOptions(pathCredentialListSid, pathSid){ PathAccountSid = pathAccountSid, Password = password }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListResource.cs b/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListResource.cs index 5845621b5..ca894ebe2 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListResource.cs @@ -68,7 +68,7 @@ public static CredentialListResource Create(CreateCredentialListOptions options, /// Create CredentialList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialListOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); @@ -99,7 +99,7 @@ public static CredentialListResource Create( public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, string pathAccountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCredentialListOptions(friendlyName){ PathAccountSid = pathAccountSid }; return await CreateAsync(options, client); @@ -146,7 +146,7 @@ public static bool Delete(DeleteCredentialListOptions options, ITwilioRestClient /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialListOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); @@ -171,7 +171,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The unique id of the Account that is responsible for this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCredentialListOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client); @@ -213,7 +213,7 @@ public static CredentialListResource Fetch(FetchCredentialListOptions options, I /// Fetch CredentialList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialListOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -240,7 +240,7 @@ public static CredentialListResource Fetch( /// The unique id of the Account that is responsible for this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCredentialListOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client); @@ -280,7 +280,7 @@ public static ResourceSet Read(ReadCredentialListOptions /// Read CredentialList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialListOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialListOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -316,7 +316,7 @@ public static async System.Threading.Tasks.Task Task that resolves to A single instance of CredentialList #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialListOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -444,7 +444,7 @@ public static async System.Threading.Tasks.Task UpdateAs string pathSid, string friendlyName, string pathAccountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateCredentialListOptions(pathSid, friendlyName){ PathAccountSid = pathAccountSid }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingResource.cs b/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingResource.cs index 391227ae4..575afcb0e 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingResource.cs @@ -70,7 +70,7 @@ public static AuthCallsCredentialListMappingResource Create(CreateAuthCallsCrede /// Create AuthCallsCredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsCredentialListMapping - public static async System.Threading.Tasks.Task CreateAsync(CreateAuthCallsCredentialListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAuthCallsCredentialListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task Task that resolves to A single instance of AuthCallsCredentialListMapping public static async System.Threading.Tasks.Task DeleteAsync(DeleteAuthCallsCredentialListMappingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -182,7 +182,7 @@ public static bool Delete(string pathDomainSid, string pathSid, string pathAccou /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsCredentialListMapping - public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAuthCallsCredentialListMappingOptions(pathDomainSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -226,7 +226,7 @@ public static AuthCallsCredentialListMappingResource Fetch(FetchAuthCallsCredent /// Fetch AuthCallsCredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsCredentialListMapping - public static async System.Threading.Tasks.Task FetchAsync(FetchAuthCallsCredentialListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAuthCallsCredentialListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -256,7 +256,7 @@ public static AuthCallsCredentialListMappingResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsCredentialListMapping - public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAuthCallsCredentialListMappingOptions(pathDomainSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -298,7 +298,7 @@ public static ResourceSet Read(ReadAuthC /// Read AuthCallsCredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsCredentialListMapping - public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthCallsCredentialListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthCallsCredentialListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -338,7 +338,7 @@ public static async System.Threading.Tasks.Task Create AuthCallsIpAccessControlListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsIpAccessControlListMapping - public static async System.Threading.Tasks.Task CreateAsync(CreateAuthCallsIpAccessControlListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAuthCallsIpAccessControlListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task Task that resolves to A single instance of AuthCallsIpAccessControlListMapping public static async System.Threading.Tasks.Task DeleteAsync(DeleteAuthCallsIpAccessControlListMappingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -182,7 +182,7 @@ public static bool Delete(string pathDomainSid, string pathSid, string pathAccou /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IpAccessControlListMapping resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsIpAccessControlListMapping - public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAuthCallsIpAccessControlListMappingOptions(pathDomainSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -226,7 +226,7 @@ public static AuthCallsIpAccessControlListMappingResource Fetch(FetchAuthCallsIp /// Fetch AuthCallsIpAccessControlListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsIpAccessControlListMapping - public static async System.Threading.Tasks.Task FetchAsync(FetchAuthCallsIpAccessControlListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAuthCallsIpAccessControlListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -256,7 +256,7 @@ public static AuthCallsIpAccessControlListMappingResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IpAccessControlListMapping resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsIpAccessControlListMapping - public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAuthCallsIpAccessControlListMappingOptions(pathDomainSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -298,7 +298,7 @@ public static ResourceSet Read(Read /// Read AuthCallsIpAccessControlListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthCallsIpAccessControlListMapping - public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthCallsIpAccessControlListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthCallsIpAccessControlListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -338,7 +338,7 @@ public static async System.Threading.Tasks.Task Create AuthRegistrationsCredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthRegistrationsCredentialListMapping - public static async System.Threading.Tasks.Task CreateAsync(CreateAuthRegistrationsCredentialListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAuthRegistrationsCredentialListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task Task that resolves to A single instance of AuthRegistrationsCredentialListMapping public static async System.Threading.Tasks.Task DeleteAsync(DeleteAuthRegistrationsCredentialListMappingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -182,7 +182,7 @@ public static bool Delete(string pathDomainSid, string pathSid, string pathAccou /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthRegistrationsCredentialListMapping - public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAuthRegistrationsCredentialListMappingOptions(pathDomainSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -226,7 +226,7 @@ public static AuthRegistrationsCredentialListMappingResource Fetch(FetchAuthRegi /// Fetch AuthRegistrationsCredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthRegistrationsCredentialListMapping - public static async System.Threading.Tasks.Task FetchAsync(FetchAuthRegistrationsCredentialListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAuthRegistrationsCredentialListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -256,7 +256,7 @@ public static AuthRegistrationsCredentialListMappingResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthRegistrationsCredentialListMapping - public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAuthRegistrationsCredentialListMappingOptions(pathDomainSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -298,7 +298,7 @@ public static ResourceSet Read(R /// Read AuthRegistrationsCredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthRegistrationsCredentialListMapping - public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthRegistrationsCredentialListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthRegistrationsCredentialListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -338,7 +338,7 @@ public static async System.Threading.Tasks.Task Create CredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialListMapping - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task C string pathDomainSid, string credentialListSid, string pathAccountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCredentialListMappingOptions(pathDomainSid, credentialListSid){ PathAccountSid = pathAccountSid }; return await CreateAsync(options, client, cancellationToken); @@ -155,7 +155,7 @@ public static bool Delete(DeleteCredentialListMappingOptions options, ITwilioRes /// Task that resolves to A single instance of CredentialListMapping public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialListMappingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -182,7 +182,7 @@ public static bool Delete(string pathDomainSid, string pathSid, string pathAccou /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialListMapping - public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCredentialListMappingOptions(pathDomainSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -226,7 +226,7 @@ public static CredentialListMappingResource Fetch(FetchCredentialListMappingOpti /// Fetch CredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialListMapping - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -256,7 +256,7 @@ public static CredentialListMappingResource Fetch( /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialListMapping - public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCredentialListMappingOptions(pathDomainSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -298,7 +298,7 @@ public static ResourceSet Read(ReadCredentialList /// Read CredentialListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialListMapping - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -338,7 +338,7 @@ public static async System.Threading.Tasks.Task Create IpAccessControlListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlListMapping - public static async System.Threading.Tasks.Task CreateAsync(CreateIpAccessControlListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateIpAccessControlListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task Task that resolves to A single instance of IpAccessControlListMapping public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpAccessControlListMappingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -182,7 +182,7 @@ public static bool Delete(string pathDomainSid, string pathSid, string pathAccou /// The unique id of the Account that is responsible for this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlListMapping - public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteIpAccessControlListMappingOptions(pathDomainSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -226,7 +226,7 @@ public static IpAccessControlListMappingResource Fetch(FetchIpAccessControlListM /// Fetch IpAccessControlListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlListMapping - public static async System.Threading.Tasks.Task FetchAsync(FetchIpAccessControlListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchIpAccessControlListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -256,7 +256,7 @@ public static IpAccessControlListMappingResource Fetch( /// The unique id of the Account that is responsible for this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlListMapping - public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchIpAccessControlListMappingOptions(pathDomainSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -298,7 +298,7 @@ public static ResourceSet Read(ReadIpAccessC /// Read IpAccessControlListMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlListMapping - public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAccessControlListMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAccessControlListMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -338,7 +338,7 @@ public static async System.Threading.Tasks.Task Create Domain parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Domain - public static async System.Threading.Tasks.Task CreateAsync(CreateDomainOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateDomainOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); @@ -147,7 +147,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? secure = null, string byocTrunkSid = null, string emergencyCallerSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateDomainOptions(domainName){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, VoiceUrl = voiceUrl, VoiceMethod = voiceMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceFallbackMethod = voiceFallbackMethod, VoiceStatusCallbackUrl = voiceStatusCallbackUrl, VoiceStatusCallbackMethod = voiceStatusCallbackMethod, SipRegistration = sipRegistration, EmergencyCallingEnabled = emergencyCallingEnabled, Secure = secure, ByocTrunkSid = byocTrunkSid, EmergencyCallerSid = emergencyCallerSid }; return await CreateAsync(options, client); @@ -194,7 +194,7 @@ public static bool Delete(DeleteDomainOptions options, ITwilioRestClient client /// Client to make requests to Twilio /// Task that resolves to A single instance of Domain public static async System.Threading.Tasks.Task DeleteAsync(DeleteDomainOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); @@ -219,7 +219,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the SipDomain resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Domain - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteDomainOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client); @@ -261,7 +261,7 @@ public static DomainResource Fetch(FetchDomainOptions options, ITwilioRestClient /// Fetch Domain parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Domain - public static async System.Threading.Tasks.Task FetchAsync(FetchDomainOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchDomainOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -288,7 +288,7 @@ public static DomainResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the SipDomain resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Domain - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDomainOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client); @@ -328,7 +328,7 @@ public static ResourceSet Read(ReadDomainOptions options, ITwili /// Read Domain parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Domain - public static async System.Threading.Tasks.Task> ReadAsync(ReadDomainOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDomainOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -364,7 +364,7 @@ public static async System.Threading.Tasks.Task> Rea string pathAccountSid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadDomainOptions(){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); @@ -457,7 +457,7 @@ public static DomainResource Update(UpdateDomainOptions options, ITwilioRestClie /// Task that resolves to A single instance of Domain #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateDomainOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -540,7 +540,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? secure = null, string byocTrunkSid = null, string emergencyCallerSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateDomainOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceStatusCallbackMethod = voiceStatusCallbackMethod, VoiceStatusCallbackUrl = voiceStatusCallbackUrl, VoiceUrl = voiceUrl, SipRegistration = sipRegistration, DomainName = domainName, EmergencyCallingEnabled = emergencyCallingEnabled, Secure = secure, ByocTrunkSid = byocTrunkSid, EmergencyCallerSid = emergencyCallerSid }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressResource.cs b/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressResource.cs index dc3e2d44f..43e1d8b4d 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressResource.cs @@ -70,7 +70,7 @@ public static IpAddressResource Create(CreateIpAddressOptions options, ITwilioRe /// Create IpAddress parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAddress - public static async System.Threading.Tasks.Task CreateAsync(CreateIpAddressOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateIpAddressOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -113,7 +113,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string ipAddress, string pathAccountSid = null, int? cidrPrefixLength = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateIpAddressOptions(pathIpAccessControlListSid, friendlyName, ipAddress){ PathAccountSid = pathAccountSid, CidrPrefixLength = cidrPrefixLength }; return await CreateAsync(options, client, cancellationToken); @@ -163,7 +163,7 @@ public static bool Delete(DeleteIpAddressOptions options, ITwilioRestClient clie /// Task that resolves to A single instance of IpAddress public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpAddressOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -190,7 +190,7 @@ public static bool Delete(string pathIpAccessControlListSid, string pathSid, str /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAddress - public static async System.Threading.Tasks.Task DeleteAsync(string pathIpAccessControlListSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathIpAccessControlListSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteIpAddressOptions(pathIpAccessControlListSid, pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -234,7 +234,7 @@ public static IpAddressResource Fetch(FetchIpAddressOptions options, ITwilioRest /// Fetch IpAddress parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAddress - public static async System.Threading.Tasks.Task FetchAsync(FetchIpAddressOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchIpAddressOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -264,7 +264,7 @@ public static IpAddressResource Fetch( /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAddress - public static async System.Threading.Tasks.Task FetchAsync(string pathIpAccessControlListSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathIpAccessControlListSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchIpAddressOptions(pathIpAccessControlListSid, pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -306,7 +306,7 @@ public static ResourceSet Read(ReadIpAddressOptions options, /// Read IpAddress parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAddress - public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAddressOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAddressOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -346,7 +346,7 @@ public static async System.Threading.Tasks.Task> string pathAccountSid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadIpAddressOptions(pathIpAccessControlListSid){ PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -442,7 +442,7 @@ public static IpAddressResource Update(UpdateIpAddressOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateIpAddressOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -489,7 +489,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string ipAddress = null, string friendlyName = null, int? cidrPrefixLength = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateIpAddressOptions(pathIpAccessControlListSid, pathSid){ PathAccountSid = pathAccountSid, IpAddress = ipAddress, FriendlyName = friendlyName, CidrPrefixLength = cidrPrefixLength }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListResource.cs b/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListResource.cs index ed96dbb9c..c591f6f70 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListResource.cs @@ -68,7 +68,7 @@ public static IpAccessControlListResource Create(CreateIpAccessControlListOption /// Create IpAccessControlList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task CreateAsync(CreateIpAccessControlListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateIpAccessControlListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static IpAccessControlListResource Create( public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, string pathAccountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateIpAccessControlListOptions(friendlyName){ PathAccountSid = pathAccountSid }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteIpAccessControlListOptions options, ITwilioRestC /// Task that resolves to A single instance of IpAccessControlList public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpAccessControlListOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteIpAccessControlListOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static IpAccessControlListResource Fetch(FetchIpAccessControlListOptions /// Fetch IpAccessControlList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task FetchAsync(FetchIpAccessControlListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchIpAccessControlListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static IpAccessControlListResource Fetch( /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchIpAccessControlListOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadIpAccessControlL /// Read IpAccessControlList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAccessControlListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAccessControlListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateIpAccessControlListOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -446,7 +446,7 @@ public static async System.Threading.Tasks.Task Upd string pathSid, string friendlyName, string pathAccountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateIpAccessControlListOptions(pathSid, friendlyName){ PathAccountSid = pathAccountSid }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/TokenResource.cs b/src/Twilio/Rest/Api/V2010/Account/TokenResource.cs index 244ce4fbc..4aa0b70f3 100644 --- a/src/Twilio/Rest/Api/V2010/Account/TokenResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/TokenResource.cs @@ -68,7 +68,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTokenOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static TokenResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathAccountSid = null, int? ttl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTokenOptions(){ PathAccountSid = pathAccountSid, Ttl = ttl }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/TranscriptionResource.cs b/src/Twilio/Rest/Api/V2010/Account/TranscriptionResource.cs index 9e6b01315..c81175d8d 100644 --- a/src/Twilio/Rest/Api/V2010/Account/TranscriptionResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/TranscriptionResource.cs @@ -89,7 +89,7 @@ public static bool Delete(DeleteTranscriptionOptions options, ITwilioRestClient /// Task that resolves to A single instance of Transcription public static async System.Threading.Tasks.Task DeleteAsync(DeleteTranscriptionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -114,7 +114,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcription - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteTranscriptionOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -156,7 +156,7 @@ public static TranscriptionResource Fetch(FetchTranscriptionOptions options, ITw /// Fetch Transcription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcription - public static async System.Threading.Tasks.Task FetchAsync(FetchTranscriptionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTranscriptionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -183,7 +183,7 @@ public static TranscriptionResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcription - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTranscriptionOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -223,7 +223,7 @@ public static ResourceSet Read(ReadTranscriptionOptions o /// Read Transcription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcription - public static async System.Threading.Tasks.Task> ReadAsync(ReadTranscriptionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTranscriptionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -259,7 +259,7 @@ public static async System.Threading.Tasks.Task Read(ReadAllTimeOptions options, ITwi /// Read AllTime parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AllTime - public static async System.Threading.Tasks.Task> ReadAsync(ReadAllTimeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAllTimeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -381,7 +381,7 @@ public static async System.Threading.Tasks.Task> Re bool? includeSubaccounts = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAllTimeOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyResource.cs index 13ef5d8b7..79e1f4d33 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyResource.cs @@ -329,7 +329,7 @@ public static ResourceSet Read(ReadDailyOptions options, ITwilioR /// Read Daily parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Daily - public static async System.Threading.Tasks.Task> ReadAsync(ReadDailyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDailyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -381,7 +381,7 @@ public static async System.Threading.Tasks.Task> Read bool? includeSubaccounts = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadDailyOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthResource.cs index 0e0aaec9f..2f0814ea3 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthResource.cs @@ -329,7 +329,7 @@ public static ResourceSet Read(ReadLastMonthOptions options, /// Read LastMonth parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of LastMonth - public static async System.Threading.Tasks.Task> ReadAsync(ReadLastMonthOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadLastMonthOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -381,7 +381,7 @@ public static async System.Threading.Tasks.Task> bool? includeSubaccounts = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadLastMonthOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyResource.cs index d67347c08..e2f7cae7f 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyResource.cs @@ -329,7 +329,7 @@ public static ResourceSet Read(ReadMonthlyOptions options, ITwi /// Read Monthly parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Monthly - public static async System.Threading.Tasks.Task> ReadAsync(ReadMonthlyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMonthlyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -381,7 +381,7 @@ public static async System.Threading.Tasks.Task> Re bool? includeSubaccounts = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMonthlyOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthResource.cs index 6abceae22..93dc46af4 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthResource.cs @@ -329,7 +329,7 @@ public static ResourceSet Read(ReadThisMonthOptions options, /// Read ThisMonth parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ThisMonth - public static async System.Threading.Tasks.Task> ReadAsync(ReadThisMonthOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadThisMonthOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -381,7 +381,7 @@ public static async System.Threading.Tasks.Task> bool? includeSubaccounts = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadThisMonthOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayResource.cs index c943679c1..a1653d0b5 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayResource.cs @@ -329,7 +329,7 @@ public static ResourceSet Read(ReadTodayOptions options, ITwilioR /// Read Today parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Today - public static async System.Threading.Tasks.Task> ReadAsync(ReadTodayOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTodayOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -381,7 +381,7 @@ public static async System.Threading.Tasks.Task> Read bool? includeSubaccounts = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadTodayOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyResource.cs index 70efd17c1..da4794aef 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyResource.cs @@ -329,7 +329,7 @@ public static ResourceSet Read(ReadYearlyOptions options, ITwili /// Read Yearly parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Yearly - public static async System.Threading.Tasks.Task> ReadAsync(ReadYearlyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadYearlyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -381,7 +381,7 @@ public static async System.Threading.Tasks.Task> Rea bool? includeSubaccounts = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadYearlyOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayResource.cs index 4da3138d4..d59e93fce 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayResource.cs @@ -329,7 +329,7 @@ public static ResourceSet Read(ReadYesterdayOptions options, /// Read Yesterday parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Yesterday - public static async System.Threading.Tasks.Task> ReadAsync(ReadYesterdayOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadYesterdayOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -381,7 +381,7 @@ public static async System.Threading.Tasks.Task> bool? includeSubaccounts = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadYesterdayOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/RecordResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/RecordResource.cs index 49a392f6a..f6a90c0e0 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/RecordResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/RecordResource.cs @@ -329,7 +329,7 @@ public static ResourceSet Read(ReadRecordOptions options, ITwili /// Read Record parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Record - public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -381,7 +381,7 @@ public static async System.Threading.Tasks.Task> Rea bool? includeSubaccounts = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRecordOptions(){ PathAccountSid = pathAccountSid, Category = category, StartDate = startDate, EndDate = endDate, IncludeSubaccounts = includeSubaccounts, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerResource.cs index 769a25c5f..1bb5aa572 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerResource.cs @@ -359,7 +359,7 @@ public static TriggerResource Create(CreateTriggerOptions options, ITwilioRestCl /// Create Trigger parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Trigger - public static async System.Threading.Tasks.Task CreateAsync(CreateTriggerOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTriggerOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -414,7 +414,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string friendlyName = null, TriggerResource.RecurringEnum recurring = null, TriggerResource.TriggerFieldEnum triggerBy = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTriggerOptions(callbackUrl, triggerValue, usageCategory){ PathAccountSid = pathAccountSid, CallbackMethod = callbackMethod, FriendlyName = friendlyName, Recurring = recurring, TriggerBy = triggerBy }; return await CreateAsync(options, client, cancellationToken); @@ -462,7 +462,7 @@ public static bool Delete(DeleteTriggerOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Trigger public static async System.Threading.Tasks.Task DeleteAsync(DeleteTriggerOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -487,7 +487,7 @@ public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioR /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageTrigger resources to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Trigger - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteTriggerOptions(pathSid) { PathAccountSid = pathAccountSid }; return await DeleteAsync(options, client, cancellationToken); @@ -529,7 +529,7 @@ public static TriggerResource Fetch(FetchTriggerOptions options, ITwilioRestClie /// Fetch Trigger parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Trigger - public static async System.Threading.Tasks.Task FetchAsync(FetchTriggerOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTriggerOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -556,7 +556,7 @@ public static TriggerResource Fetch( /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageTrigger resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Trigger - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTriggerOptions(pathSid){ PathAccountSid = pathAccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -596,7 +596,7 @@ public static ResourceSet Read(ReadTriggerOptions options, ITwi /// Read Trigger parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Trigger - public static async System.Threading.Tasks.Task> ReadAsync(ReadTriggerOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTriggerOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -644,7 +644,7 @@ public static async System.Threading.Tasks.Task> Re TriggerResource.UsageCategoryEnum usageCategory = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadTriggerOptions(){ PathAccountSid = pathAccountSid, Recurring = recurring, TriggerBy = triggerBy, UsageCategory = usageCategory, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -738,7 +738,7 @@ public static TriggerResource Update(UpdateTriggerOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateTriggerOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -781,7 +781,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( Twilio.Http.HttpMethod callbackMethod = null, Uri callbackUrl = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateTriggerOptions(pathSid){ PathAccountSid = pathAccountSid, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/Account/ValidationRequestResource.cs b/src/Twilio/Rest/Api/V2010/Account/ValidationRequestResource.cs index e0fc01abd..f5eb04635 100644 --- a/src/Twilio/Rest/Api/V2010/Account/ValidationRequestResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/ValidationRequestResource.cs @@ -68,7 +68,7 @@ public static ValidationRequestResource Create(CreateValidationRequestOptions op /// Create ValidationRequest parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ValidationRequest - public static async System.Threading.Tasks.Task CreateAsync(CreateValidationRequestOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateValidationRequestOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -119,7 +119,7 @@ public static async System.Threading.Tasks.Task Creat string extension = null, Uri statusCallback = null, Twilio.Http.HttpMethod statusCallbackMethod = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateValidationRequestOptions(phoneNumber){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, CallDelay = callDelay, Extension = extension, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Api/V2010/AccountResource.cs b/src/Twilio/Rest/Api/V2010/AccountResource.cs index 16292a686..30351b7b4 100644 --- a/src/Twilio/Rest/Api/V2010/AccountResource.cs +++ b/src/Twilio/Rest/Api/V2010/AccountResource.cs @@ -93,7 +93,7 @@ public static AccountResource Create(CreateAccountOptions options, ITwilioRestCl /// Create Account parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Account - public static async System.Threading.Tasks.Task CreateAsync(CreateAccountOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAccountOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -120,7 +120,8 @@ public static AccountResource Create( /// Task that resolves to A single instance of Account public static async System.Threading.Tasks.Task CreateAsync( string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAccountOptions(){ FriendlyName = friendlyName }; return await CreateAsync(options, client, cancellationToken); @@ -160,7 +161,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAccountOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -184,7 +185,9 @@ public static AccountResource Fetch( /// The Account Sid that uniquely identifies the account to fetch /// Client to make requests to Twilio /// Task that resolves to A single instance of Account - public static async System.Threading.Tasks.Task FetchAsync(string pathSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid = null, + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAccountOptions(){ PathSid = pathSid }; return await FetchAsync(options, client, cancellationToken); @@ -222,7 +225,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAccountOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -262,7 +265,8 @@ public static async System.Threading.Tasks.Task> Re AccountResource.StatusEnum status = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAccountOptions(){ FriendlyName = friendlyName, Status = status, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -354,7 +358,7 @@ public static AccountResource Update(UpdateAccountOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateAccountOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -389,7 +393,8 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid = null, string friendlyName = null, AccountResource.StatusEnum status = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateAccountOptions(){ PathSid = pathSid, FriendlyName = friendlyName, Status = status }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Assistants/V1/Assistant/AssistantsKnowledgeResource.cs b/src/Twilio/Rest/Assistants/V1/Assistant/AssistantsKnowledgeResource.cs index 1c03d2d34..0017db737 100644 --- a/src/Twilio/Rest/Assistants/V1/Assistant/AssistantsKnowledgeResource.cs +++ b/src/Twilio/Rest/Assistants/V1/Assistant/AssistantsKnowledgeResource.cs @@ -70,7 +70,7 @@ public static AssistantsKnowledgeResource Create(CreateAssistantsKnowledgeOption /// Create AssistantsKnowledge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssistantsKnowledge - public static async System.Threading.Tasks.Task CreateAsync(CreateAssistantsKnowledgeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAssistantsKnowledgeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static AssistantsKnowledgeResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathAssistantId, string pathId, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAssistantsKnowledgeOptions(pathAssistantId, pathId){ }; return await CreateAsync(options, client, cancellationToken); @@ -149,7 +149,7 @@ public static bool Delete(DeleteAssistantsKnowledgeOptions options, ITwilioRestC /// Task that resolves to A single instance of AssistantsKnowledge public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssistantsKnowledgeOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -174,7 +174,7 @@ public static bool Delete(string pathAssistantId, string pathId, ITwilioRestClie /// The knowledge ID. /// Client to make requests to Twilio /// Task that resolves to A single instance of AssistantsKnowledge - public static async System.Threading.Tasks.Task DeleteAsync(string pathAssistantId, string pathId, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathAssistantId, string pathId, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAssistantsKnowledgeOptions(pathAssistantId, pathId) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static ResourceSet Read(ReadAssistantsKnowle /// Read AssistantsKnowledge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssistantsKnowledge - public static async System.Threading.Tasks.Task> ReadAsync(ReadAssistantsKnowledgeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAssistantsKnowledgeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -250,7 +250,7 @@ public static async System.Threading.Tasks.Task Create AssistantsTool parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssistantsTool - public static async System.Threading.Tasks.Task CreateAsync(CreateAssistantsToolOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAssistantsToolOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static AssistantsToolResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathAssistantId, string pathId, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAssistantsToolOptions(pathAssistantId, pathId){ }; return await CreateAsync(options, client, cancellationToken); @@ -149,7 +149,7 @@ public static bool Delete(DeleteAssistantsToolOptions options, ITwilioRestClient /// Task that resolves to A single instance of AssistantsTool public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssistantsToolOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -174,7 +174,7 @@ public static bool Delete(string pathAssistantId, string pathId, ITwilioRestClie /// The tool ID. /// Client to make requests to Twilio /// Task that resolves to A single instance of AssistantsTool - public static async System.Threading.Tasks.Task DeleteAsync(string pathAssistantId, string pathId, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathAssistantId, string pathId, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAssistantsToolOptions(pathAssistantId, pathId) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static ResourceSet Read(ReadAssistantsToolOptions /// Read AssistantsTool parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AssistantsTool - public static async System.Threading.Tasks.Task> ReadAsync(ReadAssistantsToolOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAssistantsToolOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -250,7 +250,7 @@ public static async System.Threading.Tasks.Task Create Feedback parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Feedback - public static async System.Threading.Tasks.Task CreateAsync(CreateFeedbackOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateFeedbackOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -143,7 +143,7 @@ public static FeedbackResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathId, FeedbackResource.AssistantsV1ServiceCreateFeedbackRequest assistantsV1ServiceCreateFeedbackRequest, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateFeedbackOptions(pathId, assistantsV1ServiceCreateFeedbackRequest){ }; return await CreateAsync(options, client, cancellationToken); @@ -183,7 +183,7 @@ public static ResourceSet Read(ReadFeedbackOptions options, IT /// Read Feedback parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Feedback - public static async System.Threading.Tasks.Task> ReadAsync(ReadFeedbackOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFeedbackOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -219,7 +219,7 @@ public static async System.Threading.Tasks.Task> R string pathId, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadFeedbackOptions(pathId){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Assistants/V1/Assistant/MessageResource.cs b/src/Twilio/Rest/Assistants/V1/Assistant/MessageResource.cs index 2d21ff40a..dd9056de0 100644 --- a/src/Twilio/Rest/Assistants/V1/Assistant/MessageResource.cs +++ b/src/Twilio/Rest/Assistants/V1/Assistant/MessageResource.cs @@ -119,7 +119,7 @@ public static MessageResource Create(CreateMessageOptions options, ITwilioRestCl /// Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -150,7 +150,7 @@ public static MessageResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathId, MessageResource.AssistantsV1ServiceAssistantSendMessageRequest assistantsV1ServiceAssistantSendMessageRequest, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMessageOptions(pathId, assistantsV1ServiceAssistantSendMessageRequest){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Assistants/V1/AssistantResource.cs b/src/Twilio/Rest/Assistants/V1/AssistantResource.cs index 794a427cb..43e7550ae 100644 --- a/src/Twilio/Rest/Assistants/V1/AssistantResource.cs +++ b/src/Twilio/Rest/Assistants/V1/AssistantResource.cs @@ -416,7 +416,7 @@ public static AssistantResource Create(CreateAssistantOptions options, ITwilioRe /// Create Assistant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task CreateAsync(CreateAssistantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAssistantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -443,7 +443,7 @@ public static AssistantResource Create( /// Task that resolves to A single instance of Assistant public static async System.Threading.Tasks.Task CreateAsync( AssistantResource.AssistantsV1ServiceCreateAssistantRequest assistantsV1ServiceCreateAssistantRequest, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAssistantOptions(assistantsV1ServiceCreateAssistantRequest){ }; return await CreateAsync(options, client, cancellationToken); @@ -489,7 +489,7 @@ public static bool Delete(DeleteAssistantOptions options, ITwilioRestClient clie /// Task that resolves to A single instance of Assistant public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssistantOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -512,7 +512,7 @@ public static bool Delete(string pathId, ITwilioRestClient client = null) /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task DeleteAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathId, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAssistantOptions(pathId) ; return await DeleteAsync(options, client, cancellationToken); @@ -552,7 +552,7 @@ public static AssistantResource Fetch(FetchAssistantOptions options, ITwilioRest /// Fetch Assistant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task FetchAsync(FetchAssistantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAssistantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -576,7 +576,7 @@ public static AssistantResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAssistantOptions(pathId){ }; return await FetchAsync(options, client, cancellationToken); @@ -614,7 +614,7 @@ public static ResourceSet Read(ReadAssistantOptions options, /// Read Assistant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task> ReadAsync(ReadAssistantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAssistantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -646,7 +646,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAssistantOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -739,7 +739,7 @@ public static AssistantResource Update(UpdateAssistantOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateAssistantOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -766,7 +766,7 @@ public static AssistantResource Update( /// Task that resolves to A single instance of Assistant public static async System.Threading.Tasks.Task UpdateAsync( string pathId, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateAssistantOptions(pathId){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Assistants/V1/Knowledge/ChunkResource.cs b/src/Twilio/Rest/Assistants/V1/Knowledge/ChunkResource.cs index 2332b7210..ef8fbb781 100644 --- a/src/Twilio/Rest/Assistants/V1/Knowledge/ChunkResource.cs +++ b/src/Twilio/Rest/Assistants/V1/Knowledge/ChunkResource.cs @@ -67,7 +67,7 @@ public static ResourceSet Read(ReadChunkOptions options, ITwilioR /// Read Chunk parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Chunk - public static async System.Threading.Tasks.Task> ReadAsync(ReadChunkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChunkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task> Read string pathId, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadChunkOptions(pathId){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Assistants/V1/Knowledge/KnowledgeStatusResource.cs b/src/Twilio/Rest/Assistants/V1/Knowledge/KnowledgeStatusResource.cs index 801c1a32b..3687e4d6f 100644 --- a/src/Twilio/Rest/Assistants/V1/Knowledge/KnowledgeStatusResource.cs +++ b/src/Twilio/Rest/Assistants/V1/Knowledge/KnowledgeStatusResource.cs @@ -67,7 +67,7 @@ public static KnowledgeStatusResource Fetch(FetchKnowledgeStatusOptions options, /// Fetch KnowledgeStatus parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of KnowledgeStatus - public static async System.Threading.Tasks.Task FetchAsync(FetchKnowledgeStatusOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchKnowledgeStatusOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static KnowledgeStatusResource Fetch( /// the Knowledge ID. /// Client to make requests to Twilio /// Task that resolves to A single instance of KnowledgeStatus - public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchKnowledgeStatusOptions(pathId){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Assistants/V1/KnowledgeResource.cs b/src/Twilio/Rest/Assistants/V1/KnowledgeResource.cs index f66c70493..6b60a544d 100644 --- a/src/Twilio/Rest/Assistants/V1/KnowledgeResource.cs +++ b/src/Twilio/Rest/Assistants/V1/KnowledgeResource.cs @@ -238,7 +238,7 @@ public static KnowledgeResource Create(CreateKnowledgeOptions options, ITwilioRe /// Create Knowledge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Knowledge - public static async System.Threading.Tasks.Task CreateAsync(CreateKnowledgeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateKnowledgeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -265,7 +265,7 @@ public static KnowledgeResource Create( /// Task that resolves to A single instance of Knowledge public static async System.Threading.Tasks.Task CreateAsync( KnowledgeResource.AssistantsV1ServiceCreateKnowledgeRequest assistantsV1ServiceCreateKnowledgeRequest, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateKnowledgeOptions(assistantsV1ServiceCreateKnowledgeRequest){ }; return await CreateAsync(options, client, cancellationToken); @@ -311,7 +311,7 @@ public static bool Delete(DeleteKnowledgeOptions options, ITwilioRestClient clie /// Task that resolves to A single instance of Knowledge public static async System.Threading.Tasks.Task DeleteAsync(DeleteKnowledgeOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -334,7 +334,7 @@ public static bool Delete(string pathId, ITwilioRestClient client = null) /// the Knowledge ID. /// Client to make requests to Twilio /// Task that resolves to A single instance of Knowledge - public static async System.Threading.Tasks.Task DeleteAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathId, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteKnowledgeOptions(pathId) ; return await DeleteAsync(options, client, cancellationToken); @@ -374,7 +374,7 @@ public static KnowledgeResource Fetch(FetchKnowledgeOptions options, ITwilioRest /// Fetch Knowledge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Knowledge - public static async System.Threading.Tasks.Task FetchAsync(FetchKnowledgeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchKnowledgeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -398,7 +398,7 @@ public static KnowledgeResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Knowledge - public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchKnowledgeOptions(pathId){ }; return await FetchAsync(options, client, cancellationToken); @@ -436,7 +436,7 @@ public static ResourceSet Read(ReadKnowledgeOptions options, /// Read Knowledge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Knowledge - public static async System.Threading.Tasks.Task> ReadAsync(ReadKnowledgeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadKnowledgeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -472,7 +472,7 @@ public static async System.Threading.Tasks.Task> string assistantId = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadKnowledgeOptions(){ AssistantId = assistantId, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -565,7 +565,7 @@ public static KnowledgeResource Update(UpdateKnowledgeOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateKnowledgeOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -592,7 +592,7 @@ public static KnowledgeResource Update( /// Task that resolves to A single instance of Knowledge public static async System.Threading.Tasks.Task UpdateAsync( string pathId, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateKnowledgeOptions(pathId){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Assistants/V1/PolicyResource.cs b/src/Twilio/Rest/Assistants/V1/PolicyResource.cs index ff15ba305..c9ce25a3f 100644 --- a/src/Twilio/Rest/Assistants/V1/PolicyResource.cs +++ b/src/Twilio/Rest/Assistants/V1/PolicyResource.cs @@ -65,7 +65,7 @@ public static ResourceSet Read(ReadPolicyOptions options, ITwili /// Read Policy parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Policy - public static async System.Threading.Tasks.Task> ReadAsync(ReadPolicyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPolicyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task> Rea string knowledgeId = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadPolicyOptions(){ ToolId = toolId, KnowledgeId = knowledgeId, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Assistants/V1/Session/MessageResource.cs b/src/Twilio/Rest/Assistants/V1/Session/MessageResource.cs index 7ef3bdce7..0b7d677db 100644 --- a/src/Twilio/Rest/Assistants/V1/Session/MessageResource.cs +++ b/src/Twilio/Rest/Assistants/V1/Session/MessageResource.cs @@ -67,7 +67,7 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task> Re string pathSessionId, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMessageOptions(pathSessionId){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Assistants/V1/SessionResource.cs b/src/Twilio/Rest/Assistants/V1/SessionResource.cs index ea70c0b8d..8b8232cea 100644 --- a/src/Twilio/Rest/Assistants/V1/SessionResource.cs +++ b/src/Twilio/Rest/Assistants/V1/SessionResource.cs @@ -67,7 +67,7 @@ public static SessionResource Fetch(FetchSessionOptions options, ITwilioRestClie /// Fetch Session parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task FetchAsync(FetchSessionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSessionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static SessionResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSessionOptions(pathId){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadSessionOptions options, ITwi /// Read Session parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task> ReadAsync(ReadSessionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSessionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSessionOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Assistants/V1/ToolResource.cs b/src/Twilio/Rest/Assistants/V1/ToolResource.cs index 61ee20229..71aa505fc 100644 --- a/src/Twilio/Rest/Assistants/V1/ToolResource.cs +++ b/src/Twilio/Rest/Assistants/V1/ToolResource.cs @@ -323,7 +323,7 @@ public static ToolResource Create(CreateToolOptions options, ITwilioRestClient c /// Create Tool parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Tool - public static async System.Threading.Tasks.Task CreateAsync(CreateToolOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateToolOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -350,7 +350,7 @@ public static ToolResource Create( /// Task that resolves to A single instance of Tool public static async System.Threading.Tasks.Task CreateAsync( ToolResource.AssistantsV1ServiceCreateToolRequest assistantsV1ServiceCreateToolRequest, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateToolOptions(assistantsV1ServiceCreateToolRequest){ }; return await CreateAsync(options, client, cancellationToken); @@ -396,7 +396,7 @@ public static bool Delete(DeleteToolOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Tool public static async System.Threading.Tasks.Task DeleteAsync(DeleteToolOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -419,7 +419,7 @@ public static bool Delete(string pathId, ITwilioRestClient client = null) /// The tool ID. /// Client to make requests to Twilio /// Task that resolves to A single instance of Tool - public static async System.Threading.Tasks.Task DeleteAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathId, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteToolOptions(pathId) ; return await DeleteAsync(options, client, cancellationToken); @@ -459,7 +459,7 @@ public static ToolResource Fetch(FetchToolOptions options, ITwilioRestClient cli /// Fetch Tool parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Tool - public static async System.Threading.Tasks.Task FetchAsync(FetchToolOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchToolOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -483,7 +483,7 @@ public static ToolResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Tool - public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchToolOptions(pathId){ }; return await FetchAsync(options, client, cancellationToken); @@ -521,7 +521,7 @@ public static ResourceSet Read(ReadToolOptions options, ITwilioRes /// Read Tool parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Tool - public static async System.Threading.Tasks.Task> ReadAsync(ReadToolOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadToolOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -557,7 +557,7 @@ public static async System.Threading.Tasks.Task> ReadA string assistantId = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadToolOptions(){ AssistantId = assistantId, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -650,7 +650,7 @@ public static ToolResource Update(UpdateToolOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateToolOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -677,7 +677,7 @@ public static ToolResource Update( /// Task that resolves to A single instance of Tool public static async System.Threading.Tasks.Task UpdateAsync( string pathId, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateToolOptions(pathId){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Bulkexports/V1/Export/DayResource.cs b/src/Twilio/Rest/Bulkexports/V1/Export/DayResource.cs index dfdf7b0eb..047ce1b06 100644 --- a/src/Twilio/Rest/Bulkexports/V1/Export/DayResource.cs +++ b/src/Twilio/Rest/Bulkexports/V1/Export/DayResource.cs @@ -69,7 +69,7 @@ public static DayResource Fetch(FetchDayOptions options, ITwilioRestClient clien /// Fetch Day parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Day - public static async System.Threading.Tasks.Task FetchAsync(FetchDayOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDayOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static DayResource Fetch( /// The ISO 8601 format date of the resources in the file, for a UTC day /// Client to make requests to Twilio /// Task that resolves to A single instance of Day - public static async System.Threading.Tasks.Task FetchAsync(string pathResourceType, string pathDay, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathResourceType, string pathDay, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDayOptions(pathResourceType, pathDay){ }; return await FetchAsync(options, client, cancellationToken); @@ -136,7 +136,7 @@ public static ResourceSet Read(ReadDayOptions options, ITwilioRestC /// Read Day parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Day - public static async System.Threading.Tasks.Task> ReadAsync(ReadDayOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDayOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static async System.Threading.Tasks.Task> ReadAs string pathResourceType, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadDayOptions(pathResourceType){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobResource.cs b/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobResource.cs index fbd9089d7..f3265249f 100644 --- a/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobResource.cs +++ b/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobResource.cs @@ -68,7 +68,7 @@ public static ExportCustomJobResource Create(CreateExportCustomJobOptions option /// Create ExportCustomJob parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ExportCustomJob - public static async System.Threading.Tasks.Task CreateAsync(CreateExportCustomJobOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateExportCustomJobOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -119,7 +119,7 @@ public static async System.Threading.Tasks.Task CreateA string webhookUrl = null, string webhookMethod = null, string email = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateExportCustomJobOptions(pathResourceType, startDay, endDay, friendlyName){ WebhookUrl = webhookUrl, WebhookMethod = webhookMethod, Email = email }; return await CreateAsync(options, client, cancellationToken); @@ -159,7 +159,7 @@ public static ResourceSet Read(ReadExportCustomJobOptio /// Read ExportCustomJob parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ExportCustomJob - public static async System.Threading.Tasks.Task> ReadAsync(ReadExportCustomJobOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadExportCustomJobOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -195,7 +195,7 @@ public static async System.Threading.Tasks.Task Task that resolves to A single instance of Job public static async System.Threading.Tasks.Task DeleteAsync(DeleteJobOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static bool Delete(string pathJobSid, ITwilioRestClient client = null) /// The unique string that that we created to identify the Bulk Export job /// Client to make requests to Twilio /// Task that resolves to A single instance of Job - public static async System.Threading.Tasks.Task DeleteAsync(string pathJobSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathJobSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteJobOptions(pathJobSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -136,7 +136,7 @@ public static JobResource Fetch(FetchJobOptions options, ITwilioRestClient clien /// Fetch Job parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Job - public static async System.Threading.Tasks.Task FetchAsync(FetchJobOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchJobOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -160,7 +160,7 @@ public static JobResource Fetch( /// The unique string that that we created to identify the Bulk Export job /// Client to make requests to Twilio /// Task that resolves to A single instance of Job - public static async System.Threading.Tasks.Task FetchAsync(string pathJobSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathJobSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchJobOptions(pathJobSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationResource.cs b/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationResource.cs index 13e71978f..f4b620ffc 100644 --- a/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationResource.cs +++ b/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationResource.cs @@ -67,7 +67,7 @@ public static ExportConfigurationResource Fetch(FetchExportConfigurationOptions /// Fetch ExportConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ExportConfiguration - public static async System.Threading.Tasks.Task FetchAsync(FetchExportConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchExportConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static ExportConfigurationResource Fetch( /// The type of communication – Messages, Calls, Conferences, and Participants /// Client to make requests to Twilio /// Task that resolves to A single instance of ExportConfiguration - public static async System.Threading.Tasks.Task FetchAsync(string pathResourceType, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathResourceType, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchExportConfigurationOptions(pathResourceType){ }; return await FetchAsync(options, client, cancellationToken); @@ -134,7 +134,7 @@ public static ExportConfigurationResource Update(UpdateExportConfigurationOption #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateExportConfigurationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -173,7 +173,7 @@ public static async System.Threading.Tasks.Task Upd bool? enabled = null, Uri webhookUrl = null, string webhookMethod = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateExportConfigurationOptions(pathResourceType){ Enabled = enabled, WebhookUrl = webhookUrl, WebhookMethod = webhookMethod }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Bulkexports/V1/ExportResource.cs b/src/Twilio/Rest/Bulkexports/V1/ExportResource.cs index f092e5f48..56d8cc0b2 100644 --- a/src/Twilio/Rest/Bulkexports/V1/ExportResource.cs +++ b/src/Twilio/Rest/Bulkexports/V1/ExportResource.cs @@ -67,7 +67,7 @@ public static ExportResource Fetch(FetchExportOptions options, ITwilioRestClient /// Fetch Export parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Export - public static async System.Threading.Tasks.Task FetchAsync(FetchExportOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchExportOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static ExportResource Fetch( /// The type of communication – Messages, Calls, Conferences, and Participants /// Client to make requests to Twilio /// Task that resolves to A single instance of Export - public static async System.Threading.Tasks.Task FetchAsync(string pathResourceType, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathResourceType, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchExportOptions(pathResourceType){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Chat/V1/CredentialResource.cs b/src/Twilio/Rest/Chat/V1/CredentialResource.cs index 41697510a..892dcf442 100644 --- a/src/Twilio/Rest/Chat/V1/CredentialResource.cs +++ b/src/Twilio/Rest/Chat/V1/CredentialResource.cs @@ -80,7 +80,7 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio /// Create Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -131,7 +131,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? sandbox = null, string apiKey = null, string secret = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCredentialOptions(type){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; return await CreateAsync(options, client, cancellationToken); @@ -177,7 +177,7 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli /// Task that resolves to A single instance of Credential public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -200,7 +200,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the Credential resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCredentialOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -240,7 +240,7 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe /// Fetch Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -264,7 +264,7 @@ public static CredentialResource Fetch( /// The Twilio-provided string that uniquely identifies the Credential resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCredentialOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadCredentialOptions options /// Read Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -334,7 +334,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCredentialOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -426,7 +426,7 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -477,7 +477,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? sandbox = null, string apiKey = null, string secret = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateCredentialOptions(pathSid){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Chat/V1/Service/Channel/InviteResource.cs b/src/Twilio/Rest/Chat/V1/Service/Channel/InviteResource.cs index 8c4c40b05..fbcf37f2a 100644 --- a/src/Twilio/Rest/Chat/V1/Service/Channel/InviteResource.cs +++ b/src/Twilio/Rest/Chat/V1/Service/Channel/InviteResource.cs @@ -70,7 +70,7 @@ public static InviteResource Create(CreateInviteOptions options, ITwilioRestClie /// Create Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task CreateAsync(CreateInviteOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateInviteOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string pathChannelSid, string identity, string roleSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateInviteOptions(pathServiceSid, pathChannelSid, identity){ RoleSid = roleSid }; return await CreateAsync(options, client, cancellationToken); @@ -159,7 +159,7 @@ public static bool Delete(DeleteInviteOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Invite public static async System.Threading.Tasks.Task DeleteAsync(DeleteInviteOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -186,7 +186,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p /// The Twilio-provided string that uniquely identifies the Invite resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteInviteOptions(pathServiceSid, pathChannelSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ public static InviteResource Fetch(FetchInviteOptions options, ITwilioRestClient /// Fetch Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task FetchAsync(FetchInviteOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchInviteOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -260,7 +260,7 @@ public static InviteResource Fetch( /// The Twilio-provided string that uniquely identifies the Invite resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInviteOptions(pathServiceSid, pathChannelSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadInviteOptions options, ITwili /// Read Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task> ReadAsync(ReadInviteOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInviteOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -346,7 +346,7 @@ public static async System.Threading.Tasks.Task> Rea List identity = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadInviteOptions(pathServiceSid, pathChannelSid){ Identity = identity, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Chat/V1/Service/Channel/MemberResource.cs b/src/Twilio/Rest/Chat/V1/Service/Channel/MemberResource.cs index 5cb12793f..455e015b8 100644 --- a/src/Twilio/Rest/Chat/V1/Service/Channel/MemberResource.cs +++ b/src/Twilio/Rest/Chat/V1/Service/Channel/MemberResource.cs @@ -70,7 +70,7 @@ public static MemberResource Create(CreateMemberOptions options, ITwilioRestClie /// Create Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task CreateAsync(CreateMemberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateMemberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string pathChannelSid, string identity, string roleSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMemberOptions(pathServiceSid, pathChannelSid, identity){ RoleSid = roleSid }; return await CreateAsync(options, client, cancellationToken); @@ -159,7 +159,7 @@ public static bool Delete(DeleteMemberOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Member public static async System.Threading.Tasks.Task DeleteAsync(DeleteMemberOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -186,7 +186,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p /// The Twilio-provided string that uniquely identifies the Member resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteMemberOptions(pathServiceSid, pathChannelSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ public static MemberResource Fetch(FetchMemberOptions options, ITwilioRestClient /// Fetch Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -260,7 +260,7 @@ public static MemberResource Fetch( /// The Twilio-provided string that uniquely identifies the Member resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMemberOptions(pathServiceSid, pathChannelSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadMemberOptions options, ITwili /// Read Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -346,7 +346,7 @@ public static async System.Threading.Tasks.Task> Rea List identity = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMemberOptions(pathServiceSid, pathChannelSid){ Identity = identity, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -442,7 +442,7 @@ public static MemberResource Update(UpdateMemberOptions options, ITwilioRestClie #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateMemberOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -485,7 +485,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string roleSid = null, int? lastConsumedMessageIndex = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateMemberOptions(pathServiceSid, pathChannelSid, pathSid){ RoleSid = roleSid, LastConsumedMessageIndex = lastConsumedMessageIndex }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Chat/V1/Service/Channel/MessageResource.cs b/src/Twilio/Rest/Chat/V1/Service/Channel/MessageResource.cs index f604cb135..668fddd54 100644 --- a/src/Twilio/Rest/Chat/V1/Service/Channel/MessageResource.cs +++ b/src/Twilio/Rest/Chat/V1/Service/Channel/MessageResource.cs @@ -82,7 +82,7 @@ public static MessageResource Create(CreateMessageOptions options, ITwilioRestCl /// Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -125,7 +125,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string body, string from = null, string attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMessageOptions(pathServiceSid, pathChannelSid, body){ From = from, Attributes = attributes }; return await CreateAsync(options, client, cancellationToken); @@ -175,7 +175,7 @@ public static bool Delete(DeleteMessageOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Message public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -202,7 +202,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p /// The Twilio-provided string that uniquely identifies the Message resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteMessageOptions(pathServiceSid, pathChannelSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -246,7 +246,7 @@ public static MessageResource Fetch(FetchMessageOptions options, ITwilioRestClie /// Fetch Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -276,7 +276,7 @@ public static MessageResource Fetch( /// The Twilio-provided string that uniquely identifies the Message resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMessageOptions(pathServiceSid, pathChannelSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -318,7 +318,7 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -362,7 +362,7 @@ public static async System.Threading.Tasks.Task> Re MessageResource.OrderTypeEnum order = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMessageOptions(pathServiceSid, pathChannelSid){ Order = order, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -458,7 +458,7 @@ public static MessageResource Update(UpdateMessageOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -501,7 +501,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string body = null, string attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateMessageOptions(pathServiceSid, pathChannelSid, pathSid){ Body = body, Attributes = attributes }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Chat/V1/Service/ChannelResource.cs b/src/Twilio/Rest/Chat/V1/Service/ChannelResource.cs index 24626128f..4d3ec2633 100644 --- a/src/Twilio/Rest/Chat/V1/Service/ChannelResource.cs +++ b/src/Twilio/Rest/Chat/V1/Service/ChannelResource.cs @@ -81,7 +81,7 @@ public static ChannelResource Create(CreateChannelOptions options, ITwilioRestCl /// Create Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -124,7 +124,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string uniqueName = null, string attributes = null, ChannelResource.ChannelTypeEnum type = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateChannelOptions(pathServiceSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes, Type = type }; return await CreateAsync(options, client, cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(DeleteChannelOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Channel public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -197,7 +197,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The Twilio-provided string that uniquely identifies the Channel resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteChannelOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -239,7 +239,7 @@ public static ChannelResource Fetch(FetchChannelOptions options, ITwilioRestClie /// Fetch Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -266,7 +266,7 @@ public static ChannelResource Fetch( /// The Twilio-provided string that uniquely identifies the Channel resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchChannelOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -306,7 +306,7 @@ public static ResourceSet Read(ReadChannelOptions options, ITwi /// Read Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -346,7 +346,7 @@ public static async System.Threading.Tasks.Task> Re List type = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadChannelOptions(pathServiceSid){ Type = type, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -440,7 +440,7 @@ public static ChannelResource Update(UpdateChannelOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -483,7 +483,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string friendlyName = null, string uniqueName = null, string attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateChannelOptions(pathServiceSid, pathSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Chat/V1/Service/RoleResource.cs b/src/Twilio/Rest/Chat/V1/Service/RoleResource.cs index 5b94d3acd..242818007 100644 --- a/src/Twilio/Rest/Chat/V1/Service/RoleResource.cs +++ b/src/Twilio/Rest/Chat/V1/Service/RoleResource.cs @@ -81,7 +81,7 @@ public static RoleResource Create(CreateRoleOptions options, ITwilioRestClient c /// Create Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -120,7 +120,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, RoleResource.RoleTypeEnum type, List permission, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateRoleOptions(pathServiceSid, friendlyName, type, permission){ }; return await CreateAsync(options, client, cancellationToken); @@ -168,7 +168,7 @@ public static bool Delete(DeleteRoleOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Role public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -193,7 +193,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The Twilio-provided string that uniquely identifies the Role resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRoleOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -235,7 +235,7 @@ public static RoleResource Fetch(FetchRoleOptions options, ITwilioRestClient cli /// Fetch Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -262,7 +262,7 @@ public static RoleResource Fetch( /// The Twilio-provided string that uniquely identifies the Role resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRoleOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadRoleOptions options, ITwilioRes /// Read Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -338,7 +338,7 @@ public static async System.Threading.Tasks.Task> ReadA string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRoleOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -432,7 +432,7 @@ public static RoleResource Update(UpdateRoleOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -467,7 +467,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathServiceSid, string pathSid, List permission, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRoleOptions(pathServiceSid, pathSid, permission){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Chat/V1/Service/User/UserChannelResource.cs b/src/Twilio/Rest/Chat/V1/Service/User/UserChannelResource.cs index 91f185959..a6eb9cb26 100644 --- a/src/Twilio/Rest/Chat/V1/Service/User/UserChannelResource.cs +++ b/src/Twilio/Rest/Chat/V1/Service/User/UserChannelResource.cs @@ -83,7 +83,7 @@ public static ResourceSet Read(ReadUserChannelOptions optio /// Read UserChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadUserChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -123,7 +123,7 @@ public static async System.Threading.Tasks.Task string pathUserSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUserChannelOptions(pathServiceSid, pathUserSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Chat/V1/Service/UserResource.cs b/src/Twilio/Rest/Chat/V1/Service/UserResource.cs index ad86a908f..ec03928f8 100644 --- a/src/Twilio/Rest/Chat/V1/Service/UserResource.cs +++ b/src/Twilio/Rest/Chat/V1/Service/UserResource.cs @@ -68,7 +68,7 @@ public static UserResource Create(CreateUserOptions options, ITwilioRestClient c /// 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -111,7 +111,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string roleSid = null, string attributes = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateUserOptions(pathServiceSid, identity){ RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName }; return await CreateAsync(options, client, cancellationToken); @@ -159,7 +159,7 @@ public static bool Delete(DeleteUserOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of User public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -184,7 +184,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The Twilio-provided string that uniquely identifies the User resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUserOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -226,7 +226,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -253,7 +253,7 @@ public static UserResource Fetch( /// The Twilio-provided string that uniquely identifies the User resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUserOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -293,7 +293,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -329,7 +329,7 @@ public static async System.Threading.Tasks.Task> ReadA string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUserOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -423,7 +423,7 @@ public static UserResource Update(UpdateUserOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -466,7 +466,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string roleSid = null, string attributes = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateUserOptions(pathServiceSid, pathSid){ RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Chat/V1/ServiceResource.cs b/src/Twilio/Rest/Chat/V1/ServiceResource.cs index 28f421abb..722c42152 100644 --- a/src/Twilio/Rest/Chat/V1/ServiceResource.cs +++ b/src/Twilio/Rest/Chat/V1/ServiceResource.cs @@ -66,7 +66,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -93,7 +93,7 @@ public static ServiceResource Create( /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateServiceOptions(friendlyName){ }; return await CreateAsync(options, client, cancellationToken); @@ -139,7 +139,7 @@ public static bool Delete(DeleteServiceOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -162,7 +162,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteServiceOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -202,7 +202,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -226,7 +226,7 @@ public static ServiceResource Fetch( /// The Twilio-provided string that uniquely identifies 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchServiceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -264,7 +264,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -296,7 +296,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadServiceOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -388,7 +388,7 @@ public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -631,7 +631,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( Twilio.Http.HttpMethod webhooksOnMemberRemovedMethod = null, int? limitsChannelMembers = null, int? limitsUserChannels = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, DefaultServiceRoleSid = defaultServiceRoleSid, DefaultChannelRoleSid = defaultChannelRoleSid, DefaultChannelCreatorRoleSid = defaultChannelCreatorRoleSid, ReadStatusEnabled = readStatusEnabled, ReachabilityEnabled = reachabilityEnabled, TypingIndicatorTimeout = typingIndicatorTimeout, ConsumptionReportInterval = consumptionReportInterval, NotificationsNewMessageEnabled = notificationsNewMessageEnabled, NotificationsNewMessageTemplate = notificationsNewMessageTemplate, NotificationsAddedToChannelEnabled = notificationsAddedToChannelEnabled, NotificationsAddedToChannelTemplate = notificationsAddedToChannelTemplate, NotificationsRemovedFromChannelEnabled = notificationsRemovedFromChannelEnabled, NotificationsRemovedFromChannelTemplate = notificationsRemovedFromChannelTemplate, NotificationsInvitedToChannelEnabled = notificationsInvitedToChannelEnabled, NotificationsInvitedToChannelTemplate = notificationsInvitedToChannelTemplate, PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, WebhookMethod = webhookMethod, WebhookFilters = webhookFilters, WebhooksOnMessageSendUrl = webhooksOnMessageSendUrl, WebhooksOnMessageSendMethod = webhooksOnMessageSendMethod, WebhooksOnMessageUpdateUrl = webhooksOnMessageUpdateUrl, WebhooksOnMessageUpdateMethod = webhooksOnMessageUpdateMethod, WebhooksOnMessageRemoveUrl = webhooksOnMessageRemoveUrl, WebhooksOnMessageRemoveMethod = webhooksOnMessageRemoveMethod, WebhooksOnChannelAddUrl = webhooksOnChannelAddUrl, WebhooksOnChannelAddMethod = webhooksOnChannelAddMethod, WebhooksOnChannelDestroyUrl = webhooksOnChannelDestroyUrl, WebhooksOnChannelDestroyMethod = webhooksOnChannelDestroyMethod, WebhooksOnChannelUpdateUrl = webhooksOnChannelUpdateUrl, WebhooksOnChannelUpdateMethod = webhooksOnChannelUpdateMethod, WebhooksOnMemberAddUrl = webhooksOnMemberAddUrl, WebhooksOnMemberAddMethod = webhooksOnMemberAddMethod, WebhooksOnMemberRemoveUrl = webhooksOnMemberRemoveUrl, WebhooksOnMemberRemoveMethod = webhooksOnMemberRemoveMethod, WebhooksOnMessageSentUrl = webhooksOnMessageSentUrl, WebhooksOnMessageSentMethod = webhooksOnMessageSentMethod, WebhooksOnMessageUpdatedUrl = webhooksOnMessageUpdatedUrl, WebhooksOnMessageUpdatedMethod = webhooksOnMessageUpdatedMethod, WebhooksOnMessageRemovedUrl = webhooksOnMessageRemovedUrl, WebhooksOnMessageRemovedMethod = webhooksOnMessageRemovedMethod, WebhooksOnChannelAddedUrl = webhooksOnChannelAddedUrl, WebhooksOnChannelAddedMethod = webhooksOnChannelAddedMethod, WebhooksOnChannelDestroyedUrl = webhooksOnChannelDestroyedUrl, WebhooksOnChannelDestroyedMethod = webhooksOnChannelDestroyedMethod, WebhooksOnChannelUpdatedUrl = webhooksOnChannelUpdatedUrl, WebhooksOnChannelUpdatedMethod = webhooksOnChannelUpdatedMethod, WebhooksOnMemberAddedUrl = webhooksOnMemberAddedUrl, WebhooksOnMemberAddedMethod = webhooksOnMemberAddedMethod, WebhooksOnMemberRemovedUrl = webhooksOnMemberRemovedUrl, WebhooksOnMemberRemovedMethod = webhooksOnMemberRemovedMethod, LimitsChannelMembers = limitsChannelMembers, LimitsUserChannels = limitsUserChannels }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Chat/V2/CredentialResource.cs b/src/Twilio/Rest/Chat/V2/CredentialResource.cs index fb604666c..33af02d63 100644 --- a/src/Twilio/Rest/Chat/V2/CredentialResource.cs +++ b/src/Twilio/Rest/Chat/V2/CredentialResource.cs @@ -80,7 +80,7 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio /// Create Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -131,7 +131,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? sandbox = null, string apiKey = null, string secret = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCredentialOptions(type){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; return await CreateAsync(options, client, cancellationToken); @@ -177,7 +177,7 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli /// Task that resolves to A single instance of Credential public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -200,7 +200,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Credential resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCredentialOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -240,7 +240,7 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe /// Fetch Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -264,7 +264,7 @@ public static CredentialResource Fetch( /// The SID of the Credential resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCredentialOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadCredentialOptions options /// Read Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -334,7 +334,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCredentialOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -426,7 +426,7 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -477,7 +477,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? sandbox = null, string apiKey = null, string secret = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateCredentialOptions(pathSid){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Chat/V2/Service/BindingResource.cs b/src/Twilio/Rest/Chat/V2/Service/BindingResource.cs index 498335c47..327faabf3 100644 --- a/src/Twilio/Rest/Chat/V2/Service/BindingResource.cs +++ b/src/Twilio/Rest/Chat/V2/Service/BindingResource.cs @@ -89,7 +89,7 @@ public static bool Delete(DeleteBindingOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Binding public static async System.Threading.Tasks.Task DeleteAsync(DeleteBindingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -114,7 +114,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The SID of the Binding resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteBindingOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -156,7 +156,7 @@ public static BindingResource Fetch(FetchBindingOptions options, ITwilioRestClie /// Fetch Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -183,7 +183,7 @@ public static BindingResource Fetch( /// The SID of the Binding resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchBindingOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -223,7 +223,7 @@ public static ResourceSet Read(ReadBindingOptions options, ITwi /// Read Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -267,7 +267,7 @@ public static async System.Threading.Tasks.Task> Re List identity = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadBindingOptions(pathServiceSid){ BindingType = bindingType, Identity = identity, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Chat/V2/Service/Channel/InviteResource.cs b/src/Twilio/Rest/Chat/V2/Service/Channel/InviteResource.cs index f22682476..0368f97fe 100644 --- a/src/Twilio/Rest/Chat/V2/Service/Channel/InviteResource.cs +++ b/src/Twilio/Rest/Chat/V2/Service/Channel/InviteResource.cs @@ -70,7 +70,7 @@ public static InviteResource Create(CreateInviteOptions options, ITwilioRestClie /// Create Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task CreateAsync(CreateInviteOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateInviteOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string pathChannelSid, string identity, string roleSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateInviteOptions(pathServiceSid, pathChannelSid, identity){ RoleSid = roleSid }; return await CreateAsync(options, client); @@ -158,7 +158,7 @@ public static bool Delete(DeleteInviteOptions options, ITwilioRestClient client /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite public static async System.Threading.Tasks.Task DeleteAsync(DeleteInviteOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); @@ -185,7 +185,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p /// The SID of the Invite resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteInviteOptions(pathServiceSid, pathChannelSid, pathSid) ; return await DeleteAsync(options, client); @@ -229,7 +229,7 @@ public static InviteResource Fetch(FetchInviteOptions options, ITwilioRestClient /// Fetch Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task FetchAsync(FetchInviteOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchInviteOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -259,7 +259,7 @@ public static InviteResource Fetch( /// The SID of the Invite resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInviteOptions(pathServiceSid, pathChannelSid, pathSid){ }; return await FetchAsync(options, client); @@ -301,7 +301,7 @@ public static ResourceSet Read(ReadInviteOptions options, ITwili /// Read Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task> ReadAsync(ReadInviteOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInviteOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -345,7 +345,7 @@ public static async System.Threading.Tasks.Task> Rea List identity = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadInviteOptions(pathServiceSid, pathChannelSid){ Identity = identity, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); diff --git a/src/Twilio/Rest/Chat/V2/Service/Channel/MemberResource.cs b/src/Twilio/Rest/Chat/V2/Service/Channel/MemberResource.cs index ee5d3861a..ef6304d46 100644 --- a/src/Twilio/Rest/Chat/V2/Service/Channel/MemberResource.cs +++ b/src/Twilio/Rest/Chat/V2/Service/Channel/MemberResource.cs @@ -82,7 +82,7 @@ public static MemberResource Create(CreateMemberOptions options, ITwilioRestClie /// Create Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task CreateAsync(CreateMemberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMemberOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); @@ -145,7 +145,7 @@ public static async System.Threading.Tasks.Task CreateAsync( DateTime? dateUpdated = null, string attributes = null, MemberResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMemberOptions(pathServiceSid, pathChannelSid, identity){ RoleSid = roleSid, LastConsumedMessageIndex = lastConsumedMessageIndex, LastConsumptionTimestamp = lastConsumptionTimestamp, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client); @@ -194,7 +194,7 @@ public static bool Delete(DeleteMemberOptions options, ITwilioRestClient client /// Client to make requests to Twilio /// Task that resolves to A single instance of Member public static async System.Threading.Tasks.Task DeleteAsync(DeleteMemberOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); @@ -223,7 +223,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, MemberResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, MemberResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteMemberOptions(pathServiceSid, pathChannelSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client); @@ -267,7 +267,7 @@ public static MemberResource Fetch(FetchMemberOptions options, ITwilioRestClient /// Fetch Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -297,7 +297,7 @@ public static MemberResource Fetch( /// The SID of the Member resource to fetch. This value can be either the Member's `sid` or its `identity` value. /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMemberOptions(pathServiceSid, pathChannelSid, pathSid){ }; return await FetchAsync(options, client); @@ -339,7 +339,7 @@ public static ResourceSet Read(ReadMemberOptions options, ITwili /// Read Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -383,7 +383,7 @@ public static async System.Threading.Tasks.Task> Rea List identity = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMemberOptions(pathServiceSid, pathChannelSid){ Identity = identity, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); @@ -478,7 +478,7 @@ public static MemberResource Update(UpdateMemberOptions options, ITwilioRestClie /// Task that resolves to A single instance of Member #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateMemberOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -541,7 +541,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( DateTime? dateUpdated = null, string attributes = null, MemberResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateMemberOptions(pathServiceSid, pathChannelSid, pathSid){ RoleSid = roleSid, LastConsumedMessageIndex = lastConsumedMessageIndex, LastConsumptionTimestamp = lastConsumptionTimestamp, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Chat/V2/Service/Channel/MessageResource.cs b/src/Twilio/Rest/Chat/V2/Service/Channel/MessageResource.cs index aa4c3036f..94ea55b05 100644 --- a/src/Twilio/Rest/Chat/V2/Service/Channel/MessageResource.cs +++ b/src/Twilio/Rest/Chat/V2/Service/Channel/MessageResource.cs @@ -94,7 +94,7 @@ public static MessageResource Create(CreateMessageOptions options, ITwilioRestCl /// Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); @@ -157,7 +157,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string body = null, string mediaSid = null, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMessageOptions(pathServiceSid, pathChannelSid){ From = from, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, LastUpdatedBy = lastUpdatedBy, Body = body, MediaSid = mediaSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client); @@ -206,7 +206,7 @@ public static bool Delete(DeleteMessageOptions options, ITwilioRestClient client /// Client to make requests to Twilio /// Task that resolves to A single instance of Message public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); @@ -235,7 +235,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteMessageOptions(pathServiceSid, pathChannelSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client); @@ -279,7 +279,7 @@ public static MessageResource Fetch(FetchMessageOptions options, ITwilioRestClie /// Fetch Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -309,7 +309,7 @@ public static MessageResource Fetch( /// The SID of the Message resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMessageOptions(pathServiceSid, pathChannelSid, pathSid){ }; return await FetchAsync(options, client); @@ -351,7 +351,7 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -395,7 +395,7 @@ public static async System.Threading.Tasks.Task> Re MessageResource.OrderTypeEnum order = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMessageOptions(pathServiceSid, pathChannelSid){ Order = order, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); @@ -490,7 +490,7 @@ public static MessageResource Update(UpdateMessageOptions options, ITwilioRestCl /// Task that resolves to A single instance of Message #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -553,7 +553,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string lastUpdatedBy = null, string from = null, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateMessageOptions(pathServiceSid, pathChannelSid, pathSid){ Body = body, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, LastUpdatedBy = lastUpdatedBy, From = from, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookResource.cs b/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookResource.cs index 3134f38ad..55115e0d1 100644 --- a/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookResource.cs +++ b/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookResource.cs @@ -95,7 +95,7 @@ public static WebhookResource Create(CreateWebhookOptions options, ITwilioRestCl /// Create Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); @@ -154,7 +154,7 @@ public static async System.Threading.Tasks.Task CreateAsync( List configurationTriggers = null, string configurationFlowSid = null, int? configurationRetryCount = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateWebhookOptions(pathServiceSid, pathChannelSid, type){ ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid, ConfigurationRetryCount = configurationRetryCount }; return await CreateAsync(options, client); @@ -203,7 +203,7 @@ public static bool Delete(DeleteWebhookOptions options, ITwilioRestClient client /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebhookOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); @@ -230,7 +230,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p /// The SID of the Channel Webhook resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteWebhookOptions(pathServiceSid, pathChannelSid, pathSid) ; return await DeleteAsync(options, client); @@ -274,7 +274,7 @@ public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClie /// Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -304,7 +304,7 @@ public static WebhookResource Fetch( /// The SID of the Channel Webhook resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWebhookOptions(pathServiceSid, pathChannelSid, pathSid){ }; return await FetchAsync(options, client); @@ -346,7 +346,7 @@ public static ResourceSet Read(ReadWebhookOptions options, ITwi /// Read Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -386,7 +386,7 @@ public static async System.Threading.Tasks.Task> Re string pathChannelSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadWebhookOptions(pathServiceSid, pathChannelSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); @@ -481,7 +481,7 @@ public static WebhookResource Update(UpdateWebhookOptions options, ITwilioRestCl /// Task that resolves to A single instance of Webhook #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -540,7 +540,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( List configurationTriggers = null, string configurationFlowSid = null, int? configurationRetryCount = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateWebhookOptions(pathServiceSid, pathChannelSid, pathSid){ ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid, ConfigurationRetryCount = configurationRetryCount }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Chat/V2/Service/ChannelResource.cs b/src/Twilio/Rest/Chat/V2/Service/ChannelResource.cs index 7aadd8d51..9f0fc7f49 100644 --- a/src/Twilio/Rest/Chat/V2/Service/ChannelResource.cs +++ b/src/Twilio/Rest/Chat/V2/Service/ChannelResource.cs @@ -93,7 +93,7 @@ public static ChannelResource Create(CreateChannelOptions options, ITwilioRestCl /// Create Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -152,7 +152,7 @@ public static async System.Threading.Tasks.Task CreateAsync( DateTime? dateUpdated = null, string createdBy = null, ChannelResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateChannelOptions(pathServiceSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes, Type = type, DateCreated = dateCreated, DateUpdated = dateUpdated, CreatedBy = createdBy, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -200,7 +200,7 @@ public static bool Delete(DeleteChannelOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Channel public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -227,7 +227,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ChannelResource /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ChannelResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ChannelResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteChannelOptions(pathServiceSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client, cancellationToken); @@ -269,7 +269,7 @@ public static ChannelResource Fetch(FetchChannelOptions options, ITwilioRestClie /// Fetch Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -296,7 +296,7 @@ public static ChannelResource Fetch( /// The SID of the Channel resource to fetch. This value can be either the `sid` or the `unique_name` of the Channel resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchChannelOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -336,7 +336,7 @@ public static ResourceSet Read(ReadChannelOptions options, ITwi /// Read Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -376,7 +376,7 @@ public static async System.Threading.Tasks.Task> Re List type = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadChannelOptions(pathServiceSid){ Type = type, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -470,7 +470,7 @@ public static ChannelResource Update(UpdateChannelOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -529,7 +529,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( DateTime? dateUpdated = null, string createdBy = null, ChannelResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateChannelOptions(pathServiceSid, pathSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, CreatedBy = createdBy, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Chat/V2/Service/RoleResource.cs b/src/Twilio/Rest/Chat/V2/Service/RoleResource.cs index 0748b396e..c03eed69f 100644 --- a/src/Twilio/Rest/Chat/V2/Service/RoleResource.cs +++ b/src/Twilio/Rest/Chat/V2/Service/RoleResource.cs @@ -81,7 +81,7 @@ public static RoleResource Create(CreateRoleOptions options, ITwilioRestClient c /// Create Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); @@ -120,7 +120,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, RoleResource.RoleTypeEnum type, List permission, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateRoleOptions(pathServiceSid, friendlyName, type, permission){ }; return await CreateAsync(options, client); @@ -167,7 +167,7 @@ public static bool Delete(DeleteRoleOptions options, ITwilioRestClient client = /// Client to make requests to Twilio /// Task that resolves to A single instance of Role public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); @@ -192,7 +192,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The SID of the Role resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRoleOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client); @@ -234,7 +234,7 @@ public static RoleResource Fetch(FetchRoleOptions options, ITwilioRestClient cli /// Fetch Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -261,7 +261,7 @@ public static RoleResource Fetch( /// The SID of the Role resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRoleOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client); @@ -301,7 +301,7 @@ public static ResourceSet Read(ReadRoleOptions options, ITwilioRes /// Read Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -337,7 +337,7 @@ public static async System.Threading.Tasks.Task> ReadA string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRoleOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); @@ -430,7 +430,7 @@ public static RoleResource Update(UpdateRoleOptions options, ITwilioRestClient c /// Task that resolves to A single instance of Role #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -465,7 +465,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathServiceSid, string pathSid, List permission, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRoleOptions(pathServiceSid, pathSid, permission){ }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Chat/V2/Service/User/UserBindingResource.cs b/src/Twilio/Rest/Chat/V2/Service/User/UserBindingResource.cs index a274b9850..b250ebd61 100644 --- a/src/Twilio/Rest/Chat/V2/Service/User/UserBindingResource.cs +++ b/src/Twilio/Rest/Chat/V2/Service/User/UserBindingResource.cs @@ -90,7 +90,7 @@ public static bool Delete(DeleteUserBindingOptions options, ITwilioRestClient cl /// Client to make requests to Twilio /// Task that resolves to A single instance of UserBinding public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserBindingOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); @@ -117,7 +117,7 @@ public static bool Delete(string pathServiceSid, string pathUserSid, string path /// The SID of the User Binding resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of UserBinding - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathUserSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathUserSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUserBindingOptions(pathServiceSid, pathUserSid, pathSid) ; return await DeleteAsync(options, client); @@ -161,7 +161,7 @@ public static UserBindingResource Fetch(FetchUserBindingOptions options, ITwilio /// Fetch UserBinding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserBinding - public static async System.Threading.Tasks.Task FetchAsync(FetchUserBindingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserBindingOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -191,7 +191,7 @@ public static UserBindingResource Fetch( /// The SID of the User Binding resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of UserBinding - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathUserSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathUserSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUserBindingOptions(pathServiceSid, pathUserSid, pathSid){ }; return await FetchAsync(options, client); @@ -233,7 +233,7 @@ public static ResourceSet Read(ReadUserBindingOptions optio /// Read UserBinding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserBinding - public static async System.Threading.Tasks.Task> ReadAsync(ReadUserBindingOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserBindingOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -277,7 +277,7 @@ public static async System.Threading.Tasks.Task List bindingType = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUserBindingOptions(pathServiceSid, pathUserSid){ BindingType = bindingType, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); diff --git a/src/Twilio/Rest/Chat/V2/Service/User/UserChannelResource.cs b/src/Twilio/Rest/Chat/V2/Service/User/UserChannelResource.cs index ed4a2448f..6d1814f92 100644 --- a/src/Twilio/Rest/Chat/V2/Service/User/UserChannelResource.cs +++ b/src/Twilio/Rest/Chat/V2/Service/User/UserChannelResource.cs @@ -115,7 +115,7 @@ public static bool Delete(DeleteUserChannelOptions options, ITwilioRestClient cl /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserChannelOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); @@ -144,7 +144,7 @@ public static bool Delete(string pathServiceSid, string pathUserSid, string path /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathUserSid, string pathChannelSid, UserChannelResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathUserSid, string pathChannelSid, UserChannelResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client); @@ -188,7 +188,7 @@ public static UserChannelResource Fetch(FetchUserChannelOptions options, ITwilio /// Fetch UserChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task FetchAsync(FetchUserChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserChannelOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -218,7 +218,7 @@ public static UserChannelResource Fetch( /// The SID of the [Channel](https://www.twilio.com/docs/chat/channels) that has the User Channel to fetch. This value can be either the `sid` or the `unique_name` of the Channel to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathUserSid, string pathChannelSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathUserSid, string pathChannelSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid){ }; return await FetchAsync(options, client); @@ -260,7 +260,7 @@ public static ResourceSet Read(ReadUserChannelOptions optio /// Read UserChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadUserChannelOptions options, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserChannelOptions options, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -300,7 +300,7 @@ public static async System.Threading.Tasks.Task string pathUserSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUserChannelOptions(pathServiceSid, pathUserSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); @@ -395,7 +395,7 @@ public static UserChannelResource Update(UpdateUserChannelOptions options, ITwil /// Task that resolves to A single instance of UserChannel #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserChannelOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -442,7 +442,7 @@ public static async System.Threading.Tasks.Task UpdateAsync UserChannelResource.NotificationLevelEnum notificationLevel = null, int? lastConsumedMessageIndex = null, DateTime? lastConsumptionTimestamp = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid){ NotificationLevel = notificationLevel, LastConsumedMessageIndex = lastConsumedMessageIndex, LastConsumptionTimestamp = lastConsumptionTimestamp }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Chat/V2/Service/UserResource.cs b/src/Twilio/Rest/Chat/V2/Service/UserResource.cs index 65f84bcac..06d7af1bd 100644 --- a/src/Twilio/Rest/Chat/V2/Service/UserResource.cs +++ b/src/Twilio/Rest/Chat/V2/Service/UserResource.cs @@ -80,7 +80,7 @@ public static UserResource Create(CreateUserOptions options, ITwilioRestClient c /// 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 , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); @@ -127,7 +127,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string attributes = null, string friendlyName = null, UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateUserOptions(pathServiceSid, identity){ RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client); @@ -174,7 +174,7 @@ public static bool Delete(DeleteUserOptions options, ITwilioRestClient client = /// 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) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); @@ -199,7 +199,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUserOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client); @@ -241,7 +241,7 @@ 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 , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); @@ -268,7 +268,7 @@ public static UserResource Fetch( /// The SID of the User resource to fetch. This value can be either the `sid` or the `identity` of the User resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUserOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client); @@ -308,7 +308,7 @@ 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 , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); @@ -344,7 +344,7 @@ public static async System.Threading.Tasks.Task> ReadA string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUserOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client); @@ -437,7 +437,7 @@ public static UserResource Update(UpdateUserOptions options, ITwilioRestClient c /// Task that resolves to A single instance of User #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -484,7 +484,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string attributes = null, string friendlyName = null, UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateUserOptions(pathServiceSid, pathSid){ RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Chat/V2/ServiceResource.cs b/src/Twilio/Rest/Chat/V2/ServiceResource.cs index 542084964..9757bb1d4 100644 --- a/src/Twilio/Rest/Chat/V2/ServiceResource.cs +++ b/src/Twilio/Rest/Chat/V2/ServiceResource.cs @@ -66,7 +66,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -93,7 +93,7 @@ public static ServiceResource Create( /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateServiceOptions(friendlyName){ }; return await CreateAsync(options, client, cancellationToken); @@ -139,7 +139,7 @@ public static bool Delete(DeleteServiceOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -162,7 +162,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteServiceOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -202,7 +202,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -226,7 +226,7 @@ public static ServiceResource Fetch( /// The SID 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchServiceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -264,7 +264,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -296,7 +296,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadServiceOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -388,7 +388,7 @@ public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -539,7 +539,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( int? preWebhookRetryCount = null, int? postWebhookRetryCount = null, bool? notificationsLogEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, DefaultServiceRoleSid = defaultServiceRoleSid, DefaultChannelRoleSid = defaultChannelRoleSid, DefaultChannelCreatorRoleSid = defaultChannelCreatorRoleSid, ReadStatusEnabled = readStatusEnabled, ReachabilityEnabled = reachabilityEnabled, TypingIndicatorTimeout = typingIndicatorTimeout, ConsumptionReportInterval = consumptionReportInterval, NotificationsNewMessageEnabled = notificationsNewMessageEnabled, NotificationsNewMessageTemplate = notificationsNewMessageTemplate, NotificationsNewMessageSound = notificationsNewMessageSound, NotificationsNewMessageBadgeCountEnabled = notificationsNewMessageBadgeCountEnabled, NotificationsAddedToChannelEnabled = notificationsAddedToChannelEnabled, NotificationsAddedToChannelTemplate = notificationsAddedToChannelTemplate, NotificationsAddedToChannelSound = notificationsAddedToChannelSound, NotificationsRemovedFromChannelEnabled = notificationsRemovedFromChannelEnabled, NotificationsRemovedFromChannelTemplate = notificationsRemovedFromChannelTemplate, NotificationsRemovedFromChannelSound = notificationsRemovedFromChannelSound, NotificationsInvitedToChannelEnabled = notificationsInvitedToChannelEnabled, NotificationsInvitedToChannelTemplate = notificationsInvitedToChannelTemplate, NotificationsInvitedToChannelSound = notificationsInvitedToChannelSound, PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, WebhookMethod = webhookMethod, WebhookFilters = webhookFilters, LimitsChannelMembers = limitsChannelMembers, LimitsUserChannels = limitsUserChannels, MediaCompatibilityMessage = mediaCompatibilityMessage, PreWebhookRetryCount = preWebhookRetryCount, PostWebhookRetryCount = postWebhookRetryCount, NotificationsLogEnabled = notificationsLogEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Chat/V3/ChannelResource.cs b/src/Twilio/Rest/Chat/V3/ChannelResource.cs index 11d1617ed..719497e8f 100644 --- a/src/Twilio/Rest/Chat/V3/ChannelResource.cs +++ b/src/Twilio/Rest/Chat/V3/ChannelResource.cs @@ -96,7 +96,7 @@ public static ChannelResource Update(UpdateChannelOptions options, ITwilioRestCl /// Task that resolves to A single instance of Channel #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateChannelOptions options, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); @@ -139,7 +139,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( ChannelResource.ChannelTypeEnum type = null, string messagingServiceSid = null, ChannelResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateChannelOptions(pathServiceSid, pathSid){ Type = type, MessagingServiceSid = messagingServiceSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client); diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalCreateResource.cs b/src/Twilio/Rest/Content/V1/Content/ApprovalCreateResource.cs index d9b7381af..ad0872502 100644 --- a/src/Twilio/Rest/Content/V1/Content/ApprovalCreateResource.cs +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalCreateResource.cs @@ -98,7 +98,7 @@ public static ApprovalCreateResource Create(CreateApprovalCreateOptions options, /// Create ApprovalCreate parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ApprovalCreate - public static async System.Threading.Tasks.Task CreateAsync(CreateApprovalCreateOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateApprovalCreateOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -129,7 +129,7 @@ public static ApprovalCreateResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathContentSid, ApprovalCreateResource.ContentApprovalRequest contentApprovalRequest, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateApprovalCreateOptions(pathContentSid, contentApprovalRequest){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalFetchResource.cs b/src/Twilio/Rest/Content/V1/Content/ApprovalFetchResource.cs index 7ea704fe1..d317d8e4d 100644 --- a/src/Twilio/Rest/Content/V1/Content/ApprovalFetchResource.cs +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalFetchResource.cs @@ -67,7 +67,7 @@ public static ApprovalFetchResource Fetch(FetchApprovalFetchOptions options, ITw /// Fetch ApprovalFetch parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ApprovalFetch - public static async System.Threading.Tasks.Task FetchAsync(FetchApprovalFetchOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchApprovalFetchOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static ApprovalFetchResource Fetch( /// The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ApprovalFetch - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchApprovalFetchOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Content/V1/ContentAndApprovalsResource.cs b/src/Twilio/Rest/Content/V1/ContentAndApprovalsResource.cs index c5fba2c84..9660add5b 100644 --- a/src/Twilio/Rest/Content/V1/ContentAndApprovalsResource.cs +++ b/src/Twilio/Rest/Content/V1/ContentAndApprovalsResource.cs @@ -65,7 +65,7 @@ public static ResourceSet Read(ReadContentAndApprov /// Read ContentAndApprovals parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ContentAndApprovals - public static async System.Threading.Tasks.Task> ReadAsync(ReadContentAndApprovalsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadContentAndApprovalsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -97,7 +97,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadContentAndApprovalsOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Content/V1/ContentResource.cs b/src/Twilio/Rest/Content/V1/ContentResource.cs index 05d289063..434ea82fa 100644 --- a/src/Twilio/Rest/Content/V1/ContentResource.cs +++ b/src/Twilio/Rest/Content/V1/ContentResource.cs @@ -1174,7 +1174,7 @@ public static ContentResource Create(CreateContentOptions options, ITwilioRestCl /// Create Content parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Content - public static async System.Threading.Tasks.Task CreateAsync(CreateContentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateContentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -1201,7 +1201,7 @@ public static ContentResource Create( /// Task that resolves to A single instance of Content public static async System.Threading.Tasks.Task CreateAsync( ContentResource.ContentCreateRequest contentCreateRequest, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateContentOptions(contentCreateRequest){ }; return await CreateAsync(options, client, cancellationToken); @@ -1247,7 +1247,7 @@ public static bool Delete(DeleteContentOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Content public static async System.Threading.Tasks.Task DeleteAsync(DeleteContentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -1270,7 +1270,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the Content resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Content - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteContentOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -1310,7 +1310,7 @@ public static ContentResource Fetch(FetchContentOptions options, ITwilioRestClie /// Fetch Content parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Content - public static async System.Threading.Tasks.Task FetchAsync(FetchContentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchContentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -1334,7 +1334,7 @@ public static ContentResource Fetch( /// The Twilio-provided string that uniquely identifies the Content resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Content - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchContentOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -1372,7 +1372,7 @@ public static ResourceSet Read(ReadContentOptions options, ITwi /// Read Content parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Content - public static async System.Threading.Tasks.Task> ReadAsync(ReadContentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadContentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -1404,7 +1404,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadContentOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Content/V1/LegacyContentResource.cs b/src/Twilio/Rest/Content/V1/LegacyContentResource.cs index 9de9baf6d..ede0e7fd4 100644 --- a/src/Twilio/Rest/Content/V1/LegacyContentResource.cs +++ b/src/Twilio/Rest/Content/V1/LegacyContentResource.cs @@ -65,7 +65,7 @@ public static ResourceSet Read(ReadLegacyContentOptions o /// Read LegacyContent parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of LegacyContent - public static async System.Threading.Tasks.Task> ReadAsync(ReadLegacyContentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadLegacyContentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -97,7 +97,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadLegacyContentOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Content/V2/ContentAndApprovalsResource.cs b/src/Twilio/Rest/Content/V2/ContentAndApprovalsResource.cs index b4a9ac1b9..0f7b8f1c1 100644 --- a/src/Twilio/Rest/Content/V2/ContentAndApprovalsResource.cs +++ b/src/Twilio/Rest/Content/V2/ContentAndApprovalsResource.cs @@ -65,7 +65,7 @@ public static ResourceSet Read(ReadContentAndApprov /// Read ContentAndApprovals parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ContentAndApprovals - public static async System.Threading.Tasks.Task> ReadAsync(ReadContentAndApprovalsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadContentAndApprovalsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -133,7 +133,7 @@ public static async System.Threading.Tasks.Task contentType = null, List channelEligibility = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadContentAndApprovalsOptions(){ PageSize = pageSize, SortByDate = sortByDate, SortByContentName = sortByContentName, DateCreatedAfter = dateCreatedAfter, DateCreatedBefore = dateCreatedBefore, ContentName = contentName, Content = content, Language = language, ContentType = contentType, ChannelEligibility = channelEligibility, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Content/V2/ContentResource.cs b/src/Twilio/Rest/Content/V2/ContentResource.cs index 2d1cb6ec4..595152fa6 100644 --- a/src/Twilio/Rest/Content/V2/ContentResource.cs +++ b/src/Twilio/Rest/Content/V2/ContentResource.cs @@ -65,7 +65,7 @@ public static ResourceSet Read(ReadContentOptions options, ITwi /// Read Content parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Content - public static async System.Threading.Tasks.Task> ReadAsync(ReadContentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadContentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -133,7 +133,7 @@ public static async System.Threading.Tasks.Task> Re List contentType = null, List channelEligibility = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadContentOptions(){ PageSize = pageSize, SortByDate = sortByDate, SortByContentName = sortByContentName, DateCreatedAfter = dateCreatedAfter, DateCreatedBefore = dateCreatedBefore, ContentName = contentName, Content = content, Language = language, ContentType = contentType, ChannelEligibility = channelEligibility, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/AddressConfigurationResource.cs b/src/Twilio/Rest/Conversations/V1/AddressConfigurationResource.cs index a98651d72..f794c1092 100644 --- a/src/Twilio/Rest/Conversations/V1/AddressConfigurationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/AddressConfigurationResource.cs @@ -107,7 +107,7 @@ public static AddressConfigurationResource Create(CreateAddressConfigurationOpti /// Create AddressConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AddressConfiguration - public static async System.Threading.Tasks.Task CreateAsync(CreateAddressConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAddressConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -178,7 +178,7 @@ public static async System.Threading.Tasks.Task Cr string autoCreationStudioFlowSid = null, int? autoCreationStudioRetryCount = null, string addressCountry = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAddressConfigurationOptions(type, address){ FriendlyName = friendlyName, AutoCreationEnabled = autoCreationEnabled, AutoCreationType = autoCreationType, AutoCreationConversationServiceSid = autoCreationConversationServiceSid, AutoCreationWebhookUrl = autoCreationWebhookUrl, AutoCreationWebhookMethod = autoCreationWebhookMethod, AutoCreationWebhookFilters = autoCreationWebhookFilters, AutoCreationStudioFlowSid = autoCreationStudioFlowSid, AutoCreationStudioRetryCount = autoCreationStudioRetryCount, AddressCountry = addressCountry }; return await CreateAsync(options, client, cancellationToken); @@ -224,7 +224,7 @@ public static bool Delete(DeleteAddressConfigurationOptions options, ITwilioRest /// Task that resolves to A single instance of AddressConfiguration public static async System.Threading.Tasks.Task DeleteAsync(DeleteAddressConfigurationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -247,7 +247,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Address Configuration resource. This value can be either the `sid` or the `address` of the configuration /// Client to make requests to Twilio /// Task that resolves to A single instance of AddressConfiguration - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAddressConfigurationOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -287,7 +287,7 @@ public static AddressConfigurationResource Fetch(FetchAddressConfigurationOption /// Fetch AddressConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AddressConfiguration - public static async System.Threading.Tasks.Task FetchAsync(FetchAddressConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAddressConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -311,7 +311,7 @@ public static AddressConfigurationResource Fetch( /// The SID of the Address Configuration resource. This value can be either the `sid` or the `address` of the configuration /// Client to make requests to Twilio /// Task that resolves to A single instance of AddressConfiguration - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAddressConfigurationOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -349,7 +349,7 @@ public static ResourceSet Read(ReadAddressConfigur /// Read AddressConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AddressConfiguration - public static async System.Threading.Tasks.Task> ReadAsync(ReadAddressConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAddressConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -385,7 +385,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateAddressConfigurationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -540,7 +540,7 @@ public static async System.Threading.Tasks.Task Up List autoCreationWebhookFilters = null, string autoCreationStudioFlowSid = null, int? autoCreationStudioRetryCount = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateAddressConfigurationOptions(pathSid){ FriendlyName = friendlyName, AutoCreationEnabled = autoCreationEnabled, AutoCreationType = autoCreationType, AutoCreationConversationServiceSid = autoCreationConversationServiceSid, AutoCreationWebhookUrl = autoCreationWebhookUrl, AutoCreationWebhookMethod = autoCreationWebhookMethod, AutoCreationWebhookFilters = autoCreationWebhookFilters, AutoCreationStudioFlowSid = autoCreationStudioFlowSid, AutoCreationStudioRetryCount = autoCreationStudioRetryCount }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Configuration/WebhookResource.cs b/src/Twilio/Rest/Conversations/V1/Configuration/WebhookResource.cs index 79f5d0142..41ca9914c 100644 --- a/src/Twilio/Rest/Conversations/V1/Configuration/WebhookResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Configuration/WebhookResource.cs @@ -91,7 +91,7 @@ public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClie /// Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -112,7 +112,7 @@ public static WebhookResource Fetch( /// fetch /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWebhookOptions(){ }; return await FetchAsync(options, client, cancellationToken); @@ -153,7 +153,7 @@ public static WebhookResource Update(UpdateWebhookOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -196,7 +196,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string preWebhookUrl = null, string postWebhookUrl = null, WebhookResource.TargetEnum target = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateWebhookOptions(){ Method = method, Filters = filters, PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, Target = target }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/ConfigurationResource.cs b/src/Twilio/Rest/Conversations/V1/ConfigurationResource.cs index 9ad72a449..fd6c76fcc 100644 --- a/src/Twilio/Rest/Conversations/V1/ConfigurationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/ConfigurationResource.cs @@ -65,7 +65,7 @@ public static ConfigurationResource Fetch(FetchConfigurationOptions options, ITw /// Fetch Configuration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration - public static async System.Threading.Tasks.Task FetchAsync(FetchConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -86,7 +86,7 @@ public static ConfigurationResource Fetch( /// Fetch the global configuration of conversations on your account /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchConfigurationOptions(){ }; return await FetchAsync(options, client, cancellationToken); @@ -127,7 +127,7 @@ public static ConfigurationResource Update(UpdateConfigurationOptions options, I #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateConfigurationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -166,7 +166,7 @@ public static async System.Threading.Tasks.Task UpdateAsy string defaultMessagingServiceSid = null, string defaultInactiveTimer = null, string defaultClosedTimer = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateConfigurationOptions(){ DefaultChatServiceSid = defaultChatServiceSid, DefaultMessagingServiceSid = defaultMessagingServiceSid, DefaultInactiveTimer = defaultInactiveTimer, DefaultClosedTimer = defaultClosedTimer }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptResource.cs b/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptResource.cs index 5c539e3c8..7bfe776b5 100644 --- a/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptResource.cs @@ -87,7 +87,7 @@ public static DeliveryReceiptResource Fetch(FetchDeliveryReceiptOptions options, /// Fetch DeliveryReceipt parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeliveryReceipt - public static async System.Threading.Tasks.Task FetchAsync(FetchDeliveryReceiptOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDeliveryReceiptOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -117,7 +117,7 @@ public static DeliveryReceiptResource Fetch( /// A 34 character string that uniquely identifies this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of DeliveryReceipt - public static async System.Threading.Tasks.Task FetchAsync(string pathConversationSid, string pathMessageSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathConversationSid, string pathMessageSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDeliveryReceiptOptions(pathConversationSid, pathMessageSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -159,7 +159,7 @@ public static ResourceSet Read(ReadDeliveryReceiptOptio /// Read DeliveryReceipt parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeliveryReceipt - public static async System.Threading.Tasks.Task> ReadAsync(ReadDeliveryReceiptOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDeliveryReceiptOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -199,7 +199,7 @@ public static async System.Threading.Tasks.Task Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -159,7 +159,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string contentVariables = null, string subject = null, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMessageOptions(pathConversationSid){ Author = author, Body = body, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MediaSid = mediaSid, ContentSid = contentSid, ContentVariables = contentVariables, Subject = subject, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -207,7 +207,7 @@ public static bool Delete(DeleteMessageOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Message public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -234,7 +234,7 @@ public static bool Delete(string pathConversationSid, string pathSid, MessageRes /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task DeleteAsync(string pathConversationSid, string pathSid, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathConversationSid, string pathSid, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteMessageOptions(pathConversationSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client, cancellationToken); @@ -276,7 +276,7 @@ public static MessageResource Fetch(FetchMessageOptions options, ITwilioRestClie /// Fetch Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -303,7 +303,7 @@ public static MessageResource Fetch( /// A 34 character string that uniquely identifies this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(string pathConversationSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathConversationSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMessageOptions(pathConversationSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -343,7 +343,7 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -383,7 +383,7 @@ public static async System.Threading.Tasks.Task> Re MessageResource.OrderTypeEnum order = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMessageOptions(pathConversationSid){ Order = order, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -477,7 +477,7 @@ public static MessageResource Update(UpdateMessageOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -536,7 +536,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string attributes = null, string subject = null, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateMessageOptions(pathConversationSid, pathSid){ Author = author, Body = body, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, Subject = subject, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantResource.cs b/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantResource.cs index edbc446e4..643890962 100644 --- a/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantResource.cs @@ -80,7 +80,7 @@ public static ParticipantResource Create(CreateParticipantOptions options, ITwil /// Create Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -143,7 +143,7 @@ public static async System.Threading.Tasks.Task CreateAsync string messagingBindingProjectedAddress = null, string roleSid = null, ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateParticipantOptions(pathConversationSid){ Identity = identity, MessagingBindingAddress = messagingBindingAddress, MessagingBindingProxyAddress = messagingBindingProxyAddress, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MessagingBindingProjectedAddress = messagingBindingProjectedAddress, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -191,7 +191,7 @@ public static bool Delete(DeleteParticipantOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of Participant public static async System.Threading.Tasks.Task DeleteAsync(DeleteParticipantOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -218,7 +218,7 @@ public static bool Delete(string pathConversationSid, string pathSid, Participan /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task DeleteAsync(string pathConversationSid, string pathSid, ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathConversationSid, string pathSid, ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteParticipantOptions(pathConversationSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client, cancellationToken); @@ -260,7 +260,7 @@ public static ParticipantResource Fetch(FetchParticipantOptions options, ITwilio /// Fetch Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -287,7 +287,7 @@ public static ParticipantResource Fetch( /// A 34 character string that uniquely identifies this resource. Alternatively, you can pass a Participant's `identity` rather than the SID. /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(string pathConversationSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathConversationSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchParticipantOptions(pathConversationSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -327,7 +327,7 @@ public static ResourceSet Read(ReadParticipantOptions optio /// Read Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -363,7 +363,7 @@ public static async System.Threading.Tasks.Task string pathConversationSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadParticipantOptions(pathConversationSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -457,7 +457,7 @@ public static ParticipantResource Update(UpdateParticipantOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateParticipantOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -528,7 +528,7 @@ public static async System.Threading.Tasks.Task UpdateAsync int? lastReadMessageIndex = null, string lastReadTimestamp = null, ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateParticipantOptions(pathConversationSid, pathSid){ DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, RoleSid = roleSid, MessagingBindingProxyAddress = messagingBindingProxyAddress, MessagingBindingProjectedAddress = messagingBindingProjectedAddress, Identity = identity, LastReadMessageIndex = lastReadMessageIndex, LastReadTimestamp = lastReadTimestamp, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Conversation/WebhookResource.cs b/src/Twilio/Rest/Conversations/V1/Conversation/WebhookResource.cs index 0c7569408..b05e19291 100644 --- a/src/Twilio/Rest/Conversations/V1/Conversation/WebhookResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Conversation/WebhookResource.cs @@ -93,7 +93,7 @@ public static WebhookResource Create(CreateWebhookOptions options, ITwilioRestCl /// Create Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -148,7 +148,7 @@ public static async System.Threading.Tasks.Task CreateAsync( List configurationTriggers = null, string configurationFlowSid = null, int? configurationReplayAfter = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateWebhookOptions(pathConversationSid, target){ ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid, ConfigurationReplayAfter = configurationReplayAfter }; return await CreateAsync(options, client, cancellationToken); @@ -196,7 +196,7 @@ public static bool Delete(DeleteWebhookOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Webhook public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebhookOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -221,7 +221,7 @@ public static bool Delete(string pathConversationSid, string pathSid, ITwilioRes /// A 34 character string that uniquely identifies this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task DeleteAsync(string pathConversationSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathConversationSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteWebhookOptions(pathConversationSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -263,7 +263,7 @@ public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClie /// Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -290,7 +290,7 @@ public static WebhookResource Fetch( /// A 34 character string that uniquely identifies this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(string pathConversationSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathConversationSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWebhookOptions(pathConversationSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -330,7 +330,7 @@ public static ResourceSet Read(ReadWebhookOptions options, ITwi /// Read Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -366,7 +366,7 @@ public static async System.Threading.Tasks.Task> Re string pathConversationSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadWebhookOptions(pathConversationSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -460,7 +460,7 @@ public static WebhookResource Update(UpdateWebhookOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -511,7 +511,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( List configurationFilters = null, List configurationTriggers = null, string configurationFlowSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateWebhookOptions(pathConversationSid, pathSid){ ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/ConversationResource.cs b/src/Twilio/Rest/Conversations/V1/ConversationResource.cs index ef8f1c811..c4d67ef83 100644 --- a/src/Twilio/Rest/Conversations/V1/ConversationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/ConversationResource.cs @@ -92,7 +92,7 @@ public static ConversationResource Create(CreateConversationOptions options, ITw /// Create Conversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task CreateAsync(CreateConversationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateConversationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -163,7 +163,7 @@ public static async System.Threading.Tasks.Task CreateAsyn string bindingsEmailAddress = null, string bindingsEmailName = null, ConversationResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateConversationOptions(){ FriendlyName = friendlyName, UniqueName = uniqueName, DateCreated = dateCreated, DateUpdated = dateUpdated, MessagingServiceSid = messagingServiceSid, Attributes = attributes, State = state, TimersInactive = timersInactive, TimersClosed = timersClosed, BindingsEmailAddress = bindingsEmailAddress, BindingsEmailName = bindingsEmailName, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -209,7 +209,7 @@ public static bool Delete(DeleteConversationOptions options, ITwilioRestClient c /// Task that resolves to A single instance of Conversation public static async System.Threading.Tasks.Task DeleteAsync(DeleteConversationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -234,7 +234,7 @@ public static bool Delete(string pathSid, ConversationResource.WebhookEnabledTyp /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ConversationResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ConversationResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteConversationOptions(pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client, cancellationToken); @@ -274,7 +274,7 @@ public static ConversationResource Fetch(FetchConversationOptions options, ITwil /// Fetch Conversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task FetchAsync(FetchConversationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchConversationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -298,7 +298,7 @@ public static ConversationResource Fetch( /// A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchConversationOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -336,7 +336,7 @@ public static ResourceSet Read(ReadConversationOptions opt /// Read Conversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task> ReadAsync(ReadConversationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConversationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -380,7 +380,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateConversationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -547,7 +547,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn string bindingsEmailAddress = null, string bindingsEmailName = null, ConversationResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateConversationOptions(pathSid){ FriendlyName = friendlyName, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MessagingServiceSid = messagingServiceSid, State = state, TimersInactive = timersInactive, TimersClosed = timersClosed, UniqueName = uniqueName, BindingsEmailAddress = bindingsEmailAddress, BindingsEmailName = bindingsEmailName, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/ConversationWithParticipantsResource.cs b/src/Twilio/Rest/Conversations/V1/ConversationWithParticipantsResource.cs index 3e7b266ac..b97a1fc36 100644 --- a/src/Twilio/Rest/Conversations/V1/ConversationWithParticipantsResource.cs +++ b/src/Twilio/Rest/Conversations/V1/ConversationWithParticipantsResource.cs @@ -92,7 +92,7 @@ public static ConversationWithParticipantsResource Create(CreateConversationWith /// Create ConversationWithParticipants parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConversationWithParticipants - public static async System.Threading.Tasks.Task CreateAsync(CreateConversationWithParticipantsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateConversationWithParticipantsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -167,7 +167,7 @@ public static async System.Threading.Tasks.Task participant = null, ConversationWithParticipantsResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateConversationWithParticipantsOptions(){ FriendlyName = friendlyName, UniqueName = uniqueName, DateCreated = dateCreated, DateUpdated = dateUpdated, MessagingServiceSid = messagingServiceSid, Attributes = attributes, State = state, TimersInactive = timersInactive, TimersClosed = timersClosed, BindingsEmailAddress = bindingsEmailAddress, BindingsEmailName = bindingsEmailName, Participant = participant, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/CredentialResource.cs b/src/Twilio/Rest/Conversations/V1/CredentialResource.cs index e9bf49728..3b9e13c83 100644 --- a/src/Twilio/Rest/Conversations/V1/CredentialResource.cs +++ b/src/Twilio/Rest/Conversations/V1/CredentialResource.cs @@ -80,7 +80,7 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio /// Create Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -131,7 +131,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? sandbox = null, string apiKey = null, string secret = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCredentialOptions(type){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; return await CreateAsync(options, client, cancellationToken); @@ -177,7 +177,7 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli /// Task that resolves to A single instance of Credential public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -200,7 +200,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCredentialOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -240,7 +240,7 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe /// Fetch Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -264,7 +264,7 @@ public static CredentialResource Fetch( /// A 34 character string that uniquely identifies this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCredentialOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadCredentialOptions options /// Read Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -334,7 +334,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCredentialOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -426,7 +426,7 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -481,7 +481,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? sandbox = null, string apiKey = null, string secret = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateCredentialOptions(pathSid){ Type = type, FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/ParticipantConversationResource.cs b/src/Twilio/Rest/Conversations/V1/ParticipantConversationResource.cs index 853470cb5..6c3dbdbf7 100644 --- a/src/Twilio/Rest/Conversations/V1/ParticipantConversationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/ParticipantConversationResource.cs @@ -79,7 +79,7 @@ public static ResourceSet Read(ReadParticipantC /// Read ParticipantConversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ParticipantConversation - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantConversationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantConversationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -119,7 +119,7 @@ public static async System.Threading.Tasks.Task Create Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -114,7 +114,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, RoleResource.RoleTypeEnum type, List permission, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateRoleOptions(friendlyName, type, permission){ }; return await CreateAsync(options, client, cancellationToken); @@ -160,7 +160,7 @@ public static bool Delete(DeleteRoleOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Role public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -183,7 +183,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Role resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRoleOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -223,7 +223,7 @@ public static RoleResource Fetch(FetchRoleOptions options, ITwilioRestClient cli /// Fetch Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -247,7 +247,7 @@ public static RoleResource Fetch( /// The SID of the Role resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRoleOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadRoleOptions options, ITwilioRes /// Read Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRoleOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -409,7 +409,7 @@ public static RoleResource Update(UpdateRoleOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -440,7 +440,7 @@ public static RoleResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, List permission, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRoleOptions(pathSid, permission){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Service/BindingResource.cs b/src/Twilio/Rest/Conversations/V1/Service/BindingResource.cs index 1cfbf420c..6b1c7ed4f 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/BindingResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/BindingResource.cs @@ -89,7 +89,7 @@ public static bool Delete(DeleteBindingOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Binding public static async System.Threading.Tasks.Task DeleteAsync(DeleteBindingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -114,7 +114,7 @@ public static bool Delete(string pathChatServiceSid, string pathSid, ITwilioRest /// The SID of the Binding resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteBindingOptions(pathChatServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -156,7 +156,7 @@ public static BindingResource Fetch(FetchBindingOptions options, ITwilioRestClie /// Fetch Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -183,7 +183,7 @@ public static BindingResource Fetch( /// A 34 character string that uniquely identifies this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchBindingOptions(pathChatServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -223,7 +223,7 @@ public static ResourceSet Read(ReadBindingOptions options, ITwi /// Read Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -267,7 +267,7 @@ public static async System.Threading.Tasks.Task> Re List identity = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadBindingOptions(pathChatServiceSid){ BindingType = bindingType, Identity = identity, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationResource.cs b/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationResource.cs index ba662d72c..318877f0e 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationResource.cs @@ -67,7 +67,7 @@ public static NotificationResource Fetch(FetchNotificationOptions options, ITwil /// Fetch Notification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task FetchAsync(FetchNotificationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchNotificationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static NotificationResource Fetch( /// The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Configuration applies to. /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchNotificationOptions(pathChatServiceSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -134,7 +134,7 @@ public static NotificationResource Update(UpdateNotificationOptions options, ITw #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateNotificationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -213,7 +213,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn string removedFromConversationSound = null, bool? newMessageWithMediaEnabled = null, string newMessageWithMediaTemplate = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateNotificationOptions(pathChatServiceSid){ LogEnabled = logEnabled, NewMessageEnabled = newMessageEnabled, NewMessageTemplate = newMessageTemplate, NewMessageSound = newMessageSound, NewMessageBadgeCountEnabled = newMessageBadgeCountEnabled, AddedToConversationEnabled = addedToConversationEnabled, AddedToConversationTemplate = addedToConversationTemplate, AddedToConversationSound = addedToConversationSound, RemovedFromConversationEnabled = removedFromConversationEnabled, RemovedFromConversationTemplate = removedFromConversationTemplate, RemovedFromConversationSound = removedFromConversationSound, NewMessageWithMediaEnabled = newMessageWithMediaEnabled, NewMessageWithMediaTemplate = newMessageWithMediaTemplate }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookResource.cs b/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookResource.cs index c376b6953..d6f7d8a26 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookResource.cs @@ -80,7 +80,7 @@ public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClie /// Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -104,7 +104,7 @@ public static WebhookResource Fetch( /// The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWebhookOptions(pathChatServiceSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static WebhookResource Update(UpdateWebhookOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -190,7 +190,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( Uri postWebhookUrl = null, List filters = null, string method = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateWebhookOptions(pathChatServiceSid){ PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, Filters = filters, Method = method }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Service/ConfigurationResource.cs b/src/Twilio/Rest/Conversations/V1/Service/ConfigurationResource.cs index d6e75abea..d45a96c29 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/ConfigurationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/ConfigurationResource.cs @@ -67,7 +67,7 @@ public static ConfigurationResource Fetch(FetchConfigurationOptions options, ITw /// Fetch Configuration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration - public static async System.Threading.Tasks.Task FetchAsync(FetchConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static ConfigurationResource Fetch( /// The SID of the Service configuration resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchConfigurationOptions(pathChatServiceSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -134,7 +134,7 @@ public static ConfigurationResource Update(UpdateConfigurationOptions options, I #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateConfigurationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -177,7 +177,7 @@ public static async System.Threading.Tasks.Task UpdateAsy string defaultConversationRoleSid = null, string defaultChatServiceRoleSid = null, bool? reachabilityEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateConfigurationOptions(pathChatServiceSid){ DefaultConversationCreatorRoleSid = defaultConversationCreatorRoleSid, DefaultConversationRoleSid = defaultConversationRoleSid, DefaultChatServiceRoleSid = defaultChatServiceRoleSid, ReachabilityEnabled = reachabilityEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptResource.cs b/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptResource.cs index 5694cbb0c..323c2ce79 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptResource.cs @@ -89,7 +89,7 @@ public static DeliveryReceiptResource Fetch(FetchDeliveryReceiptOptions options, /// Fetch DeliveryReceipt parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeliveryReceipt - public static async System.Threading.Tasks.Task FetchAsync(FetchDeliveryReceiptOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDeliveryReceiptOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -122,7 +122,7 @@ public static DeliveryReceiptResource Fetch( /// A 34 character string that uniquely identifies this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of DeliveryReceipt - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathConversationSid, string pathMessageSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathConversationSid, string pathMessageSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDeliveryReceiptOptions(pathChatServiceSid, pathConversationSid, pathMessageSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -166,7 +166,7 @@ public static ResourceSet Read(ReadDeliveryReceiptOptio /// Read DeliveryReceipt parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeliveryReceipt - public static async System.Threading.Tasks.Task> ReadAsync(ReadDeliveryReceiptOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDeliveryReceiptOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -210,7 +210,7 @@ public static async System.Threading.Tasks.Task Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -165,7 +165,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string contentVariables = null, string subject = null, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMessageOptions(pathChatServiceSid, pathConversationSid){ Author = author, Body = body, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MediaSid = mediaSid, ContentSid = contentSid, ContentVariables = contentVariables, Subject = subject, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -215,7 +215,7 @@ public static bool Delete(DeleteMessageOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Message public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -244,7 +244,7 @@ public static bool Delete(string pathChatServiceSid, string pathConversationSid, /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteMessageOptions(pathChatServiceSid, pathConversationSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client, cancellationToken); @@ -288,7 +288,7 @@ public static MessageResource Fetch(FetchMessageOptions options, ITwilioRestClie /// Fetch Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -318,7 +318,7 @@ public static MessageResource Fetch( /// A 34 character string that uniquely identifies this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMessageOptions(pathChatServiceSid, pathConversationSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -360,7 +360,7 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -404,7 +404,7 @@ public static async System.Threading.Tasks.Task> Re MessageResource.OrderTypeEnum order = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMessageOptions(pathChatServiceSid, pathConversationSid){ Order = order, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -500,7 +500,7 @@ public static MessageResource Update(UpdateMessageOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -563,7 +563,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string attributes = null, string subject = null, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateMessageOptions(pathChatServiceSid, pathConversationSid, pathSid){ Author = author, Body = body, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, Subject = subject, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantResource.cs b/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantResource.cs index 64a3b5144..bc74a1e2c 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantResource.cs @@ -82,7 +82,7 @@ public static ParticipantResource Create(CreateParticipantOptions options, ITwil /// Create Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -149,7 +149,7 @@ public static async System.Threading.Tasks.Task CreateAsync string messagingBindingProjectedAddress = null, string roleSid = null, ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateParticipantOptions(pathChatServiceSid, pathConversationSid){ Identity = identity, MessagingBindingAddress = messagingBindingAddress, MessagingBindingProxyAddress = messagingBindingProxyAddress, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MessagingBindingProjectedAddress = messagingBindingProjectedAddress, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -199,7 +199,7 @@ public static bool Delete(DeleteParticipantOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of Participant public static async System.Threading.Tasks.Task DeleteAsync(DeleteParticipantOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -228,7 +228,7 @@ public static bool Delete(string pathChatServiceSid, string pathConversationSid, /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteParticipantOptions(pathChatServiceSid, pathConversationSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client, cancellationToken); @@ -272,7 +272,7 @@ public static ParticipantResource Fetch(FetchParticipantOptions options, ITwilio /// Fetch Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -302,7 +302,7 @@ public static ParticipantResource Fetch( /// A 34 character string that uniquely identifies this resource. Alternatively, you can pass a Participant's `identity` rather than the SID. /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchParticipantOptions(pathChatServiceSid, pathConversationSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -344,7 +344,7 @@ public static ResourceSet Read(ReadParticipantOptions optio /// Read Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -384,7 +384,7 @@ public static async System.Threading.Tasks.Task string pathConversationSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadParticipantOptions(pathChatServiceSid, pathConversationSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -480,7 +480,7 @@ public static ParticipantResource Update(UpdateParticipantOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateParticipantOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -555,7 +555,7 @@ public static async System.Threading.Tasks.Task UpdateAsync int? lastReadMessageIndex = null, string lastReadTimestamp = null, ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateParticipantOptions(pathChatServiceSid, pathConversationSid, pathSid){ DateCreated = dateCreated, DateUpdated = dateUpdated, Identity = identity, Attributes = attributes, RoleSid = roleSid, MessagingBindingProxyAddress = messagingBindingProxyAddress, MessagingBindingProjectedAddress = messagingBindingProjectedAddress, LastReadMessageIndex = lastReadMessageIndex, LastReadTimestamp = lastReadTimestamp, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookResource.cs b/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookResource.cs index 32a4798ed..493cf95ea 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookResource.cs @@ -95,7 +95,7 @@ public static WebhookResource Create(CreateWebhookOptions options, ITwilioRestCl /// Create Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -154,7 +154,7 @@ public static async System.Threading.Tasks.Task CreateAsync( List configurationTriggers = null, string configurationFlowSid = null, int? configurationReplayAfter = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateWebhookOptions(pathChatServiceSid, pathConversationSid, target){ ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid, ConfigurationReplayAfter = configurationReplayAfter }; return await CreateAsync(options, client, cancellationToken); @@ -204,7 +204,7 @@ public static bool Delete(DeleteWebhookOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Webhook public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebhookOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -231,7 +231,7 @@ public static bool Delete(string pathChatServiceSid, string pathConversationSid, /// A 34 character string that uniquely identifies this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteWebhookOptions(pathChatServiceSid, pathConversationSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -275,7 +275,7 @@ public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClie /// Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -305,7 +305,7 @@ public static WebhookResource Fetch( /// A 34 character string that uniquely identifies this resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWebhookOptions(pathChatServiceSid, pathConversationSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -347,7 +347,7 @@ public static ResourceSet Read(ReadWebhookOptions options, ITwi /// Read Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -387,7 +387,7 @@ public static async System.Threading.Tasks.Task> Re string pathConversationSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadWebhookOptions(pathChatServiceSid, pathConversationSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -483,7 +483,7 @@ public static WebhookResource Update(UpdateWebhookOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -538,7 +538,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( List configurationFilters = null, List configurationTriggers = null, string configurationFlowSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateWebhookOptions(pathChatServiceSid, pathConversationSid, pathSid){ ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Service/ConversationResource.cs b/src/Twilio/Rest/Conversations/V1/Service/ConversationResource.cs index 002ad8247..1fe5a23e9 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/ConversationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/ConversationResource.cs @@ -94,7 +94,7 @@ public static ConversationResource Create(CreateConversationOptions options, ITw /// Create Conversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task CreateAsync(CreateConversationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateConversationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -169,7 +169,7 @@ public static async System.Threading.Tasks.Task CreateAsyn string bindingsEmailAddress = null, string bindingsEmailName = null, ConversationResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateConversationOptions(pathChatServiceSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes, MessagingServiceSid = messagingServiceSid, DateCreated = dateCreated, DateUpdated = dateUpdated, State = state, TimersInactive = timersInactive, TimersClosed = timersClosed, BindingsEmailAddress = bindingsEmailAddress, BindingsEmailName = bindingsEmailName, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -217,7 +217,7 @@ public static bool Delete(DeleteConversationOptions options, ITwilioRestClient c /// Task that resolves to A single instance of Conversation public static async System.Threading.Tasks.Task DeleteAsync(DeleteConversationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -244,7 +244,7 @@ public static bool Delete(string pathChatServiceSid, string pathSid, Conversatio /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathSid, ConversationResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathSid, ConversationResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteConversationOptions(pathChatServiceSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client, cancellationToken); @@ -286,7 +286,7 @@ public static ConversationResource Fetch(FetchConversationOptions options, ITwil /// Fetch Conversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task FetchAsync(FetchConversationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchConversationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -313,7 +313,7 @@ public static ConversationResource Fetch( /// A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchConversationOptions(pathChatServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -353,7 +353,7 @@ public static ResourceSet Read(ReadConversationOptions opt /// Read Conversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conversation - public static async System.Threading.Tasks.Task> ReadAsync(ReadConversationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConversationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -401,7 +401,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateConversationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -574,7 +574,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn string bindingsEmailAddress = null, string bindingsEmailName = null, ConversationResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateConversationOptions(pathChatServiceSid, pathSid){ FriendlyName = friendlyName, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MessagingServiceSid = messagingServiceSid, State = state, TimersInactive = timersInactive, TimersClosed = timersClosed, UniqueName = uniqueName, BindingsEmailAddress = bindingsEmailAddress, BindingsEmailName = bindingsEmailName, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Service/ConversationWithParticipantsResource.cs b/src/Twilio/Rest/Conversations/V1/Service/ConversationWithParticipantsResource.cs index ea2fd0903..6362d8d5e 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/ConversationWithParticipantsResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/ConversationWithParticipantsResource.cs @@ -94,7 +94,7 @@ public static ConversationWithParticipantsResource Create(CreateConversationWith /// Create ConversationWithParticipants parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConversationWithParticipants - public static async System.Threading.Tasks.Task CreateAsync(CreateConversationWithParticipantsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateConversationWithParticipantsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -173,7 +173,7 @@ public static async System.Threading.Tasks.Task participant = null, ConversationWithParticipantsResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateConversationWithParticipantsOptions(pathChatServiceSid){ FriendlyName = friendlyName, UniqueName = uniqueName, DateCreated = dateCreated, DateUpdated = dateUpdated, MessagingServiceSid = messagingServiceSid, Attributes = attributes, State = state, TimersInactive = timersInactive, TimersClosed = timersClosed, BindingsEmailAddress = bindingsEmailAddress, BindingsEmailName = bindingsEmailName, Participant = participant, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationResource.cs b/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationResource.cs index 5bfed979a..2eb195e24 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationResource.cs @@ -81,7 +81,7 @@ public static ResourceSet Read(ReadParticipantC /// Read ParticipantConversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ParticipantConversation - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantConversationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantConversationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -125,7 +125,7 @@ public static async System.Threading.Tasks.Task Create Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -120,7 +120,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, RoleResource.RoleTypeEnum type, List permission, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateRoleOptions(pathChatServiceSid, friendlyName, type, permission){ }; return await CreateAsync(options, client, cancellationToken); @@ -168,7 +168,7 @@ public static bool Delete(DeleteRoleOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Role public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -193,7 +193,7 @@ public static bool Delete(string pathChatServiceSid, string pathSid, ITwilioRest /// The SID of the Role resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRoleOptions(pathChatServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -235,7 +235,7 @@ public static RoleResource Fetch(FetchRoleOptions options, ITwilioRestClient cli /// Fetch Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -262,7 +262,7 @@ public static RoleResource Fetch( /// The SID of the Role resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRoleOptions(pathChatServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadRoleOptions options, ITwilioRes /// Read Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -338,7 +338,7 @@ public static async System.Threading.Tasks.Task> ReadA string pathChatServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRoleOptions(pathChatServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -432,7 +432,7 @@ public static RoleResource Update(UpdateRoleOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -467,7 +467,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathChatServiceSid, string pathSid, List permission, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRoleOptions(pathChatServiceSid, pathSid, permission){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationResource.cs b/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationResource.cs index d17eb853b..a87d0f8d9 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationResource.cs @@ -104,7 +104,7 @@ public static bool Delete(DeleteUserConversationOptions options, ITwilioRestClie /// Task that resolves to A single instance of UserConversation public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserConversationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -131,7 +131,7 @@ public static bool Delete(string pathChatServiceSid, string pathUserSid, string /// The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). /// Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation - public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathUserSid, string pathConversationSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathUserSid, string pathConversationSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUserConversationOptions(pathChatServiceSid, pathUserSid, pathConversationSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -175,7 +175,7 @@ public static UserConversationResource Fetch(FetchUserConversationOptions option /// Fetch UserConversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation - public static async System.Threading.Tasks.Task FetchAsync(FetchUserConversationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserConversationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -205,7 +205,7 @@ public static UserConversationResource Fetch( /// The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). /// Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathUserSid, string pathConversationSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathUserSid, string pathConversationSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUserConversationOptions(pathChatServiceSid, pathUserSid, pathConversationSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -247,7 +247,7 @@ public static ResourceSet Read(ReadUserConversationOpt /// Read UserConversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation - public static async System.Threading.Tasks.Task> ReadAsync(ReadUserConversationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserConversationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -287,7 +287,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserConversationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -430,7 +430,7 @@ public static async System.Threading.Tasks.Task Update UserConversationResource.NotificationLevelEnum notificationLevel = null, DateTime? lastReadTimestamp = null, int? lastReadMessageIndex = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateUserConversationOptions(pathChatServiceSid, pathUserSid, pathConversationSid){ NotificationLevel = notificationLevel, LastReadTimestamp = lastReadTimestamp, LastReadMessageIndex = lastReadMessageIndex }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/Service/UserResource.cs b/src/Twilio/Rest/Conversations/V1/Service/UserResource.cs index d97121591..65deceeae 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/UserResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/UserResource.cs @@ -80,7 +80,7 @@ public static UserResource Create(CreateUserOptions options, ITwilioRestClient c /// 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -127,7 +127,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string attributes = null, string roleSid = null, UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateUserOptions(pathChatServiceSid, identity){ FriendlyName = friendlyName, Attributes = attributes, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -175,7 +175,7 @@ public static bool Delete(DeleteUserOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of User public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -202,7 +202,7 @@ public static bool Delete(string pathChatServiceSid, string pathSid, UserResourc /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathSid, UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathChatServiceSid, string pathSid, UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUserOptions(pathChatServiceSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client, cancellationToken); @@ -244,7 +244,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -271,7 +271,7 @@ public static UserResource Fetch( /// The SID of the User resource to fetch. This value can be either the `sid` or the `identity` of the User resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathChatServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUserOptions(pathChatServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -311,7 +311,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -347,7 +347,7 @@ public static async System.Threading.Tasks.Task> ReadA string pathChatServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUserOptions(pathChatServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -441,7 +441,7 @@ public static UserResource Update(UpdateUserOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -488,7 +488,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string attributes = null, string roleSid = null, UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateUserOptions(pathChatServiceSid, pathSid){ FriendlyName = friendlyName, Attributes = attributes, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/ServiceResource.cs b/src/Twilio/Rest/Conversations/V1/ServiceResource.cs index 64ab79fa1..fcb575146 100644 --- a/src/Twilio/Rest/Conversations/V1/ServiceResource.cs +++ b/src/Twilio/Rest/Conversations/V1/ServiceResource.cs @@ -66,7 +66,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -93,7 +93,7 @@ public static ServiceResource Create( /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateServiceOptions(friendlyName){ }; return await CreateAsync(options, client, cancellationToken); @@ -139,7 +139,7 @@ public static bool Delete(DeleteServiceOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -162,7 +162,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this resource. /// 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteServiceOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -202,7 +202,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -226,7 +226,7 @@ public static ServiceResource Fetch( /// A 34 character string that uniquely identifies this resource. /// 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchServiceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -264,7 +264,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -296,7 +296,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadServiceOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/User/UserConversationResource.cs b/src/Twilio/Rest/Conversations/V1/User/UserConversationResource.cs index fb45fe39f..dd46eb2d9 100644 --- a/src/Twilio/Rest/Conversations/V1/User/UserConversationResource.cs +++ b/src/Twilio/Rest/Conversations/V1/User/UserConversationResource.cs @@ -102,7 +102,7 @@ public static bool Delete(DeleteUserConversationOptions options, ITwilioRestClie /// Task that resolves to A single instance of UserConversation public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserConversationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -127,7 +127,7 @@ public static bool Delete(string pathUserSid, string pathConversationSid, ITwili /// The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). /// Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation - public static async System.Threading.Tasks.Task DeleteAsync(string pathUserSid, string pathConversationSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathUserSid, string pathConversationSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUserConversationOptions(pathUserSid, pathConversationSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -169,7 +169,7 @@ public static UserConversationResource Fetch(FetchUserConversationOptions option /// Fetch UserConversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation - public static async System.Threading.Tasks.Task FetchAsync(FetchUserConversationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserConversationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -196,7 +196,7 @@ public static UserConversationResource Fetch( /// The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). /// Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation - public static async System.Threading.Tasks.Task FetchAsync(string pathUserSid, string pathConversationSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathUserSid, string pathConversationSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUserConversationOptions(pathUserSid, pathConversationSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -236,7 +236,7 @@ public static ResourceSet Read(ReadUserConversationOpt /// Read UserConversation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserConversation - public static async System.Threading.Tasks.Task> ReadAsync(ReadUserConversationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserConversationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -272,7 +272,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserConversationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -409,7 +409,7 @@ public static async System.Threading.Tasks.Task Update UserConversationResource.NotificationLevelEnum notificationLevel = null, DateTime? lastReadTimestamp = null, int? lastReadMessageIndex = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateUserConversationOptions(pathUserSid, pathConversationSid){ NotificationLevel = notificationLevel, LastReadTimestamp = lastReadTimestamp, LastReadMessageIndex = lastReadMessageIndex }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Conversations/V1/UserResource.cs b/src/Twilio/Rest/Conversations/V1/UserResource.cs index c7c20eee2..d37bdede6 100644 --- a/src/Twilio/Rest/Conversations/V1/UserResource.cs +++ b/src/Twilio/Rest/Conversations/V1/UserResource.cs @@ -78,7 +78,7 @@ public static UserResource Create(CreateUserOptions options, ITwilioRestClient c /// 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -121,7 +121,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string attributes = null, string roleSid = null, UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateUserOptions(identity){ FriendlyName = friendlyName, Attributes = attributes, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -167,7 +167,7 @@ public static bool Delete(DeleteUserOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of User public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -192,7 +192,7 @@ public static bool Delete(string pathSid, UserResource.WebhookEnabledTypeEnum xT /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUserOptions(pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client, cancellationToken); @@ -232,7 +232,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -256,7 +256,7 @@ public static UserResource Fetch( /// The SID of the User resource to fetch. This value can be either the `sid` or the `identity` of the User resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUserOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -294,7 +294,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -326,7 +326,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUserOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -418,7 +418,7 @@ public static UserResource Update(UpdateUserOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -461,7 +461,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string attributes = null, string roleSid = null, UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateUserOptions(pathSid){ FriendlyName = friendlyName, Attributes = attributes, RoleSid = roleSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Events/V1/EventTypeResource.cs b/src/Twilio/Rest/Events/V1/EventTypeResource.cs index f125530b9..fb7c1250d 100644 --- a/src/Twilio/Rest/Events/V1/EventTypeResource.cs +++ b/src/Twilio/Rest/Events/V1/EventTypeResource.cs @@ -67,7 +67,7 @@ public static EventTypeResource Fetch(FetchEventTypeOptions options, ITwilioRest /// Fetch EventType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EventType - public static async System.Threading.Tasks.Task FetchAsync(FetchEventTypeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchEventTypeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static EventTypeResource Fetch( /// A string that uniquely identifies this Event Type. /// Client to make requests to Twilio /// Task that resolves to A single instance of EventType - public static async System.Threading.Tasks.Task FetchAsync(string pathType, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathType, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchEventTypeOptions(pathType){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadEventTypeOptions options, /// Read EventType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EventType - public static async System.Threading.Tasks.Task> ReadAsync(ReadEventTypeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEventTypeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -165,7 +165,7 @@ public static async System.Threading.Tasks.Task> string schemaId = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadEventTypeOptions(){ SchemaId = schemaId, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Events/V1/Schema/SchemaVersionResource.cs b/src/Twilio/Rest/Events/V1/Schema/SchemaVersionResource.cs index 7e561bd0d..b952cf65c 100644 --- a/src/Twilio/Rest/Events/V1/Schema/SchemaVersionResource.cs +++ b/src/Twilio/Rest/Events/V1/Schema/SchemaVersionResource.cs @@ -69,7 +69,7 @@ public static SchemaVersionResource Fetch(FetchSchemaVersionOptions options, ITw /// Fetch SchemaVersion parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SchemaVersion - public static async System.Threading.Tasks.Task FetchAsync(FetchSchemaVersionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSchemaVersionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static SchemaVersionResource Fetch( /// The version of the schema /// Client to make requests to Twilio /// Task that resolves to A single instance of SchemaVersion - public static async System.Threading.Tasks.Task FetchAsync(string pathId, int? pathSchemaVersion, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathId, int? pathSchemaVersion, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSchemaVersionOptions(pathId, pathSchemaVersion){ }; return await FetchAsync(options, client, cancellationToken); @@ -136,7 +136,7 @@ public static ResourceSet Read(ReadSchemaVersionOptions o /// Read SchemaVersion parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SchemaVersion - public static async System.Threading.Tasks.Task> ReadAsync(ReadSchemaVersionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSchemaVersionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static async System.Threading.Tasks.Task Fetch Schema parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Schema - public static async System.Threading.Tasks.Task FetchAsync(FetchSchemaOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSchemaOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static SchemaResource Fetch( /// The unique identifier of the schema. Each schema can have multiple versions, that share the same id. /// Client to make requests to Twilio /// Task that resolves to A single instance of Schema - public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathId, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSchemaOptions(pathId){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Events/V1/Sink/SinkTestResource.cs b/src/Twilio/Rest/Events/V1/Sink/SinkTestResource.cs index 50879169b..b70b86979 100644 --- a/src/Twilio/Rest/Events/V1/Sink/SinkTestResource.cs +++ b/src/Twilio/Rest/Events/V1/Sink/SinkTestResource.cs @@ -68,7 +68,7 @@ public static SinkTestResource Create(CreateSinkTestOptions options, ITwilioRest /// Create SinkTest parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SinkTest - public static async System.Threading.Tasks.Task CreateAsync(CreateSinkTestOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSinkTestOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -95,7 +95,7 @@ public static SinkTestResource Create( /// Task that resolves to A single instance of SinkTest public static async System.Threading.Tasks.Task CreateAsync( string pathSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSinkTestOptions(pathSid){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Events/V1/Sink/SinkValidateResource.cs b/src/Twilio/Rest/Events/V1/Sink/SinkValidateResource.cs index 37edb6fea..ba9f02101 100644 --- a/src/Twilio/Rest/Events/V1/Sink/SinkValidateResource.cs +++ b/src/Twilio/Rest/Events/V1/Sink/SinkValidateResource.cs @@ -68,7 +68,7 @@ public static SinkValidateResource Create(CreateSinkValidateOptions options, ITw /// Create SinkValidate parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SinkValidate - public static async System.Threading.Tasks.Task CreateAsync(CreateSinkValidateOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSinkValidateOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static SinkValidateResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathSid, string testId, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSinkValidateOptions(pathSid, testId){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Events/V1/SinkResource.cs b/src/Twilio/Rest/Events/V1/SinkResource.cs index b5431f351..ca65dc95f 100644 --- a/src/Twilio/Rest/Events/V1/SinkResource.cs +++ b/src/Twilio/Rest/Events/V1/SinkResource.cs @@ -95,7 +95,7 @@ public static SinkResource Create(CreateSinkOptions options, ITwilioRestClient c /// Create Sink parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sink - public static async System.Threading.Tasks.Task CreateAsync(CreateSinkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSinkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -130,7 +130,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string description, object sinkConfiguration, SinkResource.SinkTypeEnum sinkType, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSinkOptions(description, sinkConfiguration, sinkType){ }; return await CreateAsync(options, client, cancellationToken); @@ -176,7 +176,7 @@ public static bool Delete(DeleteSinkOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Sink public static async System.Threading.Tasks.Task DeleteAsync(DeleteSinkOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -199,7 +199,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this Sink. /// Client to make requests to Twilio /// Task that resolves to A single instance of Sink - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSinkOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -239,7 +239,7 @@ public static SinkResource Fetch(FetchSinkOptions options, ITwilioRestClient cli /// Fetch Sink parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sink - public static async System.Threading.Tasks.Task FetchAsync(FetchSinkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSinkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -263,7 +263,7 @@ public static SinkResource Fetch( /// A 34 character string that uniquely identifies this Sink. /// Client to make requests to Twilio /// Task that resolves to A single instance of Sink - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSinkOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -301,7 +301,7 @@ public static ResourceSet Read(ReadSinkOptions options, ITwilioRes /// Read Sink parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sink - public static async System.Threading.Tasks.Task> ReadAsync(ReadSinkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSinkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -341,7 +341,7 @@ public static async System.Threading.Tasks.Task> ReadA string status = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSinkOptions(){ InUse = inUse, Status = status, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -433,7 +433,7 @@ public static SinkResource Update(UpdateSinkOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSinkOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -464,7 +464,7 @@ public static SinkResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string description, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSinkOptions(pathSid, description){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventResource.cs b/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventResource.cs index 7925d2e6d..4b6a854f9 100644 --- a/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventResource.cs +++ b/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventResource.cs @@ -68,7 +68,7 @@ public static SubscribedEventResource Create(CreateSubscribedEventOptions option /// Create SubscribedEvent parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedEvent - public static async System.Threading.Tasks.Task CreateAsync(CreateSubscribedEventOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSubscribedEventOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task CreateA string pathSubscriptionSid, string type, int? schemaVersion = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSubscribedEventOptions(pathSubscriptionSid, type){ SchemaVersion = schemaVersion }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static bool Delete(DeleteSubscribedEventOptions options, ITwilioRestClien /// Task that resolves to A single instance of SubscribedEvent public static async System.Threading.Tasks.Task DeleteAsync(DeleteSubscribedEventOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -176,7 +176,7 @@ public static bool Delete(string pathSubscriptionSid, string pathType, ITwilioRe /// Type of event being subscribed to. /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedEvent - public static async System.Threading.Tasks.Task DeleteAsync(string pathSubscriptionSid, string pathType, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSubscriptionSid, string pathType, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSubscribedEventOptions(pathSubscriptionSid, pathType) ; return await DeleteAsync(options, client, cancellationToken); @@ -218,7 +218,7 @@ public static SubscribedEventResource Fetch(FetchSubscribedEventOptions options, /// Fetch SubscribedEvent parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedEvent - public static async System.Threading.Tasks.Task FetchAsync(FetchSubscribedEventOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSubscribedEventOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static SubscribedEventResource Fetch( /// Type of event being subscribed to. /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedEvent - public static async System.Threading.Tasks.Task FetchAsync(string pathSubscriptionSid, string pathType, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSubscriptionSid, string pathType, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSubscribedEventOptions(pathSubscriptionSid, pathType){ }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadSubscribedEventOptio /// Read SubscribedEvent parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedEvent - public static async System.Threading.Tasks.Task> ReadAsync(ReadSubscribedEventOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSubscribedEventOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateSubscribedEventOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -450,7 +450,7 @@ public static async System.Threading.Tasks.Task UpdateA string pathSubscriptionSid, string pathType, int? schemaVersion = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSubscribedEventOptions(pathSubscriptionSid, pathType){ SchemaVersion = schemaVersion }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Events/V1/SubscriptionResource.cs b/src/Twilio/Rest/Events/V1/SubscriptionResource.cs index 433328705..fdf1755ef 100644 --- a/src/Twilio/Rest/Events/V1/SubscriptionResource.cs +++ b/src/Twilio/Rest/Events/V1/SubscriptionResource.cs @@ -66,7 +66,7 @@ public static SubscriptionResource Create(CreateSubscriptionOptions options, ITw /// Create Subscription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Subscription - public static async System.Threading.Tasks.Task CreateAsync(CreateSubscriptionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSubscriptionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static async System.Threading.Tasks.Task CreateAsyn string description, string sinkSid, List types, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSubscriptionOptions(description, sinkSid, types){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteSubscriptionOptions options, ITwilioRestClient c /// Task that resolves to A single instance of Subscription public static async System.Threading.Tasks.Task DeleteAsync(DeleteSubscriptionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -170,7 +170,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this Subscription. /// Client to make requests to Twilio /// Task that resolves to A single instance of Subscription - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSubscriptionOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -210,7 +210,7 @@ public static SubscriptionResource Fetch(FetchSubscriptionOptions options, ITwil /// Fetch Subscription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Subscription - public static async System.Threading.Tasks.Task FetchAsync(FetchSubscriptionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSubscriptionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -234,7 +234,7 @@ public static SubscriptionResource Fetch( /// A 34 character string that uniquely identifies this Subscription. /// Client to make requests to Twilio /// Task that resolves to A single instance of Subscription - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSubscriptionOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -272,7 +272,7 @@ public static ResourceSet Read(ReadSubscriptionOptions opt /// Read Subscription parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Subscription - public static async System.Threading.Tasks.Task> ReadAsync(ReadSubscriptionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSubscriptionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -308,7 +308,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateSubscriptionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -435,7 +435,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn string pathSid, string description = null, string sinkSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSubscriptionOptions(pathSid){ Description = description, SinkSid = sinkSid }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/AssessmentsResource.cs b/src/Twilio/Rest/FlexApi/V1/AssessmentsResource.cs index 1201d7e53..95a6b80c5 100644 --- a/src/Twilio/Rest/FlexApi/V1/AssessmentsResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/AssessmentsResource.cs @@ -66,7 +66,7 @@ public static AssessmentsResource Create(CreateAssessmentsOptions options, ITwil /// Create Assessments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Assessments - public static async System.Threading.Tasks.Task CreateAsync(CreateAssessmentsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAssessmentsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -133,7 +133,7 @@ public static async System.Threading.Tasks.Task CreateAsync string answerId, string questionnaireSid, string authorization = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAssessmentsOptions(categorySid, categoryName, segmentId, agentId, offset, metricId, metricName, answerText, answerId, questionnaireSid){ Authorization = authorization }; return await CreateAsync(options, client, cancellationToken); @@ -171,7 +171,7 @@ public static ResourceSet Read(ReadAssessmentsOptions optio /// Read Assessments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Assessments - public static async System.Threading.Tasks.Task> ReadAsync(ReadAssessmentsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAssessmentsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -211,7 +211,7 @@ public static async System.Threading.Tasks.Task string segmentId = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAssessmentsOptions(){ Authorization = authorization, SegmentId = segmentId, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -303,7 +303,7 @@ public static AssessmentsResource Update(UpdateAssessmentsOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateAssessmentsOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -346,7 +346,7 @@ public static async System.Threading.Tasks.Task UpdateAsync string answerText, string answerId, string authorization = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateAssessmentsOptions(pathAssessmentSid, offset, answerText, answerId){ Authorization = authorization }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/ChannelResource.cs b/src/Twilio/Rest/FlexApi/V1/ChannelResource.cs index ba05f8fe8..9105dc74b 100644 --- a/src/Twilio/Rest/FlexApi/V1/ChannelResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/ChannelResource.cs @@ -66,7 +66,7 @@ public static ChannelResource Create(CreateChannelOptions options, ITwilioRestCl /// Create Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -129,7 +129,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string taskSid = null, string taskAttributes = null, bool? longLived = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateChannelOptions(flexFlowSid, identity, chatUserFriendlyName, chatFriendlyName){ Target = target, ChatUniqueName = chatUniqueName, PreEngagementData = preEngagementData, TaskSid = taskSid, TaskAttributes = taskAttributes, LongLived = longLived }; return await CreateAsync(options, client, cancellationToken); @@ -175,7 +175,7 @@ public static bool Delete(DeleteChannelOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Channel public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -198,7 +198,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Flex chat channel resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteChannelOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -238,7 +238,7 @@ public static ChannelResource Fetch(FetchChannelOptions options, ITwilioRestClie /// Fetch Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -262,7 +262,7 @@ public static ChannelResource Fetch( /// The SID of the Flex chat channel resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchChannelOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -300,7 +300,7 @@ public static ResourceSet Read(ReadChannelOptions options, ITwi /// Read Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -332,7 +332,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadChannelOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs b/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs index 995550220..8e2329bd8 100644 --- a/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs @@ -79,7 +79,7 @@ public static ConfigurationResource Fetch(FetchConfigurationOptions options, ITw /// Fetch Configuration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration - public static async System.Threading.Tasks.Task FetchAsync(FetchConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static ConfigurationResource Fetch( /// The Pinned UI version of the Configuration resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Configuration - public static async System.Threading.Tasks.Task FetchAsync(string uiVersion = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string uiVersion = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchConfigurationOptions(){ UiVersion = uiVersion }; return await FetchAsync(options, client, cancellationToken); @@ -145,7 +145,7 @@ public static ConfigurationResource Update(UpdateConfigurationOptions options, I #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateConfigurationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -169,7 +169,7 @@ public static ConfigurationResource Update( /// Task that resolves to A single instance of Configuration public static async System.Threading.Tasks.Task UpdateAsync( ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateConfigurationOptions(){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/FlexFlowResource.cs b/src/Twilio/Rest/FlexApi/V1/FlexFlowResource.cs index 43622eadf..3257ac606 100644 --- a/src/Twilio/Rest/FlexApi/V1/FlexFlowResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/FlexFlowResource.cs @@ -97,7 +97,7 @@ public static FlexFlowResource Create(CreateFlexFlowOptions options, ITwilioRest /// Create FlexFlow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexFlow - public static async System.Threading.Tasks.Task CreateAsync(CreateFlexFlowOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateFlexFlowOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -188,7 +188,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? longLived = null, bool? janitorEnabled = null, int? integrationRetryCount = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateFlexFlowOptions(friendlyName, chatServiceSid, channelType){ ContactIdentity = contactIdentity, Enabled = enabled, IntegrationType = integrationType, IntegrationFlowSid = integrationFlowSid, IntegrationUrl = integrationUrl, IntegrationWorkspaceSid = integrationWorkspaceSid, IntegrationWorkflowSid = integrationWorkflowSid, IntegrationChannel = integrationChannel, IntegrationTimeout = integrationTimeout, IntegrationPriority = integrationPriority, IntegrationCreationOnMessage = integrationCreationOnMessage, LongLived = longLived, JanitorEnabled = janitorEnabled, IntegrationRetryCount = integrationRetryCount }; return await CreateAsync(options, client, cancellationToken); @@ -234,7 +234,7 @@ public static bool Delete(DeleteFlexFlowOptions options, ITwilioRestClient clien /// Task that resolves to A single instance of FlexFlow public static async System.Threading.Tasks.Task DeleteAsync(DeleteFlexFlowOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -257,7 +257,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Flex Flow resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexFlow - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteFlexFlowOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -297,7 +297,7 @@ public static FlexFlowResource Fetch(FetchFlexFlowOptions options, ITwilioRestCl /// Fetch FlexFlow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexFlow - public static async System.Threading.Tasks.Task FetchAsync(FetchFlexFlowOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchFlexFlowOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static FlexFlowResource Fetch( /// The SID of the Flex Flow resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexFlow - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchFlexFlowOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -359,7 +359,7 @@ public static ResourceSet Read(ReadFlexFlowOptions options, IT /// Read FlexFlow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexFlow - public static async System.Threading.Tasks.Task> ReadAsync(ReadFlexFlowOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFlexFlowOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -395,7 +395,7 @@ public static async System.Threading.Tasks.Task> R string friendlyName = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadFlexFlowOptions(){ FriendlyName = friendlyName, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -487,7 +487,7 @@ public static FlexFlowResource Update(UpdateFlexFlowOptions options, ITwilioRest #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlexFlowOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -582,7 +582,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? longLived = null, bool? janitorEnabled = null, int? integrationRetryCount = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateFlexFlowOptions(pathSid){ FriendlyName = friendlyName, ChatServiceSid = chatServiceSid, ChannelType = channelType, ContactIdentity = contactIdentity, Enabled = enabled, IntegrationType = integrationType, IntegrationFlowSid = integrationFlowSid, IntegrationUrl = integrationUrl, IntegrationWorkspaceSid = integrationWorkspaceSid, IntegrationWorkflowSid = integrationWorkflowSid, IntegrationChannel = integrationChannel, IntegrationTimeout = integrationTimeout, IntegrationPriority = integrationPriority, IntegrationCreationOnMessage = integrationCreationOnMessage, LongLived = longLived, JanitorEnabled = janitorEnabled, IntegrationRetryCount = integrationRetryCount }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentResource.cs b/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentResource.cs index 70e3bc890..7ff54151c 100644 --- a/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentResource.cs @@ -66,7 +66,7 @@ public static InsightsAssessmentsCommentResource Create(CreateInsightsAssessment /// Create InsightsAssessmentsComment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsAssessmentsComment - public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsAssessmentsCommentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsAssessmentsCommentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -117,7 +117,7 @@ public static async System.Threading.Tasks.Task Read(ReadInsightsA /// Read InsightsAssessmentsComment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsAssessmentsComment - public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsAssessmentsCommentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsAssessmentsCommentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -199,7 +199,7 @@ public static async System.Threading.Tasks.Task Read(ReadInsightsConver /// Read InsightsConversations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsConversations - public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsConversationsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsConversationsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task Create InsightsQuestionnairesCategory parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnairesCategory - public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsQuestionnairesCategoryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsQuestionnairesCategoryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -97,7 +97,7 @@ public static InsightsQuestionnairesCategoryResource Create( public static async System.Threading.Tasks.Task CreateAsync( string name, string authorization = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateInsightsQuestionnairesCategoryOptions(name){ Authorization = authorization }; return await CreateAsync(options, client, cancellationToken); @@ -143,7 +143,7 @@ public static bool Delete(DeleteInsightsQuestionnairesCategoryOptions options, I /// Task that resolves to A single instance of InsightsQuestionnairesCategory public static async System.Threading.Tasks.Task DeleteAsync(DeleteInsightsQuestionnairesCategoryOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -168,7 +168,7 @@ public static bool Delete(string pathCategorySid, string authorization = null, I /// The Authorization HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnairesCategory - public static async System.Threading.Tasks.Task DeleteAsync(string pathCategorySid, string authorization = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathCategorySid, string authorization = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteInsightsQuestionnairesCategoryOptions(pathCategorySid) { Authorization = authorization }; return await DeleteAsync(options, client, cancellationToken); @@ -206,7 +206,7 @@ public static ResourceSet Read(ReadInsig /// Read InsightsQuestionnairesCategory parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnairesCategory - public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsQuestionnairesCategoryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsQuestionnairesCategoryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -242,7 +242,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateInsightsQuestionnairesCategoryOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -369,7 +369,7 @@ public static async System.Threading.Tasks.Task Create InsightsQuestionnairesQuestion parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnairesQuestion - public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsQuestionnairesQuestionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsQuestionnairesQuestionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -113,7 +113,7 @@ public static async System.Threading.Tasks.Task Task that resolves to A single instance of InsightsQuestionnairesQuestion public static async System.Threading.Tasks.Task DeleteAsync(DeleteInsightsQuestionnairesQuestionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -184,7 +184,7 @@ public static bool Delete(string pathQuestionSid, string authorization = null, I /// The Authorization HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnairesQuestion - public static async System.Threading.Tasks.Task DeleteAsync(string pathQuestionSid, string authorization = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathQuestionSid, string authorization = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteInsightsQuestionnairesQuestionOptions(pathQuestionSid) { Authorization = authorization }; return await DeleteAsync(options, client, cancellationToken); @@ -222,7 +222,7 @@ public static ResourceSet Read(ReadInsig /// Read InsightsQuestionnairesQuestion parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnairesQuestion - public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsQuestionnairesQuestionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsQuestionnairesQuestionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -262,7 +262,7 @@ public static async System.Threading.Tasks.Task categorySid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadInsightsQuestionnairesQuestionOptions(){ Authorization = authorization, CategorySid = categorySid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -354,7 +354,7 @@ public static InsightsQuestionnairesQuestionResource Update(UpdateInsightsQuesti #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateInsightsQuestionnairesQuestionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -405,7 +405,7 @@ public static async System.Threading.Tasks.Task Create InsightsQuestionnaires parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnaires - public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsQuestionnairesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsQuestionnairesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task bool? active = null, List questionSids = null, string authorization = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateInsightsQuestionnairesOptions(name){ Description = description, Active = active, QuestionSids = questionSids, Authorization = authorization }; return await CreateAsync(options, client, cancellationToken); @@ -155,7 +155,7 @@ public static bool Delete(DeleteInsightsQuestionnairesOptions options, ITwilioRe /// Task that resolves to A single instance of InsightsQuestionnaires public static async System.Threading.Tasks.Task DeleteAsync(DeleteInsightsQuestionnairesOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -180,7 +180,7 @@ public static bool Delete(string pathQuestionnaireSid, string authorization = nu /// The Authorization HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnaires - public static async System.Threading.Tasks.Task DeleteAsync(string pathQuestionnaireSid, string authorization = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathQuestionnaireSid, string authorization = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteInsightsQuestionnairesOptions(pathQuestionnaireSid) { Authorization = authorization }; return await DeleteAsync(options, client, cancellationToken); @@ -220,7 +220,7 @@ public static InsightsQuestionnairesResource Fetch(FetchInsightsQuestionnairesOp /// Fetch InsightsQuestionnaires parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnaires - public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsQuestionnairesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsQuestionnairesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -247,7 +247,7 @@ public static InsightsQuestionnairesResource Fetch( /// The Authorization HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnaires - public static async System.Threading.Tasks.Task FetchAsync(string pathQuestionnaireSid, string authorization = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathQuestionnaireSid, string authorization = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInsightsQuestionnairesOptions(pathQuestionnaireSid){ Authorization = authorization }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadInsightsQuest /// Read InsightsQuestionnaires parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsQuestionnaires - public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsQuestionnairesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsQuestionnairesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -325,7 +325,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateInsightsQuestionnairesOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -464,7 +464,7 @@ public static async System.Threading.Tasks.Task string description = null, List questionSids = null, string authorization = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateInsightsQuestionnairesOptions(pathQuestionnaireSid, active){ Name = name, Description = description, QuestionSids = questionSids, Authorization = authorization }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsResource.cs b/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsResource.cs index d742bead2..53dd2dfb8 100644 --- a/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsResource.cs @@ -65,7 +65,7 @@ public static ResourceSet Read(ReadInsightsSegmentsOpt /// Read InsightsSegments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsSegments - public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsSegmentsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInsightsSegmentsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task reservationId = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadInsightsSegmentsOptions(){ Authorization = authorization, SegmentId = segmentId, ReservationId = reservationId, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsSessionResource.cs b/src/Twilio/Rest/FlexApi/V1/InsightsSessionResource.cs index d53f904a7..fe5fbd7d0 100644 --- a/src/Twilio/Rest/FlexApi/V1/InsightsSessionResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/InsightsSessionResource.cs @@ -66,7 +66,7 @@ public static InsightsSessionResource Create(CreateInsightsSessionOptions option /// Create InsightsSession parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsSession - public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsSessionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateInsightsSessionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -93,7 +93,7 @@ public static InsightsSessionResource Create( /// Task that resolves to A single instance of InsightsSession public static async System.Threading.Tasks.Task CreateAsync( string authorization = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateInsightsSessionOptions(){ Authorization = authorization }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsResource.cs b/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsResource.cs index 7de0d7aec..5ad2bfcb1 100644 --- a/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsResource.cs @@ -65,7 +65,7 @@ public static InsightsSettingsAnswerSetsResource Fetch(FetchInsightsSettingsAnsw /// Fetch InsightsSettingsAnswerSets parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsSettingsAnswerSets - public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsSettingsAnswerSetsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsSettingsAnswerSetsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -89,7 +89,7 @@ public static InsightsSettingsAnswerSetsResource Fetch( /// The Authorization HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsSettingsAnswerSets - public static async System.Threading.Tasks.Task FetchAsync(string authorization = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string authorization = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInsightsSettingsAnswerSetsOptions(){ Authorization = authorization }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentResource.cs b/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentResource.cs index d68e43ff1..ad4ed54b4 100644 --- a/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentResource.cs @@ -65,7 +65,7 @@ public static InsightsSettingsCommentResource Fetch(FetchInsightsSettingsComment /// Fetch InsightsSettingsComment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsSettingsComment - public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsSettingsCommentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsSettingsCommentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -89,7 +89,7 @@ public static InsightsSettingsCommentResource Fetch( /// The Authorization HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsSettingsComment - public static async System.Threading.Tasks.Task FetchAsync(string authorization = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string authorization = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInsightsSettingsCommentOptions(){ Authorization = authorization }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesResource.cs b/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesResource.cs index c7d1967a1..77e0227ef 100644 --- a/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesResource.cs @@ -65,7 +65,7 @@ public static InsightsUserRolesResource Fetch(FetchInsightsUserRolesOptions opti /// Fetch InsightsUserRoles parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsUserRoles - public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsUserRolesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsUserRolesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -89,7 +89,7 @@ public static InsightsUserRolesResource Fetch( /// The Authorization HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of InsightsUserRoles - public static async System.Threading.Tasks.Task FetchAsync(string authorization = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string authorization = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInsightsUserRolesOptions(){ Authorization = authorization }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteResource.cs b/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteResource.cs index 400988e8a..9a32521d5 100644 --- a/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteResource.cs @@ -70,7 +70,7 @@ public static InteractionChannelInviteResource Create(CreateInteractionChannelIn /// Create InteractionChannelInvite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannelInvite - public static async System.Threading.Tasks.Task CreateAsync(CreateInteractionChannelInviteOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateInteractionChannelInviteOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task Read(ReadInteraction /// Read InteractionChannelInvite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannelInvite - public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionChannelInviteOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionChannelInviteOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -187,7 +187,7 @@ public static async System.Threading.Tasks.Task Create InteractionChannelParticipant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannelParticipant - public static async System.Threading.Tasks.Task CreateAsync(CreateInteractionChannelParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateInteractionChannelParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -141,7 +141,7 @@ public static async System.Threading.Tasks.Task Read(ReadIntera /// Read InteractionChannelParticipant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannelParticipant - public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionChannelParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionChannelParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -223,7 +223,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateInteractionChannelParticipantOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -358,7 +358,7 @@ public static async System.Threading.Tasks.Task Fetch InteractionChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannel - public static async System.Threading.Tasks.Task FetchAsync(FetchInteractionChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchInteractionChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -143,7 +143,7 @@ public static InteractionChannelResource Fetch( /// The unique string created by Twilio to identify an Interaction Channel resource, prefixed with UO. /// Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannel - public static async System.Threading.Tasks.Task FetchAsync(string pathInteractionSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathInteractionSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInteractionChannelOptions(pathInteractionSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -183,7 +183,7 @@ public static ResourceSet Read(ReadInteractionChanne /// Read InteractionChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -219,7 +219,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateInteractionChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -352,7 +352,7 @@ public static async System.Threading.Tasks.Task Upda string pathSid, InteractionChannelResource.UpdateChannelStatusEnum status, object routing = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateInteractionChannelOptions(pathInteractionSid, pathSid, status){ Routing = routing }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/InteractionResource.cs b/src/Twilio/Rest/FlexApi/V1/InteractionResource.cs index 9a22071d6..eb9ed53b1 100644 --- a/src/Twilio/Rest/FlexApi/V1/InteractionResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/InteractionResource.cs @@ -66,7 +66,7 @@ public static InteractionResource Create(CreateInteractionOptions options, ITwil /// Create Interaction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Interaction - public static async System.Threading.Tasks.Task CreateAsync(CreateInteractionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateInteractionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static async System.Threading.Tasks.Task CreateAsync object channel, object routing = null, string interactionContextSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateInteractionOptions(channel){ Routing = routing, InteractionContextSid = interactionContextSid }; return await CreateAsync(options, client, cancellationToken); @@ -141,7 +141,7 @@ public static InteractionResource Fetch(FetchInteractionOptions options, ITwilio /// Fetch Interaction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Interaction - public static async System.Threading.Tasks.Task FetchAsync(FetchInteractionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchInteractionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -165,7 +165,7 @@ public static InteractionResource Fetch( /// The SID of the Interaction resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Interaction - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInteractionOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsResource.cs b/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsResource.cs index 10584c773..278460000 100644 --- a/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsResource.cs @@ -68,7 +68,7 @@ public static PluginVersionsResource Create(CreatePluginVersionsOptions options, /// Create PluginVersions parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginVersions - public static async System.Threading.Tasks.Task CreateAsync(CreatePluginVersionsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreatePluginVersionsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -123,7 +123,7 @@ public static async System.Threading.Tasks.Task CreateAs string cliVersion = null, string validateStatus = null, string flexMetadata = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreatePluginVersionsOptions(pathPluginSid, version, pluginUrl){ Changelog = changelog, Private = _private, CliVersion = cliVersion, ValidateStatus = validateStatus, FlexMetadata = flexMetadata }; return await CreateAsync(options, client, cancellationToken); @@ -165,7 +165,7 @@ public static PluginVersionsResource Fetch(FetchPluginVersionsOptions options, I /// Fetch PluginVersions parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginVersions - public static async System.Threading.Tasks.Task FetchAsync(FetchPluginVersionsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPluginVersionsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -195,7 +195,7 @@ public static PluginVersionsResource Fetch( /// The Flex-Metadata HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginVersions - public static async System.Threading.Tasks.Task FetchAsync(string pathPluginSid, string pathSid, string flexMetadata = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathPluginSid, string pathSid, string flexMetadata = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPluginVersionsOptions(pathPluginSid, pathSid){ FlexMetadata = flexMetadata }; return await FetchAsync(options, client, cancellationToken); @@ -235,7 +235,7 @@ public static ResourceSet Read(ReadPluginVersionsOptions /// Read PluginVersions parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginVersions - public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginVersionsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginVersionsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -275,7 +275,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdatePluginArchiveOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static PluginArchiveResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string flexMetadata = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdatePluginArchiveOptions(pathSid){ FlexMetadata = flexMetadata }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginResource.cs b/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginResource.cs index d9bb8ddbc..fc7018310 100644 --- a/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginResource.cs @@ -69,7 +69,7 @@ public static ConfiguredPluginResource Fetch(FetchConfiguredPluginOptions option /// Fetch ConfiguredPlugin parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConfiguredPlugin - public static async System.Threading.Tasks.Task FetchAsync(FetchConfiguredPluginOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchConfiguredPluginOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static ConfiguredPluginResource Fetch( /// The Flex-Metadata HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of ConfiguredPlugin - public static async System.Threading.Tasks.Task FetchAsync(string pathConfigurationSid, string pathPluginSid, string flexMetadata = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathConfigurationSid, string pathPluginSid, string flexMetadata = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchConfiguredPluginOptions(pathConfigurationSid, pathPluginSid){ FlexMetadata = flexMetadata }; return await FetchAsync(options, client, cancellationToken); @@ -139,7 +139,7 @@ public static ResourceSet Read(ReadConfiguredPluginOpt /// Read ConfiguredPlugin parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConfiguredPlugin - public static async System.Threading.Tasks.Task> ReadAsync(ReadConfiguredPluginOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConfiguredPluginOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -179,7 +179,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdatePluginConfigurationArchiveOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static PluginConfigurationArchiveResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string flexMetadata = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdatePluginConfigurationArchiveOptions(pathSid){ FlexMetadata = flexMetadata }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/PluginConfigurationResource.cs b/src/Twilio/Rest/FlexApi/V1/PluginConfigurationResource.cs index ada3eb686..84bd3c8bf 100644 --- a/src/Twilio/Rest/FlexApi/V1/PluginConfigurationResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/PluginConfigurationResource.cs @@ -66,7 +66,7 @@ public static PluginConfigurationResource Create(CreatePluginConfigurationOption /// Create PluginConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginConfiguration - public static async System.Threading.Tasks.Task CreateAsync(CreatePluginConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreatePluginConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task Cre List plugins = null, string description = null, string flexMetadata = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreatePluginConfigurationOptions(name){ Plugins = plugins, Description = description, FlexMetadata = flexMetadata }; return await CreateAsync(options, client, cancellationToken); @@ -145,7 +145,7 @@ public static PluginConfigurationResource Fetch(FetchPluginConfigurationOptions /// Fetch PluginConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginConfiguration - public static async System.Threading.Tasks.Task FetchAsync(FetchPluginConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPluginConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static PluginConfigurationResource Fetch( /// The Flex-Metadata HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginConfiguration - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string flexMetadata = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string flexMetadata = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPluginConfigurationOptions(pathSid){ FlexMetadata = flexMetadata }; return await FetchAsync(options, client, cancellationToken); @@ -210,7 +210,7 @@ public static ResourceSet Read(ReadPluginConfigurat /// Read PluginConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginConfiguration - public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -246,7 +246,7 @@ public static async System.Threading.Tasks.Task Create PluginRelease parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginRelease - public static async System.Threading.Tasks.Task CreateAsync(CreatePluginReleaseOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreatePluginReleaseOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -97,7 +97,7 @@ public static PluginReleaseResource Create( public static async System.Threading.Tasks.Task CreateAsync( string configurationId, string flexMetadata = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreatePluginReleaseOptions(configurationId){ FlexMetadata = flexMetadata }; return await CreateAsync(options, client, cancellationToken); @@ -137,7 +137,7 @@ public static PluginReleaseResource Fetch(FetchPluginReleaseOptions options, ITw /// Fetch PluginRelease parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginRelease - public static async System.Threading.Tasks.Task FetchAsync(FetchPluginReleaseOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPluginReleaseOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -164,7 +164,7 @@ public static PluginReleaseResource Fetch( /// The Flex-Metadata HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginRelease - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string flexMetadata = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string flexMetadata = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPluginReleaseOptions(pathSid){ FlexMetadata = flexMetadata }; return await FetchAsync(options, client, cancellationToken); @@ -202,7 +202,7 @@ public static ResourceSet Read(ReadPluginReleaseOptions o /// Read PluginRelease parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PluginRelease - public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginReleaseOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginReleaseOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -238,7 +238,7 @@ public static async System.Threading.Tasks.Task Create Plugin parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Plugin - public static async System.Threading.Tasks.Task CreateAsync(CreatePluginOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreatePluginOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string friendlyName = null, string description = null, string flexMetadata = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreatePluginOptions(uniqueName){ FriendlyName = friendlyName, Description = description, FlexMetadata = flexMetadata }; return await CreateAsync(options, client, cancellationToken); @@ -145,7 +145,7 @@ public static PluginResource Fetch(FetchPluginOptions options, ITwilioRestClient /// Fetch Plugin parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Plugin - public static async System.Threading.Tasks.Task FetchAsync(FetchPluginOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPluginOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static PluginResource Fetch( /// The Flex-Metadata HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Plugin - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string flexMetadata = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string flexMetadata = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPluginOptions(pathSid){ FlexMetadata = flexMetadata }; return await FetchAsync(options, client, cancellationToken); @@ -210,7 +210,7 @@ public static ResourceSet Read(ReadPluginOptions options, ITwili /// Read Plugin parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Plugin - public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPluginOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -246,7 +246,7 @@ public static async System.Threading.Tasks.Task> Rea string flexMetadata = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadPluginOptions(){ FlexMetadata = flexMetadata, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -338,7 +338,7 @@ public static PluginResource Update(UpdatePluginOptions options, ITwilioRestClie #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdatePluginOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -377,7 +377,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string friendlyName = null, string description = null, string flexMetadata = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdatePluginOptions(pathSid){ FriendlyName = friendlyName, Description = description, FlexMetadata = flexMetadata }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveResource.cs b/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveResource.cs index f1a25ca8a..1b2765c41 100644 --- a/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveResource.cs @@ -72,7 +72,7 @@ public static PluginVersionArchiveResource Update(UpdatePluginVersionArchiveOpti #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdatePluginVersionArchiveOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -107,7 +107,7 @@ public static async System.Threading.Tasks.Task Up string pathPluginSid, string pathSid, string flexMetadata = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdatePluginVersionArchiveOptions(pathPluginSid, pathSid){ FlexMetadata = flexMetadata }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusResource.cs b/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusResource.cs index fc8dd394b..d249d682a 100644 --- a/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusResource.cs @@ -80,7 +80,7 @@ public static ProvisioningStatusResource Fetch(FetchProvisioningStatusOptions op /// Fetch ProvisioningStatus parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ProvisioningStatus - public static async System.Threading.Tasks.Task FetchAsync(FetchProvisioningStatusOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchProvisioningStatusOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static ProvisioningStatusResource Fetch( /// fetch /// Client to make requests to Twilio /// Task that resolves to A single instance of ProvisioningStatus - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchProvisioningStatusOptions(){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V1/WebChannelResource.cs b/src/Twilio/Rest/FlexApi/V1/WebChannelResource.cs index 04ff47499..f7a71bb3c 100644 --- a/src/Twilio/Rest/FlexApi/V1/WebChannelResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/WebChannelResource.cs @@ -77,7 +77,7 @@ public static WebChannelResource Create(CreateWebChannelOptions options, ITwilio /// Create WebChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WebChannel - public static async System.Threading.Tasks.Task CreateAsync(CreateWebChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateWebChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -124,7 +124,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string chatFriendlyName, string chatUniqueName = null, string preEngagementData = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateWebChannelOptions(flexFlowSid, identity, customerFriendlyName, chatFriendlyName){ ChatUniqueName = chatUniqueName, PreEngagementData = preEngagementData }; return await CreateAsync(options, client, cancellationToken); @@ -170,7 +170,7 @@ public static bool Delete(DeleteWebChannelOptions options, ITwilioRestClient cli /// Task that resolves to A single instance of WebChannel public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -193,7 +193,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the WebChannel resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of WebChannel - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteWebChannelOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -233,7 +233,7 @@ public static WebChannelResource Fetch(FetchWebChannelOptions options, ITwilioRe /// Fetch WebChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WebChannel - public static async System.Threading.Tasks.Task FetchAsync(FetchWebChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -257,7 +257,7 @@ public static WebChannelResource Fetch( /// The SID of the WebChannel resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of WebChannel - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWebChannelOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -295,7 +295,7 @@ public static ResourceSet Read(ReadWebChannelOptions options /// Read WebChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WebChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadWebChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWebChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -327,7 +327,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadWebChannelOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -419,7 +419,7 @@ public static WebChannelResource Update(UpdateWebChannelOptions options, ITwilio #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -454,7 +454,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, WebChannelResource.ChatStatusEnum chatStatus = null, string postEngagementData = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateWebChannelOptions(pathSid){ ChatStatus = chatStatus, PostEngagementData = postEngagementData }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V2/FlexUserResource.cs b/src/Twilio/Rest/FlexApi/V2/FlexUserResource.cs index ea3f74ffd..c0eb6c6c0 100644 --- a/src/Twilio/Rest/FlexApi/V2/FlexUserResource.cs +++ b/src/Twilio/Rest/FlexApi/V2/FlexUserResource.cs @@ -69,7 +69,7 @@ public static FlexUserResource Fetch(FetchFlexUserOptions options, ITwilioRestCl /// Fetch FlexUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexUser - public static async System.Threading.Tasks.Task FetchAsync(FetchFlexUserOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchFlexUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static FlexUserResource Fetch( /// The unique id for the flex user to be retrieved. /// Client to make requests to Twilio /// Task that resolves to A single instance of FlexUser - public static async System.Threading.Tasks.Task FetchAsync(string pathInstanceSid, string pathFlexUserSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathInstanceSid, string pathFlexUserSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchFlexUserOptions(pathInstanceSid, pathFlexUserSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -141,7 +141,7 @@ public static FlexUserResource Update(UpdateFlexUserOptions options, ITwilioRest #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlexUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -196,7 +196,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string friendlyName = null, string userSid = null, string locale = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateFlexUserOptions(pathInstanceSid, pathFlexUserSid){ FirstName = firstName, LastName = lastName, Email = email, FriendlyName = friendlyName, UserSid = userSid, Locale = locale }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FlexApi/V2/WebChannelsResource.cs b/src/Twilio/Rest/FlexApi/V2/WebChannelsResource.cs index 2578c78ed..60f8f409c 100644 --- a/src/Twilio/Rest/FlexApi/V2/WebChannelsResource.cs +++ b/src/Twilio/Rest/FlexApi/V2/WebChannelsResource.cs @@ -66,7 +66,7 @@ public static WebChannelsResource Create(CreateWebChannelsOptions options, ITwil /// Create WebChannels parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WebChannels - public static async System.Threading.Tasks.Task CreateAsync(CreateWebChannelsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateWebChannelsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task CreateAsync string customerFriendlyName = null, string preEngagementData = null, string uiVersion = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateWebChannelsOptions(addressSid){ ChatFriendlyName = chatFriendlyName, CustomerFriendlyName = customerFriendlyName, PreEngagementData = preEngagementData, UiVersion = uiVersion }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/FrontlineApi/V1/UserResource.cs b/src/Twilio/Rest/FrontlineApi/V1/UserResource.cs index 5181df693..9975cead9 100644 --- a/src/Twilio/Rest/FrontlineApi/V1/UserResource.cs +++ b/src/Twilio/Rest/FrontlineApi/V1/UserResource.cs @@ -80,7 +80,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -104,7 +104,7 @@ public static UserResource Fetch( /// The SID of the User resource to fetch. This value can be either the `sid` or the `identity` of the User resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUserOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static UserResource Update(UpdateUserOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -190,7 +190,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string avatar = null, UserResource.StateTypeEnum state = null, bool? isAvailable = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateUserOptions(pathSid){ FriendlyName = friendlyName, Avatar = avatar, State = state, IsAvailable = isAvailable }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Iam/V1/ApiKeyResource.cs b/src/Twilio/Rest/Iam/V1/ApiKeyResource.cs index 266ea8f82..cb99c1b50 100644 --- a/src/Twilio/Rest/Iam/V1/ApiKeyResource.cs +++ b/src/Twilio/Rest/Iam/V1/ApiKeyResource.cs @@ -73,7 +73,7 @@ public static bool Delete(DeleteApiKeyOptions options, ITwilioRestClient client /// Task that resolves to A single instance of ApiKey public static async System.Threading.Tasks.Task DeleteAsync(DeleteApiKeyOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the Key resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of ApiKey - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteApiKeyOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -136,7 +136,7 @@ public static ApiKeyResource Fetch(FetchApiKeyOptions options, ITwilioRestClient /// Fetch ApiKey parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ApiKey - public static async System.Threading.Tasks.Task FetchAsync(FetchApiKeyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchApiKeyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -160,7 +160,7 @@ public static ApiKeyResource Fetch( /// The Twilio-provided string that uniquely identifies the Key resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ApiKey - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchApiKeyOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -203,7 +203,7 @@ public static ApiKeyResource Update(UpdateApiKeyOptions options, ITwilioRestClie #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateApiKeyOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -238,7 +238,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string friendlyName = null, object policy = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateApiKeyOptions(pathSid){ FriendlyName = friendlyName, Policy = policy }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Iam/V1/GetApiKeysResource.cs b/src/Twilio/Rest/Iam/V1/GetApiKeysResource.cs index f286f7770..4bfa39257 100644 --- a/src/Twilio/Rest/Iam/V1/GetApiKeysResource.cs +++ b/src/Twilio/Rest/Iam/V1/GetApiKeysResource.cs @@ -65,7 +65,7 @@ public static ResourceSet Read(ReadGetApiKeysOptions options /// Read GetApiKeys parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of GetApiKeys - public static async System.Threading.Tasks.Task> ReadAsync(ReadGetApiKeysOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadGetApiKeysOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static async System.Threading.Tasks.Task> string accountSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadGetApiKeysOptions(accountSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Iam/V1/KeyResource.cs b/src/Twilio/Rest/Iam/V1/KeyResource.cs index 29cde4336..916dad571 100644 --- a/src/Twilio/Rest/Iam/V1/KeyResource.cs +++ b/src/Twilio/Rest/Iam/V1/KeyResource.cs @@ -77,7 +77,7 @@ public static KeyResource Create(CreateKeyOptions options, ITwilioRestClient cli /// Create Key parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Key - public static async System.Threading.Tasks.Task CreateAsync(CreateKeyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateKeyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -117,7 +117,7 @@ public static async System.Threading.Tasks.Task CreateAsync( KeyResource.KeytypeEnum keyType = null, object policy = null, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { var options = new CreateKeyOptions(accountSid){ FriendlyName = friendlyName, KeyType = keyType, Policy = policy }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Insights/V1/Call/AnnotationResource.cs b/src/Twilio/Rest/Insights/V1/Call/AnnotationResource.cs index dacf5c293..8dc388362 100644 --- a/src/Twilio/Rest/Insights/V1/Call/AnnotationResource.cs +++ b/src/Twilio/Rest/Insights/V1/Call/AnnotationResource.cs @@ -98,7 +98,7 @@ public static AnnotationResource Fetch(FetchAnnotationOptions options, ITwilioRe /// Fetch Annotation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Annotation - public static async System.Threading.Tasks.Task FetchAsync(FetchAnnotationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAnnotationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -122,7 +122,7 @@ public static AnnotationResource Fetch( /// The unique SID identifier of the Call. /// Client to make requests to Twilio /// Task that resolves to A single instance of Annotation - public static async System.Threading.Tasks.Task FetchAsync(string pathCallSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathCallSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAnnotationOptions(pathCallSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -165,7 +165,7 @@ public static AnnotationResource Update(UpdateAnnotationOptions options, ITwilio #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateAnnotationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -220,7 +220,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( int? callScore = null, string comment = null, string incident = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateAnnotationOptions(pathCallSid){ AnsweredBy = answeredBy, ConnectivityIssue = connectivityIssue, QualityIssues = qualityIssues, Spam = spam, CallScore = callScore, Comment = comment, Incident = incident }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Insights/V1/Call/CallSummaryResource.cs b/src/Twilio/Rest/Insights/V1/Call/CallSummaryResource.cs index 2e1ff6ac7..f8846f106 100644 --- a/src/Twilio/Rest/Insights/V1/Call/CallSummaryResource.cs +++ b/src/Twilio/Rest/Insights/V1/Call/CallSummaryResource.cs @@ -133,7 +133,7 @@ public static CallSummaryResource Fetch(FetchCallSummaryOptions options, ITwilio /// Fetch CallSummary parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CallSummary - public static async System.Threading.Tasks.Task FetchAsync(FetchCallSummaryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCallSummaryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -160,7 +160,7 @@ public static CallSummaryResource Fetch( /// The Processing State of this Call Summary. One of `complete`, `partial` or `all`. /// Client to make requests to Twilio /// Task that resolves to A single instance of CallSummary - public static async System.Threading.Tasks.Task FetchAsync(string pathCallSid, CallSummaryResource.ProcessingStateEnum processingState = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathCallSid, CallSummaryResource.ProcessingStateEnum processingState = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCallSummaryOptions(pathCallSid){ ProcessingState = processingState }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Insights/V1/Call/EventResource.cs b/src/Twilio/Rest/Insights/V1/Call/EventResource.cs index 4300098ff..daab95720 100644 --- a/src/Twilio/Rest/Insights/V1/Call/EventResource.cs +++ b/src/Twilio/Rest/Insights/V1/Call/EventResource.cs @@ -99,7 +99,7 @@ public static ResourceSet Read(ReadEventOptions options, ITwilioR /// Read Event parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Event - public static async System.Threading.Tasks.Task> ReadAsync(ReadEventOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEventOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -139,7 +139,7 @@ public static async System.Threading.Tasks.Task> Read EventResource.TwilioEdgeEnum edge = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadEventOptions(pathCallSid){ Edge = edge, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Insights/V1/Call/MetricResource.cs b/src/Twilio/Rest/Insights/V1/Call/MetricResource.cs index f52ebde35..4f22b21e5 100644 --- a/src/Twilio/Rest/Insights/V1/Call/MetricResource.cs +++ b/src/Twilio/Rest/Insights/V1/Call/MetricResource.cs @@ -98,7 +98,7 @@ public static ResourceSet Read(ReadMetricOptions options, ITwili /// Read Metric parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Metric - public static async System.Threading.Tasks.Task> ReadAsync(ReadMetricOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMetricOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -142,7 +142,7 @@ public static async System.Threading.Tasks.Task> Rea MetricResource.StreamDirectionEnum direction = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMetricOptions(pathCallSid){ Edge = edge, Direction = direction, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Insights/V1/CallResource.cs b/src/Twilio/Rest/Insights/V1/CallResource.cs index aad4ed38f..db2a7d222 100644 --- a/src/Twilio/Rest/Insights/V1/CallResource.cs +++ b/src/Twilio/Rest/Insights/V1/CallResource.cs @@ -67,7 +67,7 @@ public static CallResource Fetch(FetchCallOptions options, ITwilioRestClient cli /// Fetch Call parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Call - public static async System.Threading.Tasks.Task FetchAsync(FetchCallOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCallOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static CallResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Call - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCallOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Insights/V1/CallSummariesResource.cs b/src/Twilio/Rest/Insights/V1/CallSummariesResource.cs index e4855def0..3d1618b09 100644 --- a/src/Twilio/Rest/Insights/V1/CallSummariesResource.cs +++ b/src/Twilio/Rest/Insights/V1/CallSummariesResource.cs @@ -157,7 +157,7 @@ public static ResourceSet Read(ReadCallSummariesOptions o /// Read CallSummaries parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CallSummaries - public static async System.Threading.Tasks.Task> ReadAsync(ReadCallSummariesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCallSummariesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task Fetch ConferenceParticipant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConferenceParticipant - public static async System.Threading.Tasks.Task FetchAsync(FetchConferenceParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchConferenceParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -195,7 +195,7 @@ public static ConferenceParticipantResource Fetch( /// Object. Contains participant call quality metrics. /// Client to make requests to Twilio /// Task that resolves to A single instance of ConferenceParticipant - public static async System.Threading.Tasks.Task FetchAsync(string pathConferenceSid, string pathParticipantSid, string events = null, string metrics = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathConferenceSid, string pathParticipantSid, string events = null, string metrics = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchConferenceParticipantOptions(pathConferenceSid, pathParticipantSid){ Events = events,Metrics = metrics }; return await FetchAsync(options, client, cancellationToken); @@ -235,7 +235,7 @@ public static ResourceSet Read(ReadConferencePart /// Read ConferenceParticipant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConferenceParticipant - public static async System.Threading.Tasks.Task> ReadAsync(ReadConferenceParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConferenceParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -283,7 +283,7 @@ public static async System.Threading.Tasks.Task Fetch Conference parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conference - public static async System.Threading.Tasks.Task FetchAsync(FetchConferenceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchConferenceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -177,7 +177,7 @@ public static ConferenceResource Fetch( /// The unique SID identifier of the Conference. /// Client to make requests to Twilio /// Task that resolves to A single instance of Conference - public static async System.Threading.Tasks.Task FetchAsync(string pathConferenceSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathConferenceSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchConferenceOptions(pathConferenceSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -215,7 +215,7 @@ public static ResourceSet Read(ReadConferenceOptions options /// Read Conference parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Conference - public static async System.Threading.Tasks.Task> ReadAsync(ReadConferenceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConferenceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -287,7 +287,7 @@ public static async System.Threading.Tasks.Task> string endReason = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadConferenceOptions(){ ConferenceSid = conferenceSid, FriendlyName = friendlyName, Status = status, CreatedAfter = createdAfter, CreatedBefore = createdBefore, MixerRegion = mixerRegion, Tags = tags, Subaccount = subaccount, DetectedIssues = detectedIssues, EndReason = endReason, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Insights/V1/Room/ParticipantResource.cs b/src/Twilio/Rest/Insights/V1/Room/ParticipantResource.cs index 35a740ea7..5e7b6d587 100644 --- a/src/Twilio/Rest/Insights/V1/Room/ParticipantResource.cs +++ b/src/Twilio/Rest/Insights/V1/Room/ParticipantResource.cs @@ -140,7 +140,7 @@ public static ParticipantResource Fetch(FetchParticipantOptions options, ITwilio /// Fetch Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -167,7 +167,7 @@ public static ParticipantResource Fetch( /// The SID of the Participant resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathParticipantSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathParticipantSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchParticipantOptions(pathRoomSid, pathParticipantSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -207,7 +207,7 @@ public static ResourceSet Read(ReadParticipantOptions optio /// Read Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -243,7 +243,7 @@ public static async System.Threading.Tasks.Task string pathRoomSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadParticipantOptions(pathRoomSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Insights/V1/RoomResource.cs b/src/Twilio/Rest/Insights/V1/RoomResource.cs index 4a3edd6e3..9c27d39fc 100644 --- a/src/Twilio/Rest/Insights/V1/RoomResource.cs +++ b/src/Twilio/Rest/Insights/V1/RoomResource.cs @@ -193,7 +193,7 @@ public static RoomResource Fetch(FetchRoomOptions options, ITwilioRestClient cli /// Fetch Room parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Room - public static async System.Threading.Tasks.Task FetchAsync(FetchRoomOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoomOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -217,7 +217,7 @@ public static RoomResource Fetch( /// The SID of the Room resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Room - public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRoomOptions(pathRoomSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -255,7 +255,7 @@ public static ResourceSet Read(ReadRoomOptions options, ITwilioRes /// Read Room parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Room - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoomOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoomOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -307,7 +307,7 @@ public static async System.Threading.Tasks.Task> ReadA DateTime? createdBefore = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRoomOptions(){ RoomType = roomType, Codec = codec, RoomName = roomName, CreatedAfter = createdAfter, CreatedBefore = createdBefore, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Insights/V1/SettingResource.cs b/src/Twilio/Rest/Insights/V1/SettingResource.cs index 3bde88eef..f3fedf755 100644 --- a/src/Twilio/Rest/Insights/V1/SettingResource.cs +++ b/src/Twilio/Rest/Insights/V1/SettingResource.cs @@ -65,7 +65,7 @@ public static SettingResource Fetch(FetchSettingOptions options, ITwilioRestClie /// Fetch Setting parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Setting - public static async System.Threading.Tasks.Task FetchAsync(FetchSettingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSettingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -89,7 +89,7 @@ public static SettingResource Fetch( /// The unique SID identifier of the Subaccount. /// Client to make requests to Twilio /// Task that resolves to A single instance of Setting - public static async System.Threading.Tasks.Task FetchAsync(string subaccountSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string subaccountSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSettingOptions(){ SubaccountSid = subaccountSid }; return await FetchAsync(options, client, cancellationToken); @@ -130,7 +130,7 @@ public static SettingResource Update(UpdateSettingOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSettingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -165,7 +165,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? advancedFeatures = null, bool? voiceTrace = null, string subaccountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSettingOptions(){ AdvancedFeatures = advancedFeatures, VoiceTrace = voiceTrace, SubaccountSid = subaccountSid }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Intelligence/V2/CustomOperatorResource.cs b/src/Twilio/Rest/Intelligence/V2/CustomOperatorResource.cs index 093d73eba..dd62f80bd 100644 --- a/src/Twilio/Rest/Intelligence/V2/CustomOperatorResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/CustomOperatorResource.cs @@ -81,7 +81,7 @@ public static CustomOperatorResource Create(CreateCustomOperatorOptions options, /// Create CustomOperator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomOperator - public static async System.Threading.Tasks.Task CreateAsync(CreateCustomOperatorOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCustomOperatorOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -116,7 +116,7 @@ public static async System.Threading.Tasks.Task CreateAs string friendlyName, string operatorType, object config, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCustomOperatorOptions(friendlyName, operatorType, config){ }; return await CreateAsync(options, client, cancellationToken); @@ -162,7 +162,7 @@ public static bool Delete(DeleteCustomOperatorOptions options, ITwilioRestClient /// Task that resolves to A single instance of CustomOperator public static async System.Threading.Tasks.Task DeleteAsync(DeleteCustomOperatorOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -185,7 +185,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this Custom Operator. /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomOperator - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCustomOperatorOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -225,7 +225,7 @@ public static CustomOperatorResource Fetch(FetchCustomOperatorOptions options, I /// Fetch CustomOperator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomOperator - public static async System.Threading.Tasks.Task FetchAsync(FetchCustomOperatorOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCustomOperatorOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -249,7 +249,7 @@ public static CustomOperatorResource Fetch( /// A 34 character string that uniquely identifies this Custom Operator. /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomOperator - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCustomOperatorOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -287,7 +287,7 @@ public static ResourceSet Read(ReadCustomOperatorOptions /// Read CustomOperator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomOperator - public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomOperatorOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomOperatorOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -327,7 +327,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateCustomOperatorOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -458,7 +458,7 @@ public static async System.Threading.Tasks.Task UpdateAs string friendlyName, object config, string ifMatch = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateCustomOperatorOptions(pathSid, friendlyName, config){ IfMatch = ifMatch }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentResource.cs b/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentResource.cs index 0d7461f71..5846049d9 100644 --- a/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentResource.cs @@ -70,7 +70,7 @@ public static OperatorAttachmentResource Create(CreateOperatorAttachmentOptions /// Create OperatorAttachment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorAttachment - public static async System.Threading.Tasks.Task CreateAsync(CreateOperatorAttachmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateOperatorAttachmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static OperatorAttachmentResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathServiceSid, string pathOperatorSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateOperatorAttachmentOptions(pathServiceSid, pathOperatorSid){ }; return await CreateAsync(options, client, cancellationToken); @@ -149,7 +149,7 @@ public static bool Delete(DeleteOperatorAttachmentOptions options, ITwilioRestCl /// Task that resolves to A single instance of OperatorAttachment public static async System.Threading.Tasks.Task DeleteAsync(DeleteOperatorAttachmentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -174,7 +174,7 @@ public static bool Delete(string pathServiceSid, string pathOperatorSid, ITwilio /// The unique SID identifier of the Operator. Allows both Custom and Pre-built Operators. /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorAttachment - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathOperatorSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathOperatorSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteOperatorAttachmentOptions(pathServiceSid, pathOperatorSid) ; return await DeleteAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsResource.cs b/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsResource.cs index e2c7a01bc..119b1d72f 100644 --- a/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsResource.cs @@ -67,7 +67,7 @@ public static OperatorAttachmentsResource Fetch(FetchOperatorAttachmentsOptions /// Fetch OperatorAttachments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorAttachments - public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorAttachmentsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorAttachmentsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static OperatorAttachmentsResource Fetch( /// The unique SID identifier of the Service. /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorAttachments - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchOperatorAttachmentsOptions(pathServiceSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Intelligence/V2/OperatorResource.cs b/src/Twilio/Rest/Intelligence/V2/OperatorResource.cs index 9922ed86d..37b7acdeb 100644 --- a/src/Twilio/Rest/Intelligence/V2/OperatorResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/OperatorResource.cs @@ -82,7 +82,7 @@ public static OperatorResource Fetch(FetchOperatorOptions options, ITwilioRestCl /// Fetch Operator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Operator - public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -106,7 +106,7 @@ public static OperatorResource Fetch( /// A 34 character string that uniquely identifies this Operator. /// Client to make requests to Twilio /// Task that resolves to A single instance of Operator - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchOperatorOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -144,7 +144,7 @@ public static ResourceSet Read(ReadOperatorOptions options, IT /// Read Operator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Operator - public static async System.Threading.Tasks.Task> ReadAsync(ReadOperatorOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadOperatorOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -184,7 +184,7 @@ public static async System.Threading.Tasks.Task> R string languageCode = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadOperatorOptions(){ Availability = availability, LanguageCode = languageCode, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Intelligence/V2/OperatorTypeResource.cs b/src/Twilio/Rest/Intelligence/V2/OperatorTypeResource.cs index 3a072a155..6d662b939 100644 --- a/src/Twilio/Rest/Intelligence/V2/OperatorTypeResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/OperatorTypeResource.cs @@ -112,7 +112,7 @@ public static OperatorTypeResource Fetch(FetchOperatorTypeOptions options, ITwil /// Fetch OperatorType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorType - public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorTypeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorTypeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -136,7 +136,7 @@ public static OperatorTypeResource Fetch( /// Either a 34 character string that uniquely identifies this Operator Type or the unique name that references an Operator Type. /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorType - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchOperatorTypeOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -174,7 +174,7 @@ public static ResourceSet Read(ReadOperatorTypeOptions opt /// Read OperatorType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorType - public static async System.Threading.Tasks.Task> ReadAsync(ReadOperatorTypeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadOperatorTypeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -206,7 +206,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadOperatorTypeOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorResource.cs b/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorResource.cs index 2a6ff4802..c377908e0 100644 --- a/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorResource.cs @@ -82,7 +82,7 @@ public static PrebuiltOperatorResource Fetch(FetchPrebuiltOperatorOptions option /// Fetch PrebuiltOperator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PrebuiltOperator - public static async System.Threading.Tasks.Task FetchAsync(FetchPrebuiltOperatorOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPrebuiltOperatorOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -106,7 +106,7 @@ public static PrebuiltOperatorResource Fetch( /// A 34 character string that uniquely identifies this Pre-built Operator. /// Client to make requests to Twilio /// Task that resolves to A single instance of PrebuiltOperator - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPrebuiltOperatorOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -144,7 +144,7 @@ public static ResourceSet Read(ReadPrebuiltOperatorOpt /// Read PrebuiltOperator parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PrebuiltOperator - public static async System.Threading.Tasks.Task> ReadAsync(ReadPrebuiltOperatorOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPrebuiltOperatorOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -184,7 +184,7 @@ public static async System.Threading.Tasks.Task 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -139,7 +139,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? mediaRedaction = null, string webhookUrl = null, ServiceResource.HttpMethodEnum webhookHttpMethod = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateServiceOptions(uniqueName){ AutoTranscribe = autoTranscribe, DataLogging = dataLogging, FriendlyName = friendlyName, LanguageCode = languageCode, AutoRedaction = autoRedaction, MediaRedaction = mediaRedaction, WebhookUrl = webhookUrl, WebhookHttpMethod = webhookHttpMethod }; return await CreateAsync(options, client, cancellationToken); @@ -185,7 +185,7 @@ public static bool Delete(DeleteServiceOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -208,7 +208,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this Service. /// 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteServiceOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -248,7 +248,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -272,7 +272,7 @@ public static ServiceResource Fetch( /// A 34 character string that uniquely identifies this Service. /// 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchServiceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -310,7 +310,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -342,7 +342,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadServiceOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -434,7 +434,7 @@ public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -497,7 +497,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string webhookUrl = null, ServiceResource.HttpMethodEnum webhookHttpMethod = null, string ifMatch = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateServiceOptions(pathSid){ AutoTranscribe = autoTranscribe, DataLogging = dataLogging, FriendlyName = friendlyName, UniqueName = uniqueName, AutoRedaction = autoRedaction, MediaRedaction = mediaRedaction, WebhookUrl = webhookUrl, WebhookHttpMethod = webhookHttpMethod, IfMatch = ifMatch }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Intelligence/V2/Transcript/MediaResource.cs b/src/Twilio/Rest/Intelligence/V2/Transcript/MediaResource.cs index 57f6f3ceb..fe4ffd2f4 100644 --- a/src/Twilio/Rest/Intelligence/V2/Transcript/MediaResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/Transcript/MediaResource.cs @@ -67,7 +67,7 @@ public static MediaResource Fetch(FetchMediaOptions options, ITwilioRestClient c /// Fetch Media parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Media - public static async System.Threading.Tasks.Task FetchAsync(FetchMediaOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchMediaOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -94,7 +94,7 @@ public static MediaResource Fetch( /// Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. /// Client to make requests to Twilio /// Task that resolves to A single instance of Media - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, bool? redacted = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, bool? redacted = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMediaOptions(pathSid){ Redacted = redacted }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultResource.cs b/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultResource.cs index 1fde7fe44..66969c983 100644 --- a/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultResource.cs @@ -85,7 +85,7 @@ public static OperatorResultResource Fetch(FetchOperatorResultOptions options, I /// Fetch OperatorResult parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorResult - public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorResultOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchOperatorResultOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -115,7 +115,7 @@ public static OperatorResultResource Fetch( /// Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorResult - public static async System.Threading.Tasks.Task FetchAsync(string pathTranscriptSid, string pathOperatorSid, bool? redacted = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathTranscriptSid, string pathOperatorSid, bool? redacted = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchOperatorResultOptions(pathTranscriptSid, pathOperatorSid){ Redacted = redacted }; return await FetchAsync(options, client, cancellationToken); @@ -155,7 +155,7 @@ public static ResourceSet Read(ReadOperatorResultOptions /// Read OperatorResult parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OperatorResult - public static async System.Threading.Tasks.Task> ReadAsync(ReadOperatorResultOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadOperatorResultOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -195,7 +195,7 @@ public static async System.Threading.Tasks.Task Read(ReadSentenceOptions options, IT /// Read Sentence parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sentence - public static async System.Threading.Tasks.Task> ReadAsync(ReadSentenceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSentenceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -111,7 +111,7 @@ public static async System.Threading.Tasks.Task> R bool? wordTimestamps = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSentenceOptions(pathTranscriptSid){ Redacted = redacted, WordTimestamps = wordTimestamps, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Intelligence/V2/TranscriptResource.cs b/src/Twilio/Rest/Intelligence/V2/TranscriptResource.cs index ad07750ef..a22460ad8 100644 --- a/src/Twilio/Rest/Intelligence/V2/TranscriptResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/TranscriptResource.cs @@ -82,7 +82,7 @@ public static TranscriptResource Create(CreateTranscriptOptions options, ITwilio /// Create Transcript parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcript - public static async System.Threading.Tasks.Task CreateAsync(CreateTranscriptOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTranscriptOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -121,7 +121,7 @@ public static async System.Threading.Tasks.Task CreateAsync( object channel, string customerKey = null, DateTime? mediaStartTime = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTranscriptOptions(serviceSid, channel){ CustomerKey = customerKey, MediaStartTime = mediaStartTime }; return await CreateAsync(options, client, cancellationToken); @@ -167,7 +167,7 @@ public static bool Delete(DeleteTranscriptOptions options, ITwilioRestClient cli /// Task that resolves to A single instance of Transcript public static async System.Threading.Tasks.Task DeleteAsync(DeleteTranscriptOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -190,7 +190,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this Transcript. /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcript - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteTranscriptOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ public static TranscriptResource Fetch(FetchTranscriptOptions options, ITwilioRe /// Fetch Transcript parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcript - public static async System.Threading.Tasks.Task FetchAsync(FetchTranscriptOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTranscriptOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -254,7 +254,7 @@ public static TranscriptResource Fetch( /// A 34 character string that uniquely identifies this Transcript. /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcript - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTranscriptOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -292,7 +292,7 @@ public static ResourceSet Read(ReadTranscriptOptions options /// Read Transcript parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Transcript - public static async System.Threading.Tasks.Task> ReadAsync(ReadTranscriptOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTranscriptOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -356,7 +356,7 @@ public static async System.Threading.Tasks.Task> string sourceSid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadTranscriptOptions(){ ServiceSid = serviceSid, BeforeStartTime = beforeStartTime, AfterStartTime = afterStartTime, BeforeDateCreated = beforeDateCreated, AfterDateCreated = afterDateCreated, Status = status, LanguageCode = languageCode, SourceSid = sourceSid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V1/CredentialResource.cs b/src/Twilio/Rest/IpMessaging/V1/CredentialResource.cs index a98711c27..2b5038b4d 100644 --- a/src/Twilio/Rest/IpMessaging/V1/CredentialResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/CredentialResource.cs @@ -80,7 +80,7 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio /// Create Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -131,7 +131,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? sandbox = null, string apiKey = null, string secret = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCredentialOptions(type){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; return await CreateAsync(options, client, cancellationToken); @@ -177,7 +177,7 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli /// Task that resolves to A single instance of Credential public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -200,7 +200,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCredentialOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -240,7 +240,7 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe /// Fetch Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -264,7 +264,7 @@ public static CredentialResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCredentialOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadCredentialOptions options /// Read Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -334,7 +334,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCredentialOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -426,7 +426,7 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -477,7 +477,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? sandbox = null, string apiKey = null, string secret = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateCredentialOptions(pathSid){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteResource.cs b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteResource.cs index 49215a4c2..7b66ec382 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteResource.cs @@ -70,7 +70,7 @@ public static InviteResource Create(CreateInviteOptions options, ITwilioRestClie /// Create Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task CreateAsync(CreateInviteOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateInviteOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string pathChannelSid, string identity, string roleSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateInviteOptions(pathServiceSid, pathChannelSid, identity){ RoleSid = roleSid }; return await CreateAsync(options, client, cancellationToken); @@ -159,7 +159,7 @@ public static bool Delete(DeleteInviteOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Invite public static async System.Threading.Tasks.Task DeleteAsync(DeleteInviteOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -186,7 +186,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteInviteOptions(pathServiceSid, pathChannelSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ public static InviteResource Fetch(FetchInviteOptions options, ITwilioRestClient /// Fetch Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task FetchAsync(FetchInviteOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchInviteOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -260,7 +260,7 @@ public static InviteResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInviteOptions(pathServiceSid, pathChannelSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadInviteOptions options, ITwili /// Read Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task> ReadAsync(ReadInviteOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInviteOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -346,7 +346,7 @@ public static async System.Threading.Tasks.Task> Rea List identity = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadInviteOptions(pathServiceSid, pathChannelSid){ Identity = identity, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberResource.cs b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberResource.cs index b239010fc..6886ead0f 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberResource.cs @@ -70,7 +70,7 @@ public static MemberResource Create(CreateMemberOptions options, ITwilioRestClie /// Create Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task CreateAsync(CreateMemberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateMemberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string pathChannelSid, string identity, string roleSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMemberOptions(pathServiceSid, pathChannelSid, identity){ RoleSid = roleSid }; return await CreateAsync(options, client, cancellationToken); @@ -159,7 +159,7 @@ public static bool Delete(DeleteMemberOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Member public static async System.Threading.Tasks.Task DeleteAsync(DeleteMemberOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -186,7 +186,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteMemberOptions(pathServiceSid, pathChannelSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ public static MemberResource Fetch(FetchMemberOptions options, ITwilioRestClient /// Fetch Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -260,7 +260,7 @@ public static MemberResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMemberOptions(pathServiceSid, pathChannelSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadMemberOptions options, ITwili /// Read Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -346,7 +346,7 @@ public static async System.Threading.Tasks.Task> Rea List identity = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMemberOptions(pathServiceSid, pathChannelSid){ Identity = identity, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -442,7 +442,7 @@ public static MemberResource Update(UpdateMemberOptions options, ITwilioRestClie #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateMemberOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -485,7 +485,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string roleSid = null, int? lastConsumedMessageIndex = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateMemberOptions(pathServiceSid, pathChannelSid, pathSid){ RoleSid = roleSid, LastConsumedMessageIndex = lastConsumedMessageIndex }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageResource.cs b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageResource.cs index 837060321..2145d58b6 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageResource.cs @@ -82,7 +82,7 @@ public static MessageResource Create(CreateMessageOptions options, ITwilioRestCl /// Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -125,7 +125,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string body, string from = null, string attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMessageOptions(pathServiceSid, pathChannelSid, body){ From = from, Attributes = attributes }; return await CreateAsync(options, client, cancellationToken); @@ -175,7 +175,7 @@ public static bool Delete(DeleteMessageOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Message public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -202,7 +202,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteMessageOptions(pathServiceSid, pathChannelSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -246,7 +246,7 @@ public static MessageResource Fetch(FetchMessageOptions options, ITwilioRestClie /// Fetch Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -276,7 +276,7 @@ public static MessageResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMessageOptions(pathServiceSid, pathChannelSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -318,7 +318,7 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -362,7 +362,7 @@ public static async System.Threading.Tasks.Task> Re MessageResource.OrderTypeEnum order = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMessageOptions(pathServiceSid, pathChannelSid){ Order = order, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -458,7 +458,7 @@ public static MessageResource Update(UpdateMessageOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -501,7 +501,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string body = null, string attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateMessageOptions(pathServiceSid, pathChannelSid, pathSid){ Body = body, Attributes = attributes }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/ChannelResource.cs b/src/Twilio/Rest/IpMessaging/V1/Service/ChannelResource.cs index aab45716c..878113fd3 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/ChannelResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/Service/ChannelResource.cs @@ -81,7 +81,7 @@ public static ChannelResource Create(CreateChannelOptions options, ITwilioRestCl /// Create Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -124,7 +124,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string uniqueName = null, string attributes = null, ChannelResource.ChannelTypeEnum type = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateChannelOptions(pathServiceSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes, Type = type }; return await CreateAsync(options, client, cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(DeleteChannelOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Channel public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -197,7 +197,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteChannelOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -239,7 +239,7 @@ public static ChannelResource Fetch(FetchChannelOptions options, ITwilioRestClie /// Fetch Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -266,7 +266,7 @@ public static ChannelResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchChannelOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -306,7 +306,7 @@ public static ResourceSet Read(ReadChannelOptions options, ITwi /// Read Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -346,7 +346,7 @@ public static async System.Threading.Tasks.Task> Re List type = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadChannelOptions(pathServiceSid){ Type = type, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -440,7 +440,7 @@ public static ChannelResource Update(UpdateChannelOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -483,7 +483,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string friendlyName = null, string uniqueName = null, string attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateChannelOptions(pathServiceSid, pathSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/RoleResource.cs b/src/Twilio/Rest/IpMessaging/V1/Service/RoleResource.cs index ad660d7ab..70c4c050f 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/RoleResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/Service/RoleResource.cs @@ -81,7 +81,7 @@ public static RoleResource Create(CreateRoleOptions options, ITwilioRestClient c /// Create Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -120,7 +120,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, RoleResource.RoleTypeEnum type, List permission, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateRoleOptions(pathServiceSid, friendlyName, type, permission){ }; return await CreateAsync(options, client, cancellationToken); @@ -168,7 +168,7 @@ public static bool Delete(DeleteRoleOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Role public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -193,7 +193,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRoleOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -235,7 +235,7 @@ public static RoleResource Fetch(FetchRoleOptions options, ITwilioRestClient cli /// Fetch Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -262,7 +262,7 @@ public static RoleResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRoleOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadRoleOptions options, ITwilioRes /// Read Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -338,7 +338,7 @@ public static async System.Threading.Tasks.Task> ReadA string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRoleOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -432,7 +432,7 @@ public static RoleResource Update(UpdateRoleOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -467,7 +467,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathServiceSid, string pathSid, List permission, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRoleOptions(pathServiceSid, pathSid, permission){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelResource.cs b/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelResource.cs index 3b7d581e5..9d14e2fe5 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelResource.cs @@ -83,7 +83,7 @@ public static ResourceSet Read(ReadUserChannelOptions optio /// Read UserChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadUserChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -123,7 +123,7 @@ public static async System.Threading.Tasks.Task string pathUserSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUserChannelOptions(pathServiceSid, pathUserSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/UserResource.cs b/src/Twilio/Rest/IpMessaging/V1/Service/UserResource.cs index bb3b200f9..3dd48a25b 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/UserResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/Service/UserResource.cs @@ -68,7 +68,7 @@ public static UserResource Create(CreateUserOptions options, ITwilioRestClient c /// 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -111,7 +111,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string roleSid = null, string attributes = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateUserOptions(pathServiceSid, identity){ RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName }; return await CreateAsync(options, client, cancellationToken); @@ -159,7 +159,7 @@ public static bool Delete(DeleteUserOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of User public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -184,7 +184,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUserOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -226,7 +226,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -253,7 +253,7 @@ public static UserResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUserOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -293,7 +293,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -329,7 +329,7 @@ public static async System.Threading.Tasks.Task> ReadA string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUserOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -423,7 +423,7 @@ public static UserResource Update(UpdateUserOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -466,7 +466,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string roleSid = null, string attributes = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateUserOptions(pathServiceSid, pathSid){ RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V1/ServiceResource.cs b/src/Twilio/Rest/IpMessaging/V1/ServiceResource.cs index 0d595aee3..aba57449e 100644 --- a/src/Twilio/Rest/IpMessaging/V1/ServiceResource.cs +++ b/src/Twilio/Rest/IpMessaging/V1/ServiceResource.cs @@ -66,7 +66,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -93,7 +93,7 @@ public static ServiceResource Create( /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateServiceOptions(friendlyName){ }; return await CreateAsync(options, client, cancellationToken); @@ -139,7 +139,7 @@ public static bool Delete(DeleteServiceOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -162,7 +162,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// /// 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteServiceOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -202,7 +202,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -226,7 +226,7 @@ public static ServiceResource 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchServiceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -264,7 +264,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -296,7 +296,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadServiceOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -388,7 +388,7 @@ public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -631,7 +631,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( Twilio.Http.HttpMethod webhooksOnMemberRemovedMethod = null, int? limitsChannelMembers = null, int? limitsUserChannels = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, DefaultServiceRoleSid = defaultServiceRoleSid, DefaultChannelRoleSid = defaultChannelRoleSid, DefaultChannelCreatorRoleSid = defaultChannelCreatorRoleSid, ReadStatusEnabled = readStatusEnabled, ReachabilityEnabled = reachabilityEnabled, TypingIndicatorTimeout = typingIndicatorTimeout, ConsumptionReportInterval = consumptionReportInterval, NotificationsNewMessageEnabled = notificationsNewMessageEnabled, NotificationsNewMessageTemplate = notificationsNewMessageTemplate, NotificationsAddedToChannelEnabled = notificationsAddedToChannelEnabled, NotificationsAddedToChannelTemplate = notificationsAddedToChannelTemplate, NotificationsRemovedFromChannelEnabled = notificationsRemovedFromChannelEnabled, NotificationsRemovedFromChannelTemplate = notificationsRemovedFromChannelTemplate, NotificationsInvitedToChannelEnabled = notificationsInvitedToChannelEnabled, NotificationsInvitedToChannelTemplate = notificationsInvitedToChannelTemplate, PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, WebhookMethod = webhookMethod, WebhookFilters = webhookFilters, WebhooksOnMessageSendUrl = webhooksOnMessageSendUrl, WebhooksOnMessageSendMethod = webhooksOnMessageSendMethod, WebhooksOnMessageUpdateUrl = webhooksOnMessageUpdateUrl, WebhooksOnMessageUpdateMethod = webhooksOnMessageUpdateMethod, WebhooksOnMessageRemoveUrl = webhooksOnMessageRemoveUrl, WebhooksOnMessageRemoveMethod = webhooksOnMessageRemoveMethod, WebhooksOnChannelAddUrl = webhooksOnChannelAddUrl, WebhooksOnChannelAddMethod = webhooksOnChannelAddMethod, WebhooksOnChannelDestroyUrl = webhooksOnChannelDestroyUrl, WebhooksOnChannelDestroyMethod = webhooksOnChannelDestroyMethod, WebhooksOnChannelUpdateUrl = webhooksOnChannelUpdateUrl, WebhooksOnChannelUpdateMethod = webhooksOnChannelUpdateMethod, WebhooksOnMemberAddUrl = webhooksOnMemberAddUrl, WebhooksOnMemberAddMethod = webhooksOnMemberAddMethod, WebhooksOnMemberRemoveUrl = webhooksOnMemberRemoveUrl, WebhooksOnMemberRemoveMethod = webhooksOnMemberRemoveMethod, WebhooksOnMessageSentUrl = webhooksOnMessageSentUrl, WebhooksOnMessageSentMethod = webhooksOnMessageSentMethod, WebhooksOnMessageUpdatedUrl = webhooksOnMessageUpdatedUrl, WebhooksOnMessageUpdatedMethod = webhooksOnMessageUpdatedMethod, WebhooksOnMessageRemovedUrl = webhooksOnMessageRemovedUrl, WebhooksOnMessageRemovedMethod = webhooksOnMessageRemovedMethod, WebhooksOnChannelAddedUrl = webhooksOnChannelAddedUrl, WebhooksOnChannelAddedMethod = webhooksOnChannelAddedMethod, WebhooksOnChannelDestroyedUrl = webhooksOnChannelDestroyedUrl, WebhooksOnChannelDestroyedMethod = webhooksOnChannelDestroyedMethod, WebhooksOnChannelUpdatedUrl = webhooksOnChannelUpdatedUrl, WebhooksOnChannelUpdatedMethod = webhooksOnChannelUpdatedMethod, WebhooksOnMemberAddedUrl = webhooksOnMemberAddedUrl, WebhooksOnMemberAddedMethod = webhooksOnMemberAddedMethod, WebhooksOnMemberRemovedUrl = webhooksOnMemberRemovedUrl, WebhooksOnMemberRemovedMethod = webhooksOnMemberRemovedMethod, LimitsChannelMembers = limitsChannelMembers, LimitsUserChannels = limitsUserChannels }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V2/CredentialResource.cs b/src/Twilio/Rest/IpMessaging/V2/CredentialResource.cs index f90b5cece..629407509 100644 --- a/src/Twilio/Rest/IpMessaging/V2/CredentialResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/CredentialResource.cs @@ -80,7 +80,7 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio /// Create Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -131,7 +131,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? sandbox = null, string apiKey = null, string secret = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCredentialOptions(type){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; return await CreateAsync(options, client, cancellationToken); @@ -177,7 +177,7 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli /// Task that resolves to A single instance of Credential public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -200,7 +200,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCredentialOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -240,7 +240,7 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe /// Fetch Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -264,7 +264,7 @@ public static CredentialResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCredentialOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadCredentialOptions options /// Read Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -334,7 +334,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCredentialOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -426,7 +426,7 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -477,7 +477,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? sandbox = null, string apiKey = null, string secret = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateCredentialOptions(pathSid){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/BindingResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/BindingResource.cs index 92d0d823e..3c079345c 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/BindingResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/BindingResource.cs @@ -89,7 +89,7 @@ public static bool Delete(DeleteBindingOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Binding public static async System.Threading.Tasks.Task DeleteAsync(DeleteBindingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -114,7 +114,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteBindingOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -156,7 +156,7 @@ public static BindingResource Fetch(FetchBindingOptions options, ITwilioRestClie /// Fetch Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -183,7 +183,7 @@ public static BindingResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchBindingOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -223,7 +223,7 @@ public static ResourceSet Read(ReadBindingOptions options, ITwi /// Read Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -267,7 +267,7 @@ public static async System.Threading.Tasks.Task> Re List identity = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadBindingOptions(pathServiceSid){ BindingType = bindingType, Identity = identity, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteResource.cs index 4e21d3ed0..aae2d0955 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteResource.cs @@ -70,7 +70,7 @@ public static InviteResource Create(CreateInviteOptions options, ITwilioRestClie /// Create Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task CreateAsync(CreateInviteOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateInviteOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string pathChannelSid, string identity, string roleSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateInviteOptions(pathServiceSid, pathChannelSid, identity){ RoleSid = roleSid }; return await CreateAsync(options, client, cancellationToken); @@ -159,7 +159,7 @@ public static bool Delete(DeleteInviteOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Invite public static async System.Threading.Tasks.Task DeleteAsync(DeleteInviteOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -186,7 +186,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteInviteOptions(pathServiceSid, pathChannelSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ public static InviteResource Fetch(FetchInviteOptions options, ITwilioRestClient /// Fetch Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task FetchAsync(FetchInviteOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchInviteOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -260,7 +260,7 @@ public static InviteResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInviteOptions(pathServiceSid, pathChannelSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadInviteOptions options, ITwili /// Read Invite parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Invite - public static async System.Threading.Tasks.Task> ReadAsync(ReadInviteOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInviteOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -346,7 +346,7 @@ public static async System.Threading.Tasks.Task> Rea List identity = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadInviteOptions(pathServiceSid, pathChannelSid){ Identity = identity, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberResource.cs index 59b079b06..2ae706227 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberResource.cs @@ -82,7 +82,7 @@ public static MemberResource Create(CreateMemberOptions options, ITwilioRestClie /// Create Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task CreateAsync(CreateMemberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateMemberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -145,7 +145,7 @@ public static async System.Threading.Tasks.Task CreateAsync( DateTime? dateUpdated = null, string attributes = null, MemberResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMemberOptions(pathServiceSid, pathChannelSid, identity){ RoleSid = roleSid, LastConsumedMessageIndex = lastConsumedMessageIndex, LastConsumptionTimestamp = lastConsumptionTimestamp, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -195,7 +195,7 @@ public static bool Delete(DeleteMemberOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Member public static async System.Threading.Tasks.Task DeleteAsync(DeleteMemberOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -224,7 +224,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, MemberResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, MemberResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteMemberOptions(pathServiceSid, pathChannelSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client, cancellationToken); @@ -268,7 +268,7 @@ public static MemberResource Fetch(FetchMemberOptions options, ITwilioRestClient /// Fetch Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchMemberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -298,7 +298,7 @@ public static MemberResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMemberOptions(pathServiceSid, pathChannelSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -340,7 +340,7 @@ public static ResourceSet Read(ReadMemberOptions options, ITwili /// Read Member parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Member - public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMemberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -384,7 +384,7 @@ public static async System.Threading.Tasks.Task> Rea List identity = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMemberOptions(pathServiceSid, pathChannelSid){ Identity = identity, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -480,7 +480,7 @@ public static MemberResource Update(UpdateMemberOptions options, ITwilioRestClie #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateMemberOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -543,7 +543,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( DateTime? dateUpdated = null, string attributes = null, MemberResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateMemberOptions(pathServiceSid, pathChannelSid, pathSid){ RoleSid = roleSid, LastConsumedMessageIndex = lastConsumedMessageIndex, LastConsumptionTimestamp = lastConsumptionTimestamp, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageResource.cs index 8aba48233..1a12a3838 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageResource.cs @@ -94,7 +94,7 @@ public static MessageResource Create(CreateMessageOptions options, ITwilioRestCl /// Create Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -157,7 +157,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string body = null, string mediaSid = null, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMessageOptions(pathServiceSid, pathChannelSid){ From = from, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, LastUpdatedBy = lastUpdatedBy, Body = body, MediaSid = mediaSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -207,7 +207,7 @@ public static bool Delete(DeleteMessageOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Message public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessageOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -236,7 +236,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteMessageOptions(pathServiceSid, pathChannelSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client, cancellationToken); @@ -280,7 +280,7 @@ public static MessageResource Fetch(FetchMessageOptions options, ITwilioRestClie /// Fetch Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -310,7 +310,7 @@ public static MessageResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMessageOptions(pathServiceSid, pathChannelSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -352,7 +352,7 @@ public static ResourceSet Read(ReadMessageOptions options, ITwi /// Read Message parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Message - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -396,7 +396,7 @@ public static async System.Threading.Tasks.Task> Re MessageResource.OrderTypeEnum order = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadMessageOptions(pathServiceSid, pathChannelSid){ Order = order, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -492,7 +492,7 @@ public static MessageResource Update(UpdateMessageOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessageOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -555,7 +555,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string lastUpdatedBy = null, string from = null, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateMessageOptions(pathServiceSid, pathChannelSid, pathSid){ Body = body, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, LastUpdatedBy = lastUpdatedBy, From = from, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookResource.cs index 121883827..a4699205d 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookResource.cs @@ -95,7 +95,7 @@ public static WebhookResource Create(CreateWebhookOptions options, ITwilioRestCl /// Create Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -154,7 +154,7 @@ public static async System.Threading.Tasks.Task CreateAsync( List configurationTriggers = null, string configurationFlowSid = null, int? configurationRetryCount = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateWebhookOptions(pathServiceSid, pathChannelSid, type){ ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid, ConfigurationRetryCount = configurationRetryCount }; return await CreateAsync(options, client, cancellationToken); @@ -204,7 +204,7 @@ public static bool Delete(DeleteWebhookOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Webhook public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebhookOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -231,7 +231,7 @@ public static bool Delete(string pathServiceSid, string pathChannelSid, string p /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteWebhookOptions(pathServiceSid, pathChannelSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -275,7 +275,7 @@ public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClie /// Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -305,7 +305,7 @@ public static WebhookResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathChannelSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWebhookOptions(pathServiceSid, pathChannelSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -347,7 +347,7 @@ public static ResourceSet Read(ReadWebhookOptions options, ITwi /// Read Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -387,7 +387,7 @@ public static async System.Threading.Tasks.Task> Re string pathChannelSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadWebhookOptions(pathServiceSid, pathChannelSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -483,7 +483,7 @@ public static WebhookResource Update(UpdateWebhookOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -542,7 +542,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( List configurationTriggers = null, string configurationFlowSid = null, int? configurationRetryCount = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateWebhookOptions(pathServiceSid, pathChannelSid, pathSid){ ConfigurationUrl = configurationUrl, ConfigurationMethod = configurationMethod, ConfigurationFilters = configurationFilters, ConfigurationTriggers = configurationTriggers, ConfigurationFlowSid = configurationFlowSid, ConfigurationRetryCount = configurationRetryCount }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/ChannelResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/ChannelResource.cs index 342d98b0f..11f09bf91 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/ChannelResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/ChannelResource.cs @@ -93,7 +93,7 @@ public static ChannelResource Create(CreateChannelOptions options, ITwilioRestCl /// Create Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -152,7 +152,7 @@ public static async System.Threading.Tasks.Task CreateAsync( DateTime? dateUpdated = null, string createdBy = null, ChannelResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateChannelOptions(pathServiceSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes, Type = type, DateCreated = dateCreated, DateUpdated = dateUpdated, CreatedBy = createdBy, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -200,7 +200,7 @@ public static bool Delete(DeleteChannelOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Channel public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -227,7 +227,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ChannelResource /// The X-Twilio-Webhook-Enabled HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ChannelResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ChannelResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteChannelOptions(pathServiceSid, pathSid) { XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await DeleteAsync(options, client, cancellationToken); @@ -269,7 +269,7 @@ public static ChannelResource Fetch(FetchChannelOptions options, ITwilioRestClie /// Fetch Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -296,7 +296,7 @@ public static ChannelResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchChannelOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -336,7 +336,7 @@ public static ResourceSet Read(ReadChannelOptions options, ITwi /// Read Channel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Channel - public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -376,7 +376,7 @@ public static async System.Threading.Tasks.Task> Re List type = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadChannelOptions(pathServiceSid){ Type = type, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -470,7 +470,7 @@ public static ChannelResource Update(UpdateChannelOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -529,7 +529,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( DateTime? dateUpdated = null, string createdBy = null, ChannelResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateChannelOptions(pathServiceSid, pathSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, CreatedBy = createdBy, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/RoleResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/RoleResource.cs index 528fb7c70..b56a87efa 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/RoleResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/RoleResource.cs @@ -81,7 +81,7 @@ public static RoleResource Create(CreateRoleOptions options, ITwilioRestClient c /// Create Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -120,7 +120,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, RoleResource.RoleTypeEnum type, List permission, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateRoleOptions(pathServiceSid, friendlyName, type, permission){ }; return await CreateAsync(options, client, cancellationToken); @@ -168,7 +168,7 @@ public static bool Delete(DeleteRoleOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Role public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -193,7 +193,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRoleOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -235,7 +235,7 @@ public static RoleResource Fetch(FetchRoleOptions options, ITwilioRestClient cli /// Fetch Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -262,7 +262,7 @@ public static RoleResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRoleOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadRoleOptions options, ITwilioRes /// Read Role parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Role - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -338,7 +338,7 @@ public static async System.Threading.Tasks.Task> ReadA string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRoleOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -432,7 +432,7 @@ public static RoleResource Update(UpdateRoleOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoleOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -467,7 +467,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathServiceSid, string pathSid, List permission, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRoleOptions(pathServiceSid, pathSid, permission){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingResource.cs index c3d4653e9..0073c59cb 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingResource.cs @@ -91,7 +91,7 @@ public static bool Delete(DeleteUserBindingOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of UserBinding public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserBindingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -118,7 +118,7 @@ public static bool Delete(string pathServiceSid, string pathUserSid, string path /// /// Client to make requests to Twilio /// Task that resolves to A single instance of UserBinding - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathUserSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathUserSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUserBindingOptions(pathServiceSid, pathUserSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -162,7 +162,7 @@ public static UserBindingResource Fetch(FetchUserBindingOptions options, ITwilio /// Fetch UserBinding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserBinding - public static async System.Threading.Tasks.Task FetchAsync(FetchUserBindingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserBindingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -192,7 +192,7 @@ public static UserBindingResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of UserBinding - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathUserSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathUserSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUserBindingOptions(pathServiceSid, pathUserSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -234,7 +234,7 @@ public static ResourceSet Read(ReadUserBindingOptions optio /// Read UserBinding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserBinding - public static async System.Threading.Tasks.Task> ReadAsync(ReadUserBindingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserBindingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -278,7 +278,7 @@ public static async System.Threading.Tasks.Task List bindingType = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUserBindingOptions(pathServiceSid, pathUserSid){ BindingType = bindingType, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelResource.cs index fdc457bea..1fb59c707 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelResource.cs @@ -104,7 +104,7 @@ public static bool Delete(DeleteUserChannelOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of UserChannel public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -131,7 +131,7 @@ public static bool Delete(string pathServiceSid, string pathUserSid, string path /// /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathUserSid, string pathChannelSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathUserSid, string pathChannelSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -175,7 +175,7 @@ public static UserChannelResource Fetch(FetchUserChannelOptions options, ITwilio /// Fetch UserChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task FetchAsync(FetchUserChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -205,7 +205,7 @@ public static UserChannelResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathUserSid, string pathChannelSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathUserSid, string pathChannelSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -247,7 +247,7 @@ public static ResourceSet Read(ReadUserChannelOptions optio /// Read UserChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UserChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadUserChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -287,7 +287,7 @@ public static async System.Threading.Tasks.Task string pathUserSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUserChannelOptions(pathServiceSid, pathUserSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -383,7 +383,7 @@ public static UserChannelResource Update(UpdateUserChannelOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -430,7 +430,7 @@ public static async System.Threading.Tasks.Task UpdateAsync UserChannelResource.NotificationLevelEnum notificationLevel = null, int? lastConsumedMessageIndex = null, DateTime? lastConsumptionTimestamp = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid){ NotificationLevel = notificationLevel, LastConsumedMessageIndex = lastConsumedMessageIndex, LastConsumptionTimestamp = lastConsumptionTimestamp }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/UserResource.cs b/src/Twilio/Rest/IpMessaging/V2/Service/UserResource.cs index 434237bec..2192bef8b 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/UserResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/Service/UserResource.cs @@ -80,7 +80,7 @@ public static UserResource Create(CreateUserOptions options, ITwilioRestClient c /// 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -127,7 +127,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string attributes = null, string friendlyName = null, UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateUserOptions(pathServiceSid, identity){ RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -175,7 +175,7 @@ public static bool Delete(DeleteUserOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of User public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -200,7 +200,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUserOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -242,7 +242,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -269,7 +269,7 @@ public static UserResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUserOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -309,7 +309,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -345,7 +345,7 @@ public static async System.Threading.Tasks.Task> ReadA string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUserOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -439,7 +439,7 @@ public static UserResource Update(UpdateUserOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -486,7 +486,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string attributes = null, string friendlyName = null, UserResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateUserOptions(pathServiceSid, pathSid){ RoleSid = roleSid, Attributes = attributes, FriendlyName = friendlyName, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/IpMessaging/V2/ServiceResource.cs b/src/Twilio/Rest/IpMessaging/V2/ServiceResource.cs index 6aab31cef..fcc415600 100644 --- a/src/Twilio/Rest/IpMessaging/V2/ServiceResource.cs +++ b/src/Twilio/Rest/IpMessaging/V2/ServiceResource.cs @@ -66,7 +66,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -93,7 +93,7 @@ public static ServiceResource Create( /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateServiceOptions(friendlyName){ }; return await CreateAsync(options, client, cancellationToken); @@ -139,7 +139,7 @@ public static bool Delete(DeleteServiceOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -162,7 +162,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// /// 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteServiceOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -202,7 +202,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -226,7 +226,7 @@ public static ServiceResource 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchServiceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -264,7 +264,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -296,7 +296,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadServiceOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -388,7 +388,7 @@ public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -539,7 +539,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( int? preWebhookRetryCount = null, int? postWebhookRetryCount = null, bool? notificationsLogEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, DefaultServiceRoleSid = defaultServiceRoleSid, DefaultChannelRoleSid = defaultChannelRoleSid, DefaultChannelCreatorRoleSid = defaultChannelCreatorRoleSid, ReadStatusEnabled = readStatusEnabled, ReachabilityEnabled = reachabilityEnabled, TypingIndicatorTimeout = typingIndicatorTimeout, ConsumptionReportInterval = consumptionReportInterval, NotificationsNewMessageEnabled = notificationsNewMessageEnabled, NotificationsNewMessageTemplate = notificationsNewMessageTemplate, NotificationsNewMessageSound = notificationsNewMessageSound, NotificationsNewMessageBadgeCountEnabled = notificationsNewMessageBadgeCountEnabled, NotificationsAddedToChannelEnabled = notificationsAddedToChannelEnabled, NotificationsAddedToChannelTemplate = notificationsAddedToChannelTemplate, NotificationsAddedToChannelSound = notificationsAddedToChannelSound, NotificationsRemovedFromChannelEnabled = notificationsRemovedFromChannelEnabled, NotificationsRemovedFromChannelTemplate = notificationsRemovedFromChannelTemplate, NotificationsRemovedFromChannelSound = notificationsRemovedFromChannelSound, NotificationsInvitedToChannelEnabled = notificationsInvitedToChannelEnabled, NotificationsInvitedToChannelTemplate = notificationsInvitedToChannelTemplate, NotificationsInvitedToChannelSound = notificationsInvitedToChannelSound, PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, WebhookMethod = webhookMethod, WebhookFilters = webhookFilters, LimitsChannelMembers = limitsChannelMembers, LimitsUserChannels = limitsUserChannels, MediaCompatibilityMessage = mediaCompatibilityMessage, PreWebhookRetryCount = preWebhookRetryCount, PostWebhookRetryCount = postWebhookRetryCount, NotificationsLogEnabled = notificationsLogEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Lookups/V1/PhoneNumberResource.cs b/src/Twilio/Rest/Lookups/V1/PhoneNumberResource.cs index a2fc64112..d27bf181e 100644 --- a/src/Twilio/Rest/Lookups/V1/PhoneNumberResource.cs +++ b/src/Twilio/Rest/Lookups/V1/PhoneNumberResource.cs @@ -67,7 +67,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static PhoneNumberResource Fetch( /// Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. /// 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, string countryCode = null, List type = null, List addOns = null, Dictionary addOnsData = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathPhoneNumber, string countryCode = null, List type = null, List addOns = null, Dictionary addOnsData = null, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPhoneNumberOptions(pathPhoneNumber){ CountryCode = countryCode,Type = type,AddOns = addOns,AddOnsData = addOnsData }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Lookups/V2/PhoneNumberResource.cs b/src/Twilio/Rest/Lookups/V2/PhoneNumberResource.cs index 72f6ad90f..8d6778742 100644 --- a/src/Twilio/Rest/Lookups/V2/PhoneNumberResource.cs +++ b/src/Twilio/Rest/Lookups/V2/PhoneNumberResource.cs @@ -84,7 +84,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -150,7 +150,7 @@ public static PhoneNumberResource Fetch( /// The unique identifier associated with a verification process through verify API. This query parameter is only used (optionally) for pre_fill package requests. /// 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, string fields = null, string countryCode = null, string firstName = null, string lastName = null, string addressLine1 = null, string addressLine2 = null, string city = null, string state = null, string postalCode = null, string addressCountryCode = null, string nationalId = null, string dateOfBirth = null, string lastVerifiedDate = null, string verificationSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathPhoneNumber, string fields = null, string countryCode = null, string firstName = null, string lastName = null, string addressLine1 = null, string addressLine2 = null, string city = null, string state = null, string postalCode = null, string addressCountryCode = null, string nationalId = null, string dateOfBirth = null, string lastVerifiedDate = null, string verificationSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPhoneNumberOptions(pathPhoneNumber){ Fields = fields,CountryCode = countryCode,FirstName = firstName,LastName = lastName,AddressLine1 = addressLine1,AddressLine2 = addressLine2,City = city,State = state,PostalCode = postalCode,AddressCountryCode = addressCountryCode,NationalId = nationalId,DateOfBirth = dateOfBirth,LastVerifiedDate = lastVerifiedDate,VerificationSid = verificationSid }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionResource.cs b/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionResource.cs index af3f3c54e..10528f453 100644 --- a/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionResource.cs +++ b/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionResource.cs @@ -69,7 +69,7 @@ public static AvailableAddOnExtensionResource Fetch(FetchAvailableAddOnExtension /// Fetch AvailableAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnExtensionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnExtensionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static AvailableAddOnExtensionResource Fetch( /// The SID of the AvailableAddOn Extension resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(string pathAvailableAddOnSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathAvailableAddOnSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAvailableAddOnExtensionOptions(pathAvailableAddOnSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -136,7 +136,7 @@ public static ResourceSet Read(ReadAvailableAdd /// Read AvailableAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOnExtension - public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnExtensionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnExtensionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static async System.Threading.Tasks.Task Fetch AvailableAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOn - public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static AvailableAddOnResource Fetch( /// The SID of the AvailableAddOn resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOn - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAvailableAddOnOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadAvailableAddOnOptions /// Read AvailableAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOn - public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAvailableAddOnOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionResource.cs b/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionResource.cs index b27ceb77d..2c37e51a9 100644 --- a/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionResource.cs +++ b/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionResource.cs @@ -69,7 +69,7 @@ public static InstalledAddOnExtensionResource Fetch(FetchInstalledAddOnExtension /// Fetch InstalledAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnExtensionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnExtensionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static InstalledAddOnExtensionResource Fetch( /// The SID of the InstalledAddOn Extension resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(string pathInstalledAddOnSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathInstalledAddOnSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInstalledAddOnExtensionOptions(pathInstalledAddOnSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -136,7 +136,7 @@ public static ResourceSet Read(ReadInstalledAdd /// Read InstalledAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOnExtension - public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnExtensionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnExtensionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateInstalledAddOnExtensionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -301,7 +301,7 @@ public static async System.Threading.Tasks.Task string pathInstalledAddOnSid, string pathSid, bool? enabled, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateInstalledAddOnExtensionOptions(pathInstalledAddOnSid, pathSid, enabled){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageResource.cs b/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageResource.cs index d641bfa0e..4d9760cd4 100644 --- a/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageResource.cs +++ b/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageResource.cs @@ -134,7 +134,7 @@ public static InstalledAddOnUsageResource Create(CreateInstalledAddOnUsageOption /// Create InstalledAddOnUsage parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOnUsage - public static async System.Threading.Tasks.Task CreateAsync(CreateInstalledAddOnUsageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateInstalledAddOnUsageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -165,7 +165,7 @@ public static InstalledAddOnUsageResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathInstalledAddOnSid, InstalledAddOnUsageResource.MarketplaceV1InstalledAddOnInstalledAddOnUsage marketplaceV1InstalledAddOnInstalledAddOnUsage, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateInstalledAddOnUsageOptions(pathInstalledAddOnSid, marketplaceV1InstalledAddOnInstalledAddOnUsage){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Marketplace/V1/InstalledAddOnResource.cs b/src/Twilio/Rest/Marketplace/V1/InstalledAddOnResource.cs index 09387d7b8..70941f440 100644 --- a/src/Twilio/Rest/Marketplace/V1/InstalledAddOnResource.cs +++ b/src/Twilio/Rest/Marketplace/V1/InstalledAddOnResource.cs @@ -66,7 +66,7 @@ public static InstalledAddOnResource Create(CreateInstalledAddOnOptions options, /// Create InstalledAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task CreateAsync(CreateInstalledAddOnOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateInstalledAddOnOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task CreateAs bool? acceptTermsOfService, object configuration = null, string uniqueName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateInstalledAddOnOptions(availableAddOnSid, acceptTermsOfService){ Configuration = configuration, UniqueName = uniqueName }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static bool Delete(DeleteInstalledAddOnOptions options, ITwilioRestClient /// Task that resolves to A single instance of InstalledAddOn public static async System.Threading.Tasks.Task DeleteAsync(DeleteInstalledAddOnOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -174,7 +174,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the InstalledAddOn resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteInstalledAddOnOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static InstalledAddOnResource Fetch(FetchInstalledAddOnOptions options, I /// Fetch InstalledAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -238,7 +238,7 @@ public static InstalledAddOnResource Fetch( /// The SID of the InstalledAddOn resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInstalledAddOnOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -276,7 +276,7 @@ public static ResourceSet Read(ReadInstalledAddOnOptions /// Read InstalledAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -308,7 +308,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadInstalledAddOnOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -400,7 +400,7 @@ public static InstalledAddOnResource Update(UpdateInstalledAddOnOptions options, #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateInstalledAddOnOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -435,7 +435,7 @@ public static async System.Threading.Tasks.Task UpdateAs string pathSid, object configuration = null, string uniqueName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateInstalledAddOnOptions(pathSid){ Configuration = configuration, UniqueName = uniqueName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementResource.cs b/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementResource.cs index 0e68fbaf4..223935338 100644 --- a/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementResource.cs +++ b/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementResource.cs @@ -67,7 +67,7 @@ public static ModuleDataManagementResource Fetch(FetchModuleDataManagementOption /// Fetch ModuleDataManagement parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ModuleDataManagement - public static async System.Threading.Tasks.Task FetchAsync(FetchModuleDataManagementOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchModuleDataManagementOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static ModuleDataManagementResource Fetch( /// The unique identifier of a Listing. /// Client to make requests to Twilio /// Task that resolves to A single instance of ModuleDataManagement - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchModuleDataManagementOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -134,7 +134,7 @@ public static ModuleDataManagementResource Update(UpdateModuleDataManagementOpti #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateModuleDataManagementOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -189,7 +189,7 @@ public static async System.Threading.Tasks.Task Up string support = null, string configuration = null, string pricing = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateModuleDataManagementOptions(pathSid){ ModuleInfo = moduleInfo, Description = description, Documentation = documentation, Policies = policies, Support = support, Configuration = configuration, Pricing = pricing }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Marketplace/V1/ReferralConversionResource.cs b/src/Twilio/Rest/Marketplace/V1/ReferralConversionResource.cs index 2ae73ff7f..d7a2968fc 100644 --- a/src/Twilio/Rest/Marketplace/V1/ReferralConversionResource.cs +++ b/src/Twilio/Rest/Marketplace/V1/ReferralConversionResource.cs @@ -89,7 +89,7 @@ public static ReferralConversionResource Create(CreateReferralConversionOptions /// Create ReferralConversion parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ReferralConversion - public static async System.Threading.Tasks.Task CreateAsync(CreateReferralConversionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateReferralConversionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -116,7 +116,7 @@ public static ReferralConversionResource Create( /// Task that resolves to A single instance of ReferralConversion public static async System.Threading.Tasks.Task CreateAsync( ReferralConversionResource.CreateReferralConversionRequest createReferralConversionRequest, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateReferralConversionOptions(createReferralConversionRequest){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpResource.cs b/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpResource.cs index 3a030d349..da9a732f7 100644 --- a/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpResource.cs +++ b/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpResource.cs @@ -68,7 +68,7 @@ public static BrandRegistrationOtpResource Create(CreateBrandRegistrationOtpOpti /// Create BrandRegistrationOtp parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandRegistrationOtp - public static async System.Threading.Tasks.Task CreateAsync(CreateBrandRegistrationOtpOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateBrandRegistrationOtpOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -95,7 +95,7 @@ public static BrandRegistrationOtpResource Create( /// Task that resolves to A single instance of BrandRegistrationOtp public static async System.Threading.Tasks.Task CreateAsync( string pathBrandRegistrationSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateBrandRegistrationOtpOptions(pathBrandRegistrationSid){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingResource.cs b/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingResource.cs index 793b8a29c..071b1b3b1 100644 --- a/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingResource.cs +++ b/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingResource.cs @@ -80,7 +80,7 @@ public static BrandVettingResource Create(CreateBrandVettingOptions options, ITw /// Create BrandVetting parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandVetting - public static async System.Threading.Tasks.Task CreateAsync(CreateBrandVettingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateBrandVettingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -115,7 +115,7 @@ public static async System.Threading.Tasks.Task CreateAsyn string pathBrandSid, BrandVettingResource.VettingProviderEnum vettingProvider, string vettingId = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateBrandVettingOptions(pathBrandSid, vettingProvider){ VettingId = vettingId }; return await CreateAsync(options, client, cancellationToken); @@ -157,7 +157,7 @@ public static BrandVettingResource Fetch(FetchBrandVettingOptions options, ITwil /// Fetch BrandVetting parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandVetting - public static async System.Threading.Tasks.Task FetchAsync(FetchBrandVettingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchBrandVettingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -184,7 +184,7 @@ public static BrandVettingResource Fetch( /// The Twilio SID of the third-party vetting record. /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandVetting - public static async System.Threading.Tasks.Task FetchAsync(string pathBrandSid, string pathBrandVettingSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathBrandSid, string pathBrandVettingSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchBrandVettingOptions(pathBrandSid, pathBrandVettingSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -224,7 +224,7 @@ public static ResourceSet Read(ReadBrandVettingOptions opt /// Read BrandVetting parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandVetting - public static async System.Threading.Tasks.Task> ReadAsync(ReadBrandVettingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBrandVettingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -264,7 +264,7 @@ public static async System.Threading.Tasks.Task Create BrandRegistration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandRegistration - public static async System.Threading.Tasks.Task CreateAsync(CreateBrandRegistrationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateBrandRegistrationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -156,7 +156,7 @@ public static async System.Threading.Tasks.Task Creat string brandType = null, bool? mock = null, bool? skipAutomaticSecVet = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateBrandRegistrationOptions(customerProfileBundleSid, a2PProfileBundleSid){ BrandType = brandType, Mock = mock, SkipAutomaticSecVet = skipAutomaticSecVet }; return await CreateAsync(options, client, cancellationToken); @@ -196,7 +196,7 @@ public static BrandRegistrationResource Fetch(FetchBrandRegistrationOptions opti /// Fetch BrandRegistration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandRegistration - public static async System.Threading.Tasks.Task FetchAsync(FetchBrandRegistrationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchBrandRegistrationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -220,7 +220,7 @@ public static BrandRegistrationResource Fetch( /// The SID of the Brand Registration resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandRegistration - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchBrandRegistrationOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -258,7 +258,7 @@ public static ResourceSet Read(ReadBrandRegistrationO /// Read BrandRegistration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BrandRegistration - public static async System.Threading.Tasks.Task> ReadAsync(ReadBrandRegistrationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBrandRegistrationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -290,7 +290,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadBrandRegistrationOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -382,7 +382,7 @@ public static BrandRegistrationResource Update(UpdateBrandRegistrationOptions op #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateBrandRegistrationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -409,7 +409,7 @@ public static BrandRegistrationResource Update( /// Task that resolves to A single instance of BrandRegistration public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateBrandRegistrationOptions(pathSid){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/DeactivationsResource.cs b/src/Twilio/Rest/Messaging/V1/DeactivationsResource.cs index 4701c4dc3..47b98cce4 100644 --- a/src/Twilio/Rest/Messaging/V1/DeactivationsResource.cs +++ b/src/Twilio/Rest/Messaging/V1/DeactivationsResource.cs @@ -65,7 +65,7 @@ public static DeactivationsResource Fetch(FetchDeactivationsOptions options, ITw /// Fetch Deactivations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Deactivations - public static async System.Threading.Tasks.Task FetchAsync(FetchDeactivationsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDeactivationsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -89,7 +89,7 @@ public static DeactivationsResource Fetch( /// The request will return a list of all United States Phone Numbers that were deactivated on the day specified by this parameter. This date should be specified in YYYY-MM-DD format. /// Client to make requests to Twilio /// Task that resolves to A single instance of Deactivations - public static async System.Threading.Tasks.Task FetchAsync(DateTime? date = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(DateTime? date = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDeactivationsOptions(){ Date = date }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/DomainCertsResource.cs b/src/Twilio/Rest/Messaging/V1/DomainCertsResource.cs index 03bae5160..6637b5860 100644 --- a/src/Twilio/Rest/Messaging/V1/DomainCertsResource.cs +++ b/src/Twilio/Rest/Messaging/V1/DomainCertsResource.cs @@ -73,7 +73,7 @@ public static bool Delete(DeleteDomainCertsOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of DomainCerts public static async System.Threading.Tasks.Task DeleteAsync(DeleteDomainCertsOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static bool Delete(string pathDomainSid, ITwilioRestClient client = null) /// Unique string used to identify the domain that this certificate should be associated with. /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainCerts - public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteDomainCertsOptions(pathDomainSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -136,7 +136,7 @@ public static DomainCertsResource Fetch(FetchDomainCertsOptions options, ITwilio /// Fetch DomainCerts parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainCerts - public static async System.Threading.Tasks.Task FetchAsync(FetchDomainCertsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDomainCertsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -160,7 +160,7 @@ public static DomainCertsResource Fetch( /// Unique string used to identify the domain that this certificate should be associated with. /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainCerts - public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDomainCertsOptions(pathDomainSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -203,7 +203,7 @@ public static DomainCertsResource Update(UpdateDomainCertsOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateDomainCertsOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -234,7 +234,7 @@ public static DomainCertsResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathDomainSid, string tlsCert, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateDomainCertsOptions(pathDomainSid, tlsCert){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceResource.cs b/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceResource.cs index 12fc48a87..770f594fe 100644 --- a/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceResource.cs +++ b/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceResource.cs @@ -67,7 +67,7 @@ public static DomainConfigMessagingServiceResource Fetch(FetchDomainConfigMessag /// Fetch DomainConfigMessagingService parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainConfigMessagingService - public static async System.Threading.Tasks.Task FetchAsync(FetchDomainConfigMessagingServiceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDomainConfigMessagingServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static DomainConfigMessagingServiceResource Fetch( /// Unique string used to identify the Messaging service that this domain should be associated with. /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainConfigMessagingService - public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDomainConfigMessagingServiceOptions(pathMessagingServiceSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/DomainConfigResource.cs b/src/Twilio/Rest/Messaging/V1/DomainConfigResource.cs index 21eb9cd71..1d2ef9f18 100644 --- a/src/Twilio/Rest/Messaging/V1/DomainConfigResource.cs +++ b/src/Twilio/Rest/Messaging/V1/DomainConfigResource.cs @@ -67,7 +67,7 @@ public static DomainConfigResource Fetch(FetchDomainConfigOptions options, ITwil /// Fetch DomainConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainConfig - public static async System.Threading.Tasks.Task FetchAsync(FetchDomainConfigOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDomainConfigOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static DomainConfigResource Fetch( /// Unique string used to identify the domain that this config should be associated with. /// Client to make requests to Twilio /// Task that resolves to A single instance of DomainConfig - public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathDomainSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDomainConfigOptions(pathDomainSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -134,7 +134,7 @@ public static DomainConfigResource Update(UpdateDomainConfigOptions options, ITw #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateDomainConfigOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -177,7 +177,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn Uri callbackUrl = null, bool? continueOnFailure = null, bool? disableHttps = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateDomainConfigOptions(pathDomainSid){ FallbackUrl = fallbackUrl, CallbackUrl = callbackUrl, ContinueOnFailure = continueOnFailure, DisableHttps = disableHttps }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/ExternalCampaignResource.cs b/src/Twilio/Rest/Messaging/V1/ExternalCampaignResource.cs index b7560de21..5ce4d4ebe 100644 --- a/src/Twilio/Rest/Messaging/V1/ExternalCampaignResource.cs +++ b/src/Twilio/Rest/Messaging/V1/ExternalCampaignResource.cs @@ -66,7 +66,7 @@ public static ExternalCampaignResource Create(CreateExternalCampaignOptions opti /// Create ExternalCampaign parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ExternalCampaign - public static async System.Threading.Tasks.Task CreateAsync(CreateExternalCampaignOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateExternalCampaignOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static async System.Threading.Tasks.Task Create string campaignId, string messagingServiceSid, bool? cnpMigration = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateExternalCampaignOptions(campaignId, messagingServiceSid){ CnpMigration = cnpMigration }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationResource.cs b/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationResource.cs index 0ad2adbe3..5362d93a8 100644 --- a/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationResource.cs +++ b/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationResource.cs @@ -67,7 +67,7 @@ public static LinkshorteningMessagingServiceDomainAssociationResource Fetch(Fetc /// Fetch LinkshorteningMessagingServiceDomainAssociation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of LinkshorteningMessagingServiceDomainAssociation - public static async System.Threading.Tasks.Task FetchAsync(FetchLinkshorteningMessagingServiceDomainAssociationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchLinkshorteningMessagingServiceDomainAssociationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static LinkshorteningMessagingServiceDomainAssociationResource Fetch( /// Unique string used to identify the Messaging service that this domain should be associated with. /// Client to make requests to Twilio /// Task that resolves to A single instance of LinkshorteningMessagingServiceDomainAssociation - public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchLinkshorteningMessagingServiceDomainAssociationOptions(pathMessagingServiceSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceResource.cs b/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceResource.cs index 4117d4cd2..7ed444e66 100644 --- a/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceResource.cs +++ b/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceResource.cs @@ -70,7 +70,7 @@ public static LinkshorteningMessagingServiceResource Create(CreateLinkshortening /// Create LinkshorteningMessagingService parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of LinkshorteningMessagingService - public static async System.Threading.Tasks.Task CreateAsync(CreateLinkshorteningMessagingServiceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateLinkshorteningMessagingServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static LinkshorteningMessagingServiceResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathDomainSid, string pathMessagingServiceSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateLinkshorteningMessagingServiceOptions(pathDomainSid, pathMessagingServiceSid){ }; return await CreateAsync(options, client, cancellationToken); @@ -149,7 +149,7 @@ public static bool Delete(DeleteLinkshorteningMessagingServiceOptions options, I /// Task that resolves to A single instance of LinkshorteningMessagingService public static async System.Threading.Tasks.Task DeleteAsync(DeleteLinkshorteningMessagingServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -174,7 +174,7 @@ public static bool Delete(string pathDomainSid, string pathMessagingServiceSid, /// A messaging service SID to dissociate from a domain. With URL shortening enabled, links in messages sent with the provided messaging service will be shortened to the associated domain /// Client to make requests to Twilio /// Task that resolves to A single instance of LinkshorteningMessagingService - public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathMessagingServiceSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathDomainSid, string pathMessagingServiceSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteLinkshorteningMessagingServiceOptions(pathDomainSid, pathMessagingServiceSid) ; return await DeleteAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/RequestManagedCertResource.cs b/src/Twilio/Rest/Messaging/V1/RequestManagedCertResource.cs index fc3277152..6fc6e5841 100644 --- a/src/Twilio/Rest/Messaging/V1/RequestManagedCertResource.cs +++ b/src/Twilio/Rest/Messaging/V1/RequestManagedCertResource.cs @@ -70,7 +70,7 @@ public static RequestManagedCertResource Update(UpdateRequestManagedCertOptions #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRequestManagedCertOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -97,7 +97,7 @@ public static RequestManagedCertResource Update( /// Task that resolves to A single instance of RequestManagedCert public static async System.Threading.Tasks.Task UpdateAsync( string pathDomainSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRequestManagedCertOptions(pathDomainSid){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderResource.cs b/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderResource.cs index a5e51d624..ba1a58048 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderResource.cs +++ b/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderResource.cs @@ -68,7 +68,7 @@ public static AlphaSenderResource Create(CreateAlphaSenderOptions options, ITwil /// Create AlphaSender parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AlphaSender - public static async System.Threading.Tasks.Task CreateAsync(CreateAlphaSenderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAlphaSenderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static AlphaSenderResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathServiceSid, string alphaSender, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAlphaSenderOptions(pathServiceSid, alphaSender){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteAlphaSenderOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of AlphaSender public static async System.Threading.Tasks.Task DeleteAsync(DeleteAlphaSenderOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The SID of the AlphaSender resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of AlphaSender - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAlphaSenderOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static AlphaSenderResource Fetch(FetchAlphaSenderOptions options, ITwilio /// Fetch AlphaSender parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AlphaSender - public static async System.Threading.Tasks.Task FetchAsync(FetchAlphaSenderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAlphaSenderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static AlphaSenderResource Fetch( /// The SID of the AlphaSender resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AlphaSender - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAlphaSenderOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadAlphaSenderOptions optio /// Read AlphaSender parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AlphaSender - public static async System.Threading.Tasks.Task> ReadAsync(ReadAlphaSenderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAlphaSenderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAlphaSenderOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderResource.cs b/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderResource.cs index 99bb398e3..79b4e3814 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderResource.cs +++ b/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderResource.cs @@ -68,7 +68,7 @@ public static ChannelSenderResource Create(CreateChannelSenderOptions options, I /// Create ChannelSender parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ChannelSender - public static async System.Threading.Tasks.Task CreateAsync(CreateChannelSenderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateChannelSenderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static ChannelSenderResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathMessagingServiceSid, string sid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateChannelSenderOptions(pathMessagingServiceSid, sid){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteChannelSenderOptions options, ITwilioRestClient /// Task that resolves to A single instance of ChannelSender public static async System.Threading.Tasks.Task DeleteAsync(DeleteChannelSenderOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathMessagingServiceSid, string pathSid, ITwili /// The SID of the Channel Sender resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of ChannelSender - public static async System.Threading.Tasks.Task DeleteAsync(string pathMessagingServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathMessagingServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteChannelSenderOptions(pathMessagingServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static ChannelSenderResource Fetch(FetchChannelSenderOptions options, ITw /// Fetch ChannelSender parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ChannelSender - public static async System.Threading.Tasks.Task FetchAsync(FetchChannelSenderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchChannelSenderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static ChannelSenderResource Fetch( /// The SID of the ChannelSender resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ChannelSender - public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchChannelSenderOptions(pathMessagingServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadChannelSenderOptions o /// Read ChannelSender parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ChannelSender - public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelSenderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChannelSenderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task Create PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task CreateAsync(CreatePhoneNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreatePhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static PhoneNumberResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathServiceSid, string phoneNumberSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreatePhoneNumberOptions(pathServiceSid, phoneNumberSid){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeletePhoneNumberOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of PhoneNumber public static async System.Threading.Tasks.Task DeleteAsync(DeletePhoneNumberOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The SID of the PhoneNumber resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeletePhoneNumberOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static PhoneNumberResource Fetch( /// The SID of the PhoneNumber resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPhoneNumberOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadPhoneNumberOptions optio /// Read PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task> ReadAsync(ReadPhoneNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadPhoneNumberOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/Service/ShortCodeResource.cs b/src/Twilio/Rest/Messaging/V1/Service/ShortCodeResource.cs index c21c8e690..09cbac523 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/ShortCodeResource.cs +++ b/src/Twilio/Rest/Messaging/V1/Service/ShortCodeResource.cs @@ -68,7 +68,7 @@ public static ShortCodeResource Create(CreateShortCodeOptions options, ITwilioRe /// Create ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task CreateAsync(CreateShortCodeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateShortCodeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static ShortCodeResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathServiceSid, string shortCodeSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateShortCodeOptions(pathServiceSid, shortCodeSid){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteShortCodeOptions options, ITwilioRestClient clie /// Task that resolves to A single instance of ShortCode public static async System.Threading.Tasks.Task DeleteAsync(DeleteShortCodeOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The SID of the ShortCode resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteShortCodeOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static ShortCodeResource Fetch(FetchShortCodeOptions options, ITwilioRest /// Fetch ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task FetchAsync(FetchShortCodeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchShortCodeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static ShortCodeResource Fetch( /// The SID of the ShortCode resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchShortCodeOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadShortCodeOptions options, /// Read ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task> ReadAsync(ReadShortCodeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadShortCodeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task> string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadShortCodeOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonResource.cs b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonResource.cs index f601aa69e..9b7bec600 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonResource.cs +++ b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonResource.cs @@ -68,7 +68,7 @@ public static UsAppToPersonResource Create(CreateUsAppToPersonOptions options, I /// Create UsAppToPerson parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsAppToPerson - public static async System.Threading.Tasks.Task CreateAsync(CreateUsAppToPersonOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateUsAppToPersonOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -159,7 +159,7 @@ public static async System.Threading.Tasks.Task CreateAsy bool? subscriberOptIn = null, bool? ageGated = null, bool? directLending = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateUsAppToPersonOptions(pathMessagingServiceSid, brandRegistrationSid, description, messageFlow, messageSamples, usAppToPersonUsecase, hasEmbeddedLinks, hasEmbeddedPhone){ OptInMessage = optInMessage, OptOutMessage = optOutMessage, HelpMessage = helpMessage, OptInKeywords = optInKeywords, OptOutKeywords = optOutKeywords, HelpKeywords = helpKeywords, SubscriberOptIn = subscriberOptIn, AgeGated = ageGated, DirectLending = directLending }; return await CreateAsync(options, client, cancellationToken); @@ -207,7 +207,7 @@ public static bool Delete(DeleteUsAppToPersonOptions options, ITwilioRestClient /// Task that resolves to A single instance of UsAppToPerson public static async System.Threading.Tasks.Task DeleteAsync(DeleteUsAppToPersonOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -232,7 +232,7 @@ public static bool Delete(string pathMessagingServiceSid, string pathSid, ITwili /// The SID of the US A2P Compliance resource to delete `QE2c6890da8086d771620e9b13fadeba0b`. /// Client to make requests to Twilio /// Task that resolves to A single instance of UsAppToPerson - public static async System.Threading.Tasks.Task DeleteAsync(string pathMessagingServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathMessagingServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUsAppToPersonOptions(pathMessagingServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -274,7 +274,7 @@ public static UsAppToPersonResource Fetch(FetchUsAppToPersonOptions options, ITw /// Fetch UsAppToPerson parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsAppToPerson - public static async System.Threading.Tasks.Task FetchAsync(FetchUsAppToPersonOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUsAppToPersonOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -301,7 +301,7 @@ public static UsAppToPersonResource Fetch( /// The SID of the US A2P Compliance resource to fetch `QE2c6890da8086d771620e9b13fadeba0b`. /// Client to make requests to Twilio /// Task that resolves to A single instance of UsAppToPerson - public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUsAppToPersonOptions(pathMessagingServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -341,7 +341,7 @@ public static ResourceSet Read(ReadUsAppToPersonOptions o /// Read UsAppToPerson parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsAppToPerson - public static async System.Threading.Tasks.Task> ReadAsync(ReadUsAppToPersonOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUsAppToPersonOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -377,7 +377,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateUsAppToPersonOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -530,7 +530,7 @@ public static async System.Threading.Tasks.Task UpdateAsy string description, bool? ageGated, bool? directLending, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateUsAppToPersonOptions(pathMessagingServiceSid, pathSid, hasEmbeddedLinks, hasEmbeddedPhone, messageSamples, messageFlow, description, ageGated, directLending){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseResource.cs b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseResource.cs index 8004cdaff..fdff05c44 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseResource.cs +++ b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseResource.cs @@ -67,7 +67,7 @@ public static UsAppToPersonUsecaseResource Fetch(FetchUsAppToPersonUsecaseOption /// Fetch UsAppToPersonUsecase parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsAppToPersonUsecase - public static async System.Threading.Tasks.Task FetchAsync(FetchUsAppToPersonUsecaseOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUsAppToPersonUsecaseOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -94,7 +94,7 @@ public static UsAppToPersonUsecaseResource Fetch( /// The unique string to identify the A2P brand. /// Client to make requests to Twilio /// Task that resolves to A single instance of UsAppToPersonUsecase - public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, string brandRegistrationSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathMessagingServiceSid, string brandRegistrationSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUsAppToPersonUsecaseOptions(pathMessagingServiceSid){ BrandRegistrationSid = brandRegistrationSid }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/ServiceResource.cs b/src/Twilio/Rest/Messaging/V1/ServiceResource.cs index f13681cee..efbd53231 100644 --- a/src/Twilio/Rest/Messaging/V1/ServiceResource.cs +++ b/src/Twilio/Rest/Messaging/V1/ServiceResource.cs @@ -80,7 +80,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -167,7 +167,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? synchronousValidation = null, string usecase = null, bool? useInboundWebhookOnNumber = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateServiceOptions(friendlyName){ InboundRequestUrl = inboundRequestUrl, InboundMethod = inboundMethod, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StickySender = stickySender, MmsConverter = mmsConverter, SmartEncoding = smartEncoding, ScanMessageContent = scanMessageContent, FallbackToLongCode = fallbackToLongCode, AreaCodeGeomatch = areaCodeGeomatch, ValidityPeriod = validityPeriod, SynchronousValidation = synchronousValidation, Usecase = usecase, UseInboundWebhookOnNumber = useInboundWebhookOnNumber }; return await CreateAsync(options, client, cancellationToken); @@ -213,7 +213,7 @@ public static bool Delete(DeleteServiceOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -236,7 +236,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteServiceOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -276,7 +276,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -300,7 +300,7 @@ public static ServiceResource Fetch( /// The SID 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchServiceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -338,7 +338,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -370,7 +370,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadServiceOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -462,7 +462,7 @@ public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -553,7 +553,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? synchronousValidation = null, string usecase = null, bool? useInboundWebhookOnNumber = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, InboundRequestUrl = inboundRequestUrl, InboundMethod = inboundMethod, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StickySender = stickySender, MmsConverter = mmsConverter, SmartEncoding = smartEncoding, ScanMessageContent = scanMessageContent, FallbackToLongCode = fallbackToLongCode, AreaCodeGeomatch = areaCodeGeomatch, ValidityPeriod = validityPeriod, SynchronousValidation = synchronousValidation, Usecase = usecase, UseInboundWebhookOnNumber = useInboundWebhookOnNumber }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs b/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs index adee6b799..25fce2fc9 100644 --- a/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs +++ b/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs @@ -98,7 +98,7 @@ public static TollfreeVerificationResource Create(CreateTollfreeVerificationOpti /// Create TollfreeVerification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TollfreeVerification - public static async System.Threading.Tasks.Task CreateAsync(CreateTollfreeVerificationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTollfreeVerificationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -213,7 +213,7 @@ public static async System.Threading.Tasks.Task Cr string businessContactEmail = null, Types.PhoneNumber businessContactPhone = null, string externalReferenceId = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTollfreeVerificationOptions(businessName, businessWebsite, notificationEmail, useCaseCategories, useCaseSummary, productionMessageSample, optInImageUrls, optInType, messageVolume, tollfreePhoneNumberSid){ CustomerProfileSid = customerProfileSid, BusinessStreetAddress = businessStreetAddress, BusinessStreetAddress2 = businessStreetAddress2, BusinessCity = businessCity, BusinessStateProvinceRegion = businessStateProvinceRegion, BusinessPostalCode = businessPostalCode, BusinessCountry = businessCountry, AdditionalInformation = additionalInformation, BusinessContactFirstName = businessContactFirstName, BusinessContactLastName = businessContactLastName, BusinessContactEmail = businessContactEmail, BusinessContactPhone = businessContactPhone, ExternalReferenceId = externalReferenceId }; return await CreateAsync(options, client, cancellationToken); @@ -259,7 +259,7 @@ public static bool Delete(DeleteTollfreeVerificationOptions options, ITwilioRest /// Task that resolves to A single instance of TollfreeVerification public static async System.Threading.Tasks.Task DeleteAsync(DeleteTollfreeVerificationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -282,7 +282,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string to identify Tollfree Verification. /// Client to make requests to Twilio /// Task that resolves to A single instance of TollfreeVerification - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteTollfreeVerificationOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -322,7 +322,7 @@ public static TollfreeVerificationResource Fetch(FetchTollfreeVerificationOption /// Fetch TollfreeVerification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TollfreeVerification - public static async System.Threading.Tasks.Task FetchAsync(FetchTollfreeVerificationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTollfreeVerificationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -346,7 +346,7 @@ public static TollfreeVerificationResource Fetch( /// A unique string identifying a Tollfree Verification. /// Client to make requests to Twilio /// Task that resolves to A single instance of TollfreeVerification - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTollfreeVerificationOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -384,7 +384,7 @@ public static ResourceSet Read(ReadTollfreeVerific /// Read TollfreeVerification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TollfreeVerification - public static async System.Threading.Tasks.Task> ReadAsync(ReadTollfreeVerificationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTollfreeVerificationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -432,7 +432,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateTollfreeVerificationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -635,7 +635,7 @@ public static async System.Threading.Tasks.Task Up string businessContactEmail = null, Types.PhoneNumber businessContactPhone = null, string editReason = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateTollfreeVerificationOptions(pathSid){ BusinessName = businessName, BusinessWebsite = businessWebsite, NotificationEmail = notificationEmail, UseCaseCategories = useCaseCategories, UseCaseSummary = useCaseSummary, ProductionMessageSample = productionMessageSample, OptInImageUrls = optInImageUrls, OptInType = optInType, MessageVolume = messageVolume, BusinessStreetAddress = businessStreetAddress, BusinessStreetAddress2 = businessStreetAddress2, BusinessCity = businessCity, BusinessStateProvinceRegion = businessStateProvinceRegion, BusinessPostalCode = businessPostalCode, BusinessCountry = businessCountry, AdditionalInformation = additionalInformation, BusinessContactFirstName = businessContactFirstName, BusinessContactLastName = businessContactLastName, BusinessContactEmail = businessContactEmail, BusinessContactPhone = businessContactPhone, EditReason = editReason }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Messaging/V1/UsecaseResource.cs b/src/Twilio/Rest/Messaging/V1/UsecaseResource.cs index ae406cdc7..cc9a141dd 100644 --- a/src/Twilio/Rest/Messaging/V1/UsecaseResource.cs +++ b/src/Twilio/Rest/Messaging/V1/UsecaseResource.cs @@ -65,7 +65,7 @@ public static UsecaseResource Fetch(FetchUsecaseOptions options, ITwilioRestClie /// Fetch Usecase parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Usecase - public static async System.Threading.Tasks.Task FetchAsync(FetchUsecaseOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUsecaseOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -86,7 +86,7 @@ public static UsecaseResource Fetch( /// fetch /// Client to make requests to Twilio /// Task that resolves to A single instance of Usecase - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUsecaseOptions(){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Microvisor/V1/AccountConfigResource.cs b/src/Twilio/Rest/Microvisor/V1/AccountConfigResource.cs index 10393808b..90af30b45 100644 --- a/src/Twilio/Rest/Microvisor/V1/AccountConfigResource.cs +++ b/src/Twilio/Rest/Microvisor/V1/AccountConfigResource.cs @@ -66,7 +66,7 @@ public static AccountConfigResource Create(CreateAccountConfigOptions options, I /// Create AccountConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountConfig - public static async System.Threading.Tasks.Task CreateAsync(CreateAccountConfigOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAccountConfigOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -97,7 +97,7 @@ public static AccountConfigResource Create( public static async System.Threading.Tasks.Task CreateAsync( string key, string value, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAccountConfigOptions(key, value){ }; return await CreateAsync(options, client, cancellationToken); @@ -143,7 +143,7 @@ public static bool Delete(DeleteAccountConfigOptions options, ITwilioRestClient /// Task that resolves to A single instance of AccountConfig public static async System.Threading.Tasks.Task DeleteAsync(DeleteAccountConfigOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -166,7 +166,7 @@ public static bool Delete(string pathKey, ITwilioRestClient client = null) /// The config key; up to 100 characters. /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountConfig - public static async System.Threading.Tasks.Task DeleteAsync(string pathKey, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathKey, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAccountConfigOptions(pathKey) ; return await DeleteAsync(options, client, cancellationToken); @@ -206,7 +206,7 @@ public static AccountConfigResource Fetch(FetchAccountConfigOptions options, ITw /// Fetch AccountConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountConfig - public static async System.Threading.Tasks.Task FetchAsync(FetchAccountConfigOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAccountConfigOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -230,7 +230,7 @@ public static AccountConfigResource Fetch( /// The config key; up to 100 characters. /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountConfig - public static async System.Threading.Tasks.Task FetchAsync(string pathKey, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathKey, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAccountConfigOptions(pathKey){ }; return await FetchAsync(options, client, cancellationToken); @@ -268,7 +268,7 @@ public static ResourceSet Read(ReadAccountConfigOptions o /// Read AccountConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountConfig - public static async System.Threading.Tasks.Task> ReadAsync(ReadAccountConfigOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAccountConfigOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -300,7 +300,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAccountConfigOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -392,7 +392,7 @@ public static AccountConfigResource Update(UpdateAccountConfigOptions options, I #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateAccountConfigOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -423,7 +423,7 @@ public static AccountConfigResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathKey, string value, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateAccountConfigOptions(pathKey, value){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Microvisor/V1/AccountSecretResource.cs b/src/Twilio/Rest/Microvisor/V1/AccountSecretResource.cs index 88f34a95f..f8efbfc25 100644 --- a/src/Twilio/Rest/Microvisor/V1/AccountSecretResource.cs +++ b/src/Twilio/Rest/Microvisor/V1/AccountSecretResource.cs @@ -66,7 +66,7 @@ public static AccountSecretResource Create(CreateAccountSecretOptions options, I /// Create AccountSecret parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountSecret - public static async System.Threading.Tasks.Task CreateAsync(CreateAccountSecretOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAccountSecretOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -97,7 +97,7 @@ public static AccountSecretResource Create( public static async System.Threading.Tasks.Task CreateAsync( string key, string value, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAccountSecretOptions(key, value){ }; return await CreateAsync(options, client, cancellationToken); @@ -143,7 +143,7 @@ public static bool Delete(DeleteAccountSecretOptions options, ITwilioRestClient /// Task that resolves to A single instance of AccountSecret public static async System.Threading.Tasks.Task DeleteAsync(DeleteAccountSecretOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -166,7 +166,7 @@ public static bool Delete(string pathKey, ITwilioRestClient client = null) /// The secret key; up to 100 characters. /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountSecret - public static async System.Threading.Tasks.Task DeleteAsync(string pathKey, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathKey, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAccountSecretOptions(pathKey) ; return await DeleteAsync(options, client, cancellationToken); @@ -206,7 +206,7 @@ public static AccountSecretResource Fetch(FetchAccountSecretOptions options, ITw /// Fetch AccountSecret parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountSecret - public static async System.Threading.Tasks.Task FetchAsync(FetchAccountSecretOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAccountSecretOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -230,7 +230,7 @@ public static AccountSecretResource Fetch( /// The secret key; up to 100 characters. /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountSecret - public static async System.Threading.Tasks.Task FetchAsync(string pathKey, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathKey, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAccountSecretOptions(pathKey){ }; return await FetchAsync(options, client, cancellationToken); @@ -268,7 +268,7 @@ public static ResourceSet Read(ReadAccountSecretOptions o /// Read AccountSecret parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccountSecret - public static async System.Threading.Tasks.Task> ReadAsync(ReadAccountSecretOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAccountSecretOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -300,7 +300,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAccountSecretOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -392,7 +392,7 @@ public static AccountSecretResource Update(UpdateAccountSecretOptions options, I #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateAccountSecretOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -423,7 +423,7 @@ public static AccountSecretResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathKey, string value, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateAccountSecretOptions(pathKey, value){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Microvisor/V1/App/AppManifestResource.cs b/src/Twilio/Rest/Microvisor/V1/App/AppManifestResource.cs index c3422eabd..a4bc8e0a4 100644 --- a/src/Twilio/Rest/Microvisor/V1/App/AppManifestResource.cs +++ b/src/Twilio/Rest/Microvisor/V1/App/AppManifestResource.cs @@ -67,7 +67,7 @@ public static AppManifestResource Fetch(FetchAppManifestOptions options, ITwilio /// Fetch AppManifest parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AppManifest - public static async System.Threading.Tasks.Task FetchAsync(FetchAppManifestOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAppManifestOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static AppManifestResource Fetch( /// A 34-character string that uniquely identifies this App. /// Client to make requests to Twilio /// Task that resolves to A single instance of AppManifest - public static async System.Threading.Tasks.Task FetchAsync(string pathAppSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathAppSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAppManifestOptions(pathAppSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Microvisor/V1/AppResource.cs b/src/Twilio/Rest/Microvisor/V1/AppResource.cs index 3a907c55d..202edb253 100644 --- a/src/Twilio/Rest/Microvisor/V1/AppResource.cs +++ b/src/Twilio/Rest/Microvisor/V1/AppResource.cs @@ -73,7 +73,7 @@ public static bool Delete(DeleteAppOptions options, ITwilioRestClient client = n /// Task that resolves to A single instance of App public static async System.Threading.Tasks.Task DeleteAsync(DeleteAppOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34-character string that uniquely identifies this App. /// Client to make requests to Twilio /// Task that resolves to A single instance of App - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAppOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -136,7 +136,7 @@ public static AppResource Fetch(FetchAppOptions options, ITwilioRestClient clien /// Fetch App parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of App - public static async System.Threading.Tasks.Task FetchAsync(FetchAppOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAppOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -160,7 +160,7 @@ public static AppResource Fetch( /// A 34-character string that uniquely identifies this App. /// Client to make requests to Twilio /// Task that resolves to A single instance of App - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAppOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -198,7 +198,7 @@ public static ResourceSet Read(ReadAppOptions options, ITwilioRestC /// Read App parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of App - public static async System.Threading.Tasks.Task> ReadAsync(ReadAppOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAppOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -230,7 +230,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAppOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigResource.cs b/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigResource.cs index f89621dc0..aabdd9b4d 100644 --- a/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigResource.cs +++ b/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigResource.cs @@ -68,7 +68,7 @@ public static DeviceConfigResource Create(CreateDeviceConfigOptions options, ITw /// Create DeviceConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceConfig - public static async System.Threading.Tasks.Task CreateAsync(CreateDeviceConfigOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateDeviceConfigOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task CreateAsyn string pathDeviceSid, string key, string value, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateDeviceConfigOptions(pathDeviceSid, key, value){ }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static bool Delete(DeleteDeviceConfigOptions options, ITwilioRestClient c /// Task that resolves to A single instance of DeviceConfig public static async System.Threading.Tasks.Task DeleteAsync(DeleteDeviceConfigOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -176,7 +176,7 @@ public static bool Delete(string pathDeviceSid, string pathKey, ITwilioRestClien /// The config key; up to 100 characters. /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceConfig - public static async System.Threading.Tasks.Task DeleteAsync(string pathDeviceSid, string pathKey, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathDeviceSid, string pathKey, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteDeviceConfigOptions(pathDeviceSid, pathKey) ; return await DeleteAsync(options, client, cancellationToken); @@ -218,7 +218,7 @@ public static DeviceConfigResource Fetch(FetchDeviceConfigOptions options, ITwil /// Fetch DeviceConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceConfig - public static async System.Threading.Tasks.Task FetchAsync(FetchDeviceConfigOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDeviceConfigOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static DeviceConfigResource Fetch( /// The config key; up to 100 characters. /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceConfig - public static async System.Threading.Tasks.Task FetchAsync(string pathDeviceSid, string pathKey, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathDeviceSid, string pathKey, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDeviceConfigOptions(pathDeviceSid, pathKey){ }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadDeviceConfigOptions opt /// Read DeviceConfig parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceConfig - public static async System.Threading.Tasks.Task> ReadAsync(ReadDeviceConfigOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDeviceConfigOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateDeviceConfigOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -450,7 +450,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn string pathDeviceSid, string pathKey, string value, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateDeviceConfigOptions(pathDeviceSid, pathKey, value){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretResource.cs b/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretResource.cs index a0a2c0136..61719fbc3 100644 --- a/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretResource.cs +++ b/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretResource.cs @@ -68,7 +68,7 @@ public static DeviceSecretResource Create(CreateDeviceSecretOptions options, ITw /// Create DeviceSecret parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceSecret - public static async System.Threading.Tasks.Task CreateAsync(CreateDeviceSecretOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateDeviceSecretOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task CreateAsyn string pathDeviceSid, string key, string value, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateDeviceSecretOptions(pathDeviceSid, key, value){ }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static bool Delete(DeleteDeviceSecretOptions options, ITwilioRestClient c /// Task that resolves to A single instance of DeviceSecret public static async System.Threading.Tasks.Task DeleteAsync(DeleteDeviceSecretOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -176,7 +176,7 @@ public static bool Delete(string pathDeviceSid, string pathKey, ITwilioRestClien /// The secret key; up to 100 characters. /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceSecret - public static async System.Threading.Tasks.Task DeleteAsync(string pathDeviceSid, string pathKey, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathDeviceSid, string pathKey, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteDeviceSecretOptions(pathDeviceSid, pathKey) ; return await DeleteAsync(options, client, cancellationToken); @@ -218,7 +218,7 @@ public static DeviceSecretResource Fetch(FetchDeviceSecretOptions options, ITwil /// Fetch DeviceSecret parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceSecret - public static async System.Threading.Tasks.Task FetchAsync(FetchDeviceSecretOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDeviceSecretOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static DeviceSecretResource Fetch( /// The secret key; up to 100 characters. /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceSecret - public static async System.Threading.Tasks.Task FetchAsync(string pathDeviceSid, string pathKey, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathDeviceSid, string pathKey, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDeviceSecretOptions(pathDeviceSid, pathKey){ }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadDeviceSecretOptions opt /// Read DeviceSecret parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DeviceSecret - public static async System.Threading.Tasks.Task> ReadAsync(ReadDeviceSecretOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDeviceSecretOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateDeviceSecretOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -450,7 +450,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn string pathDeviceSid, string pathKey, string value, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateDeviceSecretOptions(pathDeviceSid, pathKey, value){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Microvisor/V1/DeviceResource.cs b/src/Twilio/Rest/Microvisor/V1/DeviceResource.cs index dcae1b63f..5a81f690e 100644 --- a/src/Twilio/Rest/Microvisor/V1/DeviceResource.cs +++ b/src/Twilio/Rest/Microvisor/V1/DeviceResource.cs @@ -67,7 +67,7 @@ public static DeviceResource Fetch(FetchDeviceOptions options, ITwilioRestClient /// Fetch Device parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Device - public static async System.Threading.Tasks.Task FetchAsync(FetchDeviceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDeviceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static DeviceResource Fetch( /// A 34-character string that uniquely identifies this Device. /// Client to make requests to Twilio /// Task that resolves to A single instance of Device - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDeviceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadDeviceOptions options, ITwili /// Read Device parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Device - public static async System.Threading.Tasks.Task> ReadAsync(ReadDeviceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDeviceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadDeviceOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -253,7 +253,7 @@ public static DeviceResource Update(UpdateDeviceOptions options, ITwilioRestClie #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateDeviceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -296,7 +296,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string targetApp = null, bool? loggingEnabled = null, bool? restartApp = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateDeviceOptions(pathSid){ UniqueName = uniqueName, TargetApp = targetApp, LoggingEnabled = loggingEnabled, RestartApp = restartApp }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Monitor/V1/AlertResource.cs b/src/Twilio/Rest/Monitor/V1/AlertResource.cs index 9b1752718..25a289126 100644 --- a/src/Twilio/Rest/Monitor/V1/AlertResource.cs +++ b/src/Twilio/Rest/Monitor/V1/AlertResource.cs @@ -67,7 +67,7 @@ public static AlertResource Fetch(FetchAlertOptions options, ITwilioRestClient c /// Fetch Alert parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Alert - public static async System.Threading.Tasks.Task FetchAsync(FetchAlertOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAlertOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static AlertResource Fetch( /// The SID of the Alert resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Alert - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAlertOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadAlertOptions options, ITwilioR /// Read Alert parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Alert - public static async System.Threading.Tasks.Task> ReadAsync(ReadAlertOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAlertOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -173,7 +173,7 @@ public static async System.Threading.Tasks.Task> Read DateTime? endDate = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAlertOptions(){ LogLevel = logLevel, StartDate = startDate, EndDate = endDate, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Monitor/V1/EventResource.cs b/src/Twilio/Rest/Monitor/V1/EventResource.cs index 9347c8fc0..228591731 100644 --- a/src/Twilio/Rest/Monitor/V1/EventResource.cs +++ b/src/Twilio/Rest/Monitor/V1/EventResource.cs @@ -67,7 +67,7 @@ public static EventResource Fetch(FetchEventOptions options, ITwilioRestClient c /// Fetch Event parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Event - public static async System.Threading.Tasks.Task FetchAsync(FetchEventOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchEventOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static EventResource Fetch( /// The SID of the Event resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Event - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchEventOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadEventOptions options, ITwilioR /// Read Event parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Event - public static async System.Threading.Tasks.Task> ReadAsync(ReadEventOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEventOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -185,7 +185,7 @@ public static async System.Threading.Tasks.Task> Read DateTime? endDate = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadEventOptions(){ ActorSid = actorSid, EventType = eventType, ResourceSid = resourceSid, SourceIpAddress = sourceIpAddress, StartDate = startDate, EndDate = endDate, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Notify/V1/CredentialResource.cs b/src/Twilio/Rest/Notify/V1/CredentialResource.cs index 5d1ce5cf3..4647c685a 100644 --- a/src/Twilio/Rest/Notify/V1/CredentialResource.cs +++ b/src/Twilio/Rest/Notify/V1/CredentialResource.cs @@ -80,7 +80,7 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio /// Create Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -131,7 +131,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? sandbox = null, string apiKey = null, string secret = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCredentialOptions(type){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; return await CreateAsync(options, client, cancellationToken); @@ -177,7 +177,7 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli /// Task that resolves to A single instance of Credential public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -200,7 +200,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the Credential resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCredentialOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -240,7 +240,7 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe /// Fetch Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -264,7 +264,7 @@ public static CredentialResource Fetch( /// The Twilio-provided string that uniquely identifies the Credential resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCredentialOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadCredentialOptions options /// Read Credential parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Credential - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -334,7 +334,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCredentialOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -426,7 +426,7 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateCredentialOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -477,7 +477,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? sandbox = null, string apiKey = null, string secret = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateCredentialOptions(pathSid){ FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Notify/V1/Service/BindingResource.cs b/src/Twilio/Rest/Notify/V1/Service/BindingResource.cs index 61e7505c2..ac8a9397e 100644 --- a/src/Twilio/Rest/Notify/V1/Service/BindingResource.cs +++ b/src/Twilio/Rest/Notify/V1/Service/BindingResource.cs @@ -84,7 +84,7 @@ public static BindingResource Create(CreateBindingOptions options, ITwilioRestCl /// Create Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task CreateAsync(CreateBindingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateBindingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -139,7 +139,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string notificationProtocolVersion = null, string credentialSid = null, string endpoint = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateBindingOptions(pathServiceSid, identity, bindingType, address){ Tag = tag, NotificationProtocolVersion = notificationProtocolVersion, CredentialSid = credentialSid, Endpoint = endpoint }; return await CreateAsync(options, client, cancellationToken); @@ -187,7 +187,7 @@ public static bool Delete(DeleteBindingOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Binding public static async System.Threading.Tasks.Task DeleteAsync(DeleteBindingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -212,7 +212,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The Twilio-provided string that uniquely identifies the Binding resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteBindingOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -254,7 +254,7 @@ public static BindingResource Fetch(FetchBindingOptions options, ITwilioRestClie /// Fetch Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchBindingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -281,7 +281,7 @@ public static BindingResource Fetch( /// The Twilio-provided string that uniquely identifies the Binding resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchBindingOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -321,7 +321,7 @@ public static ResourceSet Read(ReadBindingOptions options, ITwi /// Read Binding parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Binding - public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBindingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -373,7 +373,7 @@ public static async System.Threading.Tasks.Task> Re List tag = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadBindingOptions(pathServiceSid){ StartDate = startDate, EndDate = endDate, Identity = identity, Tag = tag, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Notify/V1/Service/NotificationResource.cs b/src/Twilio/Rest/Notify/V1/Service/NotificationResource.cs index 962d0b9e2..acde1d758 100644 --- a/src/Twilio/Rest/Notify/V1/Service/NotificationResource.cs +++ b/src/Twilio/Rest/Notify/V1/Service/NotificationResource.cs @@ -81,7 +81,7 @@ public static NotificationResource Create(CreateNotificationOptions options, ITw /// Create Notification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task CreateAsync(CreateNotificationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateNotificationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -180,7 +180,7 @@ public static async System.Threading.Tasks.Task CreateAsyn object alexa = null, List toBinding = null, string deliveryCallbackUrl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateNotificationOptions(pathServiceSid){ Identity = identity, Tag = tag, Body = body, Priority = priority, Ttl = ttl, Title = title, Sound = sound, Action = action, Data = data, Apn = apn, Gcm = gcm, Sms = sms, FacebookMessenger = facebookMessenger, Fcm = fcm, Segment = segment, Alexa = alexa, ToBinding = toBinding, DeliveryCallbackUrl = deliveryCallbackUrl }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Notify/V1/ServiceResource.cs b/src/Twilio/Rest/Notify/V1/ServiceResource.cs index 800b71b9a..b9f582bce 100644 --- a/src/Twilio/Rest/Notify/V1/ServiceResource.cs +++ b/src/Twilio/Rest/Notify/V1/ServiceResource.cs @@ -66,7 +66,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -145,7 +145,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string defaultAlexaNotificationProtocolVersion = null, string deliveryCallbackUrl = null, bool? deliveryCallbackEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateServiceOptions(){ FriendlyName = friendlyName, ApnCredentialSid = apnCredentialSid, GcmCredentialSid = gcmCredentialSid, MessagingServiceSid = messagingServiceSid, FacebookMessengerPageId = facebookMessengerPageId, DefaultApnNotificationProtocolVersion = defaultApnNotificationProtocolVersion, DefaultGcmNotificationProtocolVersion = defaultGcmNotificationProtocolVersion, FcmCredentialSid = fcmCredentialSid, DefaultFcmNotificationProtocolVersion = defaultFcmNotificationProtocolVersion, LogEnabled = logEnabled, AlexaSkillId = alexaSkillId, DefaultAlexaNotificationProtocolVersion = defaultAlexaNotificationProtocolVersion, DeliveryCallbackUrl = deliveryCallbackUrl, DeliveryCallbackEnabled = deliveryCallbackEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -191,7 +191,7 @@ public static bool Delete(DeleteServiceOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -214,7 +214,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteServiceOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -254,7 +254,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -278,7 +278,7 @@ public static ServiceResource Fetch( /// The Twilio-provided string that uniquely identifies 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchServiceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -316,7 +316,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -352,7 +352,7 @@ public static async System.Threading.Tasks.Task> Re string friendlyName = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadServiceOptions(){ FriendlyName = friendlyName, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -444,7 +444,7 @@ public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -527,7 +527,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string defaultAlexaNotificationProtocolVersion = null, string deliveryCallbackUrl = null, bool? deliveryCallbackEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, ApnCredentialSid = apnCredentialSid, GcmCredentialSid = gcmCredentialSid, MessagingServiceSid = messagingServiceSid, FacebookMessengerPageId = facebookMessengerPageId, DefaultApnNotificationProtocolVersion = defaultApnNotificationProtocolVersion, DefaultGcmNotificationProtocolVersion = defaultGcmNotificationProtocolVersion, FcmCredentialSid = fcmCredentialSid, DefaultFcmNotificationProtocolVersion = defaultFcmNotificationProtocolVersion, LogEnabled = logEnabled, AlexaSkillId = alexaSkillId, DefaultAlexaNotificationProtocolVersion = defaultAlexaNotificationProtocolVersion, DeliveryCallbackUrl = deliveryCallbackUrl, DeliveryCallbackEnabled = deliveryCallbackEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V1/BulkEligibilityResource.cs b/src/Twilio/Rest/Numbers/V1/BulkEligibilityResource.cs index b1b4da06f..cce1a3045 100644 --- a/src/Twilio/Rest/Numbers/V1/BulkEligibilityResource.cs +++ b/src/Twilio/Rest/Numbers/V1/BulkEligibilityResource.cs @@ -67,7 +67,7 @@ public static BulkEligibilityResource Create(CreateBulkEligibilityOptions option /// Create BulkEligibility parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkEligibility - public static async System.Threading.Tasks.Task CreateAsync(CreateBulkEligibilityOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateBulkEligibilityOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static BulkEligibilityResource Create( /// Task that resolves to A single instance of BulkEligibility public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { var options = new CreateBulkEligibilityOptions(){ }; return await CreateAsync(options, client, cancellationToken); @@ -131,7 +131,7 @@ public static BulkEligibilityResource Fetch(FetchBulkEligibilityOptions options, /// Fetch BulkEligibility parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkEligibility - public static async System.Threading.Tasks.Task FetchAsync(FetchBulkEligibilityOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchBulkEligibilityOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -155,7 +155,7 @@ public static BulkEligibilityResource Fetch( /// The SID of the bulk eligibility check that you want to know about. /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkEligibility - public static async System.Threading.Tasks.Task FetchAsync(string pathRequestId, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathRequestId, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchBulkEligibilityOptions(pathRequestId){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V1/EligibilityResource.cs b/src/Twilio/Rest/Numbers/V1/EligibilityResource.cs index 6c56bcbbc..5fb1f611c 100644 --- a/src/Twilio/Rest/Numbers/V1/EligibilityResource.cs +++ b/src/Twilio/Rest/Numbers/V1/EligibilityResource.cs @@ -67,7 +67,7 @@ public static EligibilityResource Create(CreateEligibilityOptions options, ITwil /// Create Eligibility parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Eligibility - public static async System.Threading.Tasks.Task CreateAsync(CreateEligibilityOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateEligibilityOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static EligibilityResource Create( /// Task that resolves to A single instance of Eligibility public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { var options = new CreateEligibilityOptions(){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberResource.cs b/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberResource.cs index b66b467d5..e85ea23ea 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberResource.cs +++ b/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberResource.cs @@ -75,7 +75,7 @@ public static bool Delete(DeletePortingPortInPhoneNumberOptions options, ITwilio /// Task that resolves to A single instance of PortingPortInPhoneNumber public static async System.Threading.Tasks.Task DeleteAsync(DeletePortingPortInPhoneNumberOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -100,7 +100,7 @@ public static bool Delete(string pathPortInRequestSid, string pathPhoneNumberSid /// The SID of the Port In request phone number. This is a unique identifier of the phone number. /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortInPhoneNumber - public static async System.Threading.Tasks.Task DeleteAsync(string pathPortInRequestSid, string pathPhoneNumberSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathPortInRequestSid, string pathPhoneNumberSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeletePortingPortInPhoneNumberOptions(pathPortInRequestSid, pathPhoneNumberSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -142,7 +142,7 @@ public static PortingPortInPhoneNumberResource Fetch(FetchPortingPortInPhoneNumb /// Fetch PortingPortInPhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortInPhoneNumber - public static async System.Threading.Tasks.Task FetchAsync(FetchPortingPortInPhoneNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPortingPortInPhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -169,7 +169,7 @@ public static PortingPortInPhoneNumberResource Fetch( /// The SID of the Phone number. This is a unique identifier of the phone number. /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortInPhoneNumber - public static async System.Threading.Tasks.Task FetchAsync(string pathPortInRequestSid, string pathPhoneNumberSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathPortInRequestSid, string pathPhoneNumberSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPortingPortInPhoneNumberOptions(pathPortInRequestSid, pathPhoneNumberSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V1/PortingPortInResource.cs b/src/Twilio/Rest/Numbers/V1/PortingPortInResource.cs index 1e7706218..9fdc4a764 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingPortInResource.cs +++ b/src/Twilio/Rest/Numbers/V1/PortingPortInResource.cs @@ -67,7 +67,7 @@ public static PortingPortInResource Create(CreatePortingPortInOptions options, I /// Create PortingPortIn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortIn - public static async System.Threading.Tasks.Task CreateAsync(CreatePortingPortInOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreatePortingPortInOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static PortingPortInResource Create( /// Task that resolves to A single instance of PortingPortIn public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { var options = new CreatePortingPortInOptions(){ }; return await CreateAsync(options, client, cancellationToken); @@ -137,7 +137,7 @@ public static bool Delete(DeletePortingPortInOptions options, ITwilioRestClient /// Task that resolves to A single instance of PortingPortIn public static async System.Threading.Tasks.Task DeleteAsync(DeletePortingPortInOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -160,7 +160,7 @@ public static bool Delete(string pathPortInRequestSid, ITwilioRestClient client /// The SID of the Port In request. This is a unique identifier of the port in request. /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortIn - public static async System.Threading.Tasks.Task DeleteAsync(string pathPortInRequestSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathPortInRequestSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeletePortingPortInOptions(pathPortInRequestSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -200,7 +200,7 @@ public static PortingPortInResource Fetch(FetchPortingPortInOptions options, ITw /// Fetch PortingPortIn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortIn - public static async System.Threading.Tasks.Task FetchAsync(FetchPortingPortInOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPortingPortInOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -224,7 +224,7 @@ public static PortingPortInResource Fetch( /// The SID of the Port In request. This is a unique identifier of the port in request. /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortIn - public static async System.Threading.Tasks.Task FetchAsync(string pathPortInRequestSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathPortInRequestSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPortingPortInOptions(pathPortInRequestSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V1/PortingPortabilityResource.cs b/src/Twilio/Rest/Numbers/V1/PortingPortabilityResource.cs index 03cca2d90..b8e80f391 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingPortabilityResource.cs +++ b/src/Twilio/Rest/Numbers/V1/PortingPortabilityResource.cs @@ -82,7 +82,7 @@ public static PortingPortabilityResource Fetch(FetchPortingPortabilityOptions op /// Fetch PortingPortability parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortability - public static async System.Threading.Tasks.Task FetchAsync(FetchPortingPortabilityOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPortingPortabilityOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -112,7 +112,7 @@ public static PortingPortabilityResource Fetch( /// Address Sid of customer to which the number will be ported. /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortability - public static async System.Threading.Tasks.Task FetchAsync(Types.PhoneNumber pathPhoneNumber, string targetAccountSid = null, string addressSid = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(Types.PhoneNumber pathPhoneNumber, string targetAccountSid = null, string addressSid = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPortingPortabilityOptions(pathPhoneNumber){ TargetAccountSid = targetAccountSid,AddressSid = addressSid }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteResource.cs b/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteResource.cs index 4937b0dd9..8b314a0dc 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteResource.cs +++ b/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteResource.cs @@ -85,7 +85,7 @@ public static bool Delete(DeletePortingWebhookConfigurationDeleteOptions options /// Task that resolves to A single instance of PortingWebhookConfigurationDelete public static async System.Threading.Tasks.Task DeleteAsync(DeletePortingWebhookConfigurationDeleteOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -108,7 +108,7 @@ public static bool Delete(PortingWebhookConfigurationDeleteResource.WebhookTypeE /// The webhook type for the configuration to be delete. `PORT_IN`, `PORT_OUT` /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingWebhookConfigurationDelete - public static async System.Threading.Tasks.Task DeleteAsync(PortingWebhookConfigurationDeleteResource.WebhookTypeEnum pathWebhookType, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(PortingWebhookConfigurationDeleteResource.WebhookTypeEnum pathWebhookType, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeletePortingWebhookConfigurationDeleteOptions(pathWebhookType) ; return await DeleteAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationResource.cs b/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationResource.cs index 90c5a1b30..7aaa94a3d 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationResource.cs +++ b/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationResource.cs @@ -67,7 +67,7 @@ public static PortingWebhookConfigurationResource Create(CreatePortingWebhookCon /// Create PortingWebhookConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingWebhookConfiguration - public static async System.Threading.Tasks.Task CreateAsync(CreatePortingWebhookConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreatePortingWebhookConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static PortingWebhookConfigurationResource Create( /// Task that resolves to A single instance of PortingWebhookConfiguration public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { var options = new CreatePortingWebhookConfigurationOptions(){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationResource.cs b/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationResource.cs index be09bcfd0..3d502f9d7 100644 --- a/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationResource.cs +++ b/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationResource.cs @@ -67,7 +67,7 @@ public static SigningRequestConfigurationResource Create(CreateSigningRequestCon /// Create SigningRequestConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SigningRequestConfiguration - public static async System.Threading.Tasks.Task CreateAsync(CreateSigningRequestConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSigningRequestConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static SigningRequestConfigurationResource Create( /// Task that resolves to A single instance of SigningRequestConfiguration public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSigningRequestConfigurationOptions(){ }; return await CreateAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadSigningR /// Read SigningRequestConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SigningRequestConfiguration - public static async System.Threading.Tasks.Task> ReadAsync(ReadSigningRequestConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSigningRequestConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -169,7 +169,7 @@ public static async System.Threading.Tasks.Task Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -86,7 +86,7 @@ public static WebhookResource Fetch( /// Allows to fetch the webhook configuration /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWebhookOptions(){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderResource.cs b/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderResource.cs index b264a4c30..26652d6b5 100644 --- a/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderResource.cs +++ b/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderResource.cs @@ -85,7 +85,7 @@ public static ResourceSet Read(ReadDependent /// Read DependentHostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DependentHostedNumberOrder - public static async System.Threading.Tasks.Task> ReadAsync(ReadDependentHostedNumberOrderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDependentHostedNumberOrderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -137,7 +137,7 @@ public static async System.Threading.Tasks.Task Create AuthorizationDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task CreateAsync(CreateAuthorizationDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAuthorizationDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -129,7 +129,7 @@ public static async System.Threading.Tasks.Task C List hostedNumberOrderSids, string contactTitle = null, List ccEmails = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAuthorizationDocumentOptions(addressSid, email, contactPhoneNumber, hostedNumberOrderSids){ ContactTitle = contactTitle, CcEmails = ccEmails }; return await CreateAsync(options, client, cancellationToken); @@ -175,7 +175,7 @@ public static bool Delete(DeleteAuthorizationDocumentOptions options, ITwilioRes /// Task that resolves to A single instance of AuthorizationDocument public static async System.Threading.Tasks.Task DeleteAsync(DeleteAuthorizationDocumentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -198,7 +198,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this AuthorizationDocument. /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAuthorizationDocumentOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -238,7 +238,7 @@ public static AuthorizationDocumentResource Fetch(FetchAuthorizationDocumentOpti /// Fetch AuthorizationDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizationDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizationDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -262,7 +262,7 @@ public static AuthorizationDocumentResource Fetch( /// A 34 character string that uniquely identifies this AuthorizationDocument. /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAuthorizationDocumentOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -300,7 +300,7 @@ public static ResourceSet Read(ReadAuthorizationD /// Read AuthorizationDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthorizationDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthorizationDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -340,7 +340,7 @@ public static async System.Threading.Tasks.Task Create BulkHostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkHostedNumberOrder - public static async System.Threading.Tasks.Task CreateAsync(CreateBulkHostedNumberOrderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateBulkHostedNumberOrderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static BulkHostedNumberOrderResource Create( /// Task that resolves to A single instance of BulkHostedNumberOrder public static async System.Threading.Tasks.Task CreateAsync( ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { var options = new CreateBulkHostedNumberOrderOptions(){ }; return await CreateAsync(options, client, cancellationToken); @@ -145,7 +145,7 @@ public static BulkHostedNumberOrderResource Fetch(FetchBulkHostedNumberOrderOpti /// Fetch BulkHostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkHostedNumberOrder - public static async System.Threading.Tasks.Task FetchAsync(FetchBulkHostedNumberOrderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchBulkHostedNumberOrderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static BulkHostedNumberOrderResource Fetch( /// Order status can be used for filtering on Hosted Number Order status values. To see a complete list of order statuses, please check 'https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values'. /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkHostedNumberOrder - public static async System.Threading.Tasks.Task FetchAsync(string pathBulkHostingSid, string orderStatus = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathBulkHostingSid, string orderStatus = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchBulkHostedNumberOrderOptions(pathBulkHostingSid){ OrderStatus = orderStatus }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V2/BundleCloneResource.cs b/src/Twilio/Rest/Numbers/V2/BundleCloneResource.cs index 414df771c..50515ddd6 100644 --- a/src/Twilio/Rest/Numbers/V2/BundleCloneResource.cs +++ b/src/Twilio/Rest/Numbers/V2/BundleCloneResource.cs @@ -85,7 +85,7 @@ public static BundleCloneResource Create(CreateBundleCloneOptions options, ITwil /// Create BundleClone parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BundleClone - public static async System.Threading.Tasks.Task CreateAsync(CreateBundleCloneOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateBundleCloneOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -124,7 +124,7 @@ public static async System.Threading.Tasks.Task CreateAsync string targetAccountSid, bool? moveToDraft = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateBundleCloneOptions(pathBundleSid, targetAccountSid){ MoveToDraft = moveToDraft, FriendlyName = friendlyName }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V2/HostedNumberOrderResource.cs b/src/Twilio/Rest/Numbers/V2/HostedNumberOrderResource.cs index 780db1880..a8f952a66 100644 --- a/src/Twilio/Rest/Numbers/V2/HostedNumberOrderResource.cs +++ b/src/Twilio/Rest/Numbers/V2/HostedNumberOrderResource.cs @@ -97,7 +97,7 @@ public static HostedNumberOrderResource Create(CreateHostedNumberOrderOptions op /// Create HostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task CreateAsync(CreateHostedNumberOrderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateHostedNumberOrderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -184,7 +184,7 @@ public static async System.Threading.Tasks.Task Creat Twilio.Http.HttpMethod statusCallbackMethod = null, string smsApplicationSid = null, string contactTitle = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateHostedNumberOrderOptions(phoneNumber, contactPhoneNumber, addressSid, email){ AccountSid = accountSid, FriendlyName = friendlyName, CcEmails = ccEmails, SmsUrl = smsUrl, SmsMethod = smsMethod, SmsFallbackUrl = smsFallbackUrl, SmsCapability = smsCapability, SmsFallbackMethod = smsFallbackMethod, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, SmsApplicationSid = smsApplicationSid, ContactTitle = contactTitle }; return await CreateAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ public static bool Delete(DeleteHostedNumberOrderOptions options, ITwilioRestCli /// Task that resolves to A single instance of HostedNumberOrder public static async System.Threading.Tasks.Task DeleteAsync(DeleteHostedNumberOrderOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -253,7 +253,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this HostedNumberOrder. /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteHostedNumberOrderOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -293,7 +293,7 @@ public static HostedNumberOrderResource Fetch(FetchHostedNumberOrderOptions opti /// Fetch HostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task FetchAsync(FetchHostedNumberOrderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchHostedNumberOrderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static HostedNumberOrderResource Fetch( /// A 34 character string that uniquely identifies this HostedNumberOrder. /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchHostedNumberOrderOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -355,7 +355,7 @@ public static ResourceSet Read(ReadHostedNumberOrderO /// Read HostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task> ReadAsync(ReadHostedNumberOrderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadHostedNumberOrderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -407,7 +407,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateHostedNumberOrderOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -538,7 +538,7 @@ public static async System.Threading.Tasks.Task Updat HostedNumberOrderResource.StatusEnum status, int? verificationCallDelay = null, string verificationCallExtension = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateHostedNumberOrderOptions(pathSid, status){ VerificationCallDelay = verificationCallDelay, VerificationCallExtension = verificationCallExtension }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyResource.cs index 5bd890901..d4e69b793 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyResource.cs @@ -85,7 +85,7 @@ public static BundleCopyResource Create(CreateBundleCopyOptions options, ITwilio /// Create BundleCopy parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BundleCopy - public static async System.Threading.Tasks.Task CreateAsync(CreateBundleCopyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateBundleCopyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -116,7 +116,7 @@ public static BundleCopyResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathBundleSid, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateBundleCopyOptions(pathBundleSid){ FriendlyName = friendlyName }; return await CreateAsync(options, client, cancellationToken); @@ -156,7 +156,7 @@ public static ResourceSet Read(ReadBundleCopyOptions options /// Read BundleCopy parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BundleCopy - public static async System.Threading.Tasks.Task> ReadAsync(ReadBundleCopyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBundleCopyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -192,7 +192,7 @@ public static async System.Threading.Tasks.Task> string pathBundleSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadBundleCopyOptions(pathBundleSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationResource.cs index 6a28a7f81..a509be79c 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationResource.cs @@ -81,7 +81,7 @@ public static EvaluationResource Create(CreateEvaluationOptions options, ITwilio /// Create Evaluation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Evaluation - public static async System.Threading.Tasks.Task CreateAsync(CreateEvaluationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateEvaluationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -108,7 +108,7 @@ public static EvaluationResource Create( /// Task that resolves to A single instance of Evaluation public static async System.Threading.Tasks.Task CreateAsync( string pathBundleSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateEvaluationOptions(pathBundleSid){ }; return await CreateAsync(options, client, cancellationToken); @@ -150,7 +150,7 @@ public static EvaluationResource Fetch(FetchEvaluationOptions options, ITwilioRe /// Fetch Evaluation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Evaluation - public static async System.Threading.Tasks.Task FetchAsync(FetchEvaluationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchEvaluationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -177,7 +177,7 @@ public static EvaluationResource Fetch( /// The unique string that identifies the Evaluation resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Evaluation - public static async System.Threading.Tasks.Task FetchAsync(string pathBundleSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathBundleSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchEvaluationOptions(pathBundleSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -217,7 +217,7 @@ public static ResourceSet Read(ReadEvaluationOptions options /// Read Evaluation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Evaluation - public static async System.Threading.Tasks.Task> ReadAsync(ReadEvaluationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEvaluationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -253,7 +253,7 @@ public static async System.Threading.Tasks.Task> string pathBundleSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadEvaluationOptions(pathBundleSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentResource.cs index edf6d281b..9cca2edb3 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentResource.cs @@ -68,7 +68,7 @@ public static ItemAssignmentResource Create(CreateItemAssignmentOptions options, /// Create ItemAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ItemAssignment - public static async System.Threading.Tasks.Task CreateAsync(CreateItemAssignmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateItemAssignmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static ItemAssignmentResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathBundleSid, string objectSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateItemAssignmentOptions(pathBundleSid, objectSid){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteItemAssignmentOptions options, ITwilioRestClient /// Task that resolves to A single instance of ItemAssignment public static async System.Threading.Tasks.Task DeleteAsync(DeleteItemAssignmentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathBundleSid, string pathSid, ITwilioRestClien /// The unique string that we created to identify the Identity resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of ItemAssignment - public static async System.Threading.Tasks.Task DeleteAsync(string pathBundleSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathBundleSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteItemAssignmentOptions(pathBundleSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static ItemAssignmentResource Fetch(FetchItemAssignmentOptions options, I /// Fetch ItemAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ItemAssignment - public static async System.Threading.Tasks.Task FetchAsync(FetchItemAssignmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchItemAssignmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static ItemAssignmentResource Fetch( /// The unique string that we created to identify the Identity resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of ItemAssignment - public static async System.Threading.Tasks.Task FetchAsync(string pathBundleSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathBundleSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchItemAssignmentOptions(pathBundleSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadItemAssignmentOptions /// Read ItemAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ItemAssignment - public static async System.Threading.Tasks.Task> ReadAsync(ReadItemAssignmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadItemAssignmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task Create ReplaceItems parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ReplaceItems - public static async System.Threading.Tasks.Task CreateAsync(CreateReplaceItemsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateReplaceItemsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -116,7 +116,7 @@ public static ReplaceItemsResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathBundleSid, string fromBundleSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateReplaceItemsOptions(pathBundleSid, fromBundleSid){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleResource.cs index 7016ecee9..46599de12 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleResource.cs @@ -119,7 +119,7 @@ public static BundleResource Create(CreateBundleOptions options, ITwilioRestClie /// Create Bundle parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Bundle - public static async System.Threading.Tasks.Task CreateAsync(CreateBundleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateBundleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -174,7 +174,7 @@ public static async System.Threading.Tasks.Task CreateAsync( BundleResource.EndUserTypeEnum endUserType = null, string numberType = null, bool? isTest = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateBundleOptions(friendlyName, email){ StatusCallback = statusCallback, RegulationSid = regulationSid, IsoCountry = isoCountry, EndUserType = endUserType, NumberType = numberType, IsTest = isTest }; return await CreateAsync(options, client, cancellationToken); @@ -220,7 +220,7 @@ public static bool Delete(DeleteBundleOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Bundle public static async System.Threading.Tasks.Task DeleteAsync(DeleteBundleOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -243,7 +243,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string that we created to identify the Bundle resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Bundle - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteBundleOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -283,7 +283,7 @@ public static BundleResource Fetch(FetchBundleOptions options, ITwilioRestClient /// Fetch Bundle parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Bundle - public static async System.Threading.Tasks.Task FetchAsync(FetchBundleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchBundleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -307,7 +307,7 @@ public static BundleResource Fetch( /// The unique string that we created to identify the Bundle resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Bundle - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchBundleOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -345,7 +345,7 @@ public static ResourceSet Read(ReadBundleOptions options, ITwili /// Read Bundle parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Bundle - public static async System.Threading.Tasks.Task> ReadAsync(ReadBundleOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBundleOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -421,7 +421,7 @@ public static async System.Threading.Tasks.Task> Rea DateTime? validUntilDateAfter = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadBundleOptions(){ Status = status, FriendlyName = friendlyName, RegulationSid = regulationSid, IsoCountry = isoCountry, NumberType = numberType, HasValidUntilDate = hasValidUntilDate, SortBy = sortBy, SortDirection = sortDirection, ValidUntilDateBefore = validUntilDateBefore, ValidUntilDate = validUntilDate, ValidUntilDateAfter = validUntilDateAfter, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -513,7 +513,7 @@ public static BundleResource Update(UpdateBundleOptions options, ITwilioRestClie #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateBundleOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -556,7 +556,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( Uri statusCallback = null, string friendlyName = null, string email = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateBundleOptions(pathSid){ Status = status, StatusCallback = statusCallback, FriendlyName = friendlyName, Email = email }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserResource.cs index 6b5995798..f184b6cbf 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserResource.cs @@ -79,7 +79,7 @@ public static EndUserResource Create(CreateEndUserOptions options, ITwilioRestCl /// Create EndUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task CreateAsync(CreateEndUserOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateEndUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -114,7 +114,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, EndUserResource.TypeEnum type, object attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateEndUserOptions(friendlyName, type){ Attributes = attributes }; return await CreateAsync(options, client, cancellationToken); @@ -160,7 +160,7 @@ public static bool Delete(DeleteEndUserOptions options, ITwilioRestClient client /// Task that resolves to A single instance of EndUser public static async System.Threading.Tasks.Task DeleteAsync(DeleteEndUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -183,7 +183,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string created by Twilio to identify the End User resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteEndUserOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -223,7 +223,7 @@ public static EndUserResource Fetch(FetchEndUserOptions options, ITwilioRestClie /// Fetch EndUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -247,7 +247,7 @@ public static EndUserResource Fetch( /// The unique string created by Twilio to identify the End User resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchEndUserOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadEndUserOptions options, ITwi /// Read EndUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadEndUserOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -409,7 +409,7 @@ public static EndUserResource Update(UpdateEndUserOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateEndUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -444,7 +444,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string friendlyName = null, object attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateEndUserOptions(pathSid){ FriendlyName = friendlyName, Attributes = attributes }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeResource.cs index 233190886..6f38288fe 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeResource.cs @@ -67,7 +67,7 @@ public static EndUserTypeResource Fetch(FetchEndUserTypeOptions options, ITwilio /// Fetch EndUserType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUserType - public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserTypeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserTypeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static EndUserTypeResource Fetch( /// The unique string that identifies the End-User Type resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUserType - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchEndUserTypeOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadEndUserTypeOptions optio /// Read EndUserType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUserType - public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserTypeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserTypeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadEndUserTypeOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationResource.cs index 255258d99..ec1cc7c8a 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationResource.cs @@ -80,7 +80,7 @@ public static RegulationResource Fetch(FetchRegulationOptions options, ITwilioRe /// Fetch Regulation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Regulation - public static async System.Threading.Tasks.Task FetchAsync(FetchRegulationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRegulationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -107,7 +107,7 @@ public static RegulationResource Fetch( /// A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields /// Client to make requests to Twilio /// Task that resolves to A single instance of Regulation - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, bool? includeConstraints = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, bool? includeConstraints = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRegulationOptions(pathSid){ IncludeConstraints = includeConstraints }; return await FetchAsync(options, client, cancellationToken); @@ -145,7 +145,7 @@ public static ResourceSet Read(ReadRegulationOptions options /// Read Regulation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Regulation - public static async System.Threading.Tasks.Task> ReadAsync(ReadRegulationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRegulationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -193,7 +193,7 @@ public static async System.Threading.Tasks.Task> bool? includeConstraints = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRegulationOptions(){ EndUserType = endUserType, IsoCountry = isoCountry, NumberType = numberType, IncludeConstraints = includeConstraints, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentResource.cs index b4324ab46..47da175a7 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentResource.cs @@ -83,7 +83,7 @@ public static SupportingDocumentResource Create(CreateSupportingDocumentOptions /// Create SupportingDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task CreateAsync(CreateSupportingDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSupportingDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -118,7 +118,7 @@ public static async System.Threading.Tasks.Task Crea string friendlyName, string type, object attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSupportingDocumentOptions(friendlyName, type){ Attributes = attributes }; return await CreateAsync(options, client, cancellationToken); @@ -164,7 +164,7 @@ public static bool Delete(DeleteSupportingDocumentOptions options, ITwilioRestCl /// Task that resolves to A single instance of SupportingDocument public static async System.Threading.Tasks.Task DeleteAsync(DeleteSupportingDocumentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -187,7 +187,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string created by Twilio to identify the Supporting Document resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSupportingDocumentOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -227,7 +227,7 @@ public static SupportingDocumentResource Fetch(FetchSupportingDocumentOptions op /// Fetch SupportingDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -251,7 +251,7 @@ public static SupportingDocumentResource Fetch( /// The unique string created by Twilio to identify the Supporting Document resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSupportingDocumentOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -289,7 +289,7 @@ public static ResourceSet Read(ReadSupportingDocumen /// Read SupportingDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSupportingDocumentOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -413,7 +413,7 @@ public static SupportingDocumentResource Update(UpdateSupportingDocumentOptions #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSupportingDocumentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -448,7 +448,7 @@ public static async System.Threading.Tasks.Task Upda string pathSid, string friendlyName = null, object attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSupportingDocumentOptions(pathSid){ FriendlyName = friendlyName, Attributes = attributes }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeResource.cs b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeResource.cs index cc98b37f4..bace8d110 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeResource.cs +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeResource.cs @@ -67,7 +67,7 @@ public static SupportingDocumentTypeResource Fetch(FetchSupportingDocumentTypeOp /// Fetch SupportingDocumentType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocumentType - public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentTypeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentTypeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static SupportingDocumentTypeResource Fetch( /// The unique string that identifies the Supporting Document Type resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocumentType - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSupportingDocumentTypeOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadSupportingDoc /// Read SupportingDocumentType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocumentType - public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentTypeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentTypeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSupportingDocumentTypeOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Oauth/V1/AuthorizeResource.cs b/src/Twilio/Rest/Oauth/V1/AuthorizeResource.cs index 0e81d04f6..d6d4d5e1b 100644 --- a/src/Twilio/Rest/Oauth/V1/AuthorizeResource.cs +++ b/src/Twilio/Rest/Oauth/V1/AuthorizeResource.cs @@ -65,7 +65,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetNoAuthRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static AuthorizeResource Fetch( /// An opaque value which can be used to maintain state between the request and callback /// Client to make requests to Twilio /// Task that resolves to A single instance of Authorize - 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) + 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 , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAuthorizeOptions(){ ResponseType = responseType,ClientId = clientId,RedirectUri = redirectUri,Scope = scope,State = state }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Oauth/V1/TokenResource.cs b/src/Twilio/Rest/Oauth/V1/TokenResource.cs index 04f82baa5..7f05be2ac 100644 --- a/src/Twilio/Rest/Oauth/V1/TokenResource.cs +++ b/src/Twilio/Rest/Oauth/V1/TokenResource.cs @@ -66,7 +66,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTokenOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetNoAuthRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -121,7 +121,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string audience = null, string refreshToken = null, string scope = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTokenOptions(grantType, clientId){ ClientSecret = clientSecret, Code = code, RedirectUri = redirectUri, Audience = audience, RefreshToken = refreshToken, Scope = scope }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderResource.cs b/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderResource.cs index 5f9f16069..ffb2e10ac 100644 --- a/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderResource.cs +++ b/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderResource.cs @@ -100,7 +100,7 @@ public static ResourceSet Read(ReadDependent /// Read DependentHostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DependentHostedNumberOrder - public static async System.Threading.Tasks.Task> ReadAsync(ReadDependentHostedNumberOrderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDependentHostedNumberOrderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -156,7 +156,7 @@ public static async System.Threading.Tasks.Task Create AuthorizationDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task CreateAsync(CreateAuthorizationDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAuthorizationDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -129,7 +129,7 @@ public static async System.Threading.Tasks.Task C string contactTitle, string contactPhoneNumber, List ccEmails = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAuthorizationDocumentOptions(hostedNumberOrderSids, addressSid, email, contactTitle, contactPhoneNumber){ CcEmails = ccEmails }; return await CreateAsync(options, client, cancellationToken); @@ -169,7 +169,7 @@ public static AuthorizationDocumentResource Fetch(FetchAuthorizationDocumentOpti /// Fetch AuthorizationDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizationDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizationDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -193,7 +193,7 @@ public static AuthorizationDocumentResource Fetch( /// A 34 character string that uniquely identifies this AuthorizationDocument. /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAuthorizationDocumentOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -231,7 +231,7 @@ public static ResourceSet Read(ReadAuthorizationD /// Read AuthorizationDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AuthorizationDocument - public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthorizationDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAuthorizationDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -271,7 +271,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateAuthorizationDocumentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -418,7 +418,7 @@ public static async System.Threading.Tasks.Task U AuthorizationDocumentResource.StatusEnum status = null, string contactTitle = null, string contactPhoneNumber = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateAuthorizationDocumentOptions(pathSid){ HostedNumberOrderSids = hostedNumberOrderSids, AddressSid = addressSid, Email = email, CcEmails = ccEmails, Status = status, ContactTitle = contactTitle, ContactPhoneNumber = contactPhoneNumber }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderResource.cs b/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderResource.cs index 14d7eb5a1..318aeebda 100644 --- a/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderResource.cs +++ b/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderResource.cs @@ -99,7 +99,7 @@ public static HostedNumberOrderResource Create(CreateHostedNumberOrderOptions op /// Create HostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task CreateAsync(CreateHostedNumberOrderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateHostedNumberOrderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -190,7 +190,7 @@ public static async System.Threading.Tasks.Task Creat string email = null, HostedNumberOrderResource.VerificationTypeEnum verificationType = null, string verificationDocumentSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateHostedNumberOrderOptions(phoneNumber, smsCapability){ AccountSid = accountSid, FriendlyName = friendlyName, UniqueName = uniqueName, CcEmails = ccEmails, SmsUrl = smsUrl, SmsMethod = smsMethod, SmsFallbackUrl = smsFallbackUrl, SmsFallbackMethod = smsFallbackMethod, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, SmsApplicationSid = smsApplicationSid, AddressSid = addressSid, Email = email, VerificationType = verificationType, VerificationDocumentSid = verificationDocumentSid }; return await CreateAsync(options, client, cancellationToken); @@ -236,7 +236,7 @@ public static bool Delete(DeleteHostedNumberOrderOptions options, ITwilioRestCli /// Task that resolves to A single instance of HostedNumberOrder public static async System.Threading.Tasks.Task DeleteAsync(DeleteHostedNumberOrderOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -259,7 +259,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// A 34 character string that uniquely identifies this HostedNumberOrder. /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteHostedNumberOrderOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -299,7 +299,7 @@ public static HostedNumberOrderResource Fetch(FetchHostedNumberOrderOptions opti /// Fetch HostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task FetchAsync(FetchHostedNumberOrderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchHostedNumberOrderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -323,7 +323,7 @@ public static HostedNumberOrderResource Fetch( /// A 34 character string that uniquely identifies this HostedNumberOrder. /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchHostedNumberOrderOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -361,7 +361,7 @@ public static ResourceSet Read(ReadHostedNumberOrderO /// Read HostedNumberOrder parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HostedNumberOrder - public static async System.Threading.Tasks.Task> ReadAsync(ReadHostedNumberOrderOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadHostedNumberOrderOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -413,7 +413,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateHostedNumberOrderOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -572,7 +572,7 @@ public static async System.Threading.Tasks.Task Updat string verificationDocumentSid = null, string extension = null, int? callDelay = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateHostedNumberOrderOptions(pathSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Email = email, CcEmails = ccEmails, Status = status, VerificationCode = verificationCode, VerificationType = verificationType, VerificationDocumentSid = verificationDocumentSid, Extension = extension, CallDelay = callDelay }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionResource.cs b/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionResource.cs index 17818afb9..05f85093c 100644 --- a/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionResource.cs +++ b/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionResource.cs @@ -69,7 +69,7 @@ public static AvailableAddOnExtensionResource Fetch(FetchAvailableAddOnExtension /// Fetch AvailableAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnExtensionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnExtensionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static AvailableAddOnExtensionResource Fetch( /// The SID of the AvailableAddOn Extension resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(string pathAvailableAddOnSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathAvailableAddOnSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAvailableAddOnExtensionOptions(pathAvailableAddOnSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -136,7 +136,7 @@ public static ResourceSet Read(ReadAvailableAdd /// Read AvailableAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOnExtension - public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnExtensionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnExtensionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static async System.Threading.Tasks.Task Fetch AvailableAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOn - public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAvailableAddOnOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static AvailableAddOnResource Fetch( /// The SID of the AvailableAddOn resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOn - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAvailableAddOnOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadAvailableAddOnOptions /// Read AvailableAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AvailableAddOn - public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAvailableAddOnOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAvailableAddOnOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionResource.cs b/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionResource.cs index 2bc4a3c00..c51b23df3 100644 --- a/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionResource.cs +++ b/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionResource.cs @@ -69,7 +69,7 @@ public static InstalledAddOnExtensionResource Fetch(FetchInstalledAddOnExtension /// Fetch InstalledAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnExtensionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnExtensionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static InstalledAddOnExtensionResource Fetch( /// The SID of the InstalledAddOn Extension resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOnExtension - public static async System.Threading.Tasks.Task FetchAsync(string pathInstalledAddOnSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathInstalledAddOnSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInstalledAddOnExtensionOptions(pathInstalledAddOnSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -136,7 +136,7 @@ public static ResourceSet Read(ReadInstalledAdd /// Read InstalledAddOnExtension parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOnExtension - public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnExtensionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnExtensionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateInstalledAddOnExtensionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -301,7 +301,7 @@ public static async System.Threading.Tasks.Task string pathInstalledAddOnSid, string pathSid, bool? enabled, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateInstalledAddOnExtensionOptions(pathInstalledAddOnSid, pathSid, enabled){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnResource.cs b/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnResource.cs index edcb95c44..d9ca7c445 100644 --- a/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnResource.cs +++ b/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnResource.cs @@ -66,7 +66,7 @@ public static InstalledAddOnResource Create(CreateInstalledAddOnOptions options, /// Create InstalledAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task CreateAsync(CreateInstalledAddOnOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateInstalledAddOnOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task CreateAs bool? acceptTermsOfService, object configuration = null, string uniqueName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateInstalledAddOnOptions(availableAddOnSid, acceptTermsOfService){ Configuration = configuration, UniqueName = uniqueName }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static bool Delete(DeleteInstalledAddOnOptions options, ITwilioRestClient /// Task that resolves to A single instance of InstalledAddOn public static async System.Threading.Tasks.Task DeleteAsync(DeleteInstalledAddOnOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -174,7 +174,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the InstalledAddOn resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteInstalledAddOnOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static InstalledAddOnResource Fetch(FetchInstalledAddOnOptions options, I /// Fetch InstalledAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchInstalledAddOnOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -238,7 +238,7 @@ public static InstalledAddOnResource Fetch( /// The SID of the InstalledAddOn resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInstalledAddOnOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -276,7 +276,7 @@ public static ResourceSet Read(ReadInstalledAddOnOptions /// Read InstalledAddOn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of InstalledAddOn - public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInstalledAddOnOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -308,7 +308,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadInstalledAddOnOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -400,7 +400,7 @@ public static InstalledAddOnResource Update(UpdateInstalledAddOnOptions options, #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateInstalledAddOnOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -435,7 +435,7 @@ public static async System.Threading.Tasks.Task UpdateAs string pathSid, object configuration = null, string uniqueName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateInstalledAddOnOptions(pathSid){ Configuration = configuration, UniqueName = uniqueName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionResource.cs b/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionResource.cs index 9e7bb303e..634968a19 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionResource.cs @@ -77,7 +77,7 @@ public static bool Delete(DeleteDocumentPermissionOptions options, ITwilioRestCl /// Task that resolves to A single instance of DocumentPermission public static async System.Threading.Tasks.Task DeleteAsync(DeleteDocumentPermissionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -104,7 +104,7 @@ public static bool Delete(string pathServiceSid, string pathDocumentSid, string /// Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. /// Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathDocumentSid, string pathIdentity, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathDocumentSid, string pathIdentity, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity) ; return await DeleteAsync(options, client, cancellationToken); @@ -148,7 +148,7 @@ public static DocumentPermissionResource Fetch(FetchDocumentPermissionOptions op /// Fetch DocumentPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission - public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentPermissionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentPermissionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -178,7 +178,7 @@ public static DocumentPermissionResource Fetch( /// Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. /// Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathDocumentSid, string pathIdentity, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathDocumentSid, string pathIdentity, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity){ }; return await FetchAsync(options, client, cancellationToken); @@ -220,7 +220,7 @@ public static ResourceSet Read(ReadDocumentPermissio /// Read DocumentPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission - public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentPermissionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentPermissionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -260,7 +260,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateDocumentPermissionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -403,7 +403,7 @@ public static async System.Threading.Tasks.Task Upda bool? read, bool? write, bool? manage, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity, read, write, manage){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Sync/Service/DocumentResource.cs b/src/Twilio/Rest/Preview/Sync/Service/DocumentResource.cs index ae1c4a3be..4f41797b9 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/DocumentResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/DocumentResource.cs @@ -68,7 +68,7 @@ public static DocumentResource Create(CreateDocumentOptions options, ITwilioRest /// Create Document parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task CreateAsync(CreateDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string pathServiceSid, string uniqueName = null, object data = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateDocumentOptions(pathServiceSid){ UniqueName = uniqueName, Data = data }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static bool Delete(DeleteDocumentOptions options, ITwilioRestClient clien /// Task that resolves to A single instance of Document public static async System.Threading.Tasks.Task DeleteAsync(DeleteDocumentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -176,7 +176,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteDocumentOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -218,7 +218,7 @@ public static DocumentResource Fetch(FetchDocumentOptions options, ITwilioRestCl /// Fetch Document parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static DocumentResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDocumentOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadDocumentOptions options, IT /// Read Document parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static async System.Threading.Tasks.Task> R string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadDocumentOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -415,7 +415,7 @@ public static DocumentResource Update(UpdateDocumentOptions options, ITwilioRest #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateDocumentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -454,7 +454,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, object data, string ifMatch = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateDocumentOptions(pathServiceSid, pathSid, data){ IfMatch = ifMatch }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemResource.cs b/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemResource.cs index a42cdae11..4c189dff3 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemResource.cs @@ -94,7 +94,7 @@ public static SyncListItemResource Create(CreateSyncListItemOptions options, ITw /// Create SyncListItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListItemOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListItemOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -129,7 +129,7 @@ public static async System.Threading.Tasks.Task CreateAsyn string pathServiceSid, string pathListSid, object data, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSyncListItemOptions(pathServiceSid, pathListSid, data){ }; return await CreateAsync(options, client, cancellationToken); @@ -179,7 +179,7 @@ public static bool Delete(DeleteSyncListItemOptions options, ITwilioRestClient c /// Task that resolves to A single instance of SyncListItem public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListItemOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -208,7 +208,7 @@ public static bool Delete(string pathServiceSid, string pathListSid, int? pathIn /// The If-Match HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathListSid, int? pathIndex, string ifMatch = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathListSid, int? pathIndex, string ifMatch = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSyncListItemOptions(pathServiceSid, pathListSid, pathIndex) { IfMatch = ifMatch }; return await DeleteAsync(options, client, cancellationToken); @@ -252,7 +252,7 @@ public static SyncListItemResource Fetch(FetchSyncListItemOptions options, ITwil /// Fetch SyncListItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListItemOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListItemOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -282,7 +282,7 @@ public static SyncListItemResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathListSid, int? pathIndex, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathListSid, int? pathIndex, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSyncListItemOptions(pathServiceSid, pathListSid, pathIndex){ }; return await FetchAsync(options, client, cancellationToken); @@ -324,7 +324,7 @@ public static ResourceSet Read(ReadSyncListItemOptions opt /// Read SyncListItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListItemOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListItemOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -376,7 +376,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListItemOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -515,7 +515,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn int? pathIndex, object data, string ifMatch = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSyncListItemOptions(pathServiceSid, pathListSid, pathIndex, data){ IfMatch = ifMatch }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionResource.cs b/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionResource.cs index 38d422008..721a691c8 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionResource.cs @@ -77,7 +77,7 @@ public static bool Delete(DeleteSyncListPermissionOptions options, ITwilioRestCl /// Task that resolves to A single instance of SyncListPermission public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListPermissionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -104,7 +104,7 @@ public static bool Delete(string pathServiceSid, string pathListSid, string path /// Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathListSid, string pathIdentity, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathListSid, string pathIdentity, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSyncListPermissionOptions(pathServiceSid, pathListSid, pathIdentity) ; return await DeleteAsync(options, client, cancellationToken); @@ -148,7 +148,7 @@ public static SyncListPermissionResource Fetch(FetchSyncListPermissionOptions op /// Fetch SyncListPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListPermissionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListPermissionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -178,7 +178,7 @@ public static SyncListPermissionResource Fetch( /// Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathListSid, string pathIdentity, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathListSid, string pathIdentity, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSyncListPermissionOptions(pathServiceSid, pathListSid, pathIdentity){ }; return await FetchAsync(options, client, cancellationToken); @@ -220,7 +220,7 @@ public static ResourceSet Read(ReadSyncListPermissio /// Read SyncListPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListPermissionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListPermissionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -260,7 +260,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListPermissionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -403,7 +403,7 @@ public static async System.Threading.Tasks.Task Upda bool? read, bool? write, bool? manage, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSyncListPermissionOptions(pathServiceSid, pathListSid, pathIdentity, read, write, manage){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncListResource.cs b/src/Twilio/Rest/Preview/Sync/Service/SyncListResource.cs index 713af15ba..b656343b8 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncListResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncListResource.cs @@ -68,7 +68,7 @@ public static SyncListResource Create(CreateSyncListOptions options, ITwilioRest /// Create SyncList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static SyncListResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathServiceSid, string uniqueName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSyncListOptions(pathServiceSid){ UniqueName = uniqueName }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteSyncListOptions options, ITwilioRestClient clien /// Task that resolves to A single instance of SyncList public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSyncListOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static SyncListResource Fetch(FetchSyncListOptions options, ITwilioRestCl /// Fetch SyncList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static SyncListResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSyncListOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadSyncListOptions options, IT /// Read SyncList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task> R string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSyncListOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemResource.cs b/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemResource.cs index bf98a3712..7782c3511 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemResource.cs @@ -94,7 +94,7 @@ public static SyncMapItemResource Create(CreateSyncMapItemOptions options, ITwil /// Create SyncMapItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapItemOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapItemOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -133,7 +133,7 @@ public static async System.Threading.Tasks.Task CreateAsync string pathMapSid, string key, object data, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSyncMapItemOptions(pathServiceSid, pathMapSid, key, data){ }; return await CreateAsync(options, client, cancellationToken); @@ -183,7 +183,7 @@ public static bool Delete(DeleteSyncMapItemOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of SyncMapItem public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapItemOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -212,7 +212,7 @@ public static bool Delete(string pathServiceSid, string pathMapSid, string pathK /// The If-Match HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathMapSid, string pathKey, string ifMatch = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathMapSid, string pathKey, string ifMatch = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSyncMapItemOptions(pathServiceSid, pathMapSid, pathKey) { IfMatch = ifMatch }; return await DeleteAsync(options, client, cancellationToken); @@ -256,7 +256,7 @@ public static SyncMapItemResource Fetch(FetchSyncMapItemOptions options, ITwilio /// Fetch SyncMapItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapItemOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapItemOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -286,7 +286,7 @@ public static SyncMapItemResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathMapSid, string pathKey, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathMapSid, string pathKey, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSyncMapItemOptions(pathServiceSid, pathMapSid, pathKey){ }; return await FetchAsync(options, client, cancellationToken); @@ -328,7 +328,7 @@ public static ResourceSet Read(ReadSyncMapItemOptions optio /// Read SyncMapItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapItemOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapItemOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -380,7 +380,7 @@ public static async System.Threading.Tasks.Task SyncMapItemResource.QueryFromBoundTypeEnum bounds = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSyncMapItemOptions(pathServiceSid, pathMapSid){ Order = order, From = from, Bounds = bounds, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -476,7 +476,7 @@ public static SyncMapItemResource Update(UpdateSyncMapItemOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapItemOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -519,7 +519,7 @@ public static async System.Threading.Tasks.Task UpdateAsync string pathKey, object data, string ifMatch = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSyncMapItemOptions(pathServiceSid, pathMapSid, pathKey, data){ IfMatch = ifMatch }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionResource.cs b/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionResource.cs index 9c330656d..b47cd8b37 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionResource.cs @@ -77,7 +77,7 @@ public static bool Delete(DeleteSyncMapPermissionOptions options, ITwilioRestCli /// Task that resolves to A single instance of SyncMapPermission public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapPermissionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -104,7 +104,7 @@ public static bool Delete(string pathServiceSid, string pathMapSid, string pathI /// Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathMapSid, string pathIdentity, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathMapSid, string pathIdentity, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSyncMapPermissionOptions(pathServiceSid, pathMapSid, pathIdentity) ; return await DeleteAsync(options, client, cancellationToken); @@ -148,7 +148,7 @@ public static SyncMapPermissionResource Fetch(FetchSyncMapPermissionOptions opti /// Fetch SyncMapPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapPermissionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapPermissionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -178,7 +178,7 @@ public static SyncMapPermissionResource Fetch( /// Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathMapSid, string pathIdentity, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathMapSid, string pathIdentity, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSyncMapPermissionOptions(pathServiceSid, pathMapSid, pathIdentity){ }; return await FetchAsync(options, client, cancellationToken); @@ -220,7 +220,7 @@ public static ResourceSet Read(ReadSyncMapPermissionO /// Read SyncMapPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapPermissionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapPermissionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -260,7 +260,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapPermissionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -403,7 +403,7 @@ public static async System.Threading.Tasks.Task Updat bool? read, bool? write, bool? manage, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSyncMapPermissionOptions(pathServiceSid, pathMapSid, pathIdentity, read, write, manage){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncMapResource.cs b/src/Twilio/Rest/Preview/Sync/Service/SyncMapResource.cs index 69982ee60..9f5cd7aab 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncMapResource.cs +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncMapResource.cs @@ -68,7 +68,7 @@ public static SyncMapResource Create(CreateSyncMapOptions options, ITwilioRestCl /// Create SyncMap parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static SyncMapResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathServiceSid, string uniqueName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSyncMapOptions(pathServiceSid){ UniqueName = uniqueName }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteSyncMapOptions options, ITwilioRestClient client /// Task that resolves to A single instance of SyncMap public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSyncMapOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static SyncMapResource Fetch(FetchSyncMapOptions options, ITwilioRestClie /// Fetch SyncMap parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static SyncMapResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSyncMapOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadSyncMapOptions options, ITwi /// Read SyncMap parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task> Re string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSyncMapOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Sync/ServiceResource.cs b/src/Twilio/Rest/Preview/Sync/ServiceResource.cs index cf4a8bc17..1f236f726 100644 --- a/src/Twilio/Rest/Preview/Sync/ServiceResource.cs +++ b/src/Twilio/Rest/Preview/Sync/ServiceResource.cs @@ -66,7 +66,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task CreateAsync( Uri webhookUrl = null, bool? reachabilityWebhooksEnabled = null, bool? aclEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateServiceOptions(){ FriendlyName = friendlyName, WebhookUrl = webhookUrl, ReachabilityWebhooksEnabled = reachabilityWebhooksEnabled, AclEnabled = aclEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static bool Delete(DeleteServiceOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -174,7 +174,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// /// 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteServiceOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -238,7 +238,7 @@ public static ServiceResource 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchServiceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -276,7 +276,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -308,7 +308,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadServiceOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -400,7 +400,7 @@ public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -443,7 +443,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string friendlyName = null, bool? reachabilityWebhooksEnabled = null, bool? aclEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateServiceOptions(pathSid){ WebhookUrl = webhookUrl, FriendlyName = friendlyName, ReachabilityWebhooksEnabled = reachabilityWebhooksEnabled, AclEnabled = aclEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Wireless/CommandResource.cs b/src/Twilio/Rest/Preview/Wireless/CommandResource.cs index 7c9e8637b..50564c41f 100644 --- a/src/Twilio/Rest/Preview/Wireless/CommandResource.cs +++ b/src/Twilio/Rest/Preview/Wireless/CommandResource.cs @@ -66,7 +66,7 @@ public static CommandResource Create(CreateCommandOptions options, ITwilioRestCl /// Create Command parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task CreateAsync(CreateCommandOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCommandOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -117,7 +117,7 @@ public static async System.Threading.Tasks.Task CreateAsync( Uri callbackUrl = null, string commandMode = null, string includeSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCommandOptions(command){ Device = device, Sim = sim, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, CommandMode = commandMode, IncludeSid = includeSid }; return await CreateAsync(options, client, cancellationToken); @@ -157,7 +157,7 @@ public static CommandResource Fetch(FetchCommandOptions options, ITwilioRestClie /// Fetch Command parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task FetchAsync(FetchCommandOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCommandOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -181,7 +181,7 @@ public static CommandResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCommandOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -219,7 +219,7 @@ public static ResourceSet Read(ReadCommandOptions options, ITwi /// Read Command parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task> ReadAsync(ReadCommandOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCommandOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -267,7 +267,7 @@ public static async System.Threading.Tasks.Task> Re string direction = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCommandOptions(){ Device = device, Sim = sim, Status = status, Direction = direction, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Wireless/RatePlanResource.cs b/src/Twilio/Rest/Preview/Wireless/RatePlanResource.cs index 6bc70b811..7b2dd5fdf 100644 --- a/src/Twilio/Rest/Preview/Wireless/RatePlanResource.cs +++ b/src/Twilio/Rest/Preview/Wireless/RatePlanResource.cs @@ -66,7 +66,7 @@ public static RatePlanResource Create(CreateRatePlanOptions options, ITwilioRest /// Create RatePlan parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task CreateAsync(CreateRatePlanOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateRatePlanOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -129,7 +129,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? commandsEnabled = null, bool? nationalRoamingEnabled = null, List internationalRoaming = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateRatePlanOptions(){ UniqueName = uniqueName, FriendlyName = friendlyName, DataEnabled = dataEnabled, DataLimit = dataLimit, DataMetering = dataMetering, MessagingEnabled = messagingEnabled, VoiceEnabled = voiceEnabled, CommandsEnabled = commandsEnabled, NationalRoamingEnabled = nationalRoamingEnabled, InternationalRoaming = internationalRoaming }; return await CreateAsync(options, client, cancellationToken); @@ -175,7 +175,7 @@ public static bool Delete(DeleteRatePlanOptions options, ITwilioRestClient clien /// Task that resolves to A single instance of RatePlan public static async System.Threading.Tasks.Task DeleteAsync(DeleteRatePlanOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -198,7 +198,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRatePlanOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -238,7 +238,7 @@ public static RatePlanResource Fetch(FetchRatePlanOptions options, ITwilioRestCl /// Fetch RatePlan parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task FetchAsync(FetchRatePlanOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRatePlanOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -262,7 +262,7 @@ public static RatePlanResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRatePlanOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -300,7 +300,7 @@ public static ResourceSet Read(ReadRatePlanOptions options, IT /// Read RatePlan parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task> ReadAsync(ReadRatePlanOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRatePlanOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -332,7 +332,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRatePlanOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -424,7 +424,7 @@ public static RatePlanResource Update(UpdateRatePlanOptions options, ITwilioRest #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRatePlanOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -459,7 +459,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string uniqueName = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRatePlanOptions(pathSid){ UniqueName = uniqueName, FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Wireless/Sim/UsageResource.cs b/src/Twilio/Rest/Preview/Wireless/Sim/UsageResource.cs index c0a9daf55..82ffa372b 100644 --- a/src/Twilio/Rest/Preview/Wireless/Sim/UsageResource.cs +++ b/src/Twilio/Rest/Preview/Wireless/Sim/UsageResource.cs @@ -67,7 +67,7 @@ public static UsageResource Fetch(FetchUsageOptions options, ITwilioRestClient c /// Fetch Usage parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Usage - public static async System.Threading.Tasks.Task FetchAsync(FetchUsageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUsageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -97,7 +97,7 @@ public static UsageResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Usage - public static async System.Threading.Tasks.Task FetchAsync(string pathSimSid, string end = null, string start = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSimSid, string end = null, string start = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUsageOptions(pathSimSid){ End = end,Start = start }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Preview/Wireless/SimResource.cs b/src/Twilio/Rest/Preview/Wireless/SimResource.cs index ff123c4ec..7444ca132 100644 --- a/src/Twilio/Rest/Preview/Wireless/SimResource.cs +++ b/src/Twilio/Rest/Preview/Wireless/SimResource.cs @@ -67,7 +67,7 @@ public static SimResource Fetch(FetchSimOptions options, ITwilioRestClient clien /// Fetch Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task FetchAsync(FetchSimOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSimOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static SimResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSimOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadSimOptions options, ITwilioRestC /// Read Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task> ReadAsync(ReadSimOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSimOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -181,7 +181,7 @@ public static async System.Threading.Tasks.Task> ReadAs string simRegistrationCode = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSimOptions(){ Status = status, Iccid = iccid, RatePlan = ratePlan, EId = eId, SimRegistrationCode = simRegistrationCode, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -273,7 +273,7 @@ public static SimResource Update(UpdateSimOptions options, ITwilioRestClient cli #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSimOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -364,7 +364,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( Uri voiceFallbackUrl = null, Twilio.Http.HttpMethod voiceMethod = null, Uri voiceUrl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSimOptions(pathSid){ UniqueName = uniqueName, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, FriendlyName = friendlyName, RatePlan = ratePlan, Status = status, CommandsCallbackMethod = commandsCallbackMethod, CommandsCallbackUrl = commandsCallbackUrl, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/PreviewIam/Organizations/AccountResource.cs b/src/Twilio/Rest/PreviewIam/Organizations/AccountResource.cs index 22687cb7b..ffeed230a 100644 --- a/src/Twilio/Rest/PreviewIam/Organizations/AccountResource.cs +++ b/src/Twilio/Rest/PreviewIam/Organizations/AccountResource.cs @@ -84,7 +84,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAccountOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -111,7 +111,7 @@ public static AccountResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of Account - public static async System.Threading.Tasks.Task FetchAsync(string pathOrganizationSid, string pathAccountSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathOrganizationSid, string pathAccountSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAccountOptions(pathOrganizationSid, pathAccountSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAccountOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -187,7 +187,7 @@ public static async System.Threading.Tasks.Task> Re string pathOrganizationSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAccountOptions(pathOrganizationSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/PreviewIam/Organizations/RoleAssignmentResource.cs b/src/Twilio/Rest/PreviewIam/Organizations/RoleAssignmentResource.cs index 0d38bf639..bad3f06f7 100644 --- a/src/Twilio/Rest/PreviewIam/Organizations/RoleAssignmentResource.cs +++ b/src/Twilio/Rest/PreviewIam/Organizations/RoleAssignmentResource.cs @@ -105,7 +105,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateRoleAssignmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -136,7 +136,7 @@ public static RoleAssignmentResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathOrganizationSid, RoleAssignmentResource.PublicApiCreateRoleAssignmentRequest publicApiCreateRoleAssignmentRequest, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateRoleAssignmentOptions(pathOrganizationSid, publicApiCreateRoleAssignmentRequest){ }; return await CreateAsync(options, client, cancellationToken); @@ -184,7 +184,7 @@ public static bool Delete(DeleteRoleAssignmentOptions options, ITwilioRestClient /// Task that resolves to A single instance of RoleAssignment public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoleAssignmentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -209,7 +209,7 @@ public static bool Delete(string pathOrganizationSid, string pathRoleAssignmentS /// /// Client to make requests to Twilio /// Task that resolves to A single instance of RoleAssignment - public static async System.Threading.Tasks.Task DeleteAsync(string pathOrganizationSid, string pathRoleAssignmentSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathOrganizationSid, string pathRoleAssignmentSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRoleAssignmentOptions(pathOrganizationSid, pathRoleAssignmentSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -249,7 +249,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoleAssignmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -293,7 +293,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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -300,7 +300,7 @@ public static UserResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathOrganizationSid, UserResource.ScimUser scimUser, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateUserOptions(pathOrganizationSid, scimUser){ }; return await CreateAsync(options, client, cancellationToken); @@ -348,7 +348,7 @@ public static bool Delete(DeleteUserOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of User public static async System.Threading.Tasks.Task DeleteAsync(DeleteUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -373,7 +373,7 @@ public static bool Delete(string pathOrganizationSid, string pathUserSid, ITwili /// /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task DeleteAsync(string pathOrganizationSid, string pathUserSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathOrganizationSid, string pathUserSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteUserOptions(pathOrganizationSid, pathUserSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -415,7 +415,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -442,7 +442,7 @@ public static UserResource Fetch( /// /// Client to make requests to Twilio /// Task that resolves to A single instance of User - public static async System.Threading.Tasks.Task FetchAsync(string pathOrganizationSid, string pathUserSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathOrganizationSid, string pathUserSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchUserOptions(pathOrganizationSid, pathUserSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -482,7 +482,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -518,7 +518,7 @@ public static async System.Threading.Tasks.Task> ReadA string pathOrganizationSid, string filter = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUserOptions(pathOrganizationSid){ Filter = filter, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -613,7 +613,7 @@ public static UserResource Update(UpdateUserOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -652,7 +652,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathUserSid, UserResource.ScimUser scimUser, string ifMatch = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateUserOptions(pathOrganizationSid, pathUserSid, scimUser){ IfMatch = ifMatch }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/PreviewIam/V1/AuthorizeResource.cs b/src/Twilio/Rest/PreviewIam/V1/AuthorizeResource.cs index ccf0ebb55..8a5c7290a 100644 --- a/src/Twilio/Rest/PreviewIam/V1/AuthorizeResource.cs +++ b/src/Twilio/Rest/PreviewIam/V1/AuthorizeResource.cs @@ -65,7 +65,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAuthorizeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetNoAuthRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static AuthorizeResource Fetch( /// An opaque value which can be used to maintain state between the request and callback /// Client to make requests to Twilio /// Task that resolves to A single instance of Authorize - 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) + 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 , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAuthorizeOptions(){ ResponseType = responseType,ClientId = clientId,RedirectUri = redirectUri,Scope = scope,State = state }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/PreviewIam/V1/TokenResource.cs b/src/Twilio/Rest/PreviewIam/V1/TokenResource.cs index 93c731eb0..723666e66 100644 --- a/src/Twilio/Rest/PreviewIam/V1/TokenResource.cs +++ b/src/Twilio/Rest/PreviewIam/V1/TokenResource.cs @@ -66,7 +66,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTokenOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetNoAuthRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -121,7 +121,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string audience = null, string refreshToken = null, string scope = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTokenOptions(grantType, clientId){ ClientSecret = clientSecret, Code = code, RedirectUri = redirectUri, Audience = audience, RefreshToken = refreshToken, Scope = scope }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Pricing/V1/Messaging/CountryResource.cs b/src/Twilio/Rest/Pricing/V1/Messaging/CountryResource.cs index f4f92b8b0..c7a255c61 100644 --- a/src/Twilio/Rest/Pricing/V1/Messaging/CountryResource.cs +++ b/src/Twilio/Rest/Pricing/V1/Messaging/CountryResource.cs @@ -67,7 +67,7 @@ public static CountryResource Fetch(FetchCountryOptions options, ITwilioRestClie /// Fetch Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static CountryResource Fetch( /// The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCountryOptions(pathIsoCountry){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadCountryOptions options, ITwi /// Read Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCountryOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryResource.cs b/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryResource.cs index 2c03dd43f..36d38837a 100644 --- a/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryResource.cs +++ b/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryResource.cs @@ -67,7 +67,7 @@ public static CountryResource Fetch(FetchCountryOptions options, ITwilioRestClie /// Fetch Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static CountryResource Fetch( /// The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCountryOptions(pathIsoCountry){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadCountryOptions options, ITwi /// Read Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCountryOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Pricing/V1/Voice/CountryResource.cs b/src/Twilio/Rest/Pricing/V1/Voice/CountryResource.cs index c8832e3bf..31642db5d 100644 --- a/src/Twilio/Rest/Pricing/V1/Voice/CountryResource.cs +++ b/src/Twilio/Rest/Pricing/V1/Voice/CountryResource.cs @@ -67,7 +67,7 @@ public static CountryResource Fetch(FetchCountryOptions options, ITwilioRestClie /// Fetch Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static CountryResource Fetch( /// The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCountryOptions(pathIsoCountry){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadCountryOptions options, ITwi /// Read Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCountryOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Pricing/V1/Voice/NumberResource.cs b/src/Twilio/Rest/Pricing/V1/Voice/NumberResource.cs index 2712192e7..c7d867fae 100644 --- a/src/Twilio/Rest/Pricing/V1/Voice/NumberResource.cs +++ b/src/Twilio/Rest/Pricing/V1/Voice/NumberResource.cs @@ -67,7 +67,7 @@ public static NumberResource Fetch(FetchNumberOptions options, ITwilioRestClient /// Fetch Number parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Number - public static async System.Threading.Tasks.Task FetchAsync(FetchNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static NumberResource Fetch( /// The phone number to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Number - public static async System.Threading.Tasks.Task FetchAsync(Types.PhoneNumber pathNumber, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(Types.PhoneNumber pathNumber, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchNumberOptions(pathNumber){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Pricing/V2/CountryResource.cs b/src/Twilio/Rest/Pricing/V2/CountryResource.cs index 7ccc9a7fb..e269d1a81 100644 --- a/src/Twilio/Rest/Pricing/V2/CountryResource.cs +++ b/src/Twilio/Rest/Pricing/V2/CountryResource.cs @@ -67,7 +67,7 @@ public static CountryResource Fetch(FetchCountryOptions options, ITwilioRestClie /// Fetch Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static CountryResource Fetch( /// The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCountryOptions(pathIsoCountry){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadCountryOptions options, ITwi /// Read Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCountryOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Pricing/V2/NumberResource.cs b/src/Twilio/Rest/Pricing/V2/NumberResource.cs index 1bb3a1f44..128a6ede6 100644 --- a/src/Twilio/Rest/Pricing/V2/NumberResource.cs +++ b/src/Twilio/Rest/Pricing/V2/NumberResource.cs @@ -67,7 +67,7 @@ public static NumberResource Fetch(FetchNumberOptions options, ITwilioRestClient /// Fetch Number parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Number - public static async System.Threading.Tasks.Task FetchAsync(FetchNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -94,7 +94,7 @@ public static NumberResource Fetch( /// The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. /// Client to make requests to Twilio /// Task that resolves to A single instance of Number - public static async System.Threading.Tasks.Task FetchAsync(Types.PhoneNumber pathDestinationNumber, Types.PhoneNumber originationNumber = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(Types.PhoneNumber pathDestinationNumber, Types.PhoneNumber originationNumber = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchNumberOptions(pathDestinationNumber){ OriginationNumber = originationNumber }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Pricing/V2/Voice/CountryResource.cs b/src/Twilio/Rest/Pricing/V2/Voice/CountryResource.cs index 0feb5d995..4d4822dd7 100644 --- a/src/Twilio/Rest/Pricing/V2/Voice/CountryResource.cs +++ b/src/Twilio/Rest/Pricing/V2/Voice/CountryResource.cs @@ -67,7 +67,7 @@ public static CountryResource Fetch(FetchCountryOptions options, ITwilioRestClie /// Fetch Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static CountryResource Fetch( /// The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCountry, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCountryOptions(pathIsoCountry){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadCountryOptions options, ITwi /// Read Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCountryOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Pricing/V2/Voice/NumberResource.cs b/src/Twilio/Rest/Pricing/V2/Voice/NumberResource.cs index b589efa0d..2180dc4ef 100644 --- a/src/Twilio/Rest/Pricing/V2/Voice/NumberResource.cs +++ b/src/Twilio/Rest/Pricing/V2/Voice/NumberResource.cs @@ -67,7 +67,7 @@ public static NumberResource Fetch(FetchNumberOptions options, ITwilioRestClient /// Fetch Number parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Number - public static async System.Threading.Tasks.Task FetchAsync(FetchNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -94,7 +94,7 @@ public static NumberResource Fetch( /// The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. /// Client to make requests to Twilio /// Task that resolves to A single instance of Number - public static async System.Threading.Tasks.Task FetchAsync(Types.PhoneNumber pathDestinationNumber, Types.PhoneNumber originationNumber = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(Types.PhoneNumber pathDestinationNumber, Types.PhoneNumber originationNumber = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchNumberOptions(pathDestinationNumber){ OriginationNumber = originationNumber }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberResource.cs b/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberResource.cs index c71e5e934..6ea8de46b 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberResource.cs +++ b/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberResource.cs @@ -68,7 +68,7 @@ public static PhoneNumberResource Create(CreatePhoneNumberOptions options, ITwil /// Create PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task CreateAsync(CreatePhoneNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreatePhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -107,7 +107,7 @@ public static async System.Threading.Tasks.Task CreateAsync string sid = null, Types.PhoneNumber phoneNumber = null, bool? isReserved = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreatePhoneNumberOptions(pathServiceSid){ Sid = sid, PhoneNumber = phoneNumber, IsReserved = isReserved }; return await CreateAsync(options, client, cancellationToken); @@ -155,7 +155,7 @@ public static bool Delete(DeletePhoneNumberOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of PhoneNumber public static async System.Threading.Tasks.Task DeleteAsync(DeletePhoneNumberOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -180,7 +180,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The Twilio-provided string that uniquely identifies the PhoneNumber resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeletePhoneNumberOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -222,7 +222,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -249,7 +249,7 @@ public static PhoneNumberResource Fetch( /// The Twilio-provided string that uniquely identifies the PhoneNumber resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPhoneNumberOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -289,7 +289,7 @@ public static ResourceSet Read(ReadPhoneNumberOptions optio /// Read PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task> ReadAsync(ReadPhoneNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -325,7 +325,7 @@ public static async System.Threading.Tasks.Task string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadPhoneNumberOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -419,7 +419,7 @@ public static PhoneNumberResource Update(UpdatePhoneNumberOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdatePhoneNumberOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -454,7 +454,7 @@ public static async System.Threading.Tasks.Task UpdateAsync string pathServiceSid, string pathSid, bool? isReserved = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdatePhoneNumberOptions(pathServiceSid, pathSid){ IsReserved = isReserved }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionResource.cs b/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionResource.cs index ea84d40b6..ff4d46d8f 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionResource.cs +++ b/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionResource.cs @@ -123,7 +123,7 @@ public static bool Delete(DeleteInteractionOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of Interaction public static async System.Threading.Tasks.Task DeleteAsync(DeleteInteractionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -150,7 +150,7 @@ public static bool Delete(string pathServiceSid, string pathSessionSid, string p /// The Twilio-provided string that uniquely identifies the Interaction resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Interaction - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSessionSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSessionSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteInteractionOptions(pathServiceSid, pathSessionSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -194,7 +194,7 @@ public static InteractionResource Fetch(FetchInteractionOptions options, ITwilio /// Fetch Interaction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Interaction - public static async System.Threading.Tasks.Task FetchAsync(FetchInteractionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchInteractionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -224,7 +224,7 @@ public static InteractionResource Fetch( /// The Twilio-provided string that uniquely identifies the Interaction resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Interaction - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSessionSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSessionSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchInteractionOptions(pathServiceSid, pathSessionSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -266,7 +266,7 @@ public static ResourceSet Read(ReadInteractionOptions optio /// Read Interaction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Interaction - public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadInteractionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -306,7 +306,7 @@ public static async System.Threading.Tasks.Task string pathSessionSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadInteractionOptions(pathServiceSid, pathSessionSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionResource.cs b/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionResource.cs index 28693ed3f..87e2ddfd2 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionResource.cs +++ b/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionResource.cs @@ -118,7 +118,7 @@ public static MessageInteractionResource Create(CreateMessageInteractionOptions /// Create MessageInteraction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MessageInteraction - public static async System.Threading.Tasks.Task CreateAsync(CreateMessageInteractionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessageInteractionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static async System.Threading.Tasks.Task Crea string pathParticipantSid, string body = null, List mediaUrl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMessageInteractionOptions(pathServiceSid, pathSessionSid, pathParticipantSid){ Body = body, MediaUrl = mediaUrl }; return await CreateAsync(options, client, cancellationToken); @@ -207,7 +207,7 @@ public static MessageInteractionResource Fetch(FetchMessageInteractionOptions op /// Fetch MessageInteraction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MessageInteraction - public static async System.Threading.Tasks.Task FetchAsync(FetchMessageInteractionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessageInteractionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -240,7 +240,7 @@ public static MessageInteractionResource Fetch( /// The Twilio-provided string that uniquely identifies the MessageInteraction resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of MessageInteraction - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSessionSid, string pathParticipantSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSessionSid, string pathParticipantSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMessageInteractionOptions(pathServiceSid, pathSessionSid, pathParticipantSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -284,7 +284,7 @@ public static ResourceSet Read(ReadMessageInteractio /// Read MessageInteraction parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MessageInteraction - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageInteractionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessageInteractionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -328,7 +328,7 @@ public static async System.Threading.Tasks.Task Create Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -117,7 +117,7 @@ public static async System.Threading.Tasks.Task CreateAsync string friendlyName = null, string proxyIdentifier = null, string proxyIdentifierSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateParticipantOptions(pathServiceSid, pathSessionSid, identifier){ FriendlyName = friendlyName, ProxyIdentifier = proxyIdentifier, ProxyIdentifierSid = proxyIdentifierSid }; return await CreateAsync(options, client, cancellationToken); @@ -167,7 +167,7 @@ public static bool Delete(DeleteParticipantOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of Participant public static async System.Threading.Tasks.Task DeleteAsync(DeleteParticipantOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -194,7 +194,7 @@ public static bool Delete(string pathServiceSid, string pathSessionSid, string p /// The Twilio-provided string that uniquely identifies the Participant resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSessionSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSessionSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteParticipantOptions(pathServiceSid, pathSessionSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -238,7 +238,7 @@ public static ParticipantResource Fetch(FetchParticipantOptions options, ITwilio /// Fetch Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -268,7 +268,7 @@ public static ParticipantResource Fetch( /// The Twilio-provided string that uniquely identifies the Participant resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSessionSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSessionSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchParticipantOptions(pathServiceSid, pathSessionSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -310,7 +310,7 @@ public static ResourceSet Read(ReadParticipantOptions optio /// Read Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -350,7 +350,7 @@ public static async System.Threading.Tasks.Task string pathSessionSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadParticipantOptions(pathServiceSid, pathSessionSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Proxy/V1/Service/SessionResource.cs b/src/Twilio/Rest/Proxy/V1/Service/SessionResource.cs index 49ab308e1..976a11c67 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/SessionResource.cs +++ b/src/Twilio/Rest/Proxy/V1/Service/SessionResource.cs @@ -98,7 +98,7 @@ public static SessionResource Create(CreateSessionOptions options, ITwilioRestCl /// Create Session parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task CreateAsync(CreateSessionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSessionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -149,7 +149,7 @@ public static async System.Threading.Tasks.Task CreateAsync( SessionResource.ModeEnum mode = null, SessionResource.StatusEnum status = null, List participants = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSessionOptions(pathServiceSid){ UniqueName = uniqueName, DateExpiry = dateExpiry, Ttl = ttl, Mode = mode, Status = status, Participants = participants }; return await CreateAsync(options, client, cancellationToken); @@ -197,7 +197,7 @@ public static bool Delete(DeleteSessionOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Session public static async System.Threading.Tasks.Task DeleteAsync(DeleteSessionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -222,7 +222,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The Twilio-provided string that uniquely identifies the Session resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSessionOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -264,7 +264,7 @@ public static SessionResource Fetch(FetchSessionOptions options, ITwilioRestClie /// Fetch Session parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task FetchAsync(FetchSessionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSessionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -291,7 +291,7 @@ public static SessionResource Fetch( /// The Twilio-provided string that uniquely identifies the Session resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSessionOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -331,7 +331,7 @@ public static ResourceSet Read(ReadSessionOptions options, ITwi /// Read Session parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Session - public static async System.Threading.Tasks.Task> ReadAsync(ReadSessionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSessionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -367,7 +367,7 @@ public static async System.Threading.Tasks.Task> Re string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSessionOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -461,7 +461,7 @@ public static SessionResource Update(UpdateSessionOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSessionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -504,7 +504,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( DateTime? dateExpiry = null, int? ttl = null, SessionResource.StatusEnum status = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSessionOptions(pathServiceSid, pathSid){ DateExpiry = dateExpiry, Ttl = ttl, Status = status }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Proxy/V1/Service/ShortCodeResource.cs b/src/Twilio/Rest/Proxy/V1/Service/ShortCodeResource.cs index 171766e54..a02b09f6a 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/ShortCodeResource.cs +++ b/src/Twilio/Rest/Proxy/V1/Service/ShortCodeResource.cs @@ -68,7 +68,7 @@ public static ShortCodeResource Create(CreateShortCodeOptions options, ITwilioRe /// Create ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task CreateAsync(CreateShortCodeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateShortCodeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static ShortCodeResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathServiceSid, string sid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateShortCodeOptions(pathServiceSid, sid){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteShortCodeOptions options, ITwilioRestClient clie /// Task that resolves to A single instance of ShortCode public static async System.Threading.Tasks.Task DeleteAsync(DeleteShortCodeOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The Twilio-provided string that uniquely identifies the ShortCode resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteShortCodeOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static ShortCodeResource Fetch(FetchShortCodeOptions options, ITwilioRest /// Fetch ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task FetchAsync(FetchShortCodeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchShortCodeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static ShortCodeResource Fetch( /// The Twilio-provided string that uniquely identifies the ShortCode resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchShortCodeOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadShortCodeOptions options, /// Read ShortCode parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode - public static async System.Threading.Tasks.Task> ReadAsync(ReadShortCodeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadShortCodeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task> string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadShortCodeOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -411,7 +411,7 @@ public static ShortCodeResource Update(UpdateShortCodeOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateShortCodeOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -446,7 +446,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathServiceSid, string pathSid, bool? isReserved = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateShortCodeOptions(pathServiceSid, pathSid){ IsReserved = isReserved }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Proxy/V1/ServiceResource.cs b/src/Twilio/Rest/Proxy/V1/ServiceResource.cs index 3daf430fb..8af0f157f 100644 --- a/src/Twilio/Rest/Proxy/V1/ServiceResource.cs +++ b/src/Twilio/Rest/Proxy/V1/ServiceResource.cs @@ -94,7 +94,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -149,7 +149,7 @@ public static async System.Threading.Tasks.Task CreateAsync( Uri interceptCallbackUrl = null, Uri outOfSessionCallbackUrl = null, string chatInstanceSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateServiceOptions(uniqueName){ DefaultTtl = defaultTtl, CallbackUrl = callbackUrl, GeoMatchLevel = geoMatchLevel, NumberSelectionBehavior = numberSelectionBehavior, InterceptCallbackUrl = interceptCallbackUrl, OutOfSessionCallbackUrl = outOfSessionCallbackUrl, ChatInstanceSid = chatInstanceSid }; return await CreateAsync(options, client, cancellationToken); @@ -195,7 +195,7 @@ public static bool Delete(DeleteServiceOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -218,7 +218,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteServiceOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -258,7 +258,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -282,7 +282,7 @@ public static ServiceResource Fetch( /// The Twilio-provided string that uniquely identifies 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchServiceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -320,7 +320,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -352,7 +352,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadServiceOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -444,7 +444,7 @@ public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -503,7 +503,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( Uri interceptCallbackUrl = null, Uri outOfSessionCallbackUrl = null, string chatInstanceSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateServiceOptions(pathSid){ UniqueName = uniqueName, DefaultTtl = defaultTtl, CallbackUrl = callbackUrl, GeoMatchLevel = geoMatchLevel, NumberSelectionBehavior = numberSelectionBehavior, InterceptCallbackUrl = interceptCallbackUrl, OutOfSessionCallbackUrl = outOfSessionCallbackUrl, ChatInstanceSid = chatInstanceSid }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Routes/V2/PhoneNumberResource.cs b/src/Twilio/Rest/Routes/V2/PhoneNumberResource.cs index 35321bfd0..fd7485c0e 100644 --- a/src/Twilio/Rest/Routes/V2/PhoneNumberResource.cs +++ b/src/Twilio/Rest/Routes/V2/PhoneNumberResource.cs @@ -67,7 +67,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathPhoneNumber, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPhoneNumberOptions(pathPhoneNumber){ }; return await FetchAsync(options, client, cancellationToken); @@ -134,7 +134,7 @@ public static PhoneNumberResource Update(UpdatePhoneNumberOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdatePhoneNumberOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -169,7 +169,7 @@ public static async System.Threading.Tasks.Task UpdateAsync string pathPhoneNumber, string voiceRegion = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdatePhoneNumberOptions(pathPhoneNumber){ VoiceRegion = voiceRegion, FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Routes/V2/SipDomainResource.cs b/src/Twilio/Rest/Routes/V2/SipDomainResource.cs index ebc6679ca..6b761f2c1 100644 --- a/src/Twilio/Rest/Routes/V2/SipDomainResource.cs +++ b/src/Twilio/Rest/Routes/V2/SipDomainResource.cs @@ -67,7 +67,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSipDomainOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSipDomain, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSipDomainOptions(pathSipDomain){ }; return await FetchAsync(options, client, cancellationToken); @@ -134,7 +134,7 @@ public static SipDomainResource Update(UpdateSipDomainOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSipDomainOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -169,7 +169,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSipDomain, string voiceRegion = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSipDomainOptions(pathSipDomain){ VoiceRegion = voiceRegion, FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Routes/V2/TrunkResource.cs b/src/Twilio/Rest/Routes/V2/TrunkResource.cs index b98c313a7..6e575ee55 100644 --- a/src/Twilio/Rest/Routes/V2/TrunkResource.cs +++ b/src/Twilio/Rest/Routes/V2/TrunkResource.cs @@ -67,7 +67,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTrunkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSipTrunkDomain, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTrunkOptions(pathSipTrunkDomain){ }; return await FetchAsync(options, client, cancellationToken); @@ -134,7 +134,7 @@ public static TrunkResource Update(UpdateTrunkOptions options, ITwilioRestClient #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateTrunkOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -169,7 +169,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSipTrunkDomain, string voiceRegion = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateTrunkOptions(pathSipTrunkDomain){ VoiceRegion = voiceRegion, FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionResource.cs b/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionResource.cs index 5db21920e..5dcc0b6d7 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionResource.cs +++ b/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionResource.cs @@ -85,7 +85,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAssetVersionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -115,7 +115,7 @@ public static AssetVersionResource Fetch( /// The SID of the Asset Version resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of AssetVersion - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathAssetSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathAssetSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAssetVersionOptions(pathServiceSid, pathAssetSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -157,7 +157,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAssetVersionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -197,7 +197,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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAssetOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static AssetResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathServiceSid, string friendlyName, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAssetOptions(pathServiceSid, friendlyName){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteAssetOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Asset public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssetOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The SID that identifies the Asset resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Asset - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteAssetOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAssetOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static AssetResource Fetch( /// The SID that identifies the Asset resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Asset - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAssetOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadAssetOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task> Read string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadAssetOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -411,7 +411,7 @@ public static AssetResource Update(UpdateAssetOptions options, ITwilioRestClient #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateAssetOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -446,7 +446,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathServiceSid, string pathSid, string friendlyName, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateAssetOptions(pathServiceSid, pathSid, friendlyName){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusResource.cs b/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusResource.cs index 56b56794c..601a2ed08 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusResource.cs +++ b/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusResource.cs @@ -83,7 +83,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchBuildStatusOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -110,7 +110,7 @@ public static BuildStatusResource Fetch( /// The SID of the Build resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of BuildStatus - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchBuildStatusOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Serverless/V1/Service/BuildResource.cs b/src/Twilio/Rest/Serverless/V1/Service/BuildResource.cs index 16b4c680d..8d6c6ca51 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/BuildResource.cs +++ b/src/Twilio/Rest/Serverless/V1/Service/BuildResource.cs @@ -99,7 +99,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateBuildOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -142,7 +142,7 @@ public static async System.Threading.Tasks.Task CreateAsync( List functionVersions = null, string dependencies = null, string runtime = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateBuildOptions(pathServiceSid){ AssetVersions = assetVersions, FunctionVersions = functionVersions, Dependencies = dependencies, Runtime = runtime }; return await CreateAsync(options, client, cancellationToken); @@ -190,7 +190,7 @@ public static bool Delete(DeleteBuildOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Build public static async System.Threading.Tasks.Task DeleteAsync(DeleteBuildOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -215,7 +215,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The SID of the Build resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Build - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteBuildOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -257,7 +257,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchBuildOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -284,7 +284,7 @@ public static BuildResource Fetch( /// The SID of the Build resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Build - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchBuildOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -324,7 +324,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBuildOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -360,7 +360,7 @@ public static async System.Threading.Tasks.Task> Read string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadBuildOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentResource.cs b/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentResource.cs index 44b74c337..57ce3c354 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentResource.cs +++ b/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentResource.cs @@ -70,7 +70,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateDeploymentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string pathEnvironmentSid, string buildSid = null, bool? isPlugin = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateDeploymentOptions(pathServiceSid, pathEnvironmentSid){ BuildSid = buildSid, IsPlugin = isPlugin }; return await CreateAsync(options, client, cancellationToken); @@ -153,7 +153,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDeploymentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -183,7 +183,7 @@ public static DeploymentResource Fetch( /// The SID that identifies the Deployment resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Deployment - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathEnvironmentSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathEnvironmentSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDeploymentOptions(pathServiceSid, pathEnvironmentSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -225,7 +225,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDeploymentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -265,7 +265,7 @@ public static async System.Threading.Tasks.Task> string pathEnvironmentSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadDeploymentOptions(pathServiceSid, pathEnvironmentSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Serverless/V1/Service/Environment/LogResource.cs b/src/Twilio/Rest/Serverless/V1/Service/Environment/LogResource.cs index d46bf77f6..0856b4dec 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/Environment/LogResource.cs +++ b/src/Twilio/Rest/Serverless/V1/Service/Environment/LogResource.cs @@ -85,7 +85,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchLogOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -115,7 +115,7 @@ public static LogResource Fetch( /// The SID of the Log resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Log - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathEnvironmentSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathEnvironmentSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchLogOptions(pathServiceSid, pathEnvironmentSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -157,7 +157,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadLogOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -209,7 +209,7 @@ public static async System.Threading.Tasks.Task> ReadAs DateTime? endDate = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadLogOptions(pathServiceSid, pathEnvironmentSid){ FunctionSid = functionSid, StartDate = startDate, EndDate = endDate, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableResource.cs b/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableResource.cs index a82811113..5bf4a4add 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableResource.cs +++ b/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableResource.cs @@ -70,7 +70,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateVariableOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string pathEnvironmentSid, string key, string value, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateVariableOptions(pathServiceSid, pathEnvironmentSid, key, value){ }; return await CreateAsync(options, client, cancellationToken); @@ -159,7 +159,7 @@ public static bool Delete(DeleteVariableOptions options, ITwilioRestClient clien /// Task that resolves to A single instance of Variable public static async System.Threading.Tasks.Task DeleteAsync(DeleteVariableOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -186,7 +186,7 @@ public static bool Delete(string pathServiceSid, string pathEnvironmentSid, stri /// The SID of the Variable resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Variable - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathEnvironmentSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathEnvironmentSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteVariableOptions(pathServiceSid, pathEnvironmentSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchVariableOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -260,7 +260,7 @@ public static VariableResource Fetch( /// The SID of the Variable resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Variable - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathEnvironmentSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathEnvironmentSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchVariableOptions(pathServiceSid, pathEnvironmentSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadVariableOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -342,7 +342,7 @@ public static async System.Threading.Tasks.Task> R string pathEnvironmentSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadVariableOptions(pathServiceSid, pathEnvironmentSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -438,7 +438,7 @@ public static VariableResource Update(UpdateVariableOptions options, ITwilioRest #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateVariableOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -481,7 +481,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string key = null, string value = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateVariableOptions(pathServiceSid, pathEnvironmentSid, pathSid){ Key = key, Value = value }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Serverless/V1/Service/EnvironmentResource.cs b/src/Twilio/Rest/Serverless/V1/Service/EnvironmentResource.cs index cae84b6a2..0c2f960b4 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/EnvironmentResource.cs +++ b/src/Twilio/Rest/Serverless/V1/Service/EnvironmentResource.cs @@ -68,7 +68,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateEnvironmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task CreateAsync string pathServiceSid, string uniqueName, string domainSuffix = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateEnvironmentOptions(pathServiceSid, uniqueName){ DomainSuffix = domainSuffix }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static bool Delete(DeleteEnvironmentOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of Environment public static async System.Threading.Tasks.Task DeleteAsync(DeleteEnvironmentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -176,7 +176,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The SID of the Environment resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Environment - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteEnvironmentOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -218,7 +218,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchEnvironmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static EnvironmentResource Fetch( /// The SID of the Environment resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Environment - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchEnvironmentOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEnvironmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static async System.Threading.Tasks.Task string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadEnvironmentOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); 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 0b984d25e..fa05baca2 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/Function/FunctionVersion/FunctionVersionContentResource.cs +++ b/src/Twilio/Rest/Serverless/V1/Service/Function/FunctionVersion/FunctionVersionContentResource.cs @@ -71,7 +71,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchFunctionVersionContentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static FunctionVersionContentResource Fetch( /// The SID of the Function Version content to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of FunctionVersionContent - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathFunctionSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathFunctionSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchFunctionVersionContentOptions(pathServiceSid, pathFunctionSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Serverless/V1/Service/Function/FunctionVersionResource.cs b/src/Twilio/Rest/Serverless/V1/Service/Function/FunctionVersionResource.cs index 16f80204b..5230b2ceb 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/Function/FunctionVersionResource.cs +++ b/src/Twilio/Rest/Serverless/V1/Service/Function/FunctionVersionResource.cs @@ -85,7 +85,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchFunctionVersionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -115,7 +115,7 @@ public static FunctionVersionResource Fetch( /// The SID of the Function Version resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of FunctionVersion - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathFunctionSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathFunctionSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchFunctionVersionOptions(pathServiceSid, pathFunctionSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -157,7 +157,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFunctionVersionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -197,7 +197,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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateFunctionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static FunctionResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathServiceSid, string friendlyName, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateFunctionOptions(pathServiceSid, friendlyName){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteFunctionOptions options, ITwilioRestClient clien /// Task that resolves to A single instance of Function public static async System.Threading.Tasks.Task DeleteAsync(DeleteFunctionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The SID of the Function resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Function - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteFunctionOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchFunctionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static FunctionResource Fetch( /// The SID of the Function resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Function - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchFunctionOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFunctionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task> R string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadFunctionOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -411,7 +411,7 @@ public static FunctionResource Update(UpdateFunctionOptions options, ITwilioRest #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateFunctionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -446,7 +446,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathServiceSid, string pathSid, string friendlyName, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateFunctionOptions(pathServiceSid, pathSid, friendlyName){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Serverless/V1/ServiceResource.cs b/src/Twilio/Rest/Serverless/V1/ServiceResource.cs index 6a4b60f21..4c81c0b70 100644 --- a/src/Twilio/Rest/Serverless/V1/ServiceResource.cs +++ b/src/Twilio/Rest/Serverless/V1/ServiceResource.cs @@ -66,7 +66,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, bool? includeCredentials = null, bool? uiEditable = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateServiceOptions(uniqueName, friendlyName){ IncludeCredentials = includeCredentials, UiEditable = uiEditable }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static bool Delete(DeleteServiceOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -174,7 +174,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteServiceOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -238,7 +238,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchServiceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -276,7 +276,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -308,7 +308,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadServiceOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -400,7 +400,7 @@ public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -439,7 +439,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? includeCredentials = null, string friendlyName = null, bool? uiEditable = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateServiceOptions(pathSid){ IncludeCredentials = includeCredentials, FriendlyName = friendlyName, UiEditable = uiEditable }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextResource.cs b/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextResource.cs index d840f1d0c..15bf95a99 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextResource.cs +++ b/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextResource.cs @@ -69,7 +69,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchEngagementContextOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static EngagementContextResource Fetch( /// The SID of the Engagement. /// Client to make requests to Twilio /// Task that resolves to A single instance of EngagementContext - public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathEngagementSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathEngagementSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchEngagementContextOptions(pathFlowSid, pathEngagementSid){ }; return await FetchAsync(options, client, cancellationToken); 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 2f064a8fd..5faca82c6 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextResource.cs +++ b/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextResource.cs @@ -71,7 +71,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchStepContextOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static StepContextResource Fetch( /// The SID of the Step to fetch /// Client to make requests to Twilio /// Task that resolves to A single instance of StepContext - public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathEngagementSid, string pathStepSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathEngagementSid, string pathStepSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchStepContextOptions(pathFlowSid, pathEngagementSid, pathStepSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepResource.cs b/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepResource.cs index b12d1921f..da4f9a317 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepResource.cs +++ b/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepResource.cs @@ -71,7 +71,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchStepOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static StepResource Fetch( /// The SID of the Step resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Step - public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathEngagementSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathEngagementSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchStepOptions(pathFlowSid, pathEngagementSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -143,7 +143,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadStepOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -183,7 +183,7 @@ public static async System.Threading.Tasks.Task> ReadA string pathEngagementSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadStepOptions(pathFlowSid, pathEngagementSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Studio/V1/Flow/EngagementResource.cs b/src/Twilio/Rest/Studio/V1/Flow/EngagementResource.cs index 88fdcee29..bc002826d 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/EngagementResource.cs +++ b/src/Twilio/Rest/Studio/V1/Flow/EngagementResource.cs @@ -81,7 +81,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateEngagementOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -120,7 +120,7 @@ public static async System.Threading.Tasks.Task CreateAsync( Types.PhoneNumber to, Types.PhoneNumber from, object parameters = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateEngagementOptions(pathFlowSid, to, from){ Parameters = parameters }; return await CreateAsync(options, client, cancellationToken); @@ -168,7 +168,7 @@ public static bool Delete(DeleteEngagementOptions options, ITwilioRestClient cli /// Task that resolves to A single instance of Engagement public static async System.Threading.Tasks.Task DeleteAsync(DeleteEngagementOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -193,7 +193,7 @@ public static bool Delete(string pathFlowSid, string pathSid, ITwilioRestClient /// The SID of the Engagement resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Engagement - public static async System.Threading.Tasks.Task DeleteAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteEngagementOptions(pathFlowSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -235,7 +235,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchEngagementOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -262,7 +262,7 @@ public static EngagementResource Fetch( /// The SID of the Engagement resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Engagement - public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchEngagementOptions(pathFlowSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEngagementOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -338,7 +338,7 @@ public static async System.Threading.Tasks.Task> string pathFlowSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadEngagementOptions(pathFlowSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextResource.cs b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextResource.cs index 59ecd8951..36e6aa73f 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextResource.cs +++ b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextResource.cs @@ -69,7 +69,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionContextOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static ExecutionContextResource Fetch( /// The SID of the Execution context to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ExecutionContext - public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchExecutionContextOptions(pathFlowSid, pathExecutionSid){ }; return await FetchAsync(options, client, cancellationToken); 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 af1c551b1..cdfeb0d83 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextResource.cs +++ b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextResource.cs @@ -71,7 +71,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionStepContextOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static ExecutionStepContextResource Fetch( /// The SID of the Step to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ExecutionStepContext - public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, string pathStepSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, string pathStepSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchExecutionStepContextOptions(pathFlowSid, pathExecutionSid, pathStepSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepResource.cs b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepResource.cs index d4e2a6e64..01eaaa1b4 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepResource.cs +++ b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepResource.cs @@ -71,7 +71,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionStepOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static ExecutionStepResource Fetch( /// The SID of the ExecutionStep resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ExecutionStep - public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchExecutionStepOptions(pathFlowSid, pathExecutionSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -143,7 +143,7 @@ public static ResourceSet Read(ReadExecutionStepOptions o /// Read ExecutionStep parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ExecutionStep - public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionStepOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionStepOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -183,7 +183,7 @@ public static async System.Threading.Tasks.Task Create Execution parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task CreateAsync(CreateExecutionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateExecutionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -120,7 +120,7 @@ public static async System.Threading.Tasks.Task CreateAsync( Types.PhoneNumber to, Types.PhoneNumber from, object parameters = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateExecutionOptions(pathFlowSid, to, from){ Parameters = parameters }; return await CreateAsync(options, client, cancellationToken); @@ -168,7 +168,7 @@ public static bool Delete(DeleteExecutionOptions options, ITwilioRestClient clie /// Task that resolves to A single instance of Execution public static async System.Threading.Tasks.Task DeleteAsync(DeleteExecutionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -193,7 +193,7 @@ public static bool Delete(string pathFlowSid, string pathSid, ITwilioRestClient /// The SID of the Execution resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task DeleteAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteExecutionOptions(pathFlowSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -235,7 +235,7 @@ public static ExecutionResource Fetch(FetchExecutionOptions options, ITwilioRest /// Fetch Execution parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -262,7 +262,7 @@ public static ExecutionResource Fetch( /// The SID of the Execution resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchExecutionOptions(pathFlowSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadExecutionOptions options, /// Read Execution parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -346,7 +346,7 @@ public static async System.Threading.Tasks.Task> DateTime? dateCreatedTo = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadExecutionOptions(pathFlowSid){ DateCreatedFrom = dateCreatedFrom, DateCreatedTo = dateCreatedTo, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -440,7 +440,7 @@ public static ExecutionResource Update(UpdateExecutionOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateExecutionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -475,7 +475,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathFlowSid, string pathSid, ExecutionResource.StatusEnum status, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateExecutionOptions(pathFlowSid, pathSid, status){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Studio/V1/FlowResource.cs b/src/Twilio/Rest/Studio/V1/FlowResource.cs index 81faf6348..5b3510a9f 100644 --- a/src/Twilio/Rest/Studio/V1/FlowResource.cs +++ b/src/Twilio/Rest/Studio/V1/FlowResource.cs @@ -86,7 +86,7 @@ public static bool Delete(DeleteFlowOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Flow public static async System.Threading.Tasks.Task DeleteAsync(DeleteFlowOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Flow resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteFlowOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -149,7 +149,7 @@ public static FlowResource Fetch(FetchFlowOptions options, ITwilioRestClient cli /// Fetch Flow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task FetchAsync(FetchFlowOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchFlowOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -173,7 +173,7 @@ public static FlowResource Fetch( /// The SID of the Flow resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchFlowOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -211,7 +211,7 @@ public static ResourceSet Read(ReadFlowOptions options, ITwilioRes /// Read Flow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task> ReadAsync(ReadFlowOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFlowOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -243,7 +243,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadFlowOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextResource.cs b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextResource.cs index b76bd48fb..76cdaf148 100644 --- a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextResource.cs +++ b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextResource.cs @@ -69,7 +69,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionContextOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static ExecutionContextResource Fetch( /// The SID of the Execution context to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ExecutionContext - public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchExecutionContextOptions(pathFlowSid, pathExecutionSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextResource.cs b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextResource.cs index e10449f79..42b77e25c 100644 --- a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextResource.cs +++ b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextResource.cs @@ -71,7 +71,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionStepContextOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static ExecutionStepContextResource Fetch( /// The SID of the Step to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ExecutionStepContext - public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, string pathStepSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, string pathStepSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchExecutionStepContextOptions(pathFlowSid, pathExecutionSid, pathStepSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepResource.cs b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepResource.cs index 2b3d3c965..51995db02 100644 --- a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepResource.cs +++ b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepResource.cs @@ -71,7 +71,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionStepOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static ExecutionStepResource Fetch( /// The SID of the ExecutionStep resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ExecutionStep - public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathExecutionSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchExecutionStepOptions(pathFlowSid, pathExecutionSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -143,7 +143,7 @@ public static ResourceSet Read(ReadExecutionStepOptions o /// Read ExecutionStep parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ExecutionStep - public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionStepOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionStepOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -183,7 +183,7 @@ public static async System.Threading.Tasks.Task Create Execution parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task CreateAsync(CreateExecutionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateExecutionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -120,7 +120,7 @@ public static async System.Threading.Tasks.Task CreateAsync( Types.PhoneNumber to, Types.PhoneNumber from, object parameters = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateExecutionOptions(pathFlowSid, to, from){ Parameters = parameters }; return await CreateAsync(options, client, cancellationToken); @@ -168,7 +168,7 @@ public static bool Delete(DeleteExecutionOptions options, ITwilioRestClient clie /// Task that resolves to A single instance of Execution public static async System.Threading.Tasks.Task DeleteAsync(DeleteExecutionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -193,7 +193,7 @@ public static bool Delete(string pathFlowSid, string pathSid, ITwilioRestClient /// The SID of the Execution resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task DeleteAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteExecutionOptions(pathFlowSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -235,7 +235,7 @@ public static ExecutionResource Fetch(FetchExecutionOptions options, ITwilioRest /// Fetch Execution parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchExecutionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -262,7 +262,7 @@ public static ExecutionResource Fetch( /// The SID of the Execution resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathFlowSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchExecutionOptions(pathFlowSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadExecutionOptions options, /// Read Execution parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Execution - public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadExecutionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -346,7 +346,7 @@ public static async System.Threading.Tasks.Task> DateTime? dateCreatedTo = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadExecutionOptions(pathFlowSid){ DateCreatedFrom = dateCreatedFrom, DateCreatedTo = dateCreatedTo, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -440,7 +440,7 @@ public static ExecutionResource Update(UpdateExecutionOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateExecutionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -475,7 +475,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathFlowSid, string pathSid, ExecutionResource.StatusEnum status, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateExecutionOptions(pathFlowSid, pathSid, status){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionResource.cs b/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionResource.cs index 0f628c3c9..953b0aa57 100644 --- a/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionResource.cs +++ b/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionResource.cs @@ -82,7 +82,7 @@ public static FlowRevisionResource Fetch(FetchFlowRevisionOptions options, ITwil /// Fetch FlowRevision parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlowRevision - public static async System.Threading.Tasks.Task FetchAsync(FetchFlowRevisionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchFlowRevisionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static FlowRevisionResource Fetch( /// Specific Revision number or can be `LatestPublished` and `LatestRevision`. /// Client to make requests to Twilio /// Task that resolves to A single instance of FlowRevision - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathRevision, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathRevision, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchFlowRevisionOptions(pathSid, pathRevision){ }; return await FetchAsync(options, client, cancellationToken); @@ -149,7 +149,7 @@ public static ResourceSet Read(ReadFlowRevisionOptions opt /// Read FlowRevision parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlowRevision - public static async System.Threading.Tasks.Task> ReadAsync(ReadFlowRevisionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFlowRevisionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -185,7 +185,7 @@ public static async System.Threading.Tasks.Task Fetch FlowTestUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of FlowTestUser - public static async System.Threading.Tasks.Task FetchAsync(FetchFlowTestUserOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchFlowTestUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static FlowTestUserResource Fetch( /// Unique identifier of the flow. /// Client to make requests to Twilio /// Task that resolves to A single instance of FlowTestUser - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchFlowTestUserOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -134,7 +134,7 @@ public static FlowTestUserResource Update(UpdateFlowTestUserOptions options, ITw #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlowTestUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -165,7 +165,7 @@ public static FlowTestUserResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, List testUsers, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateFlowTestUserOptions(pathSid, testUsers){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Studio/V2/FlowResource.cs b/src/Twilio/Rest/Studio/V2/FlowResource.cs index f5f27a199..b53bedc43 100644 --- a/src/Twilio/Rest/Studio/V2/FlowResource.cs +++ b/src/Twilio/Rest/Studio/V2/FlowResource.cs @@ -79,7 +79,7 @@ public static FlowResource Create(CreateFlowOptions options, ITwilioRestClient c /// Create Flow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task CreateAsync(CreateFlowOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateFlowOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -118,7 +118,7 @@ public static async System.Threading.Tasks.Task CreateAsync( FlowResource.StatusEnum status, object definition, string commitMessage = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateFlowOptions(friendlyName, status, definition){ CommitMessage = commitMessage }; return await CreateAsync(options, client, cancellationToken); @@ -164,7 +164,7 @@ public static bool Delete(DeleteFlowOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Flow public static async System.Threading.Tasks.Task DeleteAsync(DeleteFlowOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -187,7 +187,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Flow resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteFlowOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -227,7 +227,7 @@ public static FlowResource Fetch(FetchFlowOptions options, ITwilioRestClient cli /// Fetch Flow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task FetchAsync(FetchFlowOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchFlowOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -251,7 +251,7 @@ public static FlowResource Fetch( /// The SID of the Flow resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchFlowOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -289,7 +289,7 @@ public static ResourceSet Read(ReadFlowOptions options, ITwilioRes /// Read Flow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Flow - public static async System.Threading.Tasks.Task> ReadAsync(ReadFlowOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFlowOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadFlowOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -413,7 +413,7 @@ public static FlowResource Update(UpdateFlowOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlowOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -456,7 +456,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string friendlyName = null, object definition = null, string commitMessage = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateFlowOptions(pathSid, status){ FriendlyName = friendlyName, Definition = definition, CommitMessage = commitMessage }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Studio/V2/FlowValidateResource.cs b/src/Twilio/Rest/Studio/V2/FlowValidateResource.cs index cff6d614f..89fbefa77 100644 --- a/src/Twilio/Rest/Studio/V2/FlowValidateResource.cs +++ b/src/Twilio/Rest/Studio/V2/FlowValidateResource.cs @@ -80,7 +80,7 @@ public static FlowValidateResource Update(UpdateFlowValidateOptions options, ITw #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateFlowValidateOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -119,7 +119,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn FlowValidateResource.StatusEnum status, object definition, string commitMessage = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateFlowValidateOptions(friendlyName, status, definition){ CommitMessage = commitMessage }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Supersim/V1/EsimProfileResource.cs b/src/Twilio/Rest/Supersim/V1/EsimProfileResource.cs index dc6a9bae9..0a2b1562f 100644 --- a/src/Twilio/Rest/Supersim/V1/EsimProfileResource.cs +++ b/src/Twilio/Rest/Supersim/V1/EsimProfileResource.cs @@ -83,7 +83,7 @@ public static EsimProfileResource Create(CreateEsimProfileOptions options, ITwil /// Create EsimProfile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EsimProfile - public static async System.Threading.Tasks.Task CreateAsync(CreateEsimProfileOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateEsimProfileOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -122,7 +122,7 @@ public static async System.Threading.Tasks.Task CreateAsync Twilio.Http.HttpMethod callbackMethod = null, bool? generateMatchingId = null, string eid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateEsimProfileOptions(){ CallbackUrl = callbackUrl, CallbackMethod = callbackMethod, GenerateMatchingId = generateMatchingId, Eid = eid }; return await CreateAsync(options, client, cancellationToken); @@ -162,7 +162,7 @@ public static EsimProfileResource Fetch(FetchEsimProfileOptions options, ITwilio /// Fetch EsimProfile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EsimProfile - public static async System.Threading.Tasks.Task FetchAsync(FetchEsimProfileOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchEsimProfileOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -186,7 +186,7 @@ public static EsimProfileResource Fetch( /// The SID of the eSIM Profile resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of EsimProfile - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchEsimProfileOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -224,7 +224,7 @@ public static ResourceSet Read(ReadEsimProfileOptions optio /// Read EsimProfile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EsimProfile - public static async System.Threading.Tasks.Task> ReadAsync(ReadEsimProfileOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEsimProfileOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -268,7 +268,7 @@ public static async System.Threading.Tasks.Task EsimProfileResource.StatusEnum status = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadEsimProfileOptions(){ Eid = eid, SimSid = simSid, Status = status, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Supersim/V1/FleetResource.cs b/src/Twilio/Rest/Supersim/V1/FleetResource.cs index aad060c92..52d0bd0bb 100644 --- a/src/Twilio/Rest/Supersim/V1/FleetResource.cs +++ b/src/Twilio/Rest/Supersim/V1/FleetResource.cs @@ -78,7 +78,7 @@ public static FleetResource Create(CreateFleetOptions options, ITwilioRestClient /// Create Fleet parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Fleet - public static async System.Threading.Tasks.Task CreateAsync(CreateFleetOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateFleetOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -137,7 +137,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? smsCommandsEnabled = null, Uri smsCommandsUrl = null, Twilio.Http.HttpMethod smsCommandsMethod = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateFleetOptions(networkAccessProfile){ UniqueName = uniqueName, DataEnabled = dataEnabled, DataLimit = dataLimit, IpCommandsUrl = ipCommandsUrl, IpCommandsMethod = ipCommandsMethod, SmsCommandsEnabled = smsCommandsEnabled, SmsCommandsUrl = smsCommandsUrl, SmsCommandsMethod = smsCommandsMethod }; return await CreateAsync(options, client, cancellationToken); @@ -177,7 +177,7 @@ public static FleetResource Fetch(FetchFleetOptions options, ITwilioRestClient c /// Fetch Fleet parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Fleet - public static async System.Threading.Tasks.Task FetchAsync(FetchFleetOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchFleetOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -201,7 +201,7 @@ public static FleetResource Fetch( /// The SID of the Fleet resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Fleet - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchFleetOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -239,7 +239,7 @@ public static ResourceSet Read(ReadFleetOptions options, ITwilioR /// Read Fleet parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Fleet - public static async System.Threading.Tasks.Task> ReadAsync(ReadFleetOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFleetOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -275,7 +275,7 @@ public static async System.Threading.Tasks.Task> Read string networkAccessProfile = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadFleetOptions(){ NetworkAccessProfile = networkAccessProfile, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -367,7 +367,7 @@ public static FleetResource Update(UpdateFleetOptions options, ITwilioRestClient #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateFleetOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -422,7 +422,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( Uri smsCommandsUrl = null, Twilio.Http.HttpMethod smsCommandsMethod = null, int? dataLimit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateFleetOptions(pathSid){ UniqueName = uniqueName, NetworkAccessProfile = networkAccessProfile, IpCommandsUrl = ipCommandsUrl, IpCommandsMethod = ipCommandsMethod, SmsCommandsUrl = smsCommandsUrl, SmsCommandsMethod = smsCommandsMethod, DataLimit = dataLimit }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Supersim/V1/IpCommandResource.cs b/src/Twilio/Rest/Supersim/V1/IpCommandResource.cs index 810f54e39..2b2809c1f 100644 --- a/src/Twilio/Rest/Supersim/V1/IpCommandResource.cs +++ b/src/Twilio/Rest/Supersim/V1/IpCommandResource.cs @@ -107,7 +107,7 @@ public static IpCommandResource Create(CreateIpCommandOptions options, ITwilioRe /// Create IpCommand parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpCommand - public static async System.Threading.Tasks.Task CreateAsync(CreateIpCommandOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateIpCommandOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -154,7 +154,7 @@ public static async System.Threading.Tasks.Task CreateAsync( IpCommandResource.PayloadTypeEnum payloadType = null, Uri callbackUrl = null, Twilio.Http.HttpMethod callbackMethod = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateIpCommandOptions(sim, payload, devicePort){ PayloadType = payloadType, CallbackUrl = callbackUrl, CallbackMethod = callbackMethod }; return await CreateAsync(options, client, cancellationToken); @@ -194,7 +194,7 @@ public static IpCommandResource Fetch(FetchIpCommandOptions options, ITwilioRest /// Fetch IpCommand parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpCommand - public static async System.Threading.Tasks.Task FetchAsync(FetchIpCommandOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchIpCommandOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -218,7 +218,7 @@ public static IpCommandResource Fetch( /// The SID of the IP Command resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of IpCommand - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchIpCommandOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -256,7 +256,7 @@ public static ResourceSet Read(ReadIpCommandOptions options, /// Read IpCommand parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpCommand - public static async System.Threading.Tasks.Task> ReadAsync(ReadIpCommandOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadIpCommandOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -304,7 +304,7 @@ public static async System.Threading.Tasks.Task> IpCommandResource.DirectionEnum direction = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadIpCommandOptions(){ Sim = sim, SimIccid = simIccid, Status = status, Direction = direction, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkResource.cs b/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkResource.cs index fb4082666..3474f075d 100644 --- a/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkResource.cs +++ b/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkResource.cs @@ -68,7 +68,7 @@ public static NetworkAccessProfileNetworkResource Create(CreateNetworkAccessProf /// Create NetworkAccessProfileNetwork parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfileNetwork - public static async System.Threading.Tasks.Task CreateAsync(CreateNetworkAccessProfileNetworkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateNetworkAccessProfileNetworkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static NetworkAccessProfileNetworkResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathNetworkAccessProfileSid, string network, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateNetworkAccessProfileNetworkOptions(pathNetworkAccessProfileSid, network){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteNetworkAccessProfileNetworkOptions options, ITwi /// Task that resolves to A single instance of NetworkAccessProfileNetwork public static async System.Threading.Tasks.Task DeleteAsync(DeleteNetworkAccessProfileNetworkOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathNetworkAccessProfileSid, string pathSid, IT /// The SID of the Network resource to be removed from the Network Access Profile resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfileNetwork - public static async System.Threading.Tasks.Task DeleteAsync(string pathNetworkAccessProfileSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathNetworkAccessProfileSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteNetworkAccessProfileNetworkOptions(pathNetworkAccessProfileSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static NetworkAccessProfileNetworkResource Fetch(FetchNetworkAccessProfil /// Fetch NetworkAccessProfileNetwork parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfileNetwork - public static async System.Threading.Tasks.Task FetchAsync(FetchNetworkAccessProfileNetworkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchNetworkAccessProfileNetworkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static NetworkAccessProfileNetworkResource Fetch( /// The SID of the Network resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfileNetwork - public static async System.Threading.Tasks.Task FetchAsync(string pathNetworkAccessProfileSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathNetworkAccessProfileSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchNetworkAccessProfileNetworkOptions(pathNetworkAccessProfileSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadNetworkA /// Read NetworkAccessProfileNetwork parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfileNetwork - public static async System.Threading.Tasks.Task> ReadAsync(ReadNetworkAccessProfileNetworkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadNetworkAccessProfileNetworkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task Create NetworkAccessProfile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfile - public static async System.Threading.Tasks.Task CreateAsync(CreateNetworkAccessProfileOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateNetworkAccessProfileOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -97,7 +97,7 @@ public static NetworkAccessProfileResource Create( public static async System.Threading.Tasks.Task CreateAsync( string uniqueName = null, List networks = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateNetworkAccessProfileOptions(){ UniqueName = uniqueName, Networks = networks }; return await CreateAsync(options, client, cancellationToken); @@ -137,7 +137,7 @@ public static NetworkAccessProfileResource Fetch(FetchNetworkAccessProfileOption /// Fetch NetworkAccessProfile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfile - public static async System.Threading.Tasks.Task FetchAsync(FetchNetworkAccessProfileOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchNetworkAccessProfileOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static NetworkAccessProfileResource Fetch( /// The SID of the Network Access Profile resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfile - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchNetworkAccessProfileOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -199,7 +199,7 @@ public static ResourceSet Read(ReadNetworkAccessPr /// Read NetworkAccessProfile parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NetworkAccessProfile - public static async System.Threading.Tasks.Task> ReadAsync(ReadNetworkAccessProfileOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadNetworkAccessProfileOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -231,7 +231,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadNetworkAccessProfileOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -323,7 +323,7 @@ public static NetworkAccessProfileResource Update(UpdateNetworkAccessProfileOpti #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateNetworkAccessProfileOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -354,7 +354,7 @@ public static NetworkAccessProfileResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string uniqueName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateNetworkAccessProfileOptions(pathSid){ UniqueName = uniqueName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Supersim/V1/NetworkResource.cs b/src/Twilio/Rest/Supersim/V1/NetworkResource.cs index 120342c7f..f29cc09a1 100644 --- a/src/Twilio/Rest/Supersim/V1/NetworkResource.cs +++ b/src/Twilio/Rest/Supersim/V1/NetworkResource.cs @@ -67,7 +67,7 @@ public static NetworkResource Fetch(FetchNetworkOptions options, ITwilioRestClie /// Fetch Network parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Network - public static async System.Threading.Tasks.Task FetchAsync(FetchNetworkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchNetworkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static NetworkResource Fetch( /// The SID of the Network resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Network - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchNetworkOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadNetworkOptions options, ITwi /// Read Network parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Network - public static async System.Threading.Tasks.Task> ReadAsync(ReadNetworkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadNetworkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -173,7 +173,7 @@ public static async System.Threading.Tasks.Task> Re string mnc = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadNetworkOptions(){ IsoCountry = isoCountry, Mcc = mcc, Mnc = mnc, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Supersim/V1/SettingsUpdateResource.cs b/src/Twilio/Rest/Supersim/V1/SettingsUpdateResource.cs index 334a26014..613ce3121 100644 --- a/src/Twilio/Rest/Supersim/V1/SettingsUpdateResource.cs +++ b/src/Twilio/Rest/Supersim/V1/SettingsUpdateResource.cs @@ -80,7 +80,7 @@ public static ResourceSet Read(ReadSettingsUpdateOptions /// Read SettingsUpdate parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SettingsUpdate - public static async System.Threading.Tasks.Task> ReadAsync(ReadSettingsUpdateOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSettingsUpdateOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -120,7 +120,7 @@ public static async System.Threading.Tasks.Task Read(ReadBillingPeriodOptions o /// Read BillingPeriod parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BillingPeriod - public static async System.Threading.Tasks.Task> ReadAsync(ReadBillingPeriodOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBillingPeriodOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -116,7 +116,7 @@ public static async System.Threading.Tasks.Task Read(ReadSimIpAddressOptions opt /// Read SimIpAddress parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SimIpAddress - public static async System.Threading.Tasks.Task> ReadAsync(ReadSimIpAddressOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSimIpAddressOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -116,7 +116,7 @@ public static async System.Threading.Tasks.Task Create Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task CreateAsync(CreateSimOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSimOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -126,7 +126,7 @@ public static SimResource Create( public static async System.Threading.Tasks.Task CreateAsync( string iccid, string registrationCode, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSimOptions(iccid, registrationCode){ }; return await CreateAsync(options, client, cancellationToken); @@ -166,7 +166,7 @@ public static SimResource Fetch(FetchSimOptions options, ITwilioRestClient clien /// Fetch Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task FetchAsync(FetchSimOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSimOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -190,7 +190,7 @@ public static SimResource Fetch( /// The SID of the Sim resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSimOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -228,7 +228,7 @@ public static ResourceSet Read(ReadSimOptions options, ITwilioRestC /// Read Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task> ReadAsync(ReadSimOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSimOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -272,7 +272,7 @@ public static async System.Threading.Tasks.Task> ReadAs string iccid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSimOptions(){ Status = status, Fleet = fleet, Iccid = iccid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -364,7 +364,7 @@ public static SimResource Update(UpdateSimOptions options, ITwilioRestClient cli #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSimOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -415,7 +415,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( Uri callbackUrl = null, Twilio.Http.HttpMethod callbackMethod = null, string accountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSimOptions(pathSid){ UniqueName = uniqueName, Status = status, Fleet = fleet, CallbackUrl = callbackUrl, CallbackMethod = callbackMethod, AccountSid = accountSid }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Supersim/V1/SmsCommandResource.cs b/src/Twilio/Rest/Supersim/V1/SmsCommandResource.cs index 379b7c615..0235956ca 100644 --- a/src/Twilio/Rest/Supersim/V1/SmsCommandResource.cs +++ b/src/Twilio/Rest/Supersim/V1/SmsCommandResource.cs @@ -95,7 +95,7 @@ public static SmsCommandResource Create(CreateSmsCommandOptions options, ITwilio /// Create SmsCommand parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SmsCommand - public static async System.Threading.Tasks.Task CreateAsync(CreateSmsCommandOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSmsCommandOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -134,7 +134,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string payload, Twilio.Http.HttpMethod callbackMethod = null, Uri callbackUrl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSmsCommandOptions(sim, payload){ CallbackMethod = callbackMethod, CallbackUrl = callbackUrl }; return await CreateAsync(options, client, cancellationToken); @@ -174,7 +174,7 @@ public static SmsCommandResource Fetch(FetchSmsCommandOptions options, ITwilioRe /// Fetch SmsCommand parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SmsCommand - public static async System.Threading.Tasks.Task FetchAsync(FetchSmsCommandOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSmsCommandOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -198,7 +198,7 @@ public static SmsCommandResource Fetch( /// The SID of the SMS Command resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of SmsCommand - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSmsCommandOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -236,7 +236,7 @@ public static ResourceSet Read(ReadSmsCommandOptions options /// Read SmsCommand parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SmsCommand - public static async System.Threading.Tasks.Task> ReadAsync(ReadSmsCommandOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSmsCommandOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -280,7 +280,7 @@ public static async System.Threading.Tasks.Task> SmsCommandResource.DirectionEnum direction = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSmsCommandOptions(){ Sim = sim, Status = status, Direction = direction, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Supersim/V1/UsageRecordResource.cs b/src/Twilio/Rest/Supersim/V1/UsageRecordResource.cs index 02cb8d544..e0a3e9d1f 100644 --- a/src/Twilio/Rest/Supersim/V1/UsageRecordResource.cs +++ b/src/Twilio/Rest/Supersim/V1/UsageRecordResource.cs @@ -92,7 +92,7 @@ public static ResourceSet Read(ReadUsageRecordOptions optio /// Read UsageRecord parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsageRecord - public static async System.Threading.Tasks.Task> ReadAsync(ReadUsageRecordOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUsageRecordOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -156,7 +156,7 @@ public static async System.Threading.Tasks.Task DateTime? endTime = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUsageRecordOptions(){ Sim = sim, Fleet = fleet, Network = network, IsoCountry = isoCountry, Group = group, Granularity = granularity, StartTime = startTime, EndTime = endTime, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionResource.cs b/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionResource.cs index 0558730b3..c8c525f60 100644 --- a/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionResource.cs @@ -77,7 +77,7 @@ public static bool Delete(DeleteDocumentPermissionOptions options, ITwilioRestCl /// Task that resolves to A single instance of DocumentPermission public static async System.Threading.Tasks.Task DeleteAsync(DeleteDocumentPermissionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -104,7 +104,7 @@ public static bool Delete(string pathServiceSid, string pathDocumentSid, string /// The application-defined string that uniquely identifies the User's Document Permission resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathDocumentSid, string pathIdentity, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathDocumentSid, string pathIdentity, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity) ; return await DeleteAsync(options, client, cancellationToken); @@ -148,7 +148,7 @@ public static DocumentPermissionResource Fetch(FetchDocumentPermissionOptions op /// Fetch DocumentPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission - public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentPermissionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentPermissionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -178,7 +178,7 @@ public static DocumentPermissionResource Fetch( /// The application-defined string that uniquely identifies the User's Document Permission resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathDocumentSid, string pathIdentity, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathDocumentSid, string pathIdentity, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity){ }; return await FetchAsync(options, client, cancellationToken); @@ -220,7 +220,7 @@ public static ResourceSet Read(ReadDocumentPermissio /// Read DocumentPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DocumentPermission - public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentPermissionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentPermissionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -260,7 +260,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateDocumentPermissionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -403,7 +403,7 @@ public static async System.Threading.Tasks.Task Upda bool? read, bool? write, bool? manage, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateDocumentPermissionOptions(pathServiceSid, pathDocumentSid, pathIdentity, read, write, manage){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Sync/V1/Service/DocumentResource.cs b/src/Twilio/Rest/Sync/V1/Service/DocumentResource.cs index b0238b501..18c88fd33 100644 --- a/src/Twilio/Rest/Sync/V1/Service/DocumentResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/DocumentResource.cs @@ -68,7 +68,7 @@ public static DocumentResource Create(CreateDocumentOptions options, ITwilioRest /// Create Document parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task CreateAsync(CreateDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -107,7 +107,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string uniqueName = null, object data = null, int? ttl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateDocumentOptions(pathServiceSid){ UniqueName = uniqueName, Data = data, Ttl = ttl }; return await CreateAsync(options, client, cancellationToken); @@ -155,7 +155,7 @@ public static bool Delete(DeleteDocumentOptions options, ITwilioRestClient clien /// Task that resolves to A single instance of Document public static async System.Threading.Tasks.Task DeleteAsync(DeleteDocumentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -180,7 +180,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The SID of the Document resource to delete. Can be the Document resource's `sid` or its `unique_name`. /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteDocumentOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -222,7 +222,7 @@ public static DocumentResource Fetch(FetchDocumentOptions options, ITwilioRestCl /// Fetch Document parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -249,7 +249,7 @@ public static DocumentResource Fetch( /// The SID of the Document resource to fetch. Can be the Document resource's `sid` or its `unique_name`. /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchDocumentOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -289,7 +289,7 @@ public static ResourceSet Read(ReadDocumentOptions options, IT /// Read Document parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Document - public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -325,7 +325,7 @@ public static async System.Threading.Tasks.Task> R string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadDocumentOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -419,7 +419,7 @@ public static DocumentResource Update(UpdateDocumentOptions options, ITwilioRest #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateDocumentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -462,7 +462,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( object data = null, int? ttl = null, string ifMatch = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateDocumentOptions(pathServiceSid, pathSid){ Data = data, Ttl = ttl, IfMatch = ifMatch }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemResource.cs index 7b396f355..dcb52cb19 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemResource.cs @@ -94,7 +94,7 @@ public static SyncListItemResource Create(CreateSyncListItemOptions options, ITw /// Create SyncListItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListItemOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListItemOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -141,7 +141,7 @@ public static async System.Threading.Tasks.Task CreateAsyn int? ttl = null, int? itemTtl = null, int? collectionTtl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSyncListItemOptions(pathServiceSid, pathListSid, data){ Ttl = ttl, ItemTtl = itemTtl, CollectionTtl = collectionTtl }; return await CreateAsync(options, client, cancellationToken); @@ -191,7 +191,7 @@ public static bool Delete(DeleteSyncListItemOptions options, ITwilioRestClient c /// Task that resolves to A single instance of SyncListItem public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListItemOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -220,7 +220,7 @@ public static bool Delete(string pathServiceSid, string pathListSid, int? pathIn /// If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathListSid, int? pathIndex, string ifMatch = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathListSid, int? pathIndex, string ifMatch = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSyncListItemOptions(pathServiceSid, pathListSid, pathIndex) { IfMatch = ifMatch }; return await DeleteAsync(options, client, cancellationToken); @@ -264,7 +264,7 @@ public static SyncListItemResource Fetch(FetchSyncListItemOptions options, ITwil /// Fetch SyncListItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListItemOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListItemOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -294,7 +294,7 @@ public static SyncListItemResource Fetch( /// The index of the Sync List Item resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathListSid, int? pathIndex, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathListSid, int? pathIndex, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSyncListItemOptions(pathServiceSid, pathListSid, pathIndex){ }; return await FetchAsync(options, client, cancellationToken); @@ -336,7 +336,7 @@ public static ResourceSet Read(ReadSyncListItemOptions opt /// Read SyncListItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListItem - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListItemOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListItemOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -388,7 +388,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListItemOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -539,7 +539,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn int? itemTtl = null, int? collectionTtl = null, string ifMatch = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSyncListItemOptions(pathServiceSid, pathListSid, pathIndex){ Data = data, Ttl = ttl, ItemTtl = itemTtl, CollectionTtl = collectionTtl, IfMatch = ifMatch }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionResource.cs index 4625fadce..ab14c903b 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionResource.cs @@ -77,7 +77,7 @@ public static bool Delete(DeleteSyncListPermissionOptions options, ITwilioRestCl /// Task that resolves to A single instance of SyncListPermission public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListPermissionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -104,7 +104,7 @@ public static bool Delete(string pathServiceSid, string pathListSid, string path /// The application-defined string that uniquely identifies the User's Sync List Permission resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathListSid, string pathIdentity, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathListSid, string pathIdentity, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSyncListPermissionOptions(pathServiceSid, pathListSid, pathIdentity) ; return await DeleteAsync(options, client, cancellationToken); @@ -148,7 +148,7 @@ public static SyncListPermissionResource Fetch(FetchSyncListPermissionOptions op /// Fetch SyncListPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListPermissionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListPermissionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -178,7 +178,7 @@ public static SyncListPermissionResource Fetch( /// The application-defined string that uniquely identifies the User's Sync List Permission resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathListSid, string pathIdentity, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathListSid, string pathIdentity, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSyncListPermissionOptions(pathServiceSid, pathListSid, pathIdentity){ }; return await FetchAsync(options, client, cancellationToken); @@ -220,7 +220,7 @@ public static ResourceSet Read(ReadSyncListPermissio /// Read SyncListPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncListPermission - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListPermissionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListPermissionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -260,7 +260,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListPermissionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -403,7 +403,7 @@ public static async System.Threading.Tasks.Task Upda bool? read, bool? write, bool? manage, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSyncListPermissionOptions(pathServiceSid, pathListSid, pathIdentity, read, write, manage){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncListResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncListResource.cs index 14af2633f..94bdaa049 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncListResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncListResource.cs @@ -68,7 +68,7 @@ public static SyncListResource Create(CreateSyncListOptions options, ITwilioRest /// Create SyncList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -107,7 +107,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string uniqueName = null, int? ttl = null, int? collectionTtl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSyncListOptions(pathServiceSid){ UniqueName = uniqueName, Ttl = ttl, CollectionTtl = collectionTtl }; return await CreateAsync(options, client, cancellationToken); @@ -155,7 +155,7 @@ public static bool Delete(DeleteSyncListOptions options, ITwilioRestClient clien /// Task that resolves to A single instance of SyncList public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncListOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -180,7 +180,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The SID of the Sync List resource to delete. Can be the Sync List resource's `sid` or its `unique_name`. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSyncListOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -222,7 +222,7 @@ public static SyncListResource Fetch(FetchSyncListOptions options, ITwilioRestCl /// Fetch SyncList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -249,7 +249,7 @@ public static SyncListResource Fetch( /// The SID of the Sync List resource to fetch. Can be the Sync List resource's `sid` or its `unique_name`. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSyncListOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -289,7 +289,7 @@ public static ResourceSet Read(ReadSyncListOptions options, IT /// Read SyncList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncList - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -325,7 +325,7 @@ public static async System.Threading.Tasks.Task> R string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSyncListOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -419,7 +419,7 @@ public static SyncListResource Update(UpdateSyncListOptions options, ITwilioRest #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncListOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -458,7 +458,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, int? ttl = null, int? collectionTtl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSyncListOptions(pathServiceSid, pathSid){ Ttl = ttl, CollectionTtl = collectionTtl }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemResource.cs index 760b27b0b..e4daf581a 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemResource.cs @@ -94,7 +94,7 @@ public static SyncMapItemResource Create(CreateSyncMapItemOptions options, ITwil /// Create SyncMapItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapItemOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapItemOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -145,7 +145,7 @@ public static async System.Threading.Tasks.Task CreateAsync int? ttl = null, int? itemTtl = null, int? collectionTtl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSyncMapItemOptions(pathServiceSid, pathMapSid, key, data){ Ttl = ttl, ItemTtl = itemTtl, CollectionTtl = collectionTtl }; return await CreateAsync(options, client, cancellationToken); @@ -195,7 +195,7 @@ public static bool Delete(DeleteSyncMapItemOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of SyncMapItem public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapItemOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -224,7 +224,7 @@ public static bool Delete(string pathServiceSid, string pathMapSid, string pathK /// If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathMapSid, string pathKey, string ifMatch = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathMapSid, string pathKey, string ifMatch = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSyncMapItemOptions(pathServiceSid, pathMapSid, pathKey) { IfMatch = ifMatch }; return await DeleteAsync(options, client, cancellationToken); @@ -268,7 +268,7 @@ public static SyncMapItemResource Fetch(FetchSyncMapItemOptions options, ITwilio /// Fetch SyncMapItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapItemOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapItemOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -298,7 +298,7 @@ public static SyncMapItemResource Fetch( /// The `key` value of the Sync Map Item resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathMapSid, string pathKey, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathMapSid, string pathKey, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSyncMapItemOptions(pathServiceSid, pathMapSid, pathKey){ }; return await FetchAsync(options, client, cancellationToken); @@ -340,7 +340,7 @@ public static ResourceSet Read(ReadSyncMapItemOptions optio /// Read SyncMapItem parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapItem - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapItemOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapItemOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -392,7 +392,7 @@ public static async System.Threading.Tasks.Task SyncMapItemResource.QueryFromBoundTypeEnum bounds = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSyncMapItemOptions(pathServiceSid, pathMapSid){ Order = order, From = from, Bounds = bounds, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -488,7 +488,7 @@ public static SyncMapItemResource Update(UpdateSyncMapItemOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapItemOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -543,7 +543,7 @@ public static async System.Threading.Tasks.Task UpdateAsync int? itemTtl = null, int? collectionTtl = null, string ifMatch = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSyncMapItemOptions(pathServiceSid, pathMapSid, pathKey){ Data = data, Ttl = ttl, ItemTtl = itemTtl, CollectionTtl = collectionTtl, IfMatch = ifMatch }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionResource.cs index 9646ada23..36d499a60 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionResource.cs @@ -77,7 +77,7 @@ public static bool Delete(DeleteSyncMapPermissionOptions options, ITwilioRestCli /// Task that resolves to A single instance of SyncMapPermission public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapPermissionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -104,7 +104,7 @@ public static bool Delete(string pathServiceSid, string pathMapSid, string pathI /// The application-defined string that uniquely identifies the User's Sync Map Permission resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathMapSid, string pathIdentity, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathMapSid, string pathIdentity, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSyncMapPermissionOptions(pathServiceSid, pathMapSid, pathIdentity) ; return await DeleteAsync(options, client, cancellationToken); @@ -148,7 +148,7 @@ public static SyncMapPermissionResource Fetch(FetchSyncMapPermissionOptions opti /// Fetch SyncMapPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapPermissionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapPermissionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -178,7 +178,7 @@ public static SyncMapPermissionResource Fetch( /// The application-defined string that uniquely identifies the User's Sync Map Permission resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathMapSid, string pathIdentity, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathMapSid, string pathIdentity, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSyncMapPermissionOptions(pathServiceSid, pathMapSid, pathIdentity){ }; return await FetchAsync(options, client, cancellationToken); @@ -220,7 +220,7 @@ public static ResourceSet Read(ReadSyncMapPermissionO /// Read SyncMapPermission parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMapPermission - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapPermissionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapPermissionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -260,7 +260,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapPermissionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -403,7 +403,7 @@ public static async System.Threading.Tasks.Task Updat bool? read, bool? write, bool? manage, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSyncMapPermissionOptions(pathServiceSid, pathMapSid, pathIdentity, read, write, manage){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncMapResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncMapResource.cs index a07dd63f6..48a2af84a 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncMapResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncMapResource.cs @@ -68,7 +68,7 @@ public static SyncMapResource Create(CreateSyncMapOptions options, ITwilioRestCl /// Create SyncMap parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncMapOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -107,7 +107,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string uniqueName = null, int? ttl = null, int? collectionTtl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSyncMapOptions(pathServiceSid){ UniqueName = uniqueName, Ttl = ttl, CollectionTtl = collectionTtl }; return await CreateAsync(options, client, cancellationToken); @@ -155,7 +155,7 @@ public static bool Delete(DeleteSyncMapOptions options, ITwilioRestClient client /// Task that resolves to A single instance of SyncMap public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncMapOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -180,7 +180,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The SID of the Sync Map resource to delete. Can be the Sync Map's `sid` or its `unique_name`. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSyncMapOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -222,7 +222,7 @@ public static SyncMapResource Fetch(FetchSyncMapOptions options, ITwilioRestClie /// Fetch SyncMap parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncMapOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -249,7 +249,7 @@ public static SyncMapResource Fetch( /// The SID of the Sync Map resource to fetch. Can be the Sync Map's `sid` or its `unique_name`. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSyncMapOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -289,7 +289,7 @@ public static ResourceSet Read(ReadSyncMapOptions options, ITwi /// Read SyncMap parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncMap - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncMapOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -325,7 +325,7 @@ public static async System.Threading.Tasks.Task> Re string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSyncMapOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -419,7 +419,7 @@ public static SyncMapResource Update(UpdateSyncMapOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncMapOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -458,7 +458,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, int? ttl = null, int? collectionTtl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSyncMapOptions(pathServiceSid, pathSid){ Ttl = ttl, CollectionTtl = collectionTtl }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageResource.cs index b25d4ffd5..9758e36f3 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageResource.cs @@ -70,7 +70,7 @@ public static StreamMessageResource Create(CreateStreamMessageOptions options, I /// Create StreamMessage parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of StreamMessage - public static async System.Threading.Tasks.Task CreateAsync(CreateStreamMessageOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateStreamMessageOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -105,7 +105,7 @@ public static async System.Threading.Tasks.Task CreateAsy string pathServiceSid, string pathStreamSid, object data, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateStreamMessageOptions(pathServiceSid, pathStreamSid, data){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncStreamResource.cs b/src/Twilio/Rest/Sync/V1/Service/SyncStreamResource.cs index 3db535502..e915b492c 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncStreamResource.cs +++ b/src/Twilio/Rest/Sync/V1/Service/SyncStreamResource.cs @@ -68,7 +68,7 @@ public static SyncStreamResource Create(CreateSyncStreamOptions options, ITwilio /// Create SyncStream parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncStream - public static async System.Threading.Tasks.Task CreateAsync(CreateSyncStreamOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSyncStreamOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string pathServiceSid, string uniqueName = null, int? ttl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSyncStreamOptions(pathServiceSid){ UniqueName = uniqueName, Ttl = ttl }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static bool Delete(DeleteSyncStreamOptions options, ITwilioRestClient cli /// Task that resolves to A single instance of SyncStream public static async System.Threading.Tasks.Task DeleteAsync(DeleteSyncStreamOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -176,7 +176,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The SID of the Stream resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncStream - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSyncStreamOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -218,7 +218,7 @@ public static SyncStreamResource Fetch(FetchSyncStreamOptions options, ITwilioRe /// Fetch SyncStream parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncStream - public static async System.Threading.Tasks.Task FetchAsync(FetchSyncStreamOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSyncStreamOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static SyncStreamResource Fetch( /// The SID of the Stream resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncStream - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSyncStreamOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadSyncStreamOptions options /// Read SyncStream parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SyncStream - public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncStreamOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSyncStreamOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static async System.Threading.Tasks.Task> string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSyncStreamOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -415,7 +415,7 @@ public static SyncStreamResource Update(UpdateSyncStreamOptions options, ITwilio #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSyncStreamOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -450,7 +450,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathServiceSid, string pathSid, int? ttl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSyncStreamOptions(pathServiceSid, pathSid){ Ttl = ttl }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Sync/V1/ServiceResource.cs b/src/Twilio/Rest/Sync/V1/ServiceResource.cs index 4de1cde12..36e70fb60 100644 --- a/src/Twilio/Rest/Sync/V1/ServiceResource.cs +++ b/src/Twilio/Rest/Sync/V1/ServiceResource.cs @@ -66,7 +66,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -117,7 +117,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? reachabilityDebouncingEnabled = null, int? reachabilityDebouncingWindow = null, bool? webhooksFromRestEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateServiceOptions(){ FriendlyName = friendlyName, WebhookUrl = webhookUrl, ReachabilityWebhooksEnabled = reachabilityWebhooksEnabled, AclEnabled = aclEnabled, ReachabilityDebouncingEnabled = reachabilityDebouncingEnabled, ReachabilityDebouncingWindow = reachabilityDebouncingWindow, WebhooksFromRestEnabled = webhooksFromRestEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -163,7 +163,7 @@ public static bool Delete(DeleteServiceOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -186,7 +186,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteServiceOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -226,7 +226,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -250,7 +250,7 @@ public static ServiceResource Fetch( /// The SID 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchServiceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -288,7 +288,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -320,7 +320,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadServiceOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -412,7 +412,7 @@ public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -467,7 +467,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? reachabilityDebouncingEnabled = null, int? reachabilityDebouncingWindow = null, bool? webhooksFromRestEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateServiceOptions(pathSid){ WebhookUrl = webhookUrl, FriendlyName = friendlyName, ReachabilityWebhooksEnabled = reachabilityWebhooksEnabled, AclEnabled = aclEnabled, ReachabilityDebouncingEnabled = reachabilityDebouncingEnabled, ReachabilityDebouncingWindow = reachabilityDebouncingWindow, WebhooksFromRestEnabled = webhooksFromRestEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityResource.cs index 0939d6a36..a263b7a22 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityResource.cs @@ -68,7 +68,7 @@ public static ActivityResource Create(CreateActivityOptions options, ITwilioRest /// Create Activity parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Activity - public static async System.Threading.Tasks.Task CreateAsync(CreateActivityOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateActivityOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string pathWorkspaceSid, string friendlyName, bool? available = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateActivityOptions(pathWorkspaceSid, friendlyName){ Available = available }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static bool Delete(DeleteActivityOptions options, ITwilioRestClient clien /// Task that resolves to A single instance of Activity public static async System.Threading.Tasks.Task DeleteAsync(DeleteActivityOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -176,7 +176,7 @@ public static bool Delete(string pathWorkspaceSid, string pathSid, ITwilioRestCl /// The SID of the Activity resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Activity - public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteActivityOptions(pathWorkspaceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -218,7 +218,7 @@ public static ActivityResource Fetch(FetchActivityOptions options, ITwilioRestCl /// Fetch Activity parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Activity - public static async System.Threading.Tasks.Task FetchAsync(FetchActivityOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchActivityOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static ActivityResource Fetch( /// The SID of the Activity resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Activity - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchActivityOptions(pathWorkspaceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadActivityOptions options, IT /// Read Activity parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Activity - public static async System.Threading.Tasks.Task> ReadAsync(ReadActivityOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadActivityOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -329,7 +329,7 @@ public static async System.Threading.Tasks.Task> R string available = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadActivityOptions(pathWorkspaceSid){ FriendlyName = friendlyName, Available = available, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -423,7 +423,7 @@ public static ActivityResource Update(UpdateActivityOptions options, ITwilioRest #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateActivityOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -458,7 +458,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathWorkspaceSid, string pathSid, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateActivityOptions(pathWorkspaceSid, pathSid){ FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/EventResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/EventResource.cs index b0f3f4910..249aa0bec 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/EventResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/EventResource.cs @@ -69,7 +69,7 @@ public static EventResource Fetch(FetchEventOptions options, ITwilioRestClient c /// Fetch Event parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Event - public static async System.Threading.Tasks.Task FetchAsync(FetchEventOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchEventOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static EventResource Fetch( /// The SID of the Event resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Event - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchEventOptions(pathWorkspaceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -136,7 +136,7 @@ public static ResourceSet Read(ReadEventOptions options, ITwilioR /// Read Event parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Event - public static async System.Threading.Tasks.Task> ReadAsync(ReadEventOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEventOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -216,7 +216,7 @@ public static async System.Threading.Tasks.Task> Read string sid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadEventOptions(pathWorkspaceSid){ EndDate = endDate, EventType = eventType, Minutes = minutes, ReservationSid = reservationSid, StartDate = startDate, TaskQueueSid = taskQueueSid, TaskSid = taskSid, WorkerSid = workerSid, WorkflowSid = workflowSid, TaskChannel = taskChannel, Sid = sid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationResource.cs index dc4a016de..59dc85307 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationResource.cs @@ -134,7 +134,7 @@ public static ReservationResource Fetch(FetchReservationOptions options, ITwilio /// Fetch Reservation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Reservation - public static async System.Threading.Tasks.Task FetchAsync(FetchReservationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchReservationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -164,7 +164,7 @@ public static ReservationResource Fetch( /// The SID of the TaskReservation resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Reservation - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathTaskSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathTaskSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchReservationOptions(pathWorkspaceSid, pathTaskSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -206,7 +206,7 @@ public static ResourceSet Read(ReadReservationOptions optio /// Read Reservation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Reservation - public static async System.Threading.Tasks.Task> ReadAsync(ReadReservationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadReservationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -254,7 +254,7 @@ public static async System.Threading.Tasks.Task string workerSid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadReservationOptions(pathWorkspaceSid, pathTaskSid){ ReservationStatus = reservationStatus, WorkerSid = workerSid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -350,7 +350,7 @@ public static ReservationResource Update(UpdateReservationOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateReservationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -605,7 +605,7 @@ public static async System.Threading.Tasks.Task UpdateAsync bool? beepOnCustomerEntrance = null, string jitterBufferSize = null, string ifMatch = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateReservationOptions(pathWorkspaceSid, pathTaskSid, pathSid){ ReservationStatus = reservationStatus, WorkerActivitySid = workerActivitySid, Instruction = instruction, DequeuePostWorkActivitySid = dequeuePostWorkActivitySid, DequeueFrom = dequeueFrom, DequeueRecord = dequeueRecord, DequeueTimeout = dequeueTimeout, DequeueTo = dequeueTo, DequeueStatusCallbackUrl = dequeueStatusCallbackUrl, CallFrom = callFrom, CallRecord = callRecord, CallTimeout = callTimeout, CallTo = callTo, CallUrl = callUrl, CallStatusCallbackUrl = callStatusCallbackUrl, CallAccept = callAccept, RedirectCallSid = redirectCallSid, RedirectAccept = redirectAccept, RedirectUrl = redirectUrl, To = to, From = from, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, Region = region, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, DequeueStatusCallbackEvent = dequeueStatusCallbackEvent, PostWorkActivitySid = postWorkActivitySid, SupervisorMode = supervisorMode, Supervisor = supervisor, EndConferenceOnCustomerExit = endConferenceOnCustomerExit, BeepOnCustomerEntrance = beepOnCustomerEntrance, JitterBufferSize = jitterBufferSize, IfMatch = ifMatch }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelResource.cs index 3b6a8a7c0..b6eec5f82 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelResource.cs @@ -68,7 +68,7 @@ public static TaskChannelResource Create(CreateTaskChannelOptions options, ITwil /// Create TaskChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskChannel - public static async System.Threading.Tasks.Task CreateAsync(CreateTaskChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTaskChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -107,7 +107,7 @@ public static async System.Threading.Tasks.Task CreateAsync string friendlyName, string uniqueName, bool? channelOptimizedRouting = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTaskChannelOptions(pathWorkspaceSid, friendlyName, uniqueName){ ChannelOptimizedRouting = channelOptimizedRouting }; return await CreateAsync(options, client, cancellationToken); @@ -155,7 +155,7 @@ public static bool Delete(DeleteTaskChannelOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of TaskChannel public static async System.Threading.Tasks.Task DeleteAsync(DeleteTaskChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -180,7 +180,7 @@ public static bool Delete(string pathWorkspaceSid, string pathSid, ITwilioRestCl /// The SID of the Task Channel resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskChannel - public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteTaskChannelOptions(pathWorkspaceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -222,7 +222,7 @@ public static TaskChannelResource Fetch(FetchTaskChannelOptions options, ITwilio /// Fetch TaskChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskChannel - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTaskChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -249,7 +249,7 @@ public static TaskChannelResource Fetch( /// The SID of the Task Channel resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskChannel - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTaskChannelOptions(pathWorkspaceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -289,7 +289,7 @@ public static ResourceSet Read(ReadTaskChannelOptions optio /// Read TaskChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -325,7 +325,7 @@ public static async System.Threading.Tasks.Task string pathWorkspaceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadTaskChannelOptions(pathWorkspaceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -419,7 +419,7 @@ public static TaskChannelResource Update(UpdateTaskChannelOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateTaskChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -458,7 +458,7 @@ public static async System.Threading.Tasks.Task UpdateAsync string pathSid, string friendlyName = null, bool? channelOptimizedRouting = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateTaskChannelOptions(pathWorkspaceSid, pathSid){ FriendlyName = friendlyName, ChannelOptimizedRouting = channelOptimizedRouting }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsResource.cs index b482781dd..42c86fa0c 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsResource.cs @@ -69,7 +69,7 @@ public static TaskQueueBulkRealTimeStatisticsResource Create(CreateTaskQueueBulk /// Create TaskQueueBulkRealTimeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueueBulkRealTimeStatistics - public static async System.Threading.Tasks.Task CreateAsync(CreateTaskQueueBulkRealTimeStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTaskQueueBulkRealTimeStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static TaskQueueBulkRealTimeStatisticsResource Create( /// Task that resolves to A single instance of TaskQueueBulkRealTimeStatistics public static async System.Threading.Tasks.Task CreateAsync( string pathWorkspaceSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTaskQueueBulkRealTimeStatisticsOptions(pathWorkspaceSid){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsResource.cs index aaf44f11d..bbfe6144a 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsResource.cs @@ -69,7 +69,7 @@ public static TaskQueueCumulativeStatisticsResource Fetch(FetchTaskQueueCumulati /// Fetch TaskQueueCumulativeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueueCumulativeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueCumulativeStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueCumulativeStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -111,7 +111,7 @@ public static TaskQueueCumulativeStatisticsResource Fetch( /// A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. TaskRouter will calculate statistics on up to 10,000 Tasks/Reservations for any given threshold. /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueueCumulativeStatistics - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathTaskQueueSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathTaskQueueSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTaskQueueCumulativeStatisticsOptions(pathWorkspaceSid, pathTaskQueueSid){ EndDate = endDate,Minutes = minutes,StartDate = startDate,TaskChannel = taskChannel,SplitByWaitTime = splitByWaitTime }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsResource.cs index 6cfc912b5..25ec78301 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsResource.cs @@ -69,7 +69,7 @@ public static TaskQueueRealTimeStatisticsResource Fetch(FetchTaskQueueRealTimeSt /// Fetch TaskQueueRealTimeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueueRealTimeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueRealTimeStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueRealTimeStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static TaskQueueRealTimeStatisticsResource Fetch( /// The TaskChannel for which to fetch statistics. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueueRealTimeStatistics - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathTaskQueueSid, string taskChannel = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathTaskQueueSid, string taskChannel = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTaskQueueRealTimeStatisticsOptions(pathWorkspaceSid, pathTaskQueueSid){ TaskChannel = taskChannel }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsResource.cs index f6ae4166c..2a2112317 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsResource.cs @@ -69,7 +69,7 @@ public static TaskQueueStatisticsResource Fetch(FetchTaskQueueStatisticsOptions /// Fetch TaskQueueStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueueStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -111,7 +111,7 @@ public static TaskQueueStatisticsResource Fetch( /// A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueueStatistics - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathTaskQueueSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathTaskQueueSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTaskQueueStatisticsOptions(pathWorkspaceSid, pathTaskQueueSid){ EndDate = endDate,Minutes = minutes,StartDate = startDate,TaskChannel = taskChannel,SplitByWaitTime = splitByWaitTime }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsResource.cs index 9a5c7fff2..40ca801bc 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsResource.cs @@ -67,7 +67,7 @@ public static ResourceSet Read(ReadTaskQueuesStati /// Read TaskQueuesStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueuesStatistics - public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskQueuesStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskQueuesStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -127,7 +127,7 @@ public static async System.Threading.Tasks.Task Create TaskQueue parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueue - public static async System.Threading.Tasks.Task CreateAsync(CreateTaskQueueOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTaskQueueOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -132,7 +132,7 @@ public static async System.Threading.Tasks.Task CreateAsync( TaskQueueResource.TaskOrderEnum taskOrder = null, string reservationActivitySid = null, string assignmentActivitySid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTaskQueueOptions(pathWorkspaceSid, friendlyName){ TargetWorkers = targetWorkers, MaxReservedWorkers = maxReservedWorkers, TaskOrder = taskOrder, ReservationActivitySid = reservationActivitySid, AssignmentActivitySid = assignmentActivitySid }; return await CreateAsync(options, client, cancellationToken); @@ -180,7 +180,7 @@ public static bool Delete(DeleteTaskQueueOptions options, ITwilioRestClient clie /// Task that resolves to A single instance of TaskQueue public static async System.Threading.Tasks.Task DeleteAsync(DeleteTaskQueueOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -205,7 +205,7 @@ public static bool Delete(string pathWorkspaceSid, string pathSid, ITwilioRestCl /// The SID of the TaskQueue resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueue - public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteTaskQueueOptions(pathWorkspaceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -247,7 +247,7 @@ public static TaskQueueResource Fetch(FetchTaskQueueOptions options, ITwilioRest /// Fetch TaskQueue parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueue - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTaskQueueOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -274,7 +274,7 @@ public static TaskQueueResource Fetch( /// The SID of the TaskQueue resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueue - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTaskQueueOptions(pathWorkspaceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -314,7 +314,7 @@ public static ResourceSet Read(ReadTaskQueueOptions options, /// Read TaskQueue parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TaskQueue - public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskQueueOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskQueueOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -366,7 +366,7 @@ public static async System.Threading.Tasks.Task> string ordering = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadTaskQueueOptions(pathWorkspaceSid){ FriendlyName = friendlyName, EvaluateWorkerAttributes = evaluateWorkerAttributes, WorkerSid = workerSid, Ordering = ordering, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -460,7 +460,7 @@ public static TaskQueueResource Update(UpdateTaskQueueOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateTaskQueueOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -515,7 +515,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string assignmentActivitySid = null, int? maxReservedWorkers = null, TaskQueueResource.TaskOrderEnum taskOrder = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateTaskQueueOptions(pathWorkspaceSid, pathSid){ FriendlyName = friendlyName, TargetWorkers = targetWorkers, ReservationActivitySid = reservationActivitySid, AssignmentActivitySid = assignmentActivitySid, MaxReservedWorkers = maxReservedWorkers, TaskOrder = taskOrder }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskResource.cs index d20ab2193..cc1f9ae2f 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskResource.cs @@ -85,7 +85,7 @@ public static TaskResource Create(CreateTaskOptions options, ITwilioRestClient c /// Create Task parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task CreateAsync(CreateTaskOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTaskOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -148,7 +148,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string routingTarget = null, string ignoreCapacity = null, string taskQueueSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTaskOptions(pathWorkspaceSid){ Timeout = timeout, Priority = priority, TaskChannel = taskChannel, WorkflowSid = workflowSid, Attributes = attributes, VirtualStartTime = virtualStartTime, RoutingTarget = routingTarget, IgnoreCapacity = ignoreCapacity, TaskQueueSid = taskQueueSid }; return await CreateAsync(options, client, cancellationToken); @@ -196,7 +196,7 @@ public static bool Delete(DeleteTaskOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Task public static async System.Threading.Tasks.Task DeleteAsync(DeleteTaskOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -223,7 +223,7 @@ public static bool Delete(string pathWorkspaceSid, string pathSid, string ifMatc /// If provided, deletes this Task if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). /// Client to make requests to Twilio /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, string ifMatch = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, string ifMatch = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteTaskOptions(pathWorkspaceSid, pathSid) { IfMatch = ifMatch }; return await DeleteAsync(options, client, cancellationToken); @@ -265,7 +265,7 @@ public static TaskResource Fetch(FetchTaskOptions options, ITwilioRestClient cli /// Fetch Task parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTaskOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -292,7 +292,7 @@ public static TaskResource Fetch( /// The SID of the Task resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTaskOptions(pathWorkspaceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -332,7 +332,7 @@ public static ResourceSet Read(ReadTaskOptions options, ITwilioRes /// Read Task parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -408,7 +408,7 @@ public static async System.Threading.Tasks.Task> ReadA bool? hasAddons = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadTaskOptions(pathWorkspaceSid){ Priority = priority, AssignmentStatus = assignmentStatus, WorkflowSid = workflowSid, WorkflowName = workflowName, TaskQueueSid = taskQueueSid, TaskQueueName = taskQueueName, EvaluateTaskAttributes = evaluateTaskAttributes, RoutingTarget = routingTarget, Ordering = ordering, HasAddons = hasAddons, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -502,7 +502,7 @@ public static TaskResource Update(UpdateTaskOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateTaskOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -561,7 +561,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string taskChannel = null, DateTime? virtualStartTime = null, string ifMatch = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateTaskOptions(pathWorkspaceSid, pathSid){ Attributes = attributes, AssignmentStatus = assignmentStatus, Reason = reason, Priority = priority, TaskChannel = taskChannel, VirtualStartTime = virtualStartTime, IfMatch = ifMatch }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationResource.cs index 00c2290b6..45dda1d92 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationResource.cs @@ -121,7 +121,7 @@ public static ReservationResource Fetch(FetchReservationOptions options, ITwilio /// Fetch Reservation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Reservation - public static async System.Threading.Tasks.Task FetchAsync(FetchReservationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchReservationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -151,7 +151,7 @@ public static ReservationResource Fetch( /// The SID of the WorkerReservation resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Reservation - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkerSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkerSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchReservationOptions(pathWorkspaceSid, pathWorkerSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -193,7 +193,7 @@ public static ResourceSet Read(ReadReservationOptions optio /// Read Reservation parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Reservation - public static async System.Threading.Tasks.Task> ReadAsync(ReadReservationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadReservationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -237,7 +237,7 @@ public static async System.Threading.Tasks.Task ReservationResource.StatusEnum reservationStatus = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadReservationOptions(pathWorkspaceSid, pathWorkerSid){ ReservationStatus = reservationStatus, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -333,7 +333,7 @@ public static ReservationResource Update(UpdateReservationOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateReservationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -580,7 +580,7 @@ public static async System.Threading.Tasks.Task UpdateAsync bool? beepOnCustomerEntrance = null, string jitterBufferSize = null, string ifMatch = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateReservationOptions(pathWorkspaceSid, pathWorkerSid, pathSid){ ReservationStatus = reservationStatus, WorkerActivitySid = workerActivitySid, Instruction = instruction, DequeuePostWorkActivitySid = dequeuePostWorkActivitySid, DequeueFrom = dequeueFrom, DequeueRecord = dequeueRecord, DequeueTimeout = dequeueTimeout, DequeueTo = dequeueTo, DequeueStatusCallbackUrl = dequeueStatusCallbackUrl, CallFrom = callFrom, CallRecord = callRecord, CallTimeout = callTimeout, CallTo = callTo, CallUrl = callUrl, CallStatusCallbackUrl = callStatusCallbackUrl, CallAccept = callAccept, RedirectCallSid = redirectCallSid, RedirectAccept = redirectAccept, RedirectUrl = redirectUrl, To = to, From = from, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, Region = region, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, DequeueStatusCallbackEvent = dequeueStatusCallbackEvent, PostWorkActivitySid = postWorkActivitySid, EndConferenceOnCustomerExit = endConferenceOnCustomerExit, BeepOnCustomerEntrance = beepOnCustomerEntrance, JitterBufferSize = jitterBufferSize, IfMatch = ifMatch }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelResource.cs index 41fa7ae7c..357475376 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelResource.cs @@ -71,7 +71,7 @@ public static WorkerChannelResource Fetch(FetchWorkerChannelOptions options, ITw /// Fetch WorkerChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkerChannel - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkerChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkerChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static WorkerChannelResource Fetch( /// The SID of the WorkerChannel to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkerChannel - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkerSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkerSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWorkerChannelOptions(pathWorkspaceSid, pathWorkerSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -143,7 +143,7 @@ public static ResourceSet Read(ReadWorkerChannelOptions o /// Read WorkerChannel parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkerChannel - public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkerChannelOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkerChannelOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -183,7 +183,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateWorkerChannelOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -322,7 +322,7 @@ public static async System.Threading.Tasks.Task UpdateAsy string pathSid, int? capacity = null, bool? available = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateWorkerChannelOptions(pathWorkspaceSid, pathWorkerSid, pathSid){ Capacity = capacity, Available = available }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsResource.cs index b0744c560..6282f78b7 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsResource.cs @@ -69,7 +69,7 @@ public static WorkerStatisticsResource Fetch(FetchWorkerStatisticsOptions option /// Fetch WorkerStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkerStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkerStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkerStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -108,7 +108,7 @@ public static WorkerStatisticsResource Fetch( /// Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkerStatistics - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkerSid, int? minutes = null, DateTime? startDate = null, DateTime? endDate = null, string taskChannel = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkerSid, int? minutes = null, DateTime? startDate = null, DateTime? endDate = null, string taskChannel = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWorkerStatisticsOptions(pathWorkspaceSid, pathWorkerSid){ Minutes = minutes,StartDate = startDate,EndDate = endDate,TaskChannel = taskChannel }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsResource.cs index d30bcfd92..77b1608b5 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsResource.cs @@ -67,7 +67,7 @@ public static WorkersCumulativeStatisticsResource Fetch(FetchWorkersCumulativeSt /// Fetch WorkersCumulativeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkersCumulativeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkersCumulativeStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkersCumulativeStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static WorkersCumulativeStatisticsResource Fetch( /// Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkersCumulativeStatistics - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWorkersCumulativeStatisticsOptions(pathWorkspaceSid){ EndDate = endDate,Minutes = minutes,StartDate = startDate,TaskChannel = taskChannel }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsResource.cs index 7f3aa7ebf..f4f119ebc 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsResource.cs @@ -67,7 +67,7 @@ public static WorkersRealTimeStatisticsResource Fetch(FetchWorkersRealTimeStatis /// Fetch WorkersRealTimeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkersRealTimeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkersRealTimeStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkersRealTimeStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -94,7 +94,7 @@ public static WorkersRealTimeStatisticsResource Fetch( /// Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkersRealTimeStatistics - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string taskChannel = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string taskChannel = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWorkersRealTimeStatisticsOptions(pathWorkspaceSid){ TaskChannel = taskChannel }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsResource.cs index 070a115cc..f28e0d991 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsResource.cs @@ -67,7 +67,7 @@ public static WorkersStatisticsResource Fetch(FetchWorkersStatisticsOptions opti /// Fetch WorkersStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkersStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkersStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkersStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -112,7 +112,7 @@ public static WorkersStatisticsResource Fetch( /// Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkersStatistics - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, int? minutes = null, DateTime? startDate = null, DateTime? endDate = null, string taskQueueSid = null, string taskQueueName = null, string friendlyName = null, string taskChannel = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, int? minutes = null, DateTime? startDate = null, DateTime? endDate = null, string taskQueueSid = null, string taskQueueName = null, string friendlyName = null, string taskChannel = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWorkersStatisticsOptions(pathWorkspaceSid){ Minutes = minutes,StartDate = startDate,EndDate = endDate,TaskQueueSid = taskQueueSid,TaskQueueName = taskQueueName,FriendlyName = friendlyName,TaskChannel = taskChannel }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerResource.cs index 50cf06fe0..0ace6c483 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerResource.cs @@ -68,7 +68,7 @@ public static WorkerResource Create(CreateWorkerOptions options, ITwilioRestClie /// Create Worker parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Worker - public static async System.Threading.Tasks.Task CreateAsync(CreateWorkerOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateWorkerOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -107,7 +107,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, string activitySid = null, string attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateWorkerOptions(pathWorkspaceSid, friendlyName){ ActivitySid = activitySid, Attributes = attributes }; return await CreateAsync(options, client, cancellationToken); @@ -155,7 +155,7 @@ public static bool Delete(DeleteWorkerOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Worker public static async System.Threading.Tasks.Task DeleteAsync(DeleteWorkerOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -182,7 +182,7 @@ public static bool Delete(string pathWorkspaceSid, string pathSid, string ifMatc /// The If-Match HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Worker - public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, string ifMatch = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, string ifMatch = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteWorkerOptions(pathWorkspaceSid, pathSid) { IfMatch = ifMatch }; return await DeleteAsync(options, client, cancellationToken); @@ -224,7 +224,7 @@ public static WorkerResource Fetch(FetchWorkerOptions options, ITwilioRestClient /// Fetch Worker parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Worker - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkerOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkerOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -251,7 +251,7 @@ public static WorkerResource Fetch( /// The SID of the Worker resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Worker - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWorkerOptions(pathWorkspaceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -291,7 +291,7 @@ public static ResourceSet Read(ReadWorkerOptions options, ITwili /// Read Worker parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Worker - public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkerOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkerOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -359,7 +359,7 @@ public static async System.Threading.Tasks.Task> Rea string ordering = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadWorkerOptions(pathWorkspaceSid){ ActivityName = activityName, ActivitySid = activitySid, Available = available, FriendlyName = friendlyName, TargetWorkersExpression = targetWorkersExpression, TaskQueueName = taskQueueName, TaskQueueSid = taskQueueSid, Ordering = ordering, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -453,7 +453,7 @@ public static WorkerResource Update(UpdateWorkerOptions options, ITwilioRestClie #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateWorkerOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -504,7 +504,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string friendlyName = null, bool? rejectPendingReservations = null, string ifMatch = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateWorkerOptions(pathWorkspaceSid, pathSid){ ActivitySid = activitySid, Attributes = attributes, FriendlyName = friendlyName, RejectPendingReservations = rejectPendingReservations, IfMatch = ifMatch }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsResource.cs index 4199eec1c..61fad95ff 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsResource.cs @@ -69,7 +69,7 @@ public static WorkflowCumulativeStatisticsResource Fetch(FetchWorkflowCumulative /// Fetch WorkflowCumulativeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkflowCumulativeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowCumulativeStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowCumulativeStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -111,7 +111,7 @@ public static WorkflowCumulativeStatisticsResource Fetch( /// A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkflowCumulativeStatistics - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkflowSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkflowSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWorkflowCumulativeStatisticsOptions(pathWorkspaceSid, pathWorkflowSid){ EndDate = endDate,Minutes = minutes,StartDate = startDate,TaskChannel = taskChannel,SplitByWaitTime = splitByWaitTime }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsResource.cs index 7acff04ba..ba9cdae97 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsResource.cs @@ -69,7 +69,7 @@ public static WorkflowRealTimeStatisticsResource Fetch(FetchWorkflowRealTimeStat /// Fetch WorkflowRealTimeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkflowRealTimeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowRealTimeStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowRealTimeStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static WorkflowRealTimeStatisticsResource Fetch( /// Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkflowRealTimeStatistics - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkflowSid, string taskChannel = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkflowSid, string taskChannel = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWorkflowRealTimeStatisticsOptions(pathWorkspaceSid, pathWorkflowSid){ TaskChannel = taskChannel }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsResource.cs index 124c18759..18b5bda83 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsResource.cs @@ -69,7 +69,7 @@ public static WorkflowStatisticsResource Fetch(FetchWorkflowStatisticsOptions op /// Fetch WorkflowStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkflowStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -111,7 +111,7 @@ public static WorkflowStatisticsResource Fetch( /// A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkflowStatistics - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkflowSid, int? minutes = null, DateTime? startDate = null, DateTime? endDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathWorkflowSid, int? minutes = null, DateTime? startDate = null, DateTime? endDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWorkflowStatisticsOptions(pathWorkspaceSid, pathWorkflowSid){ Minutes = minutes,StartDate = startDate,EndDate = endDate,TaskChannel = taskChannel,SplitByWaitTime = splitByWaitTime }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowResource.cs index 00d2775fd..b62735f7f 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowResource.cs @@ -68,7 +68,7 @@ public static WorkflowResource Create(CreateWorkflowOptions options, ITwilioRest /// Create Workflow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Workflow - public static async System.Threading.Tasks.Task CreateAsync(CreateWorkflowOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateWorkflowOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -115,7 +115,7 @@ public static async System.Threading.Tasks.Task CreateAsync( Uri assignmentCallbackUrl = null, Uri fallbackAssignmentCallbackUrl = null, int? taskReservationTimeout = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateWorkflowOptions(pathWorkspaceSid, friendlyName, configuration){ AssignmentCallbackUrl = assignmentCallbackUrl, FallbackAssignmentCallbackUrl = fallbackAssignmentCallbackUrl, TaskReservationTimeout = taskReservationTimeout }; return await CreateAsync(options, client, cancellationToken); @@ -163,7 +163,7 @@ public static bool Delete(DeleteWorkflowOptions options, ITwilioRestClient clien /// Task that resolves to A single instance of Workflow public static async System.Threading.Tasks.Task DeleteAsync(DeleteWorkflowOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -188,7 +188,7 @@ public static bool Delete(string pathWorkspaceSid, string pathSid, ITwilioRestCl /// The SID of the Workflow resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Workflow - public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteWorkflowOptions(pathWorkspaceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ public static WorkflowResource Fetch(FetchWorkflowOptions options, ITwilioRestCl /// Fetch Workflow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Workflow - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkflowOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -257,7 +257,7 @@ public static WorkflowResource Fetch( /// The SID of the Workflow resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Workflow - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWorkflowOptions(pathWorkspaceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -297,7 +297,7 @@ public static ResourceSet Read(ReadWorkflowOptions options, IT /// Read Workflow parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Workflow - public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkflowOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkflowOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -337,7 +337,7 @@ public static async System.Threading.Tasks.Task> R string friendlyName = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadWorkflowOptions(pathWorkspaceSid){ FriendlyName = friendlyName, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -431,7 +431,7 @@ public static WorkflowResource Update(UpdateWorkflowOptions options, ITwilioRest #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateWorkflowOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -486,7 +486,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string configuration = null, int? taskReservationTimeout = null, string reEvaluateTasks = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateWorkflowOptions(pathWorkspaceSid, pathSid){ FriendlyName = friendlyName, AssignmentCallbackUrl = assignmentCallbackUrl, FallbackAssignmentCallbackUrl = fallbackAssignmentCallbackUrl, Configuration = configuration, TaskReservationTimeout = taskReservationTimeout, ReEvaluateTasks = reEvaluateTasks }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsResource.cs index 5efd1d418..deffc7839 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsResource.cs @@ -67,7 +67,7 @@ public static WorkspaceCumulativeStatisticsResource Fetch(FetchWorkspaceCumulati /// Fetch WorkspaceCumulativeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkspaceCumulativeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceCumulativeStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceCumulativeStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -106,7 +106,7 @@ public static WorkspaceCumulativeStatisticsResource Fetch( /// A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkspaceCumulativeStatistics - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, DateTime? endDate = null, int? minutes = null, DateTime? startDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWorkspaceCumulativeStatisticsOptions(pathWorkspaceSid){ EndDate = endDate,Minutes = minutes,StartDate = startDate,TaskChannel = taskChannel,SplitByWaitTime = splitByWaitTime }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsResource.cs index fc8a24e8a..c0ed4a08e 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsResource.cs @@ -67,7 +67,7 @@ public static WorkspaceRealTimeStatisticsResource Fetch(FetchWorkspaceRealTimeSt /// Fetch WorkspaceRealTimeStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkspaceRealTimeStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceRealTimeStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceRealTimeStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -94,7 +94,7 @@ public static WorkspaceRealTimeStatisticsResource Fetch( /// Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkspaceRealTimeStatistics - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string taskChannel = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, string taskChannel = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWorkspaceRealTimeStatisticsOptions(pathWorkspaceSid){ TaskChannel = taskChannel }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsResource.cs index 12f456d92..c7569db75 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsResource.cs @@ -67,7 +67,7 @@ public static WorkspaceStatisticsResource Fetch(FetchWorkspaceStatisticsOptions /// Fetch WorkspaceStatistics parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkspaceStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceStatisticsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceStatisticsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -106,7 +106,7 @@ public static WorkspaceStatisticsResource Fetch( /// A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. /// Client to make requests to Twilio /// Task that resolves to A single instance of WorkspaceStatistics - public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, int? minutes = null, DateTime? startDate = null, DateTime? endDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathWorkspaceSid, int? minutes = null, DateTime? startDate = null, DateTime? endDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWorkspaceStatisticsOptions(pathWorkspaceSid){ Minutes = minutes,StartDate = startDate,EndDate = endDate,TaskChannel = taskChannel,SplitByWaitTime = splitByWaitTime }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Taskrouter/V1/WorkspaceResource.cs b/src/Twilio/Rest/Taskrouter/V1/WorkspaceResource.cs index 0452c6ef9..0529124b5 100644 --- a/src/Twilio/Rest/Taskrouter/V1/WorkspaceResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/WorkspaceResource.cs @@ -79,7 +79,7 @@ public static WorkspaceResource Create(CreateWorkspaceOptions options, ITwilioRe /// Create Workspace parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Workspace - public static async System.Threading.Tasks.Task CreateAsync(CreateWorkspaceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateWorkspaceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -126,7 +126,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? multiTaskEnabled = null, string template = null, WorkspaceResource.QueueOrderEnum prioritizeQueueOrder = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateWorkspaceOptions(friendlyName){ EventCallbackUrl = eventCallbackUrl, EventsFilter = eventsFilter, MultiTaskEnabled = multiTaskEnabled, Template = template, PrioritizeQueueOrder = prioritizeQueueOrder }; return await CreateAsync(options, client, cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(DeleteWorkspaceOptions options, ITwilioRestClient clie /// Task that resolves to A single instance of Workspace public static async System.Threading.Tasks.Task DeleteAsync(DeleteWorkspaceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -195,7 +195,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Workspace resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Workspace - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteWorkspaceOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -235,7 +235,7 @@ public static WorkspaceResource Fetch(FetchWorkspaceOptions options, ITwilioRest /// Fetch Workspace parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Workspace - public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWorkspaceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -259,7 +259,7 @@ public static WorkspaceResource Fetch( /// The SID of the Workspace resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Workspace - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWorkspaceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -297,7 +297,7 @@ public static ResourceSet Read(ReadWorkspaceOptions options, /// Read Workspace parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Workspace - public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkspaceOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWorkspaceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -333,7 +333,7 @@ public static async System.Threading.Tasks.Task> string friendlyName = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadWorkspaceOptions(){ FriendlyName = friendlyName, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -425,7 +425,7 @@ public static WorkspaceResource Update(UpdateWorkspaceOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateWorkspaceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -480,7 +480,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? multiTaskEnabled = null, string timeoutActivitySid = null, WorkspaceResource.QueueOrderEnum prioritizeQueueOrder = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateWorkspaceOptions(pathSid){ DefaultActivitySid = defaultActivitySid, EventCallbackUrl = eventCallbackUrl, EventsFilter = eventsFilter, FriendlyName = friendlyName, MultiTaskEnabled = multiTaskEnabled, TimeoutActivitySid = timeoutActivitySid, PrioritizeQueueOrder = prioritizeQueueOrder }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListResource.cs b/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListResource.cs index 83ea3522a..5862c3198 100644 --- a/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListResource.cs +++ b/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListResource.cs @@ -68,7 +68,7 @@ public static CredentialListResource Create(CreateCredentialListOptions options, /// Create CredentialList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList - public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCredentialListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static CredentialListResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathTrunkSid, string credentialListSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCredentialListOptions(pathTrunkSid, credentialListSid){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteCredentialListOptions options, ITwilioRestClient /// Task that resolves to A single instance of CredentialList public static async System.Threading.Tasks.Task DeleteAsync(DeleteCredentialListOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathTrunkSid, string pathSid, ITwilioRestClient /// The unique string that we created to identify the CredentialList resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList - public static async System.Threading.Tasks.Task DeleteAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCredentialListOptions(pathTrunkSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static CredentialListResource Fetch(FetchCredentialListOptions options, I /// Fetch CredentialList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList - public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCredentialListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static CredentialListResource Fetch( /// The unique string that we created to identify the CredentialList resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList - public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCredentialListOptions(pathTrunkSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadCredentialListOptions /// Read CredentialList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CredentialList - public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCredentialListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task Create IpAccessControlList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task CreateAsync(CreateIpAccessControlListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateIpAccessControlListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static IpAccessControlListResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathTrunkSid, string ipAccessControlListSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateIpAccessControlListOptions(pathTrunkSid, ipAccessControlListSid){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteIpAccessControlListOptions options, ITwilioRestC /// Task that resolves to A single instance of IpAccessControlList public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpAccessControlListOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathTrunkSid, string pathSid, ITwilioRestClient /// The unique string that we created to identify the IpAccessControlList resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task DeleteAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteIpAccessControlListOptions(pathTrunkSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static IpAccessControlListResource Fetch(FetchIpAccessControlListOptions /// Fetch IpAccessControlList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task FetchAsync(FetchIpAccessControlListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchIpAccessControlListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static IpAccessControlListResource Fetch( /// The unique string that we created to identify the IpAccessControlList resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchIpAccessControlListOptions(pathTrunkSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadIpAccessControlL /// Read IpAccessControlList parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpAccessControlList - public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAccessControlListOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadIpAccessControlListOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task Create OriginationUrl parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OriginationUrl - public static async System.Threading.Tasks.Task CreateAsync(CreateOriginationUrlOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateOriginationUrlOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -115,7 +115,7 @@ public static async System.Threading.Tasks.Task CreateAs bool? enabled, string friendlyName, Uri sipUrl, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateOriginationUrlOptions(pathTrunkSid, weight, priority, enabled, friendlyName, sipUrl){ }; return await CreateAsync(options, client, cancellationToken); @@ -163,7 +163,7 @@ public static bool Delete(DeleteOriginationUrlOptions options, ITwilioRestClient /// Task that resolves to A single instance of OriginationUrl public static async System.Threading.Tasks.Task DeleteAsync(DeleteOriginationUrlOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -188,7 +188,7 @@ public static bool Delete(string pathTrunkSid, string pathSid, ITwilioRestClient /// The unique string that we created to identify the OriginationUrl resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of OriginationUrl - public static async System.Threading.Tasks.Task DeleteAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteOriginationUrlOptions(pathTrunkSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ public static OriginationUrlResource Fetch(FetchOriginationUrlOptions options, I /// Fetch OriginationUrl parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OriginationUrl - public static async System.Threading.Tasks.Task FetchAsync(FetchOriginationUrlOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchOriginationUrlOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -257,7 +257,7 @@ public static OriginationUrlResource Fetch( /// The unique string that we created to identify the OriginationUrl resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of OriginationUrl - public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchOriginationUrlOptions(pathTrunkSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -297,7 +297,7 @@ public static ResourceSet Read(ReadOriginationUrlOptions /// Read OriginationUrl parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of OriginationUrl - public static async System.Threading.Tasks.Task> ReadAsync(ReadOriginationUrlOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadOriginationUrlOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -333,7 +333,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateOriginationUrlOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -478,7 +478,7 @@ public static async System.Threading.Tasks.Task UpdateAs bool? enabled = null, string friendlyName = null, Uri sipUrl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateOriginationUrlOptions(pathTrunkSid, pathSid){ Weight = weight, Priority = priority, Enabled = enabled, FriendlyName = friendlyName, SipUrl = sipUrl }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberResource.cs b/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberResource.cs index 8112908b7..4991a5faf 100644 --- a/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberResource.cs +++ b/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberResource.cs @@ -83,7 +83,7 @@ public static PhoneNumberResource Create(CreatePhoneNumberOptions options, ITwil /// Create PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task CreateAsync(CreatePhoneNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreatePhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -114,7 +114,7 @@ public static PhoneNumberResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathTrunkSid, string phoneNumberSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreatePhoneNumberOptions(pathTrunkSid, phoneNumberSid){ }; return await CreateAsync(options, client, cancellationToken); @@ -162,7 +162,7 @@ public static bool Delete(DeletePhoneNumberOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of PhoneNumber public static async System.Threading.Tasks.Task DeleteAsync(DeletePhoneNumberOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -187,7 +187,7 @@ public static bool Delete(string pathTrunkSid, string pathSid, ITwilioRestClient /// The unique string that we created to identify the PhoneNumber resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task DeleteAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeletePhoneNumberOptions(pathTrunkSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -229,7 +229,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -256,7 +256,7 @@ public static PhoneNumberResource Fetch( /// The unique string that we created to identify the PhoneNumber resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPhoneNumberOptions(pathTrunkSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -296,7 +296,7 @@ public static ResourceSet Read(ReadPhoneNumberOptions optio /// Read PhoneNumber parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PhoneNumber - public static async System.Threading.Tasks.Task> ReadAsync(ReadPhoneNumberOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPhoneNumberOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -332,7 +332,7 @@ public static async System.Threading.Tasks.Task string pathTrunkSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadPhoneNumberOptions(pathTrunkSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Trunking/V1/Trunk/RecordingResource.cs b/src/Twilio/Rest/Trunking/V1/Trunk/RecordingResource.cs index ebb2333ce..54f954acc 100644 --- a/src/Twilio/Rest/Trunking/V1/Trunk/RecordingResource.cs +++ b/src/Twilio/Rest/Trunking/V1/Trunk/RecordingResource.cs @@ -96,7 +96,7 @@ public static RecordingResource Fetch(FetchRecordingOptions options, ITwilioRest /// Fetch Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -120,7 +120,7 @@ public static RecordingResource Fetch( /// The SID of the Trunk from which to fetch the recording settings. /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathTrunkSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRecordingOptions(pathTrunkSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -163,7 +163,7 @@ public static RecordingResource Update(UpdateRecordingOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRecordingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -198,7 +198,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathTrunkSid, RecordingResource.RecordingModeEnum mode = null, RecordingResource.RecordingTrimEnum trim = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRecordingOptions(pathTrunkSid){ Mode = mode, Trim = trim }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Trunking/V1/TrunkResource.cs b/src/Twilio/Rest/Trunking/V1/TrunkResource.cs index 8708186c9..ac8e2c7d2 100644 --- a/src/Twilio/Rest/Trunking/V1/TrunkResource.cs +++ b/src/Twilio/Rest/Trunking/V1/TrunkResource.cs @@ -93,7 +93,7 @@ public static TrunkResource Create(CreateTrunkOptions options, ITwilioRestClient /// Create Trunk parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Trunk - public static async System.Threading.Tasks.Task CreateAsync(CreateTrunkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTrunkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -148,7 +148,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? secure = null, bool? cnamLookupEnabled = null, TrunkResource.TransferCallerIdEnum transferCallerId = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTrunkOptions(){ FriendlyName = friendlyName, DomainName = domainName, DisasterRecoveryUrl = disasterRecoveryUrl, DisasterRecoveryMethod = disasterRecoveryMethod, TransferMode = transferMode, Secure = secure, CnamLookupEnabled = cnamLookupEnabled, TransferCallerId = transferCallerId }; return await CreateAsync(options, client, cancellationToken); @@ -194,7 +194,7 @@ public static bool Delete(DeleteTrunkOptions options, ITwilioRestClient client = /// Task that resolves to A single instance of Trunk public static async System.Threading.Tasks.Task DeleteAsync(DeleteTrunkOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -217,7 +217,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string that we created to identify the Trunk resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Trunk - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteTrunkOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -257,7 +257,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTrunkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -281,7 +281,7 @@ public static TrunkResource Fetch( /// The unique string that we created to identify the Trunk resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Trunk - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTrunkOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -319,7 +319,7 @@ public static ResourceSet Read(ReadTrunkOptions options, ITwilioR /// Read Trunk parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Trunk - public static async System.Threading.Tasks.Task> ReadAsync(ReadTrunkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTrunkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -351,7 +351,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadTrunkOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -443,7 +443,7 @@ public static TrunkResource Update(UpdateTrunkOptions options, ITwilioRestClient #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateTrunkOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -502,7 +502,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? secure = null, bool? cnamLookupEnabled = null, TrunkResource.TransferCallerIdEnum transferCallerId = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateTrunkOptions(pathSid){ FriendlyName = friendlyName, DomainName = domainName, DisasterRecoveryUrl = disasterRecoveryUrl, DisasterRecoveryMethod = disasterRecoveryMethod, TransferMode = transferMode, Secure = secure, CnamLookupEnabled = cnamLookupEnabled, TransferCallerId = transferCallerId }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesResource.cs b/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesResource.cs index 14aa30362..5045b687e 100644 --- a/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesResource.cs @@ -66,7 +66,7 @@ public static ComplianceInquiriesResource Create(CreateComplianceInquiriesOption /// Create ComplianceInquiries parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ComplianceInquiries - public static async System.Threading.Tasks.Task CreateAsync(CreateComplianceInquiriesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateComplianceInquiriesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static async System.Threading.Tasks.Task Cre string primaryProfileSid, string notificationEmail = null, string themeSetId = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateComplianceInquiriesOptions(primaryProfileSid){ NotificationEmail = notificationEmail, ThemeSetId = themeSetId }; return await CreateAsync(options, client, cancellationToken); @@ -144,7 +144,7 @@ public static ComplianceInquiriesResource Update(UpdateComplianceInquiriesOption #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateComplianceInquiriesOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -179,7 +179,7 @@ public static async System.Threading.Tasks.Task Upd string pathCustomerId, string primaryProfileSid, string themeSetId = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateComplianceInquiriesOptions(pathCustomerId, primaryProfileSid){ ThemeSetId = themeSetId }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs index 3fe83010e..3075aa2ce 100644 --- a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs @@ -120,7 +120,7 @@ public static ComplianceRegistrationInquiriesResource Create(CreateComplianceReg /// Create ComplianceRegistrationInquiries parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ComplianceRegistrationInquiries - public static async System.Threading.Tasks.Task CreateAsync(CreateComplianceRegistrationInquiriesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateComplianceRegistrationInquiriesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -299,7 +299,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateComplianceRegistrationInquiriesOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -377,7 +377,7 @@ public static async System.Threading.Tasks.Task Create ComplianceTollfreeInquiries parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ComplianceTollfreeInquiries - public static async System.Threading.Tasks.Task CreateAsync(CreateComplianceTollfreeInquiriesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateComplianceTollfreeInquiriesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -196,7 +196,7 @@ public static async System.Threading.Tasks.Task Create CustomerProfilesChannelEndpointAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesChannelEndpointAssignment - public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesChannelEndpointAssignmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesChannelEndpointAssignmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task Task that resolves to A single instance of CustomerProfilesChannelEndpointAssignment public static async System.Threading.Tasks.Task DeleteAsync(DeleteCustomerProfilesChannelEndpointAssignmentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -176,7 +176,7 @@ public static bool Delete(string pathCustomerProfileSid, string pathSid, ITwilio /// The unique string that we created to identify the resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesChannelEndpointAssignment - public static async System.Threading.Tasks.Task DeleteAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCustomerProfilesChannelEndpointAssignmentOptions(pathCustomerProfileSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -218,7 +218,7 @@ public static CustomerProfilesChannelEndpointAssignmentResource Fetch(FetchCusto /// Fetch CustomerProfilesChannelEndpointAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesChannelEndpointAssignment - public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesChannelEndpointAssignmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesChannelEndpointAssignmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static CustomerProfilesChannelEndpointAssignmentResource Fetch( /// The unique string that we created to identify the resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesChannelEndpointAssignment - public static async System.Threading.Tasks.Task FetchAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCustomerProfilesChannelEndpointAssignmentOptions(pathCustomerProfileSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Rea /// Read CustomerProfilesChannelEndpointAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesChannelEndpointAssignment - public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesChannelEndpointAssignmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesChannelEndpointAssignmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -329,7 +329,7 @@ public static async System.Threading.Tasks.Task Create CustomerProfilesEntityAssignments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEntityAssignments - public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesEntityAssignmentsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesEntityAssignmentsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static CustomerProfilesEntityAssignmentsResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathCustomerProfileSid, string objectSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCustomerProfilesEntityAssignmentsOptions(pathCustomerProfileSid, objectSid){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteCustomerProfilesEntityAssignmentsOptions options /// Task that resolves to A single instance of CustomerProfilesEntityAssignments public static async System.Threading.Tasks.Task DeleteAsync(DeleteCustomerProfilesEntityAssignmentsOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathCustomerProfileSid, string pathSid, ITwilio /// The unique string that we created to identify the Identity resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEntityAssignments - public static async System.Threading.Tasks.Task DeleteAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCustomerProfilesEntityAssignmentsOptions(pathCustomerProfileSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static CustomerProfilesEntityAssignmentsResource Fetch(FetchCustomerProfi /// Fetch CustomerProfilesEntityAssignments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEntityAssignments - public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesEntityAssignmentsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesEntityAssignmentsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static CustomerProfilesEntityAssignmentsResource Fetch( /// The unique string that we created to identify the Identity resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEntityAssignments - public static async System.Threading.Tasks.Task FetchAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCustomerProfilesEntityAssignmentsOptions(pathCustomerProfileSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadCu /// Read CustomerProfilesEntityAssignments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEntityAssignments - public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesEntityAssignmentsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesEntityAssignmentsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static async System.Threading.Tasks.Task Create CustomerProfilesEvaluations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEvaluations - public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesEvaluationsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesEvaluationsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -112,7 +112,7 @@ public static CustomerProfilesEvaluationsResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathCustomerProfileSid, string policySid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCustomerProfilesEvaluationsOptions(pathCustomerProfileSid, policySid){ }; return await CreateAsync(options, client, cancellationToken); @@ -154,7 +154,7 @@ public static CustomerProfilesEvaluationsResource Fetch(FetchCustomerProfilesEva /// Fetch CustomerProfilesEvaluations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEvaluations - public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesEvaluationsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesEvaluationsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -181,7 +181,7 @@ public static CustomerProfilesEvaluationsResource Fetch( /// The unique string that identifies the Evaluation resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEvaluations - public static async System.Threading.Tasks.Task FetchAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathCustomerProfileSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCustomerProfilesEvaluationsOptions(pathCustomerProfileSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -221,7 +221,7 @@ public static ResourceSet Read(ReadCustomer /// Read CustomerProfilesEvaluations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfilesEvaluations - public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesEvaluationsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesEvaluationsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -257,7 +257,7 @@ public static async System.Threading.Tasks.Task Create CustomerProfiles parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfiles - public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCustomerProfilesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -121,7 +121,7 @@ public static async System.Threading.Tasks.Task Create string email, string policySid, Uri statusCallback = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCustomerProfilesOptions(friendlyName, email, policySid){ StatusCallback = statusCallback }; return await CreateAsync(options, client, cancellationToken); @@ -167,7 +167,7 @@ public static bool Delete(DeleteCustomerProfilesOptions options, ITwilioRestClie /// Task that resolves to A single instance of CustomerProfiles public static async System.Threading.Tasks.Task DeleteAsync(DeleteCustomerProfilesOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -190,7 +190,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string that we created to identify the Customer-Profile resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfiles - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCustomerProfilesOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ public static CustomerProfilesResource Fetch(FetchCustomerProfilesOptions option /// Fetch CustomerProfiles parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfiles - public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCustomerProfilesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -254,7 +254,7 @@ public static CustomerProfilesResource Fetch( /// The unique string that we created to identify the Customer-Profile resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfiles - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCustomerProfilesOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -292,7 +292,7 @@ public static ResourceSet Read(ReadCustomerProfilesOpt /// Read CustomerProfiles parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CustomerProfiles - public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCustomerProfilesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -336,7 +336,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateCustomerProfilesOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -471,7 +471,7 @@ public static async System.Threading.Tasks.Task Update Uri statusCallback = null, string friendlyName = null, string email = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateCustomerProfilesOptions(pathSid){ Status = status, StatusCallback = statusCallback, FriendlyName = friendlyName, Email = email }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Trusthub/V1/EndUserResource.cs b/src/Twilio/Rest/Trusthub/V1/EndUserResource.cs index c862c5fa7..d0cc7ded2 100644 --- a/src/Twilio/Rest/Trusthub/V1/EndUserResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/EndUserResource.cs @@ -66,7 +66,7 @@ public static EndUserResource Create(CreateEndUserOptions options, ITwilioRestCl /// Create EndUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task CreateAsync(CreateEndUserOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateEndUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string friendlyName, string type, object attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateEndUserOptions(friendlyName, type){ Attributes = attributes }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteEndUserOptions options, ITwilioRestClient client /// Task that resolves to A single instance of EndUser public static async System.Threading.Tasks.Task DeleteAsync(DeleteEndUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -170,7 +170,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string created by Twilio to identify the End User resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteEndUserOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -210,7 +210,7 @@ public static EndUserResource Fetch(FetchEndUserOptions options, ITwilioRestClie /// Fetch EndUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -234,7 +234,7 @@ public static EndUserResource Fetch( /// The unique string created by Twilio to identify the End User resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchEndUserOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -272,7 +272,7 @@ public static ResourceSet Read(ReadEndUserOptions options, ITwi /// Read EndUser parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUser - public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -304,7 +304,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadEndUserOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -396,7 +396,7 @@ public static EndUserResource Update(UpdateEndUserOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateEndUserOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -431,7 +431,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string friendlyName = null, object attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateEndUserOptions(pathSid){ FriendlyName = friendlyName, Attributes = attributes }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Trusthub/V1/EndUserTypeResource.cs b/src/Twilio/Rest/Trusthub/V1/EndUserTypeResource.cs index 454ed95f5..f6d21dab7 100644 --- a/src/Twilio/Rest/Trusthub/V1/EndUserTypeResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/EndUserTypeResource.cs @@ -67,7 +67,7 @@ public static EndUserTypeResource Fetch(FetchEndUserTypeOptions options, ITwilio /// Fetch EndUserType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUserType - public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserTypeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchEndUserTypeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static EndUserTypeResource Fetch( /// The unique string that identifies the End-User Type resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUserType - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchEndUserTypeOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadEndUserTypeOptions optio /// Read EndUserType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of EndUserType - public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserTypeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEndUserTypeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadEndUserTypeOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Trusthub/V1/PoliciesResource.cs b/src/Twilio/Rest/Trusthub/V1/PoliciesResource.cs index 2c179bce0..66df80848 100644 --- a/src/Twilio/Rest/Trusthub/V1/PoliciesResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/PoliciesResource.cs @@ -67,7 +67,7 @@ public static PoliciesResource Fetch(FetchPoliciesOptions options, ITwilioRestCl /// Fetch Policies parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Policies - public static async System.Threading.Tasks.Task FetchAsync(FetchPoliciesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPoliciesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static PoliciesResource Fetch( /// The unique string that identifies the Policy resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of Policies - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPoliciesOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadPoliciesOptions options, IT /// Read Policies parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Policies - public static async System.Threading.Tasks.Task> ReadAsync(ReadPoliciesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPoliciesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadPoliciesOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Trusthub/V1/SupportingDocumentResource.cs b/src/Twilio/Rest/Trusthub/V1/SupportingDocumentResource.cs index 3d8bce383..882695e1d 100644 --- a/src/Twilio/Rest/Trusthub/V1/SupportingDocumentResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/SupportingDocumentResource.cs @@ -83,7 +83,7 @@ public static SupportingDocumentResource Create(CreateSupportingDocumentOptions /// Create SupportingDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task CreateAsync(CreateSupportingDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSupportingDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -118,7 +118,7 @@ public static async System.Threading.Tasks.Task Crea string friendlyName, string type, object attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSupportingDocumentOptions(friendlyName, type){ Attributes = attributes }; return await CreateAsync(options, client, cancellationToken); @@ -164,7 +164,7 @@ public static bool Delete(DeleteSupportingDocumentOptions options, ITwilioRestCl /// Task that resolves to A single instance of SupportingDocument public static async System.Threading.Tasks.Task DeleteAsync(DeleteSupportingDocumentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -187,7 +187,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string created by Twilio to identify the Supporting Document resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSupportingDocumentOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -227,7 +227,7 @@ public static SupportingDocumentResource Fetch(FetchSupportingDocumentOptions op /// Fetch SupportingDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -251,7 +251,7 @@ public static SupportingDocumentResource Fetch( /// The unique string created by Twilio to identify the Supporting Document resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSupportingDocumentOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -289,7 +289,7 @@ public static ResourceSet Read(ReadSupportingDocumen /// Read SupportingDocument parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocument - public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSupportingDocumentOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -413,7 +413,7 @@ public static SupportingDocumentResource Update(UpdateSupportingDocumentOptions #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSupportingDocumentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -448,7 +448,7 @@ public static async System.Threading.Tasks.Task Upda string pathSid, string friendlyName = null, object attributes = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSupportingDocumentOptions(pathSid){ FriendlyName = friendlyName, Attributes = attributes }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeResource.cs b/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeResource.cs index a06620688..450ad00e7 100644 --- a/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeResource.cs @@ -67,7 +67,7 @@ public static SupportingDocumentTypeResource Fetch(FetchSupportingDocumentTypeOp /// Fetch SupportingDocumentType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocumentType - public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentTypeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSupportingDocumentTypeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static SupportingDocumentTypeResource Fetch( /// The unique string that identifies the Supporting Document Type resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocumentType - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSupportingDocumentTypeOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadSupportingDoc /// Read SupportingDocumentType parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SupportingDocumentType - public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentTypeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSupportingDocumentTypeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -161,7 +161,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSupportingDocumentTypeOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentResource.cs b/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentResource.cs index 27fa7ca24..22ea52e53 100644 --- a/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentResource.cs @@ -68,7 +68,7 @@ public static TrustProductsChannelEndpointAssignmentResource Create(CreateTrustP /// Create TrustProductsChannelEndpointAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsChannelEndpointAssignment - public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsChannelEndpointAssignmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsChannelEndpointAssignmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task Task that resolves to A single instance of TrustProductsChannelEndpointAssignment public static async System.Threading.Tasks.Task DeleteAsync(DeleteTrustProductsChannelEndpointAssignmentOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -176,7 +176,7 @@ public static bool Delete(string pathTrustProductSid, string pathSid, ITwilioRes /// The unique string that we created to identify the resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsChannelEndpointAssignment - public static async System.Threading.Tasks.Task DeleteAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteTrustProductsChannelEndpointAssignmentOptions(pathTrustProductSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -218,7 +218,7 @@ public static TrustProductsChannelEndpointAssignmentResource Fetch(FetchTrustPro /// Fetch TrustProductsChannelEndpointAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsChannelEndpointAssignment - public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsChannelEndpointAssignmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsChannelEndpointAssignmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static TrustProductsChannelEndpointAssignmentResource Fetch( /// The unique string that we created to identify the resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsChannelEndpointAssignment - public static async System.Threading.Tasks.Task FetchAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTrustProductsChannelEndpointAssignmentOptions(pathTrustProductSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(R /// Read TrustProductsChannelEndpointAssignment parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsChannelEndpointAssignment - public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsChannelEndpointAssignmentOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsChannelEndpointAssignmentOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -329,7 +329,7 @@ public static async System.Threading.Tasks.Task Create TrustProductsEntityAssignments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEntityAssignments - public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsEntityAssignmentsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsEntityAssignmentsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static TrustProductsEntityAssignmentsResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathTrustProductSid, string objectSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTrustProductsEntityAssignmentsOptions(pathTrustProductSid, objectSid){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteTrustProductsEntityAssignmentsOptions options, I /// Task that resolves to A single instance of TrustProductsEntityAssignments public static async System.Threading.Tasks.Task DeleteAsync(DeleteTrustProductsEntityAssignmentsOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathTrustProductSid, string pathSid, ITwilioRes /// The unique string that we created to identify the Identity resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEntityAssignments - public static async System.Threading.Tasks.Task DeleteAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteTrustProductsEntityAssignmentsOptions(pathTrustProductSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static TrustProductsEntityAssignmentsResource Fetch(FetchTrustProductsEnt /// Fetch TrustProductsEntityAssignments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEntityAssignments - public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsEntityAssignmentsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsEntityAssignmentsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static TrustProductsEntityAssignmentsResource Fetch( /// The unique string that we created to identify the Identity resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEntityAssignments - public static async System.Threading.Tasks.Task FetchAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTrustProductsEntityAssignmentsOptions(pathTrustProductSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadTrust /// Read TrustProductsEntityAssignments parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEntityAssignments - public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsEntityAssignmentsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsEntityAssignmentsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static async System.Threading.Tasks.Task Create TrustProductsEvaluations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEvaluations - public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsEvaluationsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsEvaluationsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -112,7 +112,7 @@ public static TrustProductsEvaluationsResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathTrustProductSid, string policySid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTrustProductsEvaluationsOptions(pathTrustProductSid, policySid){ }; return await CreateAsync(options, client, cancellationToken); @@ -154,7 +154,7 @@ public static TrustProductsEvaluationsResource Fetch(FetchTrustProductsEvaluatio /// Fetch TrustProductsEvaluations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEvaluations - public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsEvaluationsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsEvaluationsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -181,7 +181,7 @@ public static TrustProductsEvaluationsResource Fetch( /// The unique string that identifies the Evaluation resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEvaluations - public static async System.Threading.Tasks.Task FetchAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathTrustProductSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTrustProductsEvaluationsOptions(pathTrustProductSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -221,7 +221,7 @@ public static ResourceSet Read(ReadTrustProduc /// Read TrustProductsEvaluations parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProductsEvaluations - public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsEvaluationsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsEvaluationsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -257,7 +257,7 @@ public static async System.Threading.Tasks.Task Create TrustProducts parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProducts - public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateTrustProductsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -121,7 +121,7 @@ public static async System.Threading.Tasks.Task CreateAsy string email, string policySid, Uri statusCallback = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateTrustProductsOptions(friendlyName, email, policySid){ StatusCallback = statusCallback }; return await CreateAsync(options, client, cancellationToken); @@ -167,7 +167,7 @@ public static bool Delete(DeleteTrustProductsOptions options, ITwilioRestClient /// Task that resolves to A single instance of TrustProducts public static async System.Threading.Tasks.Task DeleteAsync(DeleteTrustProductsOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -190,7 +190,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string that we created to identify the Trust Product resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProducts - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteTrustProductsOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ public static TrustProductsResource Fetch(FetchTrustProductsOptions options, ITw /// Fetch TrustProducts parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProducts - public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchTrustProductsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -254,7 +254,7 @@ public static TrustProductsResource Fetch( /// The unique string that we created to identify the Trust Product resource. /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProducts - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchTrustProductsOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -292,7 +292,7 @@ public static ResourceSet Read(ReadTrustProductsOptions o /// Read TrustProducts parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of TrustProducts - public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTrustProductsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -336,7 +336,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateTrustProductsOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -471,7 +471,7 @@ public static async System.Threading.Tasks.Task UpdateAsy Uri statusCallback = null, string friendlyName = null, string email = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateTrustProductsOptions(pathSid){ Status = status, StatusCallback = statusCallback, FriendlyName = friendlyName, Email = email }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/FormResource.cs b/src/Twilio/Rest/Verify/V2/FormResource.cs index 273bf3a8c..fb3f5634d 100644 --- a/src/Twilio/Rest/Verify/V2/FormResource.cs +++ b/src/Twilio/Rest/Verify/V2/FormResource.cs @@ -79,7 +79,7 @@ public static FormResource Fetch(FetchFormOptions options, ITwilioRestClient cli /// Fetch Form parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Form - public static async System.Threading.Tasks.Task FetchAsync(FetchFormOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchFormOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static FormResource Fetch( /// The Type of this Form. Currently only `form-push` is supported. /// Client to make requests to Twilio /// Task that resolves to A single instance of Form - public static async System.Threading.Tasks.Task FetchAsync(FormResource.FormTypesEnum pathFormType, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(FormResource.FormTypesEnum pathFormType, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchFormOptions(pathFormType){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/SafelistResource.cs b/src/Twilio/Rest/Verify/V2/SafelistResource.cs index 1146a0788..7b034d04c 100644 --- a/src/Twilio/Rest/Verify/V2/SafelistResource.cs +++ b/src/Twilio/Rest/Verify/V2/SafelistResource.cs @@ -66,7 +66,7 @@ public static SafelistResource Create(CreateSafelistOptions options, ITwilioRest /// Create Safelist parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task CreateAsync(CreateSafelistOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSafelistOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -93,7 +93,7 @@ public static SafelistResource Create( /// Task that resolves to A single instance of Safelist public static async System.Threading.Tasks.Task CreateAsync( string phoneNumber, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSafelistOptions(phoneNumber){ }; return await CreateAsync(options, client, cancellationToken); @@ -139,7 +139,7 @@ public static bool Delete(DeleteSafelistOptions options, ITwilioRestClient clien /// Task that resolves to A single instance of Safelist public static async System.Threading.Tasks.Task DeleteAsync(DeleteSafelistOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -162,7 +162,7 @@ public static bool Delete(string pathPhoneNumber, ITwilioRestClient client = nul /// The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task DeleteAsync(string pathPhoneNumber, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathPhoneNumber, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSafelistOptions(pathPhoneNumber) ; return await DeleteAsync(options, client, cancellationToken); @@ -202,7 +202,7 @@ public static SafelistResource Fetch(FetchSafelistOptions options, ITwilioRestCl /// Fetch Safelist parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task FetchAsync(FetchSafelistOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSafelistOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -226,7 +226,7 @@ public static SafelistResource Fetch( /// The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). /// Client to make requests to Twilio /// Task that resolves to A single instance of Safelist - public static async System.Threading.Tasks.Task FetchAsync(string pathPhoneNumber, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathPhoneNumber, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSafelistOptions(pathPhoneNumber){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/Service/AccessTokenResource.cs b/src/Twilio/Rest/Verify/V2/Service/AccessTokenResource.cs index 019f32c54..e90becbc5 100644 --- a/src/Twilio/Rest/Verify/V2/Service/AccessTokenResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/AccessTokenResource.cs @@ -80,7 +80,7 @@ public static AccessTokenResource Create(CreateAccessTokenOptions options, ITwil /// Create AccessToken parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccessToken - public static async System.Threading.Tasks.Task CreateAsync(CreateAccessTokenOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateAccessTokenOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -123,7 +123,7 @@ public static async System.Threading.Tasks.Task CreateAsync AccessTokenResource.FactorTypesEnum factorType, string factorFriendlyName = null, int? ttl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateAccessTokenOptions(pathServiceSid, identity, factorType){ FactorFriendlyName = factorFriendlyName, Ttl = ttl }; return await CreateAsync(options, client, cancellationToken); @@ -165,7 +165,7 @@ public static AccessTokenResource Fetch(FetchAccessTokenOptions options, ITwilio /// Fetch AccessToken parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of AccessToken - public static async System.Threading.Tasks.Task FetchAsync(FetchAccessTokenOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchAccessTokenOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -192,7 +192,7 @@ public static AccessTokenResource Fetch( /// A 34 character string that uniquely identifies this Access Token. /// Client to make requests to Twilio /// Task that resolves to A single instance of AccessToken - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchAccessTokenOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationResource.cs b/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationResource.cs index 4ad566aa3..a2c7e6062 100644 --- a/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationResource.cs @@ -72,7 +72,7 @@ public static NotificationResource Create(CreateNotificationOptions options, ITw /// Create Notification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Notification - public static async System.Threading.Tasks.Task CreateAsync(CreateNotificationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateNotificationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -111,7 +111,7 @@ public static async System.Threading.Tasks.Task CreateAsyn string pathIdentity, string pathChallengeSid, int? ttl = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateNotificationOptions(pathServiceSid, pathIdentity, pathChallengeSid){ Ttl = ttl }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeResource.cs b/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeResource.cs index bf56b2fb5..7e440bb22 100644 --- a/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeResource.cs @@ -124,7 +124,7 @@ public static ChallengeResource Create(CreateChallengeOptions options, ITwilioRe /// Create Challenge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Challenge - public static async System.Threading.Tasks.Task CreateAsync(CreateChallengeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateChallengeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -179,7 +179,7 @@ public static async System.Threading.Tasks.Task CreateAsync( List detailsFields = null, object hiddenDetails = null, string authPayload = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateChallengeOptions(pathServiceSid, pathIdentity, factorSid){ ExpirationDate = expirationDate, DetailsMessage = detailsMessage, DetailsFields = detailsFields, HiddenDetails = hiddenDetails, AuthPayload = authPayload }; return await CreateAsync(options, client, cancellationToken); @@ -223,7 +223,7 @@ public static ChallengeResource Fetch(FetchChallengeOptions options, ITwilioRest /// Fetch Challenge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Challenge - public static async System.Threading.Tasks.Task FetchAsync(FetchChallengeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchChallengeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -253,7 +253,7 @@ public static ChallengeResource Fetch( /// A 34 character string that uniquely identifies this Challenge. /// Client to make requests to Twilio /// Task that resolves to A single instance of Challenge - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathIdentity, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathIdentity, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchChallengeOptions(pathServiceSid, pathIdentity, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -295,7 +295,7 @@ public static ResourceSet Read(ReadChallengeOptions options, /// Read Challenge parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Challenge - public static async System.Threading.Tasks.Task> ReadAsync(ReadChallengeOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadChallengeOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -347,7 +347,7 @@ public static async System.Threading.Tasks.Task> ChallengeResource.ListOrdersEnum order = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadChallengeOptions(pathServiceSid, pathIdentity){ FactorSid = factorSid, Status = status, Order = order, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -443,7 +443,7 @@ public static ChallengeResource Update(UpdateChallengeOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateChallengeOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -486,7 +486,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string authPayload = null, object metadata = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateChallengeOptions(pathServiceSid, pathIdentity, pathSid){ AuthPayload = authPayload, Metadata = metadata }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/Service/Entity/FactorResource.cs b/src/Twilio/Rest/Verify/V2/Service/Entity/FactorResource.cs index 1f4348304..4bcd36d5d 100644 --- a/src/Twilio/Rest/Verify/V2/Service/Entity/FactorResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/Entity/FactorResource.cs @@ -116,7 +116,7 @@ public static bool Delete(DeleteFactorOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Factor public static async System.Threading.Tasks.Task DeleteAsync(DeleteFactorOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -143,7 +143,7 @@ public static bool Delete(string pathServiceSid, string pathIdentity, string pat /// A 34 character string that uniquely identifies this Factor. /// Client to make requests to Twilio /// Task that resolves to A single instance of Factor - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathIdentity, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathIdentity, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteFactorOptions(pathServiceSid, pathIdentity, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -187,7 +187,7 @@ public static FactorResource Fetch(FetchFactorOptions options, ITwilioRestClient /// Fetch Factor parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Factor - public static async System.Threading.Tasks.Task FetchAsync(FetchFactorOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchFactorOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -217,7 +217,7 @@ public static FactorResource Fetch( /// A 34 character string that uniquely identifies this Factor. /// Client to make requests to Twilio /// Task that resolves to A single instance of Factor - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathIdentity, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathIdentity, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchFactorOptions(pathServiceSid, pathIdentity, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -259,7 +259,7 @@ public static ResourceSet Read(ReadFactorOptions options, ITwili /// Read Factor parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Factor - public static async System.Threading.Tasks.Task> ReadAsync(ReadFactorOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadFactorOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -299,7 +299,7 @@ public static async System.Threading.Tasks.Task> Rea string pathIdentity, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadFactorOptions(pathServiceSid, pathIdentity){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -395,7 +395,7 @@ public static FactorResource Update(UpdateFactorOptions options, ITwilioRestClie #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateFactorOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -466,7 +466,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( int? configCodeLength = null, FactorResource.TotpAlgorithmsEnum configAlg = null, string configNotificationPlatform = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateFactorOptions(pathServiceSid, pathIdentity, pathSid){ AuthPayload = authPayload, FriendlyName = friendlyName, ConfigNotificationToken = configNotificationToken, ConfigSdkVersion = configSdkVersion, ConfigTimeStep = configTimeStep, ConfigSkew = configSkew, ConfigCodeLength = configCodeLength, ConfigAlg = configAlg, ConfigNotificationPlatform = configNotificationPlatform }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorResource.cs b/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorResource.cs index 7e5e2feac..0b5f149b4 100644 --- a/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorResource.cs @@ -122,7 +122,7 @@ public static NewFactorResource Create(CreateNewFactorOptions options, ITwilioRe /// Create NewFactor parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of NewFactor - public static async System.Threading.Tasks.Task CreateAsync(CreateNewFactorOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateNewFactorOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -209,7 +209,7 @@ public static async System.Threading.Tasks.Task CreateAsync( int? configCodeLength = null, NewFactorResource.TotpAlgorithmsEnum configAlg = null, object metadata = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateNewFactorOptions(pathServiceSid, pathIdentity, friendlyName, factorType){ BindingAlg = bindingAlg, BindingPublicKey = bindingPublicKey, ConfigAppId = configAppId, ConfigNotificationPlatform = configNotificationPlatform, ConfigNotificationToken = configNotificationToken, ConfigSdkVersion = configSdkVersion, BindingSecret = bindingSecret, ConfigTimeStep = configTimeStep, ConfigSkew = configSkew, ConfigCodeLength = configCodeLength, ConfigAlg = configAlg, Metadata = metadata }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/Service/EntityResource.cs b/src/Twilio/Rest/Verify/V2/Service/EntityResource.cs index 04fd669f3..cd81e5042 100644 --- a/src/Twilio/Rest/Verify/V2/Service/EntityResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/EntityResource.cs @@ -68,7 +68,7 @@ public static EntityResource Create(CreateEntityOptions options, ITwilioRestClie /// Create Entity parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Entity - public static async System.Threading.Tasks.Task CreateAsync(CreateEntityOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateEntityOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -99,7 +99,7 @@ public static EntityResource Create( public static async System.Threading.Tasks.Task CreateAsync( string pathServiceSid, string identity, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateEntityOptions(pathServiceSid, identity){ }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteEntityOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Entity public static async System.Threading.Tasks.Task DeleteAsync(DeleteEntityOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static bool Delete(string pathServiceSid, string pathIdentity, ITwilioRes /// The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. /// Client to make requests to Twilio /// Task that resolves to A single instance of Entity - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathIdentity, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathIdentity, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteEntityOptions(pathServiceSid, pathIdentity) ; return await DeleteAsync(options, client, cancellationToken); @@ -214,7 +214,7 @@ public static EntityResource Fetch(FetchEntityOptions options, ITwilioRestClient /// Fetch Entity parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Entity - public static async System.Threading.Tasks.Task FetchAsync(FetchEntityOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchEntityOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static EntityResource Fetch( /// The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. /// Client to make requests to Twilio /// Task that resolves to A single instance of Entity - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathIdentity, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathIdentity, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchEntityOptions(pathServiceSid, pathIdentity){ }; return await FetchAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static ResourceSet Read(ReadEntityOptions options, ITwili /// Read Entity parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Entity - public static async System.Threading.Tasks.Task> ReadAsync(ReadEntityOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadEntityOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -317,7 +317,7 @@ public static async System.Threading.Tasks.Task> Rea string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadEntityOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationResource.cs b/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationResource.cs index 3a6dc330e..1ca28318d 100644 --- a/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationResource.cs @@ -68,7 +68,7 @@ public static MessagingConfigurationResource Create(CreateMessagingConfiguration /// Create MessagingConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MessagingConfiguration - public static async System.Threading.Tasks.Task CreateAsync(CreateMessagingConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateMessagingConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task string pathServiceSid, string country, string messagingServiceSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateMessagingConfigurationOptions(pathServiceSid, country, messagingServiceSid){ }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static bool Delete(DeleteMessagingConfigurationOptions options, ITwilioRe /// Task that resolves to A single instance of MessagingConfiguration public static async System.Threading.Tasks.Task DeleteAsync(DeleteMessagingConfigurationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -176,7 +176,7 @@ public static bool Delete(string pathServiceSid, string pathCountry, ITwilioRest /// The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`. /// Client to make requests to Twilio /// Task that resolves to A single instance of MessagingConfiguration - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathCountry, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathCountry, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteMessagingConfigurationOptions(pathServiceSid, pathCountry) ; return await DeleteAsync(options, client, cancellationToken); @@ -218,7 +218,7 @@ public static MessagingConfigurationResource Fetch(FetchMessagingConfigurationOp /// Fetch MessagingConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MessagingConfiguration - public static async System.Threading.Tasks.Task FetchAsync(FetchMessagingConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchMessagingConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static MessagingConfigurationResource Fetch( /// The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`. /// Client to make requests to Twilio /// Task that resolves to A single instance of MessagingConfiguration - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathCountry, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathCountry, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchMessagingConfigurationOptions(pathServiceSid, pathCountry){ }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadMessagingConf /// Read MessagingConfiguration parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of MessagingConfiguration - public static async System.Threading.Tasks.Task> ReadAsync(ReadMessagingConfigurationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadMessagingConfigurationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateMessagingConfigurationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -450,7 +450,7 @@ public static async System.Threading.Tasks.Task string pathServiceSid, string pathCountry, string messagingServiceSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateMessagingConfigurationOptions(pathServiceSid, pathCountry, messagingServiceSid){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketResource.cs b/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketResource.cs index d336d5443..da4e42bdd 100644 --- a/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketResource.cs @@ -70,7 +70,7 @@ public static BucketResource Create(CreateBucketOptions options, ITwilioRestClie /// Create Bucket parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Bucket - public static async System.Threading.Tasks.Task CreateAsync(CreateBucketOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateBucketOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string pathRateLimitSid, int? max, int? interval, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateBucketOptions(pathServiceSid, pathRateLimitSid, max, interval){ }; return await CreateAsync(options, client, cancellationToken); @@ -159,7 +159,7 @@ public static bool Delete(DeleteBucketOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Bucket public static async System.Threading.Tasks.Task DeleteAsync(DeleteBucketOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -186,7 +186,7 @@ public static bool Delete(string pathServiceSid, string pathRateLimitSid, string /// A 34 character string that uniquely identifies this Bucket. /// Client to make requests to Twilio /// Task that resolves to A single instance of Bucket - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathRateLimitSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathRateLimitSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteBucketOptions(pathServiceSid, pathRateLimitSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ public static BucketResource Fetch(FetchBucketOptions options, ITwilioRestClient /// Fetch Bucket parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Bucket - public static async System.Threading.Tasks.Task FetchAsync(FetchBucketOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchBucketOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -260,7 +260,7 @@ public static BucketResource Fetch( /// A 34 character string that uniquely identifies this Bucket. /// Client to make requests to Twilio /// Task that resolves to A single instance of Bucket - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathRateLimitSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathRateLimitSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchBucketOptions(pathServiceSid, pathRateLimitSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -302,7 +302,7 @@ public static ResourceSet Read(ReadBucketOptions options, ITwili /// Read Bucket parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Bucket - public static async System.Threading.Tasks.Task> ReadAsync(ReadBucketOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadBucketOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -342,7 +342,7 @@ public static async System.Threading.Tasks.Task> Rea string pathRateLimitSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadBucketOptions(pathServiceSid, pathRateLimitSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -438,7 +438,7 @@ public static BucketResource Update(UpdateBucketOptions options, ITwilioRestClie #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateBucketOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -481,7 +481,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, int? max = null, int? interval = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateBucketOptions(pathServiceSid, pathRateLimitSid, pathSid){ Max = max, Interval = interval }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/Service/RateLimitResource.cs b/src/Twilio/Rest/Verify/V2/Service/RateLimitResource.cs index 02e2fbb73..6ca9da771 100644 --- a/src/Twilio/Rest/Verify/V2/Service/RateLimitResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/RateLimitResource.cs @@ -68,7 +68,7 @@ public static RateLimitResource Create(CreateRateLimitOptions options, ITwilioRe /// Create RateLimit parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RateLimit - public static async System.Threading.Tasks.Task CreateAsync(CreateRateLimitOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateRateLimitOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string pathServiceSid, string uniqueName, string description = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateRateLimitOptions(pathServiceSid, uniqueName){ Description = description }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static bool Delete(DeleteRateLimitOptions options, ITwilioRestClient clie /// Task that resolves to A single instance of RateLimit public static async System.Threading.Tasks.Task DeleteAsync(DeleteRateLimitOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -176,7 +176,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The Twilio-provided string that uniquely identifies the Rate Limit resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of RateLimit - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRateLimitOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -218,7 +218,7 @@ public static RateLimitResource Fetch(FetchRateLimitOptions options, ITwilioRest /// Fetch RateLimit parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RateLimit - public static async System.Threading.Tasks.Task FetchAsync(FetchRateLimitOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRateLimitOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -245,7 +245,7 @@ public static RateLimitResource Fetch( /// The Twilio-provided string that uniquely identifies the Rate Limit resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of RateLimit - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRateLimitOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -285,7 +285,7 @@ public static ResourceSet Read(ReadRateLimitOptions options, /// Read RateLimit parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RateLimit - public static async System.Threading.Tasks.Task> ReadAsync(ReadRateLimitOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRateLimitOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -321,7 +321,7 @@ public static async System.Threading.Tasks.Task> string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRateLimitOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -415,7 +415,7 @@ public static RateLimitResource Update(UpdateRateLimitOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRateLimitOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -450,7 +450,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathServiceSid, string pathSid, string description = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRateLimitOptions(pathServiceSid, pathSid){ Description = description }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/Service/VerificationCheckResource.cs b/src/Twilio/Rest/Verify/V2/Service/VerificationCheckResource.cs index 8f22a0725..d24bfdaf7 100644 --- a/src/Twilio/Rest/Verify/V2/Service/VerificationCheckResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/VerificationCheckResource.cs @@ -84,7 +84,7 @@ public static VerificationCheckResource Create(CreateVerificationCheckOptions op /// Create VerificationCheck parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of VerificationCheck - public static async System.Threading.Tasks.Task CreateAsync(CreateVerificationCheckOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateVerificationCheckOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -135,7 +135,7 @@ public static async System.Threading.Tasks.Task Creat string amount = null, string payee = null, string snaClientToken = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateVerificationCheckOptions(pathServiceSid){ Code = code, To = to, VerificationSid = verificationSid, Amount = amount, Payee = payee, SnaClientToken = snaClientToken }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/Service/VerificationResource.cs b/src/Twilio/Rest/Verify/V2/Service/VerificationResource.cs index ab0ab8ed0..dd7ec1b6e 100644 --- a/src/Twilio/Rest/Verify/V2/Service/VerificationResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/VerificationResource.cs @@ -108,7 +108,7 @@ public static VerificationResource Create(CreateVerificationOptions options, ITw /// Create Verification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Verification - public static async System.Threading.Tasks.Task CreateAsync(CreateVerificationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateVerificationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -207,7 +207,7 @@ public static async System.Threading.Tasks.Task CreateAsyn bool? enableSnaClientToken = null, VerificationResource.RiskCheckEnum riskCheck = null, string tags = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateVerificationOptions(pathServiceSid, to, channel){ CustomFriendlyName = customFriendlyName, CustomMessage = customMessage, SendDigits = sendDigits, Locale = locale, CustomCode = customCode, Amount = amount, Payee = payee, RateLimits = rateLimits, ChannelConfiguration = channelConfiguration, AppHash = appHash, TemplateSid = templateSid, TemplateCustomSubstitutions = templateCustomSubstitutions, DeviceIp = deviceIp, EnableSnaClientToken = enableSnaClientToken, RiskCheck = riskCheck, Tags = tags }; return await CreateAsync(options, client, cancellationToken); @@ -249,7 +249,7 @@ public static VerificationResource Fetch(FetchVerificationOptions options, ITwil /// Fetch Verification parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Verification - public static async System.Threading.Tasks.Task FetchAsync(FetchVerificationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchVerificationOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -276,7 +276,7 @@ public static VerificationResource Fetch( /// The Twilio-provided string that uniquely identifies the Verification resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Verification - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchVerificationOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -321,7 +321,7 @@ public static VerificationResource Update(UpdateVerificationOptions options, ITw #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateVerificationOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -356,7 +356,7 @@ public static async System.Threading.Tasks.Task UpdateAsyn string pathServiceSid, string pathSid, VerificationResource.StatusEnum status, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateVerificationOptions(pathServiceSid, pathSid, status){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/Service/WebhookResource.cs b/src/Twilio/Rest/Verify/V2/Service/WebhookResource.cs index 2597acc24..971c5e8fe 100644 --- a/src/Twilio/Rest/Verify/V2/Service/WebhookResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/WebhookResource.cs @@ -107,7 +107,7 @@ public static WebhookResource Create(CreateWebhookOptions options, ITwilioRestCl /// Create Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -154,7 +154,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string webhookUrl, WebhookResource.StatusEnum status = null, WebhookResource.VersionEnum version = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateWebhookOptions(pathServiceSid, friendlyName, eventTypes, webhookUrl){ Status = status, Version = version }; return await CreateAsync(options, client, cancellationToken); @@ -202,7 +202,7 @@ public static bool Delete(DeleteWebhookOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Webhook public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebhookOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -227,7 +227,7 @@ public static bool Delete(string pathServiceSid, string pathSid, ITwilioRestClie /// The Twilio-provided string that uniquely identifies the Webhook resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteWebhookOptions(pathServiceSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -269,7 +269,7 @@ public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClie /// Fetch Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -296,7 +296,7 @@ public static WebhookResource Fetch( /// The Twilio-provided string that uniquely identifies the Webhook resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchWebhookOptions(pathServiceSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -336,7 +336,7 @@ public static ResourceSet Read(ReadWebhookOptions options, ITwi /// Read Webhook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -372,7 +372,7 @@ public static async System.Threading.Tasks.Task> Re string pathServiceSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadWebhookOptions(pathServiceSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -466,7 +466,7 @@ public static WebhookResource Update(UpdateWebhookOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -517,7 +517,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string webhookUrl = null, WebhookResource.StatusEnum status = null, WebhookResource.VersionEnum version = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateWebhookOptions(pathServiceSid, pathSid){ FriendlyName = friendlyName, EventTypes = eventTypes, WebhookUrl = webhookUrl, Status = status, Version = version }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/ServiceResource.cs b/src/Twilio/Rest/Verify/V2/ServiceResource.cs index e9aabd7f2..aa3cc5614 100644 --- a/src/Twilio/Rest/Verify/V2/ServiceResource.cs +++ b/src/Twilio/Rest/Verify/V2/ServiceResource.cs @@ -66,7 +66,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -169,7 +169,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string whatsappMsgServiceSid = null, string whatsappFrom = null, bool? verifyEventSubscriptionEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateServiceOptions(friendlyName){ CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled, DoNotShareWarningEnabled = doNotShareWarningEnabled, CustomCodeEnabled = customCodeEnabled, PushIncludeDate = pushIncludeDate, PushApnCredentialSid = pushApnCredentialSid, PushFcmCredentialSid = pushFcmCredentialSid, TotpIssuer = totpIssuer, TotpTimeStep = totpTimeStep, TotpCodeLength = totpCodeLength, TotpSkew = totpSkew, DefaultTemplateSid = defaultTemplateSid, WhatsappMsgServiceSid = whatsappMsgServiceSid, WhatsappFrom = whatsappFrom, VerifyEventSubscriptionEnabled = verifyEventSubscriptionEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -215,7 +215,7 @@ public static bool Delete(DeleteServiceOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task DeleteAsync(DeleteServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -238,7 +238,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the Verification 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteServiceOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -278,7 +278,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -302,7 +302,7 @@ public static ServiceResource Fetch( /// The Twilio-provided string that uniquely identifies the Verification 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchServiceOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -340,7 +340,7 @@ 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, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadServiceOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -372,7 +372,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadServiceOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -464,7 +464,7 @@ public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestCl #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -571,7 +571,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( string whatsappMsgServiceSid = null, string whatsappFrom = null, bool? verifyEventSubscriptionEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled, DoNotShareWarningEnabled = doNotShareWarningEnabled, CustomCodeEnabled = customCodeEnabled, PushIncludeDate = pushIncludeDate, PushApnCredentialSid = pushApnCredentialSid, PushFcmCredentialSid = pushFcmCredentialSid, TotpIssuer = totpIssuer, TotpTimeStep = totpTimeStep, TotpCodeLength = totpCodeLength, TotpSkew = totpSkew, DefaultTemplateSid = defaultTemplateSid, WhatsappMsgServiceSid = whatsappMsgServiceSid, WhatsappFrom = whatsappFrom, VerifyEventSubscriptionEnabled = verifyEventSubscriptionEnabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/TemplateResource.cs b/src/Twilio/Rest/Verify/V2/TemplateResource.cs index 9c9539e79..527b2bc41 100644 --- a/src/Twilio/Rest/Verify/V2/TemplateResource.cs +++ b/src/Twilio/Rest/Verify/V2/TemplateResource.cs @@ -65,7 +65,7 @@ public static ResourceSet Read(ReadTemplateOptions options, IT /// Read Template parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Template - public static async System.Threading.Tasks.Task> ReadAsync(ReadTemplateOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadTemplateOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static async System.Threading.Tasks.Task> R string friendlyName = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadTemplateOptions(){ FriendlyName = friendlyName, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Verify/V2/VerificationAttemptResource.cs b/src/Twilio/Rest/Verify/V2/VerificationAttemptResource.cs index 14e9fcd62..c49ff54b3 100644 --- a/src/Twilio/Rest/Verify/V2/VerificationAttemptResource.cs +++ b/src/Twilio/Rest/Verify/V2/VerificationAttemptResource.cs @@ -95,7 +95,7 @@ public static VerificationAttemptResource Fetch(FetchVerificationAttemptOptions /// Fetch VerificationAttempt parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of VerificationAttempt - public static async System.Threading.Tasks.Task FetchAsync(FetchVerificationAttemptOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchVerificationAttemptOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -119,7 +119,7 @@ public static VerificationAttemptResource Fetch( /// The unique SID identifier of a Verification Attempt /// Client to make requests to Twilio /// Task that resolves to A single instance of VerificationAttempt - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchVerificationAttemptOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -157,7 +157,7 @@ public static ResourceSet Read(ReadVerificationAtte /// Read VerificationAttempt parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of VerificationAttempt - public static async System.Threading.Tasks.Task> ReadAsync(ReadVerificationAttemptOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadVerificationAttemptOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -221,7 +221,7 @@ public static async System.Threading.Tasks.Task Fetch VerificationAttemptsSummary parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of VerificationAttemptsSummary - public static async System.Threading.Tasks.Task FetchAsync(FetchVerificationAttemptsSummaryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchVerificationAttemptsSummaryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -118,7 +118,7 @@ public static VerificationAttemptsSummaryResource Fetch( /// Filter the Verification Attempts considered on the summary aggregation by Destination prefix. It is the prefix of a phone number in E.164 format. /// Client to make requests to Twilio /// Task that resolves to A single instance of VerificationAttemptsSummary - public static async System.Threading.Tasks.Task FetchAsync(string verifyServiceSid = null, DateTime? dateCreatedAfter = null, DateTime? dateCreatedBefore = null, string country = null, VerificationAttemptsSummaryResource.ChannelsEnum channel = null, string destinationPrefix = null, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string verifyServiceSid = null, DateTime? dateCreatedAfter = null, DateTime? dateCreatedBefore = null, string country = null, VerificationAttemptsSummaryResource.ChannelsEnum channel = null, string destinationPrefix = null, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchVerificationAttemptsSummaryOptions(){ VerifyServiceSid = verifyServiceSid,DateCreatedAfter = dateCreatedAfter,DateCreatedBefore = dateCreatedBefore,Country = country,Channel = channel,DestinationPrefix = destinationPrefix }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Video/V1/CompositionHookResource.cs b/src/Twilio/Rest/Video/V1/CompositionHookResource.cs index db59b3b82..806e45962 100644 --- a/src/Twilio/Rest/Video/V1/CompositionHookResource.cs +++ b/src/Twilio/Rest/Video/V1/CompositionHookResource.cs @@ -79,7 +79,7 @@ public static CompositionHookResource Create(CreateCompositionHookOptions option /// Create CompositionHook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionHook - public static async System.Threading.Tasks.Task CreateAsync(CreateCompositionHookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCompositionHookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -142,7 +142,7 @@ public static async System.Threading.Tasks.Task CreateA Uri statusCallback = null, Twilio.Http.HttpMethod statusCallbackMethod = null, bool? trim = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCompositionHookOptions(friendlyName){ Enabled = enabled, VideoLayout = videoLayout, AudioSources = audioSources, AudioSourcesExcluded = audioSourcesExcluded, Resolution = resolution, Format = format, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, Trim = trim }; return await CreateAsync(options, client, cancellationToken); @@ -188,7 +188,7 @@ public static bool Delete(DeleteCompositionHookOptions options, ITwilioRestClien /// Task that resolves to A single instance of CompositionHook public static async System.Threading.Tasks.Task DeleteAsync(DeleteCompositionHookOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -211,7 +211,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the CompositionHook resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionHook - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCompositionHookOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -251,7 +251,7 @@ public static CompositionHookResource Fetch(FetchCompositionHookOptions options, /// Fetch CompositionHook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionHook - public static async System.Threading.Tasks.Task FetchAsync(FetchCompositionHookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCompositionHookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -275,7 +275,7 @@ public static CompositionHookResource Fetch( /// The SID of the CompositionHook resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionHook - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCompositionHookOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -313,7 +313,7 @@ public static ResourceSet Read(ReadCompositionHookOptio /// Read CompositionHook parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionHook - public static async System.Threading.Tasks.Task> ReadAsync(ReadCompositionHookOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCompositionHookOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -361,7 +361,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateCompositionHookOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -520,7 +520,7 @@ public static async System.Threading.Tasks.Task UpdateA string resolution = null, Uri statusCallback = null, Twilio.Http.HttpMethod statusCallbackMethod = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateCompositionHookOptions(pathSid, friendlyName){ Enabled = enabled, VideoLayout = videoLayout, AudioSources = audioSources, AudioSourcesExcluded = audioSourcesExcluded, Trim = trim, Format = format, Resolution = resolution, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Video/V1/CompositionResource.cs b/src/Twilio/Rest/Video/V1/CompositionResource.cs index 94a99f3cd..8df2ccd0f 100644 --- a/src/Twilio/Rest/Video/V1/CompositionResource.cs +++ b/src/Twilio/Rest/Video/V1/CompositionResource.cs @@ -95,7 +95,7 @@ public static CompositionResource Create(CreateCompositionOptions options, ITwil /// Create Composition parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Composition - public static async System.Threading.Tasks.Task CreateAsync(CreateCompositionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCompositionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -154,7 +154,7 @@ public static async System.Threading.Tasks.Task CreateAsync Uri statusCallback = null, Twilio.Http.HttpMethod statusCallbackMethod = null, bool? trim = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCompositionOptions(roomSid){ VideoLayout = videoLayout, AudioSources = audioSources, AudioSourcesExcluded = audioSourcesExcluded, Resolution = resolution, Format = format, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, Trim = trim }; return await CreateAsync(options, client, cancellationToken); @@ -200,7 +200,7 @@ public static bool Delete(DeleteCompositionOptions options, ITwilioRestClient cl /// Task that resolves to A single instance of Composition public static async System.Threading.Tasks.Task DeleteAsync(DeleteCompositionOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -223,7 +223,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Composition resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Composition - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCompositionOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -263,7 +263,7 @@ public static CompositionResource Fetch(FetchCompositionOptions options, ITwilio /// Fetch Composition parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Composition - public static async System.Threading.Tasks.Task FetchAsync(FetchCompositionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCompositionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -287,7 +287,7 @@ public static CompositionResource Fetch( /// The SID of the Composition resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Composition - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCompositionOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -325,7 +325,7 @@ public static ResourceSet Read(ReadCompositionOptions optio /// Read Composition parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Composition - public static async System.Threading.Tasks.Task> ReadAsync(ReadCompositionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCompositionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -373,7 +373,7 @@ public static async System.Threading.Tasks.Task string roomSid = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCompositionOptions(){ Status = status, DateCreatedAfter = dateCreatedAfter, DateCreatedBefore = dateCreatedBefore, RoomSid = roomSid, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Video/V1/CompositionSettingsResource.cs b/src/Twilio/Rest/Video/V1/CompositionSettingsResource.cs index 4cd16f9f7..df081a805 100644 --- a/src/Twilio/Rest/Video/V1/CompositionSettingsResource.cs +++ b/src/Twilio/Rest/Video/V1/CompositionSettingsResource.cs @@ -66,7 +66,7 @@ public static CompositionSettingsResource Create(CreateCompositionSettingsOption /// Create CompositionSettings parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionSettings - public static async System.Threading.Tasks.Task CreateAsync(CreateCompositionSettingsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCompositionSettingsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -113,7 +113,7 @@ public static async System.Threading.Tasks.Task Cre Uri awsS3Url = null, bool? awsStorageEnabled = null, bool? encryptionEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCompositionSettingsOptions(friendlyName){ AwsCredentialsSid = awsCredentialsSid, EncryptionKeySid = encryptionKeySid, AwsS3Url = awsS3Url, AwsStorageEnabled = awsStorageEnabled, EncryptionEnabled = encryptionEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static CompositionSettingsResource Fetch(FetchCompositionSettingsOptions /// Fetch CompositionSettings parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionSettings - public static async System.Threading.Tasks.Task FetchAsync(FetchCompositionSettingsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCompositionSettingsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static CompositionSettingsResource Fetch( /// fetch /// Client to make requests to Twilio /// Task that resolves to A single instance of CompositionSettings - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCompositionSettingsOptions(){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Video/V1/RecordingResource.cs b/src/Twilio/Rest/Video/V1/RecordingResource.cs index b06451fc1..b8406a7c2 100644 --- a/src/Twilio/Rest/Video/V1/RecordingResource.cs +++ b/src/Twilio/Rest/Video/V1/RecordingResource.cs @@ -130,7 +130,7 @@ public static bool Delete(DeleteRecordingOptions options, ITwilioRestClient clie /// Task that resolves to A single instance of Recording public static async System.Threading.Tasks.Task DeleteAsync(DeleteRecordingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -153,7 +153,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Recording resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRecordingOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -193,7 +193,7 @@ public static RecordingResource Fetch(FetchRecordingOptions options, ITwilioRest /// Fetch Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -217,7 +217,7 @@ public static RecordingResource Fetch( /// The SID of the Recording resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRecordingOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -255,7 +255,7 @@ public static ResourceSet Read(ReadRecordingOptions options, /// Read Recording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Recording - public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRecordingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -311,7 +311,7 @@ public static async System.Threading.Tasks.Task> RecordingResource.TypeEnum mediaType = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRecordingOptions(){ Status = status, SourceSid = sourceSid, GroupingSid = groupingSid, DateCreatedAfter = dateCreatedAfter, DateCreatedBefore = dateCreatedBefore, MediaType = mediaType, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Video/V1/RecordingSettingsResource.cs b/src/Twilio/Rest/Video/V1/RecordingSettingsResource.cs index 7df052e0f..6f4ff61c9 100644 --- a/src/Twilio/Rest/Video/V1/RecordingSettingsResource.cs +++ b/src/Twilio/Rest/Video/V1/RecordingSettingsResource.cs @@ -66,7 +66,7 @@ public static RecordingSettingsResource Create(CreateRecordingSettingsOptions op /// Create RecordingSettings parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RecordingSettings - public static async System.Threading.Tasks.Task CreateAsync(CreateRecordingSettingsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateRecordingSettingsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -113,7 +113,7 @@ public static async System.Threading.Tasks.Task Creat Uri awsS3Url = null, bool? awsStorageEnabled = null, bool? encryptionEnabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateRecordingSettingsOptions(friendlyName){ AwsCredentialsSid = awsCredentialsSid, EncryptionKeySid = encryptionKeySid, AwsS3Url = awsS3Url, AwsStorageEnabled = awsStorageEnabled, EncryptionEnabled = encryptionEnabled }; return await CreateAsync(options, client, cancellationToken); @@ -151,7 +151,7 @@ public static RecordingSettingsResource Fetch(FetchRecordingSettingsOptions opti /// Fetch RecordingSettings parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RecordingSettings - public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingSettingsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingSettingsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static RecordingSettingsResource Fetch( /// fetch /// Client to make requests to Twilio /// Task that resolves to A single instance of RecordingSettings - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRecordingSettingsOptions(){ }; return await FetchAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeResource.cs b/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeResource.cs index 456b59647..2d0cc043f 100644 --- a/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeResource.cs +++ b/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeResource.cs @@ -85,7 +85,7 @@ public static AnonymizeResource Update(UpdateAnonymizeOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateAnonymizeOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -116,7 +116,7 @@ public static AnonymizeResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathRoomSid, string pathSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateAnonymizeOptions(pathRoomSid, pathSid){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackResource.cs b/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackResource.cs index c02553627..b0dda8d0b 100644 --- a/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackResource.cs +++ b/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackResource.cs @@ -85,7 +85,7 @@ public static PublishedTrackResource Fetch(FetchPublishedTrackOptions options, I /// Fetch PublishedTrack parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PublishedTrack - public static async System.Threading.Tasks.Task FetchAsync(FetchPublishedTrackOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchPublishedTrackOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -115,7 +115,7 @@ public static PublishedTrackResource Fetch( /// The SID of the RoomParticipantPublishedTrack resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of PublishedTrack - public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathParticipantSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathParticipantSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchPublishedTrackOptions(pathRoomSid, pathParticipantSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -157,7 +157,7 @@ public static ResourceSet Read(ReadPublishedTrackOptions /// Read PublishedTrack parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PublishedTrack - public static async System.Threading.Tasks.Task> ReadAsync(ReadPublishedTrackOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadPublishedTrackOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -197,7 +197,7 @@ public static async System.Threading.Tasks.Task Fetch SubscribeRules parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribeRules - public static async System.Threading.Tasks.Task FetchAsync(FetchSubscribeRulesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSubscribeRulesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -96,7 +96,7 @@ public static SubscribeRulesResource Fetch( /// The SID of the Participant resource with the subscribe rules to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribeRules - public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathParticipantSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathParticipantSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSubscribeRulesOptions(pathRoomSid, pathParticipantSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -141,7 +141,7 @@ public static SubscribeRulesResource Update(UpdateSubscribeRulesOptions options, #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSubscribeRulesOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -176,7 +176,7 @@ public static async System.Threading.Tasks.Task UpdateAs string pathRoomSid, string pathParticipantSid, object rules = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSubscribeRulesOptions(pathRoomSid, pathParticipantSid){ Rules = rules }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackResource.cs b/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackResource.cs index 0cf4b351b..722a22ddf 100644 --- a/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackResource.cs +++ b/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackResource.cs @@ -85,7 +85,7 @@ public static SubscribedTrackResource Fetch(FetchSubscribedTrackOptions options, /// Fetch SubscribedTrack parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedTrack - public static async System.Threading.Tasks.Task FetchAsync(FetchSubscribedTrackOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSubscribedTrackOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -115,7 +115,7 @@ public static SubscribedTrackResource Fetch( /// The SID of the RoomParticipantSubscribedTrack resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedTrack - public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathParticipantSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathParticipantSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSubscribedTrackOptions(pathRoomSid, pathParticipantSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -157,7 +157,7 @@ public static ResourceSet Read(ReadSubscribedTrackOptio /// Read SubscribedTrack parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedTrack - public static async System.Threading.Tasks.Task> ReadAsync(ReadSubscribedTrackOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSubscribedTrackOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -197,7 +197,7 @@ public static async System.Threading.Tasks.Task Fetch Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -109,7 +109,7 @@ public static ParticipantResource Fetch( /// The SID of the RoomParticipant resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchParticipantOptions(pathRoomSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -149,7 +149,7 @@ public static ResourceSet Read(ReadParticipantOptions optio /// Read Participant parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant - public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadParticipantOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -201,7 +201,7 @@ public static async System.Threading.Tasks.Task DateTime? dateCreatedBefore = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadParticipantOptions(pathRoomSid){ Status = status, Identity = identity, DateCreatedAfter = dateCreatedAfter, DateCreatedBefore = dateCreatedBefore, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -295,7 +295,7 @@ public static ParticipantResource Update(UpdateParticipantOptions options, ITwil #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateParticipantOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -330,7 +330,7 @@ public static async System.Threading.Tasks.Task UpdateAsync string pathRoomSid, string pathSid, ParticipantResource.StatusEnum status = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateParticipantOptions(pathRoomSid, pathSid){ Status = status }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Video/V1/Room/RecordingRulesResource.cs b/src/Twilio/Rest/Video/V1/Room/RecordingRulesResource.cs index f885a248d..3d02581ec 100644 --- a/src/Twilio/Rest/Video/V1/Room/RecordingRulesResource.cs +++ b/src/Twilio/Rest/Video/V1/Room/RecordingRulesResource.cs @@ -67,7 +67,7 @@ public static RecordingRulesResource Fetch(FetchRecordingRulesOptions options, I /// Fetch RecordingRules parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RecordingRules - public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingRulesOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRecordingRulesOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static RecordingRulesResource Fetch( /// The SID of the Room resource where the recording rules to fetch apply. /// Client to make requests to Twilio /// Task that resolves to A single instance of RecordingRules - public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRecordingRulesOptions(pathRoomSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -134,7 +134,7 @@ public static RecordingRulesResource Update(UpdateRecordingRulesOptions options, #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRecordingRulesOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -165,7 +165,7 @@ public static RecordingRulesResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathRoomSid, object rules = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRecordingRulesOptions(pathRoomSid){ Rules = rules }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Video/V1/Room/RoomRecordingResource.cs b/src/Twilio/Rest/Video/V1/Room/RoomRecordingResource.cs index 80e16062a..9b562fc89 100644 --- a/src/Twilio/Rest/Video/V1/Room/RoomRecordingResource.cs +++ b/src/Twilio/Rest/Video/V1/Room/RoomRecordingResource.cs @@ -132,7 +132,7 @@ public static bool Delete(DeleteRoomRecordingOptions options, ITwilioRestClient /// Task that resolves to A single instance of RoomRecording public static async System.Threading.Tasks.Task DeleteAsync(DeleteRoomRecordingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -157,7 +157,7 @@ public static bool Delete(string pathRoomSid, string pathSid, ITwilioRestClient /// The SID of the RoomRecording resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of RoomRecording - public static async System.Threading.Tasks.Task DeleteAsync(string pathRoomSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathRoomSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRoomRecordingOptions(pathRoomSid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -199,7 +199,7 @@ public static RoomRecordingResource Fetch(FetchRoomRecordingOptions options, ITw /// Fetch RoomRecording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RoomRecording - public static async System.Threading.Tasks.Task FetchAsync(FetchRoomRecordingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoomRecordingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -226,7 +226,7 @@ public static RoomRecordingResource Fetch( /// The SID of the RoomRecording resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of RoomRecording - public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathRoomSid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRoomRecordingOptions(pathRoomSid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -266,7 +266,7 @@ public static ResourceSet Read(ReadRoomRecordingOptions o /// Read RoomRecording parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RoomRecording - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoomRecordingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoomRecordingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -318,7 +318,7 @@ public static async System.Threading.Tasks.Task Create Room parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Room - public static async System.Threading.Tasks.Task CreateAsync(CreateRoomOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateRoomOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -191,7 +191,7 @@ public static async System.Threading.Tasks.Task CreateAsync( int? emptyRoomTimeout = null, int? unusedRoomTimeout = null, bool? largeRoom = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new CreateRoomOptions(){ EnableTurn = enableTurn, Type = type, UniqueName = uniqueName, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, MaxParticipants = maxParticipants, RecordParticipantsOnConnect = recordParticipantsOnConnect, VideoCodecs = videoCodecs, MediaRegion = mediaRegion, RecordingRules = recordingRules, AudioOnly = audioOnly, MaxParticipantDuration = maxParticipantDuration, EmptyRoomTimeout = emptyRoomTimeout, UnusedRoomTimeout = unusedRoomTimeout, LargeRoom = largeRoom }; return await CreateAsync(options, client, cancellationToken); @@ -231,7 +231,7 @@ public static RoomResource Fetch(FetchRoomOptions options, ITwilioRestClient cli /// Fetch Room parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Room - public static async System.Threading.Tasks.Task FetchAsync(FetchRoomOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRoomOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -255,7 +255,7 @@ public static RoomResource Fetch( /// The SID of the Room resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Room - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRoomOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -293,7 +293,7 @@ public static ResourceSet Read(ReadRoomOptions options, ITwilioRes /// Read Room parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Room - public static async System.Threading.Tasks.Task> ReadAsync(ReadRoomOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRoomOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -341,7 +341,7 @@ public static async System.Threading.Tasks.Task> ReadA DateTime? dateCreatedBefore = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRoomOptions(){ Status = status, UniqueName = uniqueName, DateCreatedAfter = dateCreatedAfter, DateCreatedBefore = dateCreatedBefore, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -433,7 +433,7 @@ public static RoomResource Update(UpdateRoomOptions options, ITwilioRestClient c #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRoomOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -464,7 +464,7 @@ public static RoomResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, RoomResource.RoomStatusEnum status, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRoomOptions(pathSid, status){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Voice/V1/ArchivedCallResource.cs b/src/Twilio/Rest/Voice/V1/ArchivedCallResource.cs index 86399e984..d9809131a 100644 --- a/src/Twilio/Rest/Voice/V1/ArchivedCallResource.cs +++ b/src/Twilio/Rest/Voice/V1/ArchivedCallResource.cs @@ -75,7 +75,7 @@ public static bool Delete(DeleteArchivedCallOptions options, ITwilioRestClient c /// Task that resolves to A single instance of ArchivedCall public static async System.Threading.Tasks.Task DeleteAsync(DeleteArchivedCallOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -100,7 +100,7 @@ public static bool Delete(DateTime? pathDate, string pathSid, ITwilioRestClient /// The Twilio-provided Call SID that uniquely identifies the Call resource to delete /// Client to make requests to Twilio /// Task that resolves to A single instance of ArchivedCall - public static async System.Threading.Tasks.Task DeleteAsync(DateTime? pathDate, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(DateTime? pathDate, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteArchivedCallOptions(pathDate, pathSid) ; return await DeleteAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Voice/V1/ByocTrunkResource.cs b/src/Twilio/Rest/Voice/V1/ByocTrunkResource.cs index 190f44372..c6a551f5d 100644 --- a/src/Twilio/Rest/Voice/V1/ByocTrunkResource.cs +++ b/src/Twilio/Rest/Voice/V1/ByocTrunkResource.cs @@ -66,7 +66,7 @@ public static ByocTrunkResource Create(CreateByocTrunkOptions options, ITwilioRe /// Create ByocTrunk parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ByocTrunk - public static async System.Threading.Tasks.Task CreateAsync(CreateByocTrunkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateByocTrunkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -129,7 +129,7 @@ public static async System.Threading.Tasks.Task CreateAsync( bool? cnamLookupEnabled = null, string connectionPolicySid = null, string fromDomainSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateByocTrunkOptions(){ FriendlyName = friendlyName, VoiceUrl = voiceUrl, VoiceMethod = voiceMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceFallbackMethod = voiceFallbackMethod, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, CnamLookupEnabled = cnamLookupEnabled, ConnectionPolicySid = connectionPolicySid, FromDomainSid = fromDomainSid }; return await CreateAsync(options, client, cancellationToken); @@ -175,7 +175,7 @@ public static bool Delete(DeleteByocTrunkOptions options, ITwilioRestClient clie /// Task that resolves to A single instance of ByocTrunk public static async System.Threading.Tasks.Task DeleteAsync(DeleteByocTrunkOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -198,7 +198,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the BYOC Trunk resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of ByocTrunk - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteByocTrunkOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -238,7 +238,7 @@ public static ByocTrunkResource Fetch(FetchByocTrunkOptions options, ITwilioRest /// Fetch ByocTrunk parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ByocTrunk - public static async System.Threading.Tasks.Task FetchAsync(FetchByocTrunkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchByocTrunkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -262,7 +262,7 @@ public static ByocTrunkResource Fetch( /// The Twilio-provided string that uniquely identifies the BYOC Trunk resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ByocTrunk - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchByocTrunkOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -300,7 +300,7 @@ public static ResourceSet Read(ReadByocTrunkOptions options, /// Read ByocTrunk parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ByocTrunk - public static async System.Threading.Tasks.Task> ReadAsync(ReadByocTrunkOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadByocTrunkOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -332,7 +332,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadByocTrunkOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -424,7 +424,7 @@ public static ByocTrunkResource Update(UpdateByocTrunkOptions options, ITwilioRe #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateByocTrunkOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -491,7 +491,7 @@ public static async System.Threading.Tasks.Task UpdateAsync( bool? cnamLookupEnabled = null, string connectionPolicySid = null, string fromDomainSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateByocTrunkOptions(pathSid){ FriendlyName = friendlyName, VoiceUrl = voiceUrl, VoiceMethod = voiceMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceFallbackMethod = voiceFallbackMethod, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, CnamLookupEnabled = cnamLookupEnabled, ConnectionPolicySid = connectionPolicySid, FromDomainSid = fromDomainSid }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetResource.cs b/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetResource.cs index 7215145f5..f4fd46b51 100644 --- a/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetResource.cs +++ b/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetResource.cs @@ -68,7 +68,7 @@ public static ConnectionPolicyTargetResource Create(CreateConnectionPolicyTarget /// Create ConnectionPolicyTarget parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicyTarget - public static async System.Threading.Tasks.Task CreateAsync(CreateConnectionPolicyTargetOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateConnectionPolicyTargetOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -115,7 +115,7 @@ public static async System.Threading.Tasks.Task int? priority = null, int? weight = null, bool? enabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateConnectionPolicyTargetOptions(pathConnectionPolicySid, target){ FriendlyName = friendlyName, Priority = priority, Weight = weight, Enabled = enabled }; return await CreateAsync(options, client, cancellationToken); @@ -163,7 +163,7 @@ public static bool Delete(DeleteConnectionPolicyTargetOptions options, ITwilioRe /// Task that resolves to A single instance of ConnectionPolicyTarget public static async System.Threading.Tasks.Task DeleteAsync(DeleteConnectionPolicyTargetOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -188,7 +188,7 @@ public static bool Delete(string pathConnectionPolicySid, string pathSid, ITwili /// The unique string that we created to identify the Target resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicyTarget - public static async System.Threading.Tasks.Task DeleteAsync(string pathConnectionPolicySid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task DeleteAsync(string pathConnectionPolicySid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteConnectionPolicyTargetOptions(pathConnectionPolicySid, pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -230,7 +230,7 @@ public static ConnectionPolicyTargetResource Fetch(FetchConnectionPolicyTargetOp /// Fetch ConnectionPolicyTarget parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicyTarget - public static async System.Threading.Tasks.Task FetchAsync(FetchConnectionPolicyTargetOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchConnectionPolicyTargetOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -257,7 +257,7 @@ public static ConnectionPolicyTargetResource Fetch( /// The unique string that we created to identify the Target resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicyTarget - public static async System.Threading.Tasks.Task FetchAsync(string pathConnectionPolicySid, string pathSid, ITwilioRestClient client = null) + public static async System.Threading.Tasks.Task FetchAsync(string pathConnectionPolicySid, string pathSid, ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new FetchConnectionPolicyTargetOptions(pathConnectionPolicySid, pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -297,7 +297,7 @@ public static ResourceSet Read(ReadConnectionPol /// Read ConnectionPolicyTarget parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicyTarget - public static async System.Threading.Tasks.Task> ReadAsync(ReadConnectionPolicyTargetOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConnectionPolicyTargetOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -333,7 +333,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(UpdateConnectionPolicyTargetOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -478,7 +478,7 @@ public static async System.Threading.Tasks.Task int? priority = null, int? weight = null, bool? enabled = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateConnectionPolicyTargetOptions(pathConnectionPolicySid, pathSid){ FriendlyName = friendlyName, Target = target, Priority = priority, Weight = weight, Enabled = enabled }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Voice/V1/ConnectionPolicyResource.cs b/src/Twilio/Rest/Voice/V1/ConnectionPolicyResource.cs index 82268922b..47d2165f4 100644 --- a/src/Twilio/Rest/Voice/V1/ConnectionPolicyResource.cs +++ b/src/Twilio/Rest/Voice/V1/ConnectionPolicyResource.cs @@ -66,7 +66,7 @@ public static ConnectionPolicyResource Create(CreateConnectionPolicyOptions opti /// Create ConnectionPolicy parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicy - public static async System.Threading.Tasks.Task CreateAsync(CreateConnectionPolicyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateConnectionPolicyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -93,7 +93,7 @@ public static ConnectionPolicyResource Create( /// Task that resolves to A single instance of ConnectionPolicy public static async System.Threading.Tasks.Task CreateAsync( string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateConnectionPolicyOptions(){ FriendlyName = friendlyName }; return await CreateAsync(options, client, cancellationToken); @@ -139,7 +139,7 @@ public static bool Delete(DeleteConnectionPolicyOptions options, ITwilioRestClie /// Task that resolves to A single instance of ConnectionPolicy public static async System.Threading.Tasks.Task DeleteAsync(DeleteConnectionPolicyOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -162,7 +162,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The unique string that we created to identify the Connection Policy resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicy - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteConnectionPolicyOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -202,7 +202,7 @@ public static ConnectionPolicyResource Fetch(FetchConnectionPolicyOptions option /// Fetch ConnectionPolicy parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicy - public static async System.Threading.Tasks.Task FetchAsync(FetchConnectionPolicyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchConnectionPolicyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -226,7 +226,7 @@ public static ConnectionPolicyResource Fetch( /// The unique string that we created to identify the Connection Policy resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicy - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchConnectionPolicyOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -264,7 +264,7 @@ public static ResourceSet Read(ReadConnectionPolicyOpt /// Read ConnectionPolicy parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of ConnectionPolicy - public static async System.Threading.Tasks.Task> ReadAsync(ReadConnectionPolicyOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadConnectionPolicyOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -296,7 +296,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadConnectionPolicyOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -388,7 +388,7 @@ public static ConnectionPolicyResource Update(UpdateConnectionPolicyOptions opti #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateConnectionPolicyOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -419,7 +419,7 @@ public static ConnectionPolicyResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateConnectionPolicyOptions(pathSid){ FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateResource.cs b/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateResource.cs index b7ecef5d0..7845624ee 100644 --- a/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateResource.cs +++ b/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateResource.cs @@ -66,7 +66,7 @@ public static BulkCountryUpdateResource Create(CreateBulkCountryUpdateOptions op /// Create BulkCountryUpdate parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of BulkCountryUpdate - public static async System.Threading.Tasks.Task CreateAsync(CreateBulkCountryUpdateOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateBulkCountryUpdateOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -93,7 +93,7 @@ public static BulkCountryUpdateResource Create( /// Task that resolves to A single instance of BulkCountryUpdate public static async System.Threading.Tasks.Task CreateAsync( string updateRequest, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateBulkCountryUpdateOptions(updateRequest){ }; return await CreateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixResource.cs b/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixResource.cs index 12b8d94e0..a4af1d607 100644 --- a/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixResource.cs +++ b/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixResource.cs @@ -67,7 +67,7 @@ public static ResourceSet Read(ReadHighriskSpecia /// Read HighriskSpecialPrefix parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of HighriskSpecialPrefix - public static async System.Threading.Tasks.Task> ReadAsync(ReadHighriskSpecialPrefixOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadHighriskSpecialPrefixOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -103,7 +103,7 @@ public static async System.Threading.Tasks.Task Fetch Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCountryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -91,7 +91,7 @@ public static CountryResource Fetch( /// The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the DialingPermissions Country resource to fetch /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCode, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathIsoCode, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCountryOptions(pathIsoCode){ }; return await FetchAsync(options, client, cancellationToken); @@ -129,7 +129,7 @@ public static ResourceSet Read(ReadCountryOptions options, ITwi /// Read Country parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Country - public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -185,7 +185,7 @@ public static async System.Threading.Tasks.Task> Re bool? highRiskTollfraudNumbersEnabled = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCountryOptions(){ IsoCode = isoCode, Continent = continent, CountryCode = countryCode, LowRiskNumbersEnabled = lowRiskNumbersEnabled, HighRiskSpecialNumbersEnabled = highRiskSpecialNumbersEnabled, HighRiskTollfraudNumbersEnabled = highRiskTollfraudNumbersEnabled, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsResource.cs b/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsResource.cs index b649cf480..356cc3ec8 100644 --- a/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsResource.cs +++ b/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsResource.cs @@ -65,7 +65,7 @@ public static SettingsResource Fetch(FetchSettingsOptions options, ITwilioRestCl /// Fetch Settings parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Settings - public static async System.Threading.Tasks.Task FetchAsync(FetchSettingsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSettingsOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -86,7 +86,7 @@ public static SettingsResource Fetch( /// Retrieve voice dialing permissions inheritance for the sub-account /// Client to make requests to Twilio /// Task that resolves to A single instance of Settings - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSettingsOptions(){ }; return await FetchAsync(options, client, cancellationToken); @@ -127,7 +127,7 @@ public static SettingsResource Update(UpdateSettingsOptions options, ITwilioRest #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSettingsOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -154,7 +154,7 @@ public static SettingsResource Update( /// Task that resolves to A single instance of Settings public static async System.Threading.Tasks.Task UpdateAsync( bool? dialingPermissionsInheritance = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSettingsOptions(){ DialingPermissionsInheritance = dialingPermissionsInheritance }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Voice/V1/IpRecordResource.cs b/src/Twilio/Rest/Voice/V1/IpRecordResource.cs index f9e73fca2..3a3216381 100644 --- a/src/Twilio/Rest/Voice/V1/IpRecordResource.cs +++ b/src/Twilio/Rest/Voice/V1/IpRecordResource.cs @@ -66,7 +66,7 @@ public static IpRecordResource Create(CreateIpRecordOptions options, ITwilioRest /// Create IpRecord parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpRecord - public static async System.Threading.Tasks.Task CreateAsync(CreateIpRecordOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateIpRecordOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -101,7 +101,7 @@ public static async System.Threading.Tasks.Task CreateAsync( string ipAddress, string friendlyName = null, int? cidrPrefixLength = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateIpRecordOptions(ipAddress){ FriendlyName = friendlyName, CidrPrefixLength = cidrPrefixLength }; return await CreateAsync(options, client, cancellationToken); @@ -147,7 +147,7 @@ public static bool Delete(DeleteIpRecordOptions options, ITwilioRestClient clien /// Task that resolves to A single instance of IpRecord public static async System.Threading.Tasks.Task DeleteAsync(DeleteIpRecordOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -170,7 +170,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the IP Record resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of IpRecord - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteIpRecordOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -210,7 +210,7 @@ public static IpRecordResource Fetch(FetchIpRecordOptions options, ITwilioRestCl /// Fetch IpRecord parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpRecord - public static async System.Threading.Tasks.Task FetchAsync(FetchIpRecordOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchIpRecordOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -234,7 +234,7 @@ public static IpRecordResource Fetch( /// The Twilio-provided string that uniquely identifies the IP Record resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of IpRecord - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchIpRecordOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -272,7 +272,7 @@ public static ResourceSet Read(ReadIpRecordOptions options, IT /// Read IpRecord parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of IpRecord - public static async System.Threading.Tasks.Task> ReadAsync(ReadIpRecordOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadIpRecordOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -304,7 +304,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadIpRecordOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -396,7 +396,7 @@ public static IpRecordResource Update(UpdateIpRecordOptions options, ITwilioRest #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateIpRecordOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -427,7 +427,7 @@ public static IpRecordResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateIpRecordOptions(pathSid){ FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Voice/V1/SourceIpMappingResource.cs b/src/Twilio/Rest/Voice/V1/SourceIpMappingResource.cs index 12cdcf99a..07a5a267d 100644 --- a/src/Twilio/Rest/Voice/V1/SourceIpMappingResource.cs +++ b/src/Twilio/Rest/Voice/V1/SourceIpMappingResource.cs @@ -66,7 +66,7 @@ public static SourceIpMappingResource Create(CreateSourceIpMappingOptions option /// Create SourceIpMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SourceIpMapping - public static async System.Threading.Tasks.Task CreateAsync(CreateSourceIpMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateSourceIpMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -97,7 +97,7 @@ public static SourceIpMappingResource Create( public static async System.Threading.Tasks.Task CreateAsync( string ipRecordSid, string sipDomainSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateSourceIpMappingOptions(ipRecordSid, sipDomainSid){ }; return await CreateAsync(options, client, cancellationToken); @@ -143,7 +143,7 @@ public static bool Delete(DeleteSourceIpMappingOptions options, ITwilioRestClien /// Task that resolves to A single instance of SourceIpMapping public static async System.Threading.Tasks.Task DeleteAsync(DeleteSourceIpMappingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -166,7 +166,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The Twilio-provided string that uniquely identifies the IP Record resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of SourceIpMapping - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSourceIpMappingOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -206,7 +206,7 @@ public static SourceIpMappingResource Fetch(FetchSourceIpMappingOptions options, /// Fetch SourceIpMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SourceIpMapping - public static async System.Threading.Tasks.Task FetchAsync(FetchSourceIpMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSourceIpMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -230,7 +230,7 @@ public static SourceIpMappingResource Fetch( /// The Twilio-provided string that uniquely identifies the IP Record resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of SourceIpMapping - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSourceIpMappingOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -268,7 +268,7 @@ public static ResourceSet Read(ReadSourceIpMappingOptio /// Read SourceIpMapping parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SourceIpMapping - public static async System.Threading.Tasks.Task> ReadAsync(ReadSourceIpMappingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSourceIpMappingOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -300,7 +300,7 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSourceIpMappingOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -392,7 +392,7 @@ public static SourceIpMappingResource Update(UpdateSourceIpMappingOptions option #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSourceIpMappingOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -423,7 +423,7 @@ public static SourceIpMappingResource Update( public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string sipDomainSid, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSourceIpMappingOptions(pathSid, sipDomainSid){ }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Wireless/V1/CommandResource.cs b/src/Twilio/Rest/Wireless/V1/CommandResource.cs index 6c3ad1978..ec56fc39c 100644 --- a/src/Twilio/Rest/Wireless/V1/CommandResource.cs +++ b/src/Twilio/Rest/Wireless/V1/CommandResource.cs @@ -121,7 +121,7 @@ public static CommandResource Create(CreateCommandOptions options, ITwilioRestCl /// Create Command parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task CreateAsync(CreateCommandOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateCommandOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -172,7 +172,7 @@ public static async System.Threading.Tasks.Task CreateAsync( CommandResource.CommandModeEnum commandMode = null, string includeSid = null, bool? deliveryReceiptRequested = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new CreateCommandOptions(command){ Sim = sim, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, CommandMode = commandMode, IncludeSid = includeSid, DeliveryReceiptRequested = deliveryReceiptRequested }; return await CreateAsync(options, client, cancellationToken); @@ -218,7 +218,7 @@ public static bool Delete(DeleteCommandOptions options, ITwilioRestClient client /// Task that resolves to A single instance of Command public static async System.Threading.Tasks.Task DeleteAsync(DeleteCommandOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -241,7 +241,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the Command resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteCommandOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -281,7 +281,7 @@ public static CommandResource Fetch(FetchCommandOptions options, ITwilioRestClie /// Fetch Command parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task FetchAsync(FetchCommandOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchCommandOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -305,7 +305,7 @@ public static CommandResource Fetch( /// The SID of the Command resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchCommandOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -343,7 +343,7 @@ public static ResourceSet Read(ReadCommandOptions options, ITwi /// Read Command parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Command - public static async System.Threading.Tasks.Task> ReadAsync(ReadCommandOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadCommandOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -391,7 +391,7 @@ public static async System.Threading.Tasks.Task> Re CommandResource.TransportEnum transport = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null , System.Threading.CancellationToken cancellationToken = default) { var options = new ReadCommandOptions(){ Sim = sim, Status = status, Direction = direction, Transport = transport, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Wireless/V1/RatePlanResource.cs b/src/Twilio/Rest/Wireless/V1/RatePlanResource.cs index 4022c66c9..150f42427 100644 --- a/src/Twilio/Rest/Wireless/V1/RatePlanResource.cs +++ b/src/Twilio/Rest/Wireless/V1/RatePlanResource.cs @@ -66,7 +66,7 @@ public static RatePlanResource Create(CreateRatePlanOptions options, ITwilioRest /// Create RatePlan parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task CreateAsync(CreateRatePlanOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task CreateAsync(CreateRatePlanOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken); @@ -133,7 +133,8 @@ public static async System.Threading.Tasks.Task CreateAsync( List internationalRoaming = null, int? nationalRoamingDataLimit = null, int? internationalRoamingDataLimit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new CreateRatePlanOptions(){ UniqueName = uniqueName, FriendlyName = friendlyName, DataEnabled = dataEnabled, DataLimit = dataLimit, DataMetering = dataMetering, MessagingEnabled = messagingEnabled, VoiceEnabled = voiceEnabled, NationalRoamingEnabled = nationalRoamingEnabled, InternationalRoaming = internationalRoaming, NationalRoamingDataLimit = nationalRoamingDataLimit, InternationalRoamingDataLimit = internationalRoamingDataLimit }; return await CreateAsync(options, client, cancellationToken); @@ -179,7 +180,7 @@ public static bool Delete(DeleteRatePlanOptions options, ITwilioRestClient clien /// Task that resolves to A single instance of RatePlan public static async System.Threading.Tasks.Task DeleteAsync(DeleteRatePlanOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -202,7 +203,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID of the RatePlan resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteRatePlanOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -242,7 +243,7 @@ public static RatePlanResource Fetch(FetchRatePlanOptions options, ITwilioRestCl /// Fetch RatePlan parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task FetchAsync(FetchRatePlanOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchRatePlanOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -266,7 +267,7 @@ public static RatePlanResource Fetch( /// The SID of the RatePlan resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchRatePlanOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -304,7 +305,7 @@ public static ResourceSet Read(ReadRatePlanOptions options, IT /// Read RatePlan parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of RatePlan - public static async System.Threading.Tasks.Task> ReadAsync(ReadRatePlanOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadRatePlanOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -336,7 +337,8 @@ public static ResourceSet Read( public static async System.Threading.Tasks.Task> ReadAsync( int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new ReadRatePlanOptions(){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -428,7 +430,7 @@ public static RatePlanResource Update(UpdateRatePlanOptions options, ITwilioRest #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateRatePlanOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -463,7 +465,8 @@ public static async System.Threading.Tasks.Task UpdateAsync( string pathSid, string uniqueName = null, string friendlyName = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateRatePlanOptions(pathSid){ UniqueName = uniqueName, FriendlyName = friendlyName }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Wireless/V1/Sim/DataSessionResource.cs b/src/Twilio/Rest/Wireless/V1/Sim/DataSessionResource.cs index ba250e815..b874e25ac 100644 --- a/src/Twilio/Rest/Wireless/V1/Sim/DataSessionResource.cs +++ b/src/Twilio/Rest/Wireless/V1/Sim/DataSessionResource.cs @@ -67,7 +67,7 @@ public static ResourceSet Read(ReadDataSessionOptions optio /// Read DataSession parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of DataSession - public static async System.Threading.Tasks.Task> ReadAsync(ReadDataSessionOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadDataSessionOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -103,7 +103,8 @@ public static async System.Threading.Tasks.Task string pathSimSid, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new ReadDataSessionOptions(pathSimSid){ PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordResource.cs b/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordResource.cs index 0e7fe6cce..6881bdecc 100644 --- a/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordResource.cs +++ b/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordResource.cs @@ -80,7 +80,7 @@ public static ResourceSet Read(ReadUsageRecordOptions optio /// Read UsageRecord parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsageRecord - public static async System.Threading.Tasks.Task> ReadAsync(ReadUsageRecordOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUsageRecordOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -128,7 +128,8 @@ public static async System.Threading.Tasks.Task UsageRecordResource.GranularityEnum granularity = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUsageRecordOptions(pathSimSid){ End = end, Start = start, Granularity = granularity, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Wireless/V1/SimResource.cs b/src/Twilio/Rest/Wireless/V1/SimResource.cs index 26cc0a850..a332fdced 100644 --- a/src/Twilio/Rest/Wireless/V1/SimResource.cs +++ b/src/Twilio/Rest/Wireless/V1/SimResource.cs @@ -104,7 +104,7 @@ public static bool Delete(DeleteSimOptions options, ITwilioRestClient client = n /// Task that resolves to A single instance of Sim public static async System.Threading.Tasks.Task DeleteAsync(DeleteSimOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken); @@ -127,7 +127,7 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null) /// The SID or the `unique_name` of the Sim resource to delete. /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new DeleteSimOptions(pathSid) ; return await DeleteAsync(options, client, cancellationToken); @@ -167,7 +167,7 @@ public static SimResource Fetch(FetchSimOptions options, ITwilioRestClient clien /// Fetch Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task FetchAsync(FetchSimOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(FetchSimOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken); @@ -191,7 +191,7 @@ public static SimResource Fetch( /// The SID or the `unique_name` of the Sim resource to fetch. /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { var options = new FetchSimOptions(pathSid){ }; return await FetchAsync(options, client, cancellationToken); @@ -229,7 +229,7 @@ public static ResourceSet Read(ReadSimOptions options, ITwilioRestC /// Read Sim parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of Sim - public static async System.Threading.Tasks.Task> ReadAsync(ReadSimOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadSimOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -281,7 +281,8 @@ public static async System.Threading.Tasks.Task> ReadAs string simRegistrationCode = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new ReadSimOptions(){ Status = status, Iccid = iccid, RatePlan = ratePlan, EId = eId, SimRegistrationCode = simRegistrationCode, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); @@ -373,7 +374,7 @@ public static SimResource Update(UpdateSimOptions options, ITwilioRestClient cli #if !NET35 public static async System.Threading.Tasks.Task UpdateAsync(UpdateSimOptions options, ITwilioRestClient client = null, - CancellationToken cancellationToken = default) + System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken); @@ -472,7 +473,8 @@ public static async System.Threading.Tasks.Task UpdateAsync( Uri voiceUrl = null, SimResource.ResetStatusEnum resetStatus = null, string accountSid = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new UpdateSimOptions(pathSid){ UniqueName = uniqueName, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, FriendlyName = friendlyName, RatePlan = ratePlan, Status = status, CommandsCallbackMethod = commandsCallbackMethod, CommandsCallbackUrl = commandsCallbackUrl, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl, ResetStatus = resetStatus, AccountSid = accountSid }; return await UpdateAsync(options, client, cancellationToken); diff --git a/src/Twilio/Rest/Wireless/V1/UsageRecordResource.cs b/src/Twilio/Rest/Wireless/V1/UsageRecordResource.cs index 4572c3e92..a5376c724 100644 --- a/src/Twilio/Rest/Wireless/V1/UsageRecordResource.cs +++ b/src/Twilio/Rest/Wireless/V1/UsageRecordResource.cs @@ -78,7 +78,7 @@ public static ResourceSet Read(ReadUsageRecordOptions optio /// Read UsageRecord parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of UsageRecord - public static async System.Threading.Tasks.Task> ReadAsync(ReadUsageRecordOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default) + public static async System.Threading.Tasks.Task> ReadAsync(ReadUsageRecordOptions options, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken); @@ -122,7 +122,8 @@ public static async System.Threading.Tasks.Task UsageRecordResource.GranularityEnum granularity = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null) + ITwilioRestClient client = null, + System.Threading.CancellationToken cancellationToken = default) { var options = new ReadUsageRecordOptions(){ End = end, Start = start, Granularity = granularity, PageSize = pageSize, Limit = limit}; return await ReadAsync(options, client, cancellationToken); diff --git a/test/Twilio.Test/Http/SystemNetHttpClientTest.cs b/test/Twilio.Test/Http/SystemNetHttpClientTest.cs index 5784408e7..98a5410b1 100644 --- a/test/Twilio.Test/Http/SystemNetHttpClientTest.cs +++ b/test/Twilio.Test/Http/SystemNetHttpClientTest.cs @@ -50,7 +50,7 @@ public void Error(String url, Exception error) } protected override Task SendAsync(HttpRequestMessage request, - CancellationToken cancellationToken) + System.Threading.CancellationToken cancellationToken) { // Uri will contain query params, only lookup on the uri route var route = request.RequestUri.ToString().Split('?')[0]; From 4310dc10c2f1b4fb8eb9d36b7365f874043c8556 Mon Sep 17 00:00:00 2001 From: Joseph Livecchi Date: Mon, 13 Jan 2025 10:16:19 -0500 Subject: [PATCH 5/8] Updated Build Failure --- src/Twilio/Rest/Api/V2010/Account/AddressResource.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Twilio/Rest/Api/V2010/Account/AddressResource.cs b/src/Twilio/Rest/Api/V2010/Account/AddressResource.cs index e27170c10..285741de2 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AddressResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AddressResource.cs @@ -102,7 +102,7 @@ public static AddressResource Create( bool? emergencyEnabled = null, bool? autoCorrectAddress = null, string streetSecondary = null, - ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) + ITwilioRestClient client = null) { var options = new CreateAddressOptions(customerName, street, city, region, postalCode, isoCountry){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, EmergencyEnabled = emergencyEnabled, AutoCorrectAddress = autoCorrectAddress, StreetSecondary = streetSecondary }; return Create(options, client); From a578975ff5ea726594cde24b499d8b747a11512c Mon Sep 17 00:00:00 2001 From: Joseph Livecchi Date: Mon, 13 Jan 2025 10:23:59 -0500 Subject: [PATCH 6/8] Fix build file --- src/Twilio/Rest/Api/V2010/Account/AddressResource.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Twilio/Rest/Api/V2010/Account/AddressResource.cs b/src/Twilio/Rest/Api/V2010/Account/AddressResource.cs index 285741de2..a6df93418 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AddressResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AddressResource.cs @@ -197,7 +197,7 @@ public static async System.Threading.Tasks.Task DeleteAsync(DeleteAddressO /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is responsible for the Address resource to delete. /// Client to make requests to Twilio /// A single instance of Address - public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) + public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteAddressOptions(pathSid) { PathAccountSid = pathAccountSid } ; return Delete(options, client); @@ -267,7 +267,7 @@ public static async System.Threading.Tasks.Task FetchAsync(Fetc public static AddressResource Fetch( string pathSid, string pathAccountSid = null, - ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) + ITwilioRestClient client = null) { var options = new FetchAddressOptions(pathSid){ PathAccountSid = pathAccountSid }; return Fetch(options, client); @@ -345,7 +345,7 @@ public static ResourceSet Read( string isoCountry = null, int? pageSize = null, long? limit = null, - ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) + ITwilioRestClient client = null) { var options = new ReadAddressOptions(){ PathAccountSid = pathAccountSid, CustomerName = customerName, FriendlyName = friendlyName, IsoCountry = isoCountry, PageSize = pageSize, Limit = limit}; return Read(options, client); @@ -497,7 +497,7 @@ public static AddressResource Update( bool? emergencyEnabled = null, bool? autoCorrectAddress = null, string streetSecondary = null, - ITwilioRestClient client = null, System.Threading.CancellationToken cancellationToken = default) + ITwilioRestClient client = null) { var options = new UpdateAddressOptions(pathSid){ PathAccountSid = pathAccountSid, FriendlyName = friendlyName, CustomerName = customerName, Street = street, City = city, Region = region, PostalCode = postalCode, EmergencyEnabled = emergencyEnabled, AutoCorrectAddress = autoCorrectAddress, StreetSecondary = streetSecondary }; return Update(options, client); From d71460176c0205d87ecdc974f75c07fbfdbb7760 Mon Sep 17 00:00:00 2001 From: Joseph Livecchi Date: Mon, 13 Jan 2025 10:35:44 -0500 Subject: [PATCH 7/8] Fixed build errors --- src/Twilio/Http/BearerToken/SystemNetTokenHttpClient.cs | 2 +- src/Twilio/Http/SystemNetHttpClient.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Twilio/Http/BearerToken/SystemNetTokenHttpClient.cs b/src/Twilio/Http/BearerToken/SystemNetTokenHttpClient.cs index 05e90e4db..38c0a004b 100644 --- a/src/Twilio/Http/BearerToken/SystemNetTokenHttpClient.cs +++ b/src/Twilio/Http/BearerToken/SystemNetTokenHttpClient.cs @@ -82,7 +82,7 @@ public override async Task MakeRequestAsync(TokenRequest request, Syst this.LastResponse = null; var httpResponse = await _httpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false); - var reader = new StreamReader(await httpResponse.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false)); + var reader = new StreamReader(await httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false)); // Create and return a new Response. Keep a reference to the last // response for debugging, but don't return it as it may be shared diff --git a/src/Twilio/Http/SystemNetHttpClient.cs b/src/Twilio/Http/SystemNetHttpClient.cs index dee407143..a0f2ccc36 100644 --- a/src/Twilio/Http/SystemNetHttpClient.cs +++ b/src/Twilio/Http/SystemNetHttpClient.cs @@ -77,7 +77,7 @@ public override async Task MakeRequestAsync(Request request, System.Th this.LastResponse = null; var httpResponse = await _httpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false); - var reader = new StreamReader(await httpResponse.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false)); + var reader = new StreamReader(await httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false)); // Create and return a new Response. Keep a reference to the last // response for debugging, but don't return it as it may be shared From b462539e5d1e0d9f8f87cab1deee6a58150c0e06 Mon Sep 17 00:00:00 2001 From: Joseph Livecchi Date: Mon, 13 Jan 2025 12:41:15 -0500 Subject: [PATCH 8/8] Update AddressResource.cs --- src/Twilio/Rest/Api/V2010/Account/AddressResource.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Twilio/Rest/Api/V2010/Account/AddressResource.cs b/src/Twilio/Rest/Api/V2010/Account/AddressResource.cs index a6df93418..cad0213af 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AddressResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AddressResource.cs @@ -381,7 +381,7 @@ public static async System.Threading.Tasks.Task> Re /// API-generated URL for the requested results page /// Client to make requests to Twilio /// The target page of records - public static Page GetPage(string targetUrl, ITwilioRestClient client, System.Threading.CancellationToken cancellationToken = default) + public static Page GetPage(string targetUrl, ITwilioRestClient client) { client = client ?? TwilioClient.GetRestClient();