Exemplo n.º 1
0
        /// <summary>
        /// Retrieves a collection of Accounts belonging to the account used to make the request
        /// </summary>
        ///
        /// <param name="friendlyName"> FriendlyName to filter on </param>
        /// <param name="status"> Status to filter on </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 Account </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <AccountResource> > ReadAsync(string friendlyName = null, AccountResource.StatusEnum status = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadAccountOptions {
                FriendlyName = friendlyName, Status = status, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retrieves a collection of Accounts belonging to the account used to make the request
        /// </summary>
        ///
        /// <param name="friendlyName"> FriendlyName to filter on </param>
        /// <param name="status"> Status to filter on </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 Account </returns>
        public static ResourceSet <AccountResource> Read(string friendlyName = null, AccountResource.StatusEnum status = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadAccountOptions {
                FriendlyName = friendlyName, Status = status, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Retrieves a collection of Accounts belonging to the account used to make the request
        /// </summary>
        ///
        /// <param name="options"> Read Account parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Account </returns>
        public static ResourceSet <AccountResource> Read(ReadAccountOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <AccountResource> .FromJson("accounts", response.Content);

            return(new ResourceSet <AccountResource>(page, options, client));
        }
 private static Request BuildReadRequest(ReadAccountOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts.json",
                queryParams: options.GetParams()
                ));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Retrieves a collection of Accounts belonging to the account used to make the request
        /// </summary>
        ///
        /// <param name="options"> Read Account parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Account </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <AccountResource> > ReadAsync(ReadAccountOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <AccountResource> .FromJson("accounts", response.Content);

            return(new ResourceSet <AccountResource>(page, options, client));
        }