Ejemplo n.º 1
0
        /// <summary>
        /// Retrieve a list of all Executions for the Flow.
        /// </summary>
        /// <param name="options"> Read Execution parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Execution </returns>
        public static ResourceSet <ExecutionResource> Read(ReadExecutionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <ExecutionResource> .FromJson("executions", response.Content);

            return(new ResourceSet <ExecutionResource>(page, options, client));
        }
 private static Request BuildReadRequest(ReadExecutionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Studio,
                "/v2/Flows/" + options.PathFlowSid + "/Executions",
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Retrieve a list of all Executions for the Flow.
        /// </summary>
        /// <param name="pathFlowSid"> The SID of the Flow </param>
        /// <param name="dateCreatedFrom"> Only show Executions that started on or after this ISO 8601 date-time </param>
        /// <param name="dateCreatedTo"> Only show Executions that started before this ISO 8601 date-time </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 Execution </returns>
        public static ResourceSet <ExecutionResource> Read(string pathFlowSid,
                                                           DateTime?dateCreatedFrom = null,
                                                           DateTime?dateCreatedTo   = null,
                                                           int?pageSize             = null,
                                                           long?limit = null,
                                                           ITwilioRestClient client = null)
        {
            var options = new ReadExecutionOptions(pathFlowSid)
            {
                DateCreatedFrom = dateCreatedFrom, DateCreatedTo = dateCreatedTo, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Retrieve a list of all Executions for the Flow.
        /// </summary>
        /// <param name="pathFlowSid"> The SID of the Flow </param>
        /// <param name="dateCreatedFrom"> Only show Executions that started on or after this ISO 8601 date-time </param>
        /// <param name="dateCreatedTo"> Only show Executions that started before this ISO 8601 date-time </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 Execution </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <ExecutionResource> > ReadAsync(string pathFlowSid,
                                                                                                     DateTime?dateCreatedFrom = null,
                                                                                                     DateTime?dateCreatedTo   = null,
                                                                                                     int?pageSize             = null,
                                                                                                     long?limit = null,
                                                                                                     ITwilioRestClient client = null)
        {
            var options = new ReadExecutionOptions(pathFlowSid)
            {
                DateCreatedFrom = dateCreatedFrom, DateCreatedTo = dateCreatedTo, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Retrieve a list of all Executions for the Flow.
        /// </summary>
        /// <param name="options"> Read Execution parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Execution </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <ExecutionResource> > ReadAsync(ReadExecutionOptions options,
                                                                                                     ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <ExecutionResource> .FromJson("executions", response.Content);

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