/// <summary> /// Retrieve a list of usage-triggers belonging to the account used to make the request /// </summary> /// /// <param name="pathAccountSid"> The account_sid </param> /// <param name="recurring"> Filter by recurring </param> /// <param name="triggerBy"> Filter by trigger by </param> /// <param name="usageCategory"> Filter by Usage Category </param> /// <param name="pageSize"> Page size </param> /// <param name="limit"> Record limit </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Trigger </returns> public static async System.Threading.Tasks.Task <ResourceSet <TriggerResource> > ReadAsync(string pathAccountSid = null, TriggerResource.RecurringEnum recurring = null, TriggerResource.TriggerFieldEnum triggerBy = null, TriggerResource.UsageCategoryEnum usageCategory = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadTriggerOptions { PathAccountSid = pathAccountSid, Recurring = recurring, TriggerBy = triggerBy, UsageCategory = usageCategory, PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// Retrieve a list of usage-triggers belonging to the account used to make the request /// </summary> /// /// <param name="options"> Read Trigger parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Trigger </returns> public static ResourceSet <TriggerResource> Read(ReadTriggerOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <TriggerResource> .FromJson("usage_triggers", response.Content); return(new ResourceSet <TriggerResource>(page, options, client)); }
private static Request BuildReadRequest(ReadTriggerOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Usage/Triggers.json", client.Region, queryParams: options.GetParams() )); }
/// <summary> /// Retrieve a list of usage-triggers belonging to the account used to make the request /// </summary> /// /// <param name="options"> Read Trigger parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Trigger </returns> public static async System.Threading.Tasks.Task <ResourceSet <TriggerResource> > ReadAsync(ReadTriggerOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <TriggerResource> .FromJson("usage_triggers", response.Content); return(new ResourceSet <TriggerResource>(page, options, client)); }