-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into natebrennand/add-context-methods-to-SDK
- Loading branch information
Showing
74 changed files
with
1,530 additions
and
351 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
63 changes: 63 additions & 0 deletions
63
examples/csharp/src/Twilio/Rest/FlexApi/V1/Credential/Aws/HistoryOptions.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,63 @@ | ||
/* | ||
* This code was generated by | ||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ | ||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ | ||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ | ||
* | ||
* Twilio - Accounts | ||
* This is the public Twilio REST API. | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator. | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Twilio.Base; | ||
using Twilio.Converters; | ||
|
||
|
||
|
||
|
||
namespace Twilio.Rest.FlexApi.V1.Credential.Aws | ||
{ | ||
/// <summary> fetch </summary> | ||
public class FetchHistoryOptions : IOptions<HistoryResource> | ||
{ | ||
|
||
|
||
public string PathSid { get; } | ||
|
||
|
||
public Dictionary<string, object> AddOnsData { get; set; } | ||
|
||
|
||
|
||
/// <summary> Construct a new FetchCredentialHistoryOptions </summary> | ||
/// <param name="pathSid"> </param> | ||
public FetchHistoryOptions(string pathSid) | ||
{ | ||
PathSid = pathSid; | ||
} | ||
|
||
|
||
/// <summary> Generate the necessary parameters </summary> | ||
public List<KeyValuePair<string, string>> GetParams() | ||
{ | ||
var p = new List<KeyValuePair<string, string>>(); | ||
|
||
if (AddOnsData != null) | ||
{ | ||
p.AddRange(PrefixedCollapsibleMap.Serialize(AddOnsData, "AddOns")); | ||
} | ||
return p; | ||
} | ||
|
||
|
||
} | ||
|
||
|
||
} | ||
|
144 changes: 144 additions & 0 deletions
144
examples/csharp/src/Twilio/Rest/FlexApi/V1/Credential/Aws/HistoryResource.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,144 @@ | ||
/* | ||
* This code was generated by | ||
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ | ||
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ | ||
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ | ||
* | ||
* Twilio - Accounts | ||
* This is the public Twilio REST API. | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator. | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
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.FlexApi.V1.Credential.Aws | ||
{ | ||
public class HistoryResource : Resource | ||
{ | ||
|
||
|
||
|
||
private static Request BuildFetchRequest(FetchHistoryOptions options, ITwilioRestClient client) | ||
{ | ||
|
||
string path = "/v1/Credentials/AWS/{Sid}/History"; | ||
|
||
string PathSid = options.PathSid; | ||
path = path.Replace("{"+"Sid"+"}", PathSid); | ||
|
||
|
||
return new Request( | ||
HttpMethod.Get, | ||
Rest.Domain.FlexApi, | ||
path, | ||
queryParams: options.GetParams(), | ||
headerParams: null | ||
); | ||
} | ||
|
||
/// <summary> fetch </summary> | ||
/// <param name="options"> Fetch History parameters </param> | ||
/// <param name="client"> Client to make requests to Twilio </param> | ||
/// <returns> A single instance of History </returns> | ||
public static HistoryResource Fetch(FetchHistoryOptions 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 History parameters </param> | ||
/// <param name="client"> Client to make requests to Twilio </param> | ||
/// <returns> Task that resolves to A single instance of History </returns> | ||
public static async System.Threading.Tasks.Task<HistoryResource> FetchAsync(FetchHistoryOptions 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="pathSid"> </param> | ||
/// <param name="addOnsData"> </param> | ||
/// <param name="client"> Client to make requests to Twilio </param> | ||
/// <returns> A single instance of History </returns> | ||
public static HistoryResource Fetch( | ||
string pathSid, | ||
Dictionary<string, object> addOnsData = null, | ||
ITwilioRestClient client = null) | ||
{ | ||
var options = new FetchHistoryOptions(pathSid){ AddOnsData = addOnsData }; | ||
return Fetch(options, client); | ||
} | ||
|
||
#if !NET35 | ||
/// <summary> fetch </summary> | ||
/// <param name="pathSid"> </param> | ||
/// <param name="addOnsData"> </param> | ||
/// <param name="client"> Client to make requests to Twilio </param> | ||
/// <returns> Task that resolves to A single instance of History </returns> | ||
public static async System.Threading.Tasks.Task<HistoryResource> FetchAsync(string pathSid, Dictionary<string, object> addOnsData = null, ITwilioRestClient client = null) | ||
{ | ||
var options = new FetchHistoryOptions(pathSid){ AddOnsData = addOnsData }; | ||
return await FetchAsync(options, client); | ||
} | ||
#endif | ||
|
||
/// <summary> | ||
/// Converts a JSON string into a HistoryResource object | ||
/// </summary> | ||
/// <param name="json"> Raw JSON string </param> | ||
/// <returns> HistoryResource object represented by the provided JSON </returns> | ||
public static HistoryResource FromJson(string json) | ||
{ | ||
try | ||
{ | ||
return JsonConvert.DeserializeObject<HistoryResource>(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 sid </summary> | ||
[JsonProperty("sid")] | ||
public string Sid { get; private set; } | ||
|
||
///<summary> The test_string </summary> | ||
[JsonProperty("test_string")] | ||
public string TestString { get; private set; } | ||
|
||
///<summary> The test_integer </summary> | ||
[JsonProperty("test_integer")] | ||
public int? TestInteger { get; private set; } | ||
|
||
|
||
|
||
private HistoryResource() { | ||
|
||
} | ||
} | ||
} | ||
|
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
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
Oops, something went wrong.