Esempio n. 1
0
 private static Request BuildReadRequest(ReadExecutionStepOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Studio,
                "/v2/Flows/" + options.PathFlowSid + "/Executions/" + options.PathExecutionSid + "/Steps",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Retrieve a list of all Steps for an Execution.
        /// </summary>
        /// <param name="options"> Read ExecutionStep parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ExecutionStep </returns>
        public static ResourceSet <ExecutionStepResource> Read(ReadExecutionStepOptions options,
                                                               ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <ExecutionStepResource> .FromJson("steps", response.Content);

            return(new ResourceSet <ExecutionStepResource>(page, options, client));
        }
        /// <summary>
        /// Retrieve a list of all Steps for an Execution.
        /// </summary>
        /// <param name="pathFlowSid"> The SID of the Flow </param>
        /// <param name="pathExecutionSid"> The SID of the Execution </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 ExecutionStep </returns>
        public static ResourceSet <ExecutionStepResource> Read(string pathFlowSid,
                                                               string pathExecutionSid,
                                                               int?pageSize             = null,
                                                               long?limit               = null,
                                                               ITwilioRestClient client = null)
        {
            var options = new ReadExecutionStepOptions(pathFlowSid, pathExecutionSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
        /// <summary>
        /// Retrieve a list of all Steps for an Execution.
        /// </summary>
        /// <param name="pathFlowSid"> The SID of the Flow </param>
        /// <param name="pathExecutionSid"> The SID of the Execution </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 ExecutionStep </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <ExecutionStepResource> > ReadAsync(string pathFlowSid,
                                                                                                         string pathExecutionSid,
                                                                                                         int?pageSize             = null,
                                                                                                         long?limit               = null,
                                                                                                         ITwilioRestClient client = null)
        {
            var options = new ReadExecutionStepOptions(pathFlowSid, pathExecutionSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
        /// <summary>
        /// Retrieve a list of all Steps for an Execution.
        /// </summary>
        /// <param name="options"> Read ExecutionStep parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ExecutionStep </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <ExecutionStepResource> > ReadAsync(ReadExecutionStepOptions options,
                                                                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <ExecutionStepResource> .FromJson("steps", response.Content);

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