-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Librarian] Regenerated @ 0d6397ea462cf38ccee74f7de204ee1261bb0d8f
- Loading branch information
Showing
15 changed files
with
571 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/// This code was generated by | ||
/// \ / _ _ _| _ _ | ||
/// | (_)\/(_)(_|\/| |(/_ v1.0.0 | ||
/// / / | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Twilio.Base; | ||
using Twilio.Converters; | ||
|
||
namespace Twilio.Rest.Studio.V1.Flow.Engagement | ||
{ | ||
|
||
/// <summary> | ||
/// PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. | ||
/// | ||
/// FetchEngagementContextOptions | ||
/// </summary> | ||
public class FetchEngagementContextOptions : IOptions<EngagementContextResource> | ||
{ | ||
/// <summary> | ||
/// The flow_sid | ||
/// </summary> | ||
public string PathFlowSid { get; } | ||
/// <summary> | ||
/// The engagement_sid | ||
/// </summary> | ||
public string PathEngagementSid { get; } | ||
|
||
/// <summary> | ||
/// Construct a new FetchEngagementContextOptions | ||
/// </summary> | ||
/// <param name="pathFlowSid"> The flow_sid </param> | ||
/// <param name="pathEngagementSid"> The engagement_sid </param> | ||
public FetchEngagementContextOptions(string pathFlowSid, string pathEngagementSid) | ||
{ | ||
PathFlowSid = pathFlowSid; | ||
PathEngagementSid = pathEngagementSid; | ||
} | ||
|
||
/// <summary> | ||
/// Generate the necessary parameters | ||
/// </summary> | ||
public List<KeyValuePair<string, string>> GetParams() | ||
{ | ||
var p = new List<KeyValuePair<string, string>>(); | ||
return p; | ||
} | ||
} | ||
|
||
} |
147 changes: 147 additions & 0 deletions
147
src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextResource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
/// This code was generated by | ||
/// \ / _ _ _| _ _ | ||
/// | (_)\/(_)(_|\/| |(/_ v1.0.0 | ||
/// / / | ||
/// <summary> | ||
/// PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. | ||
/// | ||
/// EngagementContextResource | ||
/// </summary> | ||
|
||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
using Twilio.Base; | ||
using Twilio.Clients; | ||
using Twilio.Converters; | ||
using Twilio.Exceptions; | ||
using Twilio.Http; | ||
|
||
namespace Twilio.Rest.Studio.V1.Flow.Engagement | ||
{ | ||
|
||
public class EngagementContextResource : Resource | ||
{ | ||
private static Request BuildFetchRequest(FetchEngagementContextOptions options, ITwilioRestClient client) | ||
{ | ||
return new Request( | ||
HttpMethod.Get, | ||
Rest.Domain.Studio, | ||
"/v1/Flows/" + options.PathFlowSid + "/Engagements/" + options.PathEngagementSid + "/Context", | ||
client.Region, | ||
queryParams: options.GetParams() | ||
); | ||
} | ||
|
||
/// <summary> | ||
/// fetch | ||
/// </summary> | ||
/// <param name="options"> Fetch EngagementContext parameters </param> | ||
/// <param name="client"> Client to make requests to Twilio </param> | ||
/// <returns> A single instance of EngagementContext </returns> | ||
public static EngagementContextResource Fetch(FetchEngagementContextOptions options, ITwilioRestClient client = null) | ||
{ | ||
client = client ?? TwilioClient.GetRestClient(); | ||
var response = client.Request(BuildFetchRequest(options, client)); | ||
return FromJson(response.Content); | ||
} | ||
|
||
#if !NET35 | ||
/// <summary> | ||
/// fetch | ||
/// </summary> | ||
/// <param name="options"> Fetch EngagementContext parameters </param> | ||
/// <param name="client"> Client to make requests to Twilio </param> | ||
/// <returns> Task that resolves to A single instance of EngagementContext </returns> | ||
public static async System.Threading.Tasks.Task<EngagementContextResource> FetchAsync(FetchEngagementContextOptions options, | ||
ITwilioRestClient client = null) | ||
{ | ||
client = client ?? TwilioClient.GetRestClient(); | ||
var response = await client.RequestAsync(BuildFetchRequest(options, client)); | ||
return FromJson(response.Content); | ||
} | ||
#endif | ||
|
||
/// <summary> | ||
/// fetch | ||
/// </summary> | ||
/// <param name="pathFlowSid"> The flow_sid </param> | ||
/// <param name="pathEngagementSid"> The engagement_sid </param> | ||
/// <param name="client"> Client to make requests to Twilio </param> | ||
/// <returns> A single instance of EngagementContext </returns> | ||
public static EngagementContextResource Fetch(string pathFlowSid, | ||
string pathEngagementSid, | ||
ITwilioRestClient client = null) | ||
{ | ||
var options = new FetchEngagementContextOptions(pathFlowSid, pathEngagementSid); | ||
return Fetch(options, client); | ||
} | ||
|
||
#if !NET35 | ||
/// <summary> | ||
/// fetch | ||
/// </summary> | ||
/// <param name="pathFlowSid"> The flow_sid </param> | ||
/// <param name="pathEngagementSid"> The engagement_sid </param> | ||
/// <param name="client"> Client to make requests to Twilio </param> | ||
/// <returns> Task that resolves to A single instance of EngagementContext </returns> | ||
public static async System.Threading.Tasks.Task<EngagementContextResource> FetchAsync(string pathFlowSid, | ||
string pathEngagementSid, | ||
ITwilioRestClient client = null) | ||
{ | ||
var options = new FetchEngagementContextOptions(pathFlowSid, pathEngagementSid); | ||
return await FetchAsync(options, client); | ||
} | ||
#endif | ||
|
||
/// <summary> | ||
/// Converts a JSON string into a EngagementContextResource object | ||
/// </summary> | ||
/// <param name="json"> Raw JSON string </param> | ||
/// <returns> EngagementContextResource object represented by the provided JSON </returns> | ||
public static EngagementContextResource FromJson(string json) | ||
{ | ||
// Convert all checked exceptions to Runtime | ||
try | ||
{ | ||
return JsonConvert.DeserializeObject<EngagementContextResource>(json); | ||
} | ||
catch (JsonException e) | ||
{ | ||
throw new ApiException(e.Message, e); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// The account_sid | ||
/// </summary> | ||
[JsonProperty("account_sid")] | ||
public string AccountSid { get; private set; } | ||
/// <summary> | ||
/// The context | ||
/// </summary> | ||
[JsonProperty("context")] | ||
public object Context { get; private set; } | ||
/// <summary> | ||
/// The engagement_sid | ||
/// </summary> | ||
[JsonProperty("engagement_sid")] | ||
public string EngagementSid { get; private set; } | ||
/// <summary> | ||
/// The flow_sid | ||
/// </summary> | ||
[JsonProperty("flow_sid")] | ||
public string FlowSid { get; private set; } | ||
/// <summary> | ||
/// The url | ||
/// </summary> | ||
[JsonProperty("url")] | ||
public Uri Url { get; private set; } | ||
|
||
private EngagementContextResource() | ||
{ | ||
|
||
} | ||
} | ||
|
||
} |
57 changes: 57 additions & 0 deletions
57
src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/// This code was generated by | ||
/// \ / _ _ _| _ _ | ||
/// | (_)\/(_)(_|\/| |(/_ v1.0.0 | ||
/// / / | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Twilio.Base; | ||
using Twilio.Converters; | ||
|
||
namespace Twilio.Rest.Studio.V1.Flow.Engagement.Step | ||
{ | ||
|
||
/// <summary> | ||
/// PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. | ||
/// | ||
/// FetchStepContextOptions | ||
/// </summary> | ||
public class FetchStepContextOptions : IOptions<StepContextResource> | ||
{ | ||
/// <summary> | ||
/// The flow_sid | ||
/// </summary> | ||
public string PathFlowSid { get; } | ||
/// <summary> | ||
/// The engagement_sid | ||
/// </summary> | ||
public string PathEngagementSid { get; } | ||
/// <summary> | ||
/// The step_sid | ||
/// </summary> | ||
public string PathStepSid { get; } | ||
|
||
/// <summary> | ||
/// Construct a new FetchStepContextOptions | ||
/// </summary> | ||
/// <param name="pathFlowSid"> The flow_sid </param> | ||
/// <param name="pathEngagementSid"> The engagement_sid </param> | ||
/// <param name="pathStepSid"> The step_sid </param> | ||
public FetchStepContextOptions(string pathFlowSid, string pathEngagementSid, string pathStepSid) | ||
{ | ||
PathFlowSid = pathFlowSid; | ||
PathEngagementSid = pathEngagementSid; | ||
PathStepSid = pathStepSid; | ||
} | ||
|
||
/// <summary> | ||
/// Generate the necessary parameters | ||
/// </summary> | ||
public List<KeyValuePair<string, string>> GetParams() | ||
{ | ||
var p = new List<KeyValuePair<string, string>>(); | ||
return p; | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.