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

            var page = Page <EngagementResource> .FromJson("engagements", response.Content);

            return(new ResourceSet <EngagementResource>(page, options, client));
        }
Пример #2
0
 private static Request BuildReadRequest(ReadEngagementOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Studio,
                "/v1/Flows/" + options.PathFlowSid + "/Engagements",
                queryParams: options.GetParams()
                ));
 }
Пример #3
0
        /// <summary>
        /// Retrieve a list of all Engagements for the Flow.
        /// </summary>
        /// <param name="pathFlowSid"> Flow 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 Engagement </returns>
        public static ResourceSet <EngagementResource> Read(string pathFlowSid,
                                                            int?pageSize             = null,
                                                            long?limit               = null,
                                                            ITwilioRestClient client = null)
        {
            var options = new ReadEngagementOptions(pathFlowSid)
            {
                PageSize = pageSize, Limit = limit
            };

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

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

            var page = Page <EngagementResource> .FromJson("engagements", response.Content);

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