Пример #1
0
        /// <summary>
        /// Retrieve a list of all Builds.
        /// </summary>
        /// <param name="options"> Read Build parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Build </returns>
        public static ResourceSet <BuildResource> Read(ReadBuildOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <BuildResource> .FromJson("builds", response.Content);

            return(new ResourceSet <BuildResource>(page, options, client));
        }
Пример #2
0
 private static Request BuildReadRequest(ReadBuildOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Serverless,
                "/v1/Services/" + options.PathServiceSid + "/Builds",
                queryParams: options.GetParams()
                ));
 }
Пример #3
0
        /// <summary>
        /// Retrieve a list of all Builds.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </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 Build </returns>
        public static ResourceSet <BuildResource> Read(string pathServiceSid,
                                                       int?pageSize             = null,
                                                       long?limit               = null,
                                                       ITwilioRestClient client = null)
        {
            var options = new ReadBuildOptions(pathServiceSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Пример #4
0
        /// <summary>
        /// Retrieve a list of all Builds.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </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 Build </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <BuildResource> > ReadAsync(string pathServiceSid,
                                                                                                 int?pageSize             = null,
                                                                                                 long?limit               = null,
                                                                                                 ITwilioRestClient client = null)
        {
            var options = new ReadBuildOptions(pathServiceSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Пример #5
0
        /// <summary>
        /// Retrieve a list of all Builds.
        /// </summary>
        /// <param name="options"> Read Build parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Build </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <BuildResource> > ReadAsync(ReadBuildOptions options,
                                                                                                 ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <BuildResource> .FromJson("builds", response.Content);

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