/// <summary> /// Retrieve the context for an Engagement Step. /// </summary> /// <param name="options"> Fetch StepContext parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of StepContext </returns> public static StepContextResource Fetch(FetchStepContextOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Retrieve the context for an Engagement Step. /// </summary> /// <param name="pathFlowSid"> Flow Sid. </param> /// <param name="pathEngagementSid"> Engagement Sid. </param> /// <param name="pathStepSid"> Step Sid. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of StepContext </returns> public static async System.Threading.Tasks.Task <StepContextResource> FetchAsync(string pathFlowSid, string pathEngagementSid, string pathStepSid, ITwilioRestClient client = null) { var options = new FetchStepContextOptions(pathFlowSid, pathEngagementSid, pathStepSid); return(await FetchAsync(options, client)); }
/// <summary> /// Retrieve the context for an Engagement Step. /// </summary> /// <param name="pathFlowSid"> Flow Sid. </param> /// <param name="pathEngagementSid"> Engagement Sid. </param> /// <param name="pathStepSid"> Step Sid. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of StepContext </returns> public static StepContextResource Fetch(string pathFlowSid, string pathEngagementSid, string pathStepSid, ITwilioRestClient client = null) { var options = new FetchStepContextOptions(pathFlowSid, pathEngagementSid, pathStepSid); return(Fetch(options, client)); }
private static Request BuildFetchRequest(FetchStepContextOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Studio, "/v1/Flows/" + options.PathFlowSid + "/Engagements/" + options.PathEngagementSid + "/Steps/" + options.PathStepSid + "/Context", queryParams: options.GetParams() )); }
/// <summary> /// Retrieve the context for an Engagement Step. /// </summary> /// <param name="options"> Fetch StepContext parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of StepContext </returns> public static async System.Threading.Tasks.Task <StepContextResource> FetchAsync(FetchStepContextOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }