Ejemplo n.º 1
0
        /// <summary>
        /// Fetch a specific Impressions Rate.
        /// </summary>
        /// <param name="options"> Fetch ImpressionsRate parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ImpressionsRate </returns>
        public static ImpressionsRateResource Fetch(FetchImpressionsRateOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 2
0
 private static Request BuildFetchRequest(FetchImpressionsRateOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/TrustedComms/Businesses/" + options.PathBusinessSid + "/Insights/ImpressionsRate",
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Fetch a specific Impressions Rate.
        /// </summary>
        /// <param name="pathBusinessSid"> Business Sid. </param>
        /// <param name="brandSid"> Brand Sid. </param>
        /// <param name="brandedChannelSid"> Branded Channel Sid. </param>
        /// <param name="phoneNumberSid"> Phone Number Sid. </param>
        /// <param name="country"> Country 2-letter ISO 3166 code. </param>
        /// <param name="start"> The start date that for this Impressions Rate. </param>
        /// <param name="end"> The end date that for this Impressions Rate. </param>
        /// <param name="interval"> The Interval of this Impressions Rate. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ImpressionsRate </returns>
        public static async System.Threading.Tasks.Task <ImpressionsRateResource> FetchAsync(string pathBusinessSid,
                                                                                             string brandSid          = null,
                                                                                             string brandedChannelSid = null,
                                                                                             string phoneNumberSid    = null,
                                                                                             string country           = null,
                                                                                             DateTime?start           = null,
                                                                                             DateTime?end             = null,
                                                                                             ImpressionsRateResource.IntervalsEnum interval = null,
                                                                                             ITwilioRestClient client = null)
        {
            var options = new FetchImpressionsRateOptions(pathBusinessSid)
            {
                BrandSid = brandSid, BrandedChannelSid = brandedChannelSid, PhoneNumberSid = phoneNumberSid, Country = country, Start = start, End = end, Interval = interval
            };

            return(await FetchAsync(options, client));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Fetch a specific Impressions Rate.
        /// </summary>
        /// <param name="options"> Fetch ImpressionsRate parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ImpressionsRate </returns>
        public static async System.Threading.Tasks.Task <ImpressionsRateResource> FetchAsync(FetchImpressionsRateOptions options,
                                                                                             ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }