/// <summary> /// Retrieve a list of outgoing-caller-ids belonging to the account used to make the request /// </summary> /// <param name="options"> Read OutgoingCallerId parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of OutgoingCallerId </returns> public static ResourceSet <OutgoingCallerIdResource> Read(ReadOutgoingCallerIdOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <OutgoingCallerIdResource> .FromJson("outgoing_caller_ids", response.Content); return(new ResourceSet <OutgoingCallerIdResource>(page, options, client)); }
/// <summary> /// Retrieve a list of credential list mappings belonging to the domain used in the request /// </summary> /// <param name="options"> Read AuthCallsCredentialListMapping parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of AuthCallsCredentialListMapping </returns> public static ResourceSet <AuthCallsCredentialListMappingResource> Read(ReadAuthCallsCredentialListMappingOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <AuthCallsCredentialListMappingResource> .FromJson("contents", response.Content); return(new ResourceSet <AuthCallsCredentialListMappingResource>(page, options, client)); }
/// <summary> /// Retrieve a list of credential list mappings belonging to the domain used in the request /// </summary> /// <param name="options"> Read AuthCallsCredentialListMapping parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of AuthCallsCredentialListMapping </returns> public static async System.Threading.Tasks.Task <ResourceSet <AuthCallsCredentialListMappingResource> > ReadAsync(ReadAuthCallsCredentialListMappingOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <AuthCallsCredentialListMappingResource> .FromJson("contents", response.Content); return(new ResourceSet <AuthCallsCredentialListMappingResource>(page, options, client)); }
/// <summary> /// Retrieve a list of authorized-connect-apps belonging to the account used to make the request /// </summary> /// <param name="options"> Read AuthorizedConnectApp parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of AuthorizedConnectApp </returns> public static ResourceSet <AuthorizedConnectAppResource> Read(ReadAuthorizedConnectAppOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <AuthorizedConnectAppResource> .FromJson("authorized_connect_apps", response.Content); return(new ResourceSet <AuthorizedConnectAppResource>(page, options, client)); }
/// <summary> /// read /// </summary> /// <param name="options"> Read Daily parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Daily </returns> public static async System.Threading.Tasks.Task <ResourceSet <DailyResource> > ReadAsync(ReadDailyOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <DailyResource> .FromJson("usage_records", response.Content); return(new ResourceSet <DailyResource>(page, options, client)); }
/// <summary> /// read /// </summary> /// <param name="options"> Read TaskQueuesStatistics parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of TaskQueuesStatistics </returns> public static ResourceSet <TaskQueuesStatisticsResource> Read(ReadTaskQueuesStatisticsOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <TaskQueuesStatisticsResource> .FromJson("task_queues_statistics", response.Content); return(new ResourceSet <TaskQueuesStatisticsResource>(page, options, client)); }
/// <summary> /// read /// </summary> /// <param name="options"> Read Local parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Local </returns> public static async System.Threading.Tasks.Task <ResourceSet <LocalResource> > ReadAsync(ReadLocalOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <LocalResource> .FromJson("incoming_phone_numbers", response.Content); return(new ResourceSet <LocalResource>(page, options, client)); }
/// <summary> /// Fetch the high-risk special services prefixes from the country resource corresponding to the [ISO country /// code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) /// </summary> /// <param name="options"> Read HighriskSpecialPrefix parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of HighriskSpecialPrefix </returns> public static ResourceSet <HighriskSpecialPrefixResource> Read(ReadHighriskSpecialPrefixOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <HighriskSpecialPrefixResource> .FromJson("content", response.Content); return(new ResourceSet <HighriskSpecialPrefixResource>(page, options, client)); }
/// <summary> /// Fetch the high-risk special services prefixes from the country resource corresponding to the [ISO country /// code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) /// </summary> /// <param name="options"> Read HighriskSpecialPrefix parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of HighriskSpecialPrefix </returns> public static async System.Threading.Tasks.Task <ResourceSet <HighriskSpecialPrefixResource> > ReadAsync(ReadHighriskSpecialPrefixOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <HighriskSpecialPrefixResource> .FromJson("content", response.Content); return(new ResourceSet <HighriskSpecialPrefixResource>(page, options, client)); }
/// <summary> /// Retrieve a list of all Supporting Document for an account. /// </summary> /// <param name="options"> Read SupportingDocument parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of SupportingDocument </returns> public static ResourceSet <SupportingDocumentResource> Read(ReadSupportingDocumentOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <SupportingDocumentResource> .FromJson("results", response.Content); return(new ResourceSet <SupportingDocumentResource>(page, options, client)); }
/// <summary> /// Retrieve a list of all Supporting Document for an account. /// </summary> /// <param name="options"> Read SupportingDocument parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of SupportingDocument </returns> public static async System.Threading.Tasks.Task <ResourceSet <SupportingDocumentResource> > ReadAsync(ReadSupportingDocumentOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <SupportingDocumentResource> .FromJson("results", response.Content); return(new ResourceSet <SupportingDocumentResource>(page, options, client)); }
/// <summary> /// read /// </summary> /// <param name="options"> Read DependentPhoneNumber parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of DependentPhoneNumber </returns> public static ResourceSet <DependentPhoneNumberResource> Read(ReadDependentPhoneNumberOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <DependentPhoneNumberResource> .FromJson("dependent_phone_numbers", response.Content); return(new ResourceSet <DependentPhoneNumberResource>(page, options, client)); }
/// <summary> /// read /// </summary> /// <param name="options"> Read ConnectionPolicyTarget parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of ConnectionPolicyTarget </returns> public static async System.Threading.Tasks.Task <ResourceSet <ConnectionPolicyTargetResource> > ReadAsync(ReadConnectionPolicyTargetOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <ConnectionPolicyTargetResource> .FromJson("targets", response.Content); return(new ResourceSet <ConnectionPolicyTargetResource>(page, options, client)); }
/// <summary> /// Retrieve a list of outgoing-caller-ids belonging to the account used to make the request /// </summary> /// <param name="options"> Read OutgoingCallerId parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of OutgoingCallerId </returns> public static async System.Threading.Tasks.Task <ResourceSet <OutgoingCallerIdResource> > ReadAsync(ReadOutgoingCallerIdOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <OutgoingCallerIdResource> .FromJson("outgoing_caller_ids", response.Content); return(new ResourceSet <OutgoingCallerIdResource>(page, options, client)); }
/// <summary> /// Retrieve a list of Add-on installations currently assigned to this Number. /// </summary> /// <param name="options"> Read AssignedAddOn parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of AssignedAddOn </returns> public static async System.Threading.Tasks.Task <ResourceSet <AssignedAddOnResource> > ReadAsync(ReadAssignedAddOnOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <AssignedAddOnResource> .FromJson("assigned_add_ons", response.Content); return(new ResourceSet <AssignedAddOnResource>(page, options, client)); }
/// <summary> /// read /// </summary> /// <param name="options"> Read IpAccessControlList parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of IpAccessControlList </returns> public static ResourceSet <IpAccessControlListResource> Read(ReadIpAccessControlListOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <IpAccessControlListResource> .FromJson("ip_access_control_lists", response.Content); return(new ResourceSet <IpAccessControlListResource>(page, options, client)); }
/// <summary> /// Retrieve a list of HostedNumberOrders belonging to the account initiating the request. /// </summary> /// <param name="options"> Read HostedNumberOrder parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of HostedNumberOrder </returns> public static ResourceSet <HostedNumberOrderResource> Read(ReadHostedNumberOrderOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <HostedNumberOrderResource> .FromJson("items", response.Content); return(new ResourceSet <HostedNumberOrderResource>(page, options, client)); }
/// <summary> /// read /// </summary> /// <param name="options"> Read IpAccessControlList parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of IpAccessControlList </returns> public static async System.Threading.Tasks.Task <ResourceSet <IpAccessControlListResource> > ReadAsync(ReadIpAccessControlListOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <IpAccessControlListResource> .FromJson("ip_access_control_lists", response.Content); return(new ResourceSet <IpAccessControlListResource>(page, options, client)); }
/// <summary> /// read /// </summary> /// <param name="options"> Read TaskQueuesStatistics parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of TaskQueuesStatistics </returns> public static async System.Threading.Tasks.Task <ResourceSet <TaskQueuesStatisticsResource> > ReadAsync(ReadTaskQueuesStatisticsOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <TaskQueuesStatisticsResource> .FromJson("task_queues_statistics", response.Content); return(new ResourceSet <TaskQueuesStatisticsResource>(page, options, client)); }
/// <summary> /// Retrieve a list of all End-User Types. /// </summary> /// <param name="options"> Read EndUserType parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of EndUserType </returns> public static async System.Threading.Tasks.Task <ResourceSet <EndUserTypeResource> > ReadAsync(ReadEndUserTypeOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <EndUserTypeResource> .FromJson("end_user_types", response.Content); return(new ResourceSet <EndUserTypeResource>(page, options, client)); }
/// <summary> /// Retrieve a list of conversations in your account's default service /// </summary> /// <param name="options"> Read Conversation parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Conversation </returns> public static ResourceSet <ConversationResource> Read(ReadConversationOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <ConversationResource> .FromJson("conversations", response.Content); return(new ResourceSet <ConversationResource>(page, options, client)); }
/// <summary> /// Retrieve a list of all Messaging Configurations for a Service. /// </summary> /// <param name="options"> Read MessagingConfiguration parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of MessagingConfiguration </returns> public static async System.Threading.Tasks.Task <ResourceSet <MessagingConfigurationResource> > ReadAsync(ReadMessagingConfigurationOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <MessagingConfigurationResource> .FromJson("messaging_configurations", response.Content); return(new ResourceSet <MessagingConfigurationResource>(page, options, client)); }
/// <summary> /// Retrieve a list of authorized-connect-apps belonging to the account used to make the request /// </summary> /// <param name="options"> Read AuthorizedConnectApp parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of AuthorizedConnectApp </returns> public static async System.Threading.Tasks.Task <ResourceSet <AuthorizedConnectAppResource> > ReadAsync(ReadAuthorizedConnectAppOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <AuthorizedConnectAppResource> .FromJson("authorized_connect_apps", response.Content); return(new ResourceSet <AuthorizedConnectAppResource>(page, options, client)); }
/// <summary> /// Retrieve a list of Add-on installations currently assigned to this Number. /// </summary> /// <param name="options"> Read AssignedAddOn parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of AssignedAddOn </returns> public static ResourceSet <AssignedAddOnResource> Read(ReadAssignedAddOnOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <AssignedAddOnResource> .FromJson("assigned_add_ons", response.Content); return(new ResourceSet <AssignedAddOnResource>(page, options, client)); }
/// <summary> /// read /// </summary> /// <param name="options"> Read OriginationUrl parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of OriginationUrl </returns> public static ResourceSet <OriginationUrlResource> Read(ReadOriginationUrlOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <OriginationUrlResource> .FromJson("origination_urls", response.Content); return(new ResourceSet <OriginationUrlResource>(page, options, client)); }
static void Main(string[] args) { // Find your Account Sid and Auth Token at twilio.com/console // To set up environmental variables, see http://twil.io/secure const string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID"); const string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN"); TwilioClient.Init(accountSid, authToken); RecordingResource.Fetch("RE557ce644e5ab84fa21cc21112e22c485", client: TwilioClient.GetRestClient()); }
/// <summary> /// Fetch the target page of records /// </summary> /// <param name="targetUrl"> API-generated URL for the requested results page </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> The target page of records </returns> public static Page<CredentialResource> GetPage(string targetUrl, ITwilioRestClient client) { client = client ?? TwilioClient.GetRestClient(); var request = new Request( HttpMethod.Get, targetUrl ); var response = client.Request(request); return Page<CredentialResource>.FromJson("credentials", response.Content); }
/// <summary> /// Fetch the target page of records /// </summary> /// <param name="targetUrl"> API-generated URL for the requested results page </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> The target page of records </returns> public static Page<HostedNumberOrderResource> GetPage(string targetUrl, ITwilioRestClient client) { client = client ?? TwilioClient.GetRestClient(); var request = new Request( HttpMethod.Get, targetUrl ); var response = client.Request(request); return Page<HostedNumberOrderResource>.FromJson("items", response.Content); }
/// <summary> /// Fetch the target page of records /// </summary> /// <param name="targetUrl"> API-generated URL for the requested results page </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> The target page of records </returns> public static Page <ThisMonthResource> GetPage(string targetUrl, ITwilioRestClient client) { client = client ?? TwilioClient.GetRestClient(); var request = new Request( HttpMethod.Get, targetUrl ); var response = client.Request(request); return(Page <ThisMonthResource> .FromJson("usage_records", response.Content)); }
/// <summary> /// Fetch the target page of records /// </summary> /// <param name="targetUrl"> API-generated URL for the requested results page </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> The target page of records </returns> public static Page <MobileResource> GetPage(string targetUrl, ITwilioRestClient client) { client = client ?? TwilioClient.GetRestClient(); var request = new Request( HttpMethod.Get, targetUrl ); var response = client.Request(request); return(Page <MobileResource> .FromJson("available_phone_numbers", response.Content)); }