/// <summary> /// Retrieve a list of notifications belonging to the account used to make the request /// </summary> /// /// <param name="pathAccountSid"> The account_sid </param> /// <param name="log"> Filter by log level </param> /// <param name="messageDateBefore"> Filter by date </param> /// <param name="messageDate"> Filter by date </param> /// <param name="messageDateAfter"> Filter by date </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 Notification </returns> public static async System.Threading.Tasks.Task <ResourceSet <NotificationResource> > ReadAsync(string pathAccountSid = null, int?log = null, DateTime?messageDateBefore = null, DateTime?messageDate = null, DateTime?messageDateAfter = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadNotificationOptions { PathAccountSid = pathAccountSid, Log = log, MessageDateBefore = messageDateBefore, MessageDate = messageDate, MessageDateAfter = messageDateAfter, PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// Retrieve a list of notifications belonging to the account used to make the request /// </summary> /// /// <param name="options"> Read Notification parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Notification </returns> public static ResourceSet <NotificationResource> Read(ReadNotificationOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <NotificationResource> .FromJson("notifications", response.Content); return(new ResourceSet <NotificationResource>(page, options, client)); }
private static Request BuildReadRequest(ReadNotificationOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Notifications.json", queryParams: options.GetParams() )); }
/// <summary> /// Retrieve a list of notifications belonging to the account used to make the request /// </summary> /// <param name="pathAccountSid"> The account_sid </param> /// <param name="log"> Filter by log level </param> /// <param name="messageDateBefore"> Filter by date </param> /// <param name="messageDate"> Filter by date </param> /// <param name="messageDateAfter"> Filter by date </param> /// <param name="pageSize"> Page size </param> /// <param name="limit"> Record limit </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Notification </returns> public static ResourceSet <NotificationResource> Read(string pathAccountSid = null, int?log = null, DateTime?messageDateBefore = null, DateTime?messageDate = null, DateTime?messageDateAfter = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadNotificationOptions() { PathAccountSid = pathAccountSid, Log = log, MessageDateBefore = messageDateBefore, MessageDate = messageDate, MessageDateAfter = messageDateAfter, PageSize = pageSize, Limit = limit }; return(Read(options, client)); }
/// <summary> /// Retrieve a list of notifications belonging to the account used to make the request /// </summary> /// /// <param name="options"> Read Notification parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Notification </returns> public static async System.Threading.Tasks.Task <ResourceSet <NotificationResource> > ReadAsync(ReadNotificationOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <NotificationResource> .FromJson("notifications", response.Content); return(new ResourceSet <NotificationResource>(page, options, client)); }