Ejemplo n.º 1
0
        /// <summary>
        /// Retrieve a list of outgoing-caller-ids belonging to the account used to make the request
        /// </summary>
        ///
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="phoneNumber"> Filter by phone number </param>
        /// <param name="friendlyName"> Filter by friendly name </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 OutgoingCallerId </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <OutgoingCallerIdResource> > ReadAsync(string pathAccountSid = null, Types.PhoneNumber phoneNumber = null, string friendlyName = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadOutgoingCallerIdOptions {
                PathAccountSid = pathAccountSid, PhoneNumber = phoneNumber, FriendlyName = friendlyName, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Ejemplo n.º 2
0
        /// <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));
        }
 private static Request BuildReadRequest(ReadOutgoingCallerIdOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/OutgoingCallerIds.json",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Retrieve a list of outgoing-caller-ids belonging to the account used to make the request
        /// </summary>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="phoneNumber"> Filter by phone number </param>
        /// <param name="friendlyName"> Filter by friendly name </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 OutgoingCallerId </returns>
        public static ResourceSet <OutgoingCallerIdResource> Read(string pathAccountSid         = null,
                                                                  Types.PhoneNumber phoneNumber = null,
                                                                  string friendlyName           = null,
                                                                  int?pageSize             = null,
                                                                  long?limit               = null,
                                                                  ITwilioRestClient client = null)
        {
            var options = new ReadOutgoingCallerIdOptions()
            {
                PathAccountSid = pathAccountSid, PhoneNumber = phoneNumber, FriendlyName = friendlyName, PageSize = pageSize, Limit = limit
            };

            return(Read(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));
        }