Beispiel #1
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Metric parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Metric </returns>
        public static ResourceSet <MetricResource> Read(ReadMetricOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <MetricResource> .FromJson("metrics", response.Content);

            return(new ResourceSet <MetricResource>(page, options, client));
        }
Beispiel #2
0
 private static Request BuildReadRequest(ReadMetricOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Insights,
                "/v1/Voice/" + options.PathCallSid + "/Metrics",
                queryParams: options.GetParams()
                ));
 }
Beispiel #3
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathCallSid"> The call_sid </param>
        /// <param name="edge"> The edge </param>
        /// <param name="direction"> The direction </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 Metric </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <MetricResource> > ReadAsync(string pathCallSid,
                                                                                                  MetricResource.TwilioEdgeEnum edge           = null,
                                                                                                  MetricResource.StreamDirectionEnum direction = null,
                                                                                                  int?pageSize             = null,
                                                                                                  long?limit               = null,
                                                                                                  ITwilioRestClient client = null)
        {
            var options = new ReadMetricOptions(pathCallSid)
            {
                Edge = edge, Direction = direction, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Beispiel #4
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Metric parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Metric </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <MetricResource> > ReadAsync(ReadMetricOptions options,
                                                                                                  ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <MetricResource> .FromJson("metrics", response.Content);

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