diff --git a/CHANGES.md b/CHANGES.md index 769e0ee4b..74eac4524 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,41 @@ twilio-csharp Changelog ======================= +[2024-02-27] Version 7.0.0 +-------------------------- +**Note:** This release contains breaking changes, check our [upgrade guide](./UPGRADE.md#2024-02-XX-6xx-to-7xx) for detailed migration notes. + +**Library - Chore** +- [PR #730](https://github.com/twilio/twilio-csharp/pull/730): add VersionSuffix to csproj file. Thanks to [@sbansla](https://github.com/sbansla)! +- [PR #727](https://github.com/twilio/twilio-csharp/pull/727): cluster tests enabled. Thanks to [@sbansla](https://github.com/sbansla)! +- [PR #725](https://github.com/twilio/twilio-csharp/pull/725): corrected repo name in code-signing workflow. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! +- [PR #722](https://github.com/twilio/twilio-csharp/pull/722): corrected nuget push command. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Library - Feature** +- [PR #728](https://github.com/twilio/twilio-csharp/pull/728): MVR Ready. Thanks to [@sbansla](https://github.com/sbansla)! **(breaking change)** + +**Api** +- remove feedback and feedback summary from call resource + +**Flex** +- Adding `routing_properties` to Interactions Channels Participant + +**Lookups** +- Add new `line_status` package to the lookup response +- Remove `live_activity` package from the lookup response **(breaking change)** + +**Messaging** +- Add tollfree multiple rejection reasons response array + +**Trusthub** +- Add ENUM for businessRegistrationAuthority in compliance_registration. **(breaking change)** +- Add new field in isIsvEmbed in compliance_registration. +- Add additional optional fields in compliance_registration for Individual business type. + +**Twiml** +- Add support for new Amazon Polly and Google voices (Q1 2024) for `Say` verb + + [2024-02-09] Version 6.18.0 --------------------------- **Library - Chore** diff --git a/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppResource.cs b/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppResource.cs index 00c511dca..2be4dc1d3 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppResource.cs @@ -301,14 +301,6 @@ public static string ToJson(object model) [JsonProperty("connect_app_sid")] public string ConnectAppSid { get; private set; } - /// The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - [JsonProperty("date_created")] - public DateTime? DateCreated { get; private set; } - - /// The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - [JsonProperty("date_updated")] - public DateTime? DateUpdated { get; private set; } - /// The set of permissions that you authorized for the Connect App. Can be: `get-all` or `post-all`. [JsonProperty("permissions")] public List Permissions { get; private set; } diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackOptions.cs b/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackOptions.cs deleted file mode 100644 index cef032ef7..000000000 --- a/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackOptions.cs +++ /dev/null @@ -1,108 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Api - * 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; -using System.Linq; - - - -namespace Twilio.Rest.Api.V2010.Account.Call -{ - /// Fetch a Feedback resource from a call - public class FetchFeedbackOptions : IOptions - { - - /// The call sid that uniquely identifies the call - public string PathCallSid { get; } - - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - public string PathAccountSid { get; set; } - - - - /// Construct a new FetchCallFeedbackOptions - /// The call sid that uniquely identifies the call - public FetchFeedbackOptions(string pathCallSid) - { - PathCallSid = pathCallSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// Update a Feedback resource for a call - public class UpdateFeedbackOptions : IOptions - { - - /// The call sid that uniquely identifies the call - public string PathCallSid { get; } - - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - public string PathAccountSid { get; set; } - - /// The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. - public int? QualityScore { get; set; } - - /// One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. - public List Issue { get; set; } - - - - /// Construct a new UpdateCallFeedbackOptions - /// The call sid that uniquely identifies the call - public UpdateFeedbackOptions(string pathCallSid) - { - PathCallSid = pathCallSid; - Issue = new List(); - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (QualityScore != null) - { - p.Add(new KeyValuePair("QualityScore", QualityScore.ToString())); - } - if (Issue != null) - { - p.AddRange(Issue.Select(Issue => new KeyValuePair("Issue", Issue.ToString()))); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackResource.cs b/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackResource.cs deleted file mode 100644 index 8d51d987d..000000000 --- a/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackResource.cs +++ /dev/null @@ -1,273 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Api - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; -using Twilio.Types; - - -namespace Twilio.Rest.Api.V2010.Account.Call -{ - public class FeedbackResource : Resource - { - - - - [JsonConverter(typeof(StringEnumConverter))] - public sealed class IssuesEnum : StringEnum - { - private IssuesEnum(string value) : base(value) {} - public IssuesEnum() {} - public static implicit operator IssuesEnum(string value) - { - return new IssuesEnum(value); - } - - public static readonly IssuesEnum AudioLatency = new IssuesEnum("audio-latency"); - public static readonly IssuesEnum DigitsNotCaptured = new IssuesEnum("digits-not-captured"); - public static readonly IssuesEnum DroppedCall = new IssuesEnum("dropped-call"); - public static readonly IssuesEnum ImperfectAudio = new IssuesEnum("imperfect-audio"); - public static readonly IssuesEnum IncorrectCallerId = new IssuesEnum("incorrect-caller-id"); - public static readonly IssuesEnum OneWayAudio = new IssuesEnum("one-way-audio"); - public static readonly IssuesEnum PostDialDelay = new IssuesEnum("post-dial-delay"); - public static readonly IssuesEnum UnsolicitedCall = new IssuesEnum("unsolicited-call"); - } - - - private static Request BuildFetchRequest(FetchFeedbackOptions options, ITwilioRestClient client) - { - - string path = "/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Feedback.json"; - - string PathAccountSid = options.PathAccountSid ?? client.AccountSid; - path = path.Replace("{"+"AccountSid"+"}", PathAccountSid); - string PathCallSid = options.PathCallSid; - path = path.Replace("{"+"CallSid"+"}", PathCallSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Api, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// Fetch a Feedback resource from a call - /// Fetch Feedback parameters - /// Client to make requests to Twilio - /// A single instance of Feedback - public static FeedbackResource Fetch(FetchFeedbackOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// Fetch a Feedback resource from a call - /// Fetch Feedback parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Feedback - public static async System.Threading.Tasks.Task FetchAsync(FetchFeedbackOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// Fetch a Feedback resource from a call - /// The call sid that uniquely identifies the call - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - /// Client to make requests to Twilio - /// A single instance of Feedback - public static FeedbackResource Fetch( - string pathCallSid, - string pathAccountSid = null, - ITwilioRestClient client = null) - { - var options = new FetchFeedbackOptions(pathCallSid){ PathAccountSid = pathAccountSid }; - return Fetch(options, client); - } - - #if !NET35 - /// Fetch a Feedback resource from a call - /// The call sid that uniquely identifies the call - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Feedback - public static async System.Threading.Tasks.Task FetchAsync(string pathCallSid, string pathAccountSid = null, ITwilioRestClient client = null) - { - var options = new FetchFeedbackOptions(pathCallSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildUpdateRequest(UpdateFeedbackOptions options, ITwilioRestClient client) - { - - string path = "/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Feedback.json"; - - string PathAccountSid = options.PathAccountSid ?? client.AccountSid; - path = path.Replace("{"+"AccountSid"+"}", PathAccountSid); - string PathCallSid = options.PathCallSid; - path = path.Replace("{"+"CallSid"+"}", PathCallSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Api, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// Update a Feedback resource for a call - /// Update Feedback parameters - /// Client to make requests to Twilio - /// A single instance of Feedback - public static FeedbackResource Update(UpdateFeedbackOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - - /// Update a Feedback resource for a call - /// Update Feedback parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Feedback - #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateFeedbackOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// Update a Feedback resource for a call - /// The call sid that uniquely identifies the call - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - /// The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. - /// One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. - /// Client to make requests to Twilio - /// A single instance of Feedback - public static FeedbackResource Update( - string pathCallSid, - string pathAccountSid = null, - int? qualityScore = null, - List issue = null, - ITwilioRestClient client = null) - { - var options = new UpdateFeedbackOptions(pathCallSid){ PathAccountSid = pathAccountSid, QualityScore = qualityScore, Issue = issue }; - return Update(options, client); - } - - #if !NET35 - /// Update a Feedback resource for a call - /// The call sid that uniquely identifies the call - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - /// The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. - /// One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Feedback - public static async System.Threading.Tasks.Task UpdateAsync( - string pathCallSid, - string pathAccountSid = null, - int? qualityScore = null, - List issue = null, - ITwilioRestClient client = null) - { - var options = new UpdateFeedbackOptions(pathCallSid){ PathAccountSid = pathAccountSid, QualityScore = qualityScore, Issue = issue }; - return await UpdateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a FeedbackResource object - /// - /// Raw JSON string - /// FeedbackResource object represented by the provided JSON - public static FeedbackResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The date that this resource was created, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. - [JsonProperty("date_created")] - public DateTime? DateCreated { get; private set; } - - /// The date that this resource was last updated, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. - [JsonProperty("date_updated")] - public DateTime? DateUpdated { get; private set; } - - /// A list of issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. - [JsonProperty("issues")] - public List Issues { get; private set; } - - /// `1` to `5` quality score where `1` represents imperfect experience and `5` represents a perfect call. - [JsonProperty("quality_score")] - public int? QualityScore { get; private set; } - - /// A 34 character string that uniquely identifies this resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - - - private FeedbackResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryOptions.cs b/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryOptions.cs deleted file mode 100644 index dfc94472e..000000000 --- a/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryOptions.cs +++ /dev/null @@ -1,158 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Api - * 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.Api.V2010.Account.Call -{ - - /// Create a FeedbackSummary resource for a call - public class CreateFeedbackSummaryOptions : IOptions - { - - /// Only include feedback given on or after this date. Format is `YYYY-MM-DD` and specified in UTC. - public DateTime? StartDate { get; } - - /// Only include feedback given on or before this date. Format is `YYYY-MM-DD` and specified in UTC. - public DateTime? EndDate { get; } - - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - public string PathAccountSid { get; set; } - - /// Whether to also include Feedback resources from all subaccounts. `true` includes feedback from all subaccounts and `false`, the default, includes feedback from only the specified account. - public bool? IncludeSubaccounts { get; set; } - - /// The URL that we will request when the feedback summary is complete. - public Uri StatusCallback { get; set; } - - /// The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` URL. - public Twilio.Http.HttpMethod StatusCallbackMethod { get; set; } - - - /// Construct a new CreateCallFeedbackSummaryOptions - /// Only include feedback given on or after this date. Format is `YYYY-MM-DD` and specified in UTC. - /// Only include feedback given on or before this date. Format is `YYYY-MM-DD` and specified in UTC. - public CreateFeedbackSummaryOptions(DateTime? startDate, DateTime? endDate) - { - StartDate = startDate; - EndDate = endDate; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (StartDate != null) - { - p.Add(new KeyValuePair("StartDate", StartDate.Value.ToString("yyyy-MM-dd"))); - } - if (EndDate != null) - { - p.Add(new KeyValuePair("EndDate", EndDate.Value.ToString("yyyy-MM-dd"))); - } - if (IncludeSubaccounts != null) - { - p.Add(new KeyValuePair("IncludeSubaccounts", IncludeSubaccounts.Value.ToString().ToLower())); - } - if (StatusCallback != null) - { - p.Add(new KeyValuePair("StatusCallback", Serializers.Url(StatusCallback))); - } - if (StatusCallbackMethod != null) - { - p.Add(new KeyValuePair("StatusCallbackMethod", StatusCallbackMethod.ToString())); - } - return p; - } - - - - } - /// Delete a FeedbackSummary resource from a call - public class DeleteFeedbackSummaryOptions : IOptions - { - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - public string PathAccountSid { get; set; } - - - - /// Construct a new DeleteCallFeedbackSummaryOptions - /// A 34 character string that uniquely identifies this resource. - public DeleteFeedbackSummaryOptions(string pathSid) - { - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// Fetch a FeedbackSummary resource from a call - public class FetchFeedbackSummaryOptions : IOptions - { - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - public string PathAccountSid { get; set; } - - - - /// Construct a new FetchCallFeedbackSummaryOptions - /// A 34 character string that uniquely identifies this resource. - public FetchFeedbackSummaryOptions(string pathSid) - { - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryResource.cs b/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryResource.cs deleted file mode 100644 index 6b9693b24..000000000 --- a/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryResource.cs +++ /dev/null @@ -1,379 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Api - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; -using Twilio.Types; - - -namespace Twilio.Rest.Api.V2010.Account.Call -{ - public class FeedbackSummaryResource : Resource - { - - - - [JsonConverter(typeof(StringEnumConverter))] - public sealed class StatusEnum : StringEnum - { - private StatusEnum(string value) : base(value) {} - public StatusEnum() {} - public static implicit operator StatusEnum(string value) - { - return new StatusEnum(value); - } - public static readonly StatusEnum Queued = new StatusEnum("queued"); - public static readonly StatusEnum InProgress = new StatusEnum("in-progress"); - public static readonly StatusEnum Completed = new StatusEnum("completed"); - public static readonly StatusEnum Failed = new StatusEnum("failed"); - - } - - - private static Request BuildCreateRequest(CreateFeedbackSummaryOptions options, ITwilioRestClient client) - { - - string path = "/2010-04-01/Accounts/{AccountSid}/Calls/FeedbackSummary.json"; - - string PathAccountSid = options.PathAccountSid ?? client.AccountSid; - path = path.Replace("{"+"AccountSid"+"}", PathAccountSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Api, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// Create a FeedbackSummary resource for a call - /// Create FeedbackSummary parameters - /// Client to make requests to Twilio - /// A single instance of FeedbackSummary - public static FeedbackSummaryResource Create(CreateFeedbackSummaryOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// Create a FeedbackSummary resource for a call - /// Create FeedbackSummary parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FeedbackSummary - public static async System.Threading.Tasks.Task CreateAsync(CreateFeedbackSummaryOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// Create a FeedbackSummary resource for a call - /// Only include feedback given on or after this date. Format is `YYYY-MM-DD` and specified in UTC. - /// Only include feedback given on or before this date. Format is `YYYY-MM-DD` and specified in UTC. - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - /// Whether to also include Feedback resources from all subaccounts. `true` includes feedback from all subaccounts and `false`, the default, includes feedback from only the specified account. - /// The URL that we will request when the feedback summary is complete. - /// The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` URL. - /// Client to make requests to Twilio - /// A single instance of FeedbackSummary - public static FeedbackSummaryResource Create( - DateTime? startDate, - DateTime? endDate, - string pathAccountSid = null, - bool? includeSubaccounts = null, - Uri statusCallback = null, - Twilio.Http.HttpMethod statusCallbackMethod = null, - ITwilioRestClient client = null) - { - var options = new CreateFeedbackSummaryOptions(startDate, endDate){ PathAccountSid = pathAccountSid, IncludeSubaccounts = includeSubaccounts, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod }; - return Create(options, client); - } - - #if !NET35 - /// Create a FeedbackSummary resource for a call - /// Only include feedback given on or after this date. Format is `YYYY-MM-DD` and specified in UTC. - /// Only include feedback given on or before this date. Format is `YYYY-MM-DD` and specified in UTC. - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - /// Whether to also include Feedback resources from all subaccounts. `true` includes feedback from all subaccounts and `false`, the default, includes feedback from only the specified account. - /// The URL that we will request when the feedback summary is complete. - /// The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` URL. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FeedbackSummary - public static async System.Threading.Tasks.Task CreateAsync( - DateTime? startDate, - DateTime? endDate, - string pathAccountSid = null, - bool? includeSubaccounts = null, - Uri statusCallback = null, - Twilio.Http.HttpMethod statusCallbackMethod = null, - ITwilioRestClient client = null) - { - var options = new CreateFeedbackSummaryOptions(startDate, endDate){ PathAccountSid = pathAccountSid, IncludeSubaccounts = includeSubaccounts, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod }; - return await CreateAsync(options, client); - } - #endif - - /// Delete a FeedbackSummary resource from a call - /// Delete FeedbackSummary parameters - /// Client to make requests to Twilio - /// A single instance of FeedbackSummary - private static Request BuildDeleteRequest(DeleteFeedbackSummaryOptions options, ITwilioRestClient client) - { - - string path = "/2010-04-01/Accounts/{AccountSid}/Calls/FeedbackSummary/{Sid}.json"; - - string PathAccountSid = options.PathAccountSid ?? client.AccountSid; - path = path.Replace("{"+"AccountSid"+"}", PathAccountSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Delete, - Rest.Domain.Api, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// Delete a FeedbackSummary resource from a call - /// Delete FeedbackSummary parameters - /// Client to make requests to Twilio - /// A single instance of FeedbackSummary - public static bool Delete(DeleteFeedbackSummaryOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - - #if !NET35 - /// Delete a FeedbackSummary resource from a call - /// Delete FeedbackSummary parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FeedbackSummary - public static async System.Threading.Tasks.Task DeleteAsync(DeleteFeedbackSummaryOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - #endif - - /// Delete a FeedbackSummary resource from a call - /// A 34 character string that uniquely identifies this resource. - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - /// Client to make requests to Twilio - /// A single instance of FeedbackSummary - public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) - { - var options = new DeleteFeedbackSummaryOptions(pathSid) { PathAccountSid = pathAccountSid } ; - return Delete(options, client); - } - - #if !NET35 - /// Delete a FeedbackSummary resource from a call - /// A 34 character string that uniquely identifies this resource. - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FeedbackSummary - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) - { - var options = new DeleteFeedbackSummaryOptions(pathSid) { PathAccountSid = pathAccountSid }; - return await DeleteAsync(options, client); - } - #endif - - private static Request BuildFetchRequest(FetchFeedbackSummaryOptions options, ITwilioRestClient client) - { - - string path = "/2010-04-01/Accounts/{AccountSid}/Calls/FeedbackSummary/{Sid}.json"; - - string PathAccountSid = options.PathAccountSid ?? client.AccountSid; - path = path.Replace("{"+"AccountSid"+"}", PathAccountSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Api, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// Fetch a FeedbackSummary resource from a call - /// Fetch FeedbackSummary parameters - /// Client to make requests to Twilio - /// A single instance of FeedbackSummary - public static FeedbackSummaryResource Fetch(FetchFeedbackSummaryOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// Fetch a FeedbackSummary resource from a call - /// Fetch FeedbackSummary parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FeedbackSummary - public static async System.Threading.Tasks.Task FetchAsync(FetchFeedbackSummaryOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// Fetch a FeedbackSummary resource from a call - /// A 34 character string that uniquely identifies this resource. - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - /// Client to make requests to Twilio - /// A single instance of FeedbackSummary - public static FeedbackSummaryResource Fetch( - string pathSid, - string pathAccountSid = null, - ITwilioRestClient client = null) - { - var options = new FetchFeedbackSummaryOptions(pathSid){ PathAccountSid = pathAccountSid }; - return Fetch(options, client); - } - - #if !NET35 - /// Fetch a FeedbackSummary resource from a call - /// A 34 character string that uniquely identifies this resource. - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FeedbackSummary - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) - { - var options = new FetchFeedbackSummaryOptions(pathSid){ PathAccountSid = pathAccountSid }; - return await FetchAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a FeedbackSummaryResource object - /// - /// Raw JSON string - /// FeedbackSummaryResource object represented by the provided JSON - public static FeedbackSummaryResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The total number of calls. - [JsonProperty("call_count")] - public int? CallCount { get; private set; } - - /// The total number of calls with a feedback entry. - [JsonProperty("call_feedback_count")] - public int? CallFeedbackCount { get; private set; } - - /// The date that this resource was created, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. - [JsonProperty("date_created")] - public DateTime? DateCreated { get; private set; } - - /// The date that this resource was last updated, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. - [JsonProperty("date_updated")] - public DateTime? DateUpdated { get; private set; } - - /// The last date for which feedback entries are included in this Feedback Summary, formatted as `YYYY-MM-DD` and specified in UTC. - [JsonProperty("end_date")] - public DateTime? EndDate { get; private set; } - - /// Whether the feedback summary includes subaccounts; `true` if it does, otherwise `false`. - [JsonProperty("include_subaccounts")] - public bool? IncludeSubaccounts { get; private set; } - - /// A list of issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, or `one-way-audio`. - [JsonProperty("issues")] - public List Issues { get; private set; } - - /// The average QualityScore of the feedback entries. - [JsonProperty("quality_score_average")] - public decimal? QualityScoreAverage { get; private set; } - - /// The median QualityScore of the feedback entries. - [JsonProperty("quality_score_median")] - public decimal? QualityScoreMedian { get; private set; } - - /// The standard deviation of the quality scores. - [JsonProperty("quality_score_standard_deviation")] - public decimal? QualityScoreStandardDeviation { get; private set; } - - /// A 34 character string that uniquely identifies this resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// The first date for which feedback entries are included in this feedback summary, formatted as `YYYY-MM-DD` and specified in UTC. - [JsonProperty("start_date")] - public DateTime? StartDate { get; private set; } - - - [JsonProperty("status")] - public FeedbackSummaryResource.StatusEnum Status { get; private set; } - - - - private FeedbackSummaryResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalCreateOptions.cs b/src/Twilio/Rest/Content/V1/Content/ApprovalCreateOptions.cs new file mode 100644 index 000000000..f8a028c59 --- /dev/null +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalCreateOptions.cs @@ -0,0 +1,63 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Content + * 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.Content.V1.Content +{ + + /// create + public class CreateApprovalCreateOptions : IOptions + { + + + public string PathSid { get; } + + + public ApprovalCreateResource.ContentApprovalRequest ContentApprovalRequest { get; } + + + /// Construct a new CreateContentApprovalRequestOptions + /// + /// + public CreateApprovalCreateOptions(string pathSid, ApprovalCreateResource.ContentApprovalRequest contentApprovalRequest) + { + PathSid = pathSid; + ContentApprovalRequest = contentApprovalRequest; + } + + + /// Generate the request body + public string GetBody() + { + string body = ""; + + if (ContentApprovalRequest != null) + { + body = ApprovalCreateResource.ToJson(ContentApprovalRequest); + } + return body; + } + + + } +} + diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalCreateResource.cs b/src/Twilio/Rest/Content/V1/Content/ApprovalCreateResource.cs new file mode 100644 index 000000000..977266744 --- /dev/null +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalCreateResource.cs @@ -0,0 +1,205 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Content + * 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.Constant; +using Twilio.Converters; +using Twilio.Exceptions; +using Twilio.Http; + + + +namespace Twilio.Rest.Content.V1.Content +{ + public class ApprovalCreateResource : Resource + { + + public class ContentApprovalRequest + { + [JsonProperty("name")] + private string Name {get; set;} + [JsonProperty("category")] + private string Category {get; set;} + public ContentApprovalRequest() { } + public class Builder + { + private ContentApprovalRequest _contentApprovalRequest = new ContentApprovalRequest(); + public Builder() + { + } + public Builder WithName(string name) + { + _contentApprovalRequest.Name= name; + return this; + } + public Builder WithCategory(string category) + { + _contentApprovalRequest.Category= category; + return this; + } + public ContentApprovalRequest Build() + { + return _contentApprovalRequest; + } + } + } + + + + + private static Request BuildCreateRequest(CreateApprovalCreateOptions options, ITwilioRestClient client) + { + + string path = "/v1/Content/{Sid}/ApprovalRequests/whatsapp"; + + string PathSid = options.PathSid; + path = path.Replace("{"+"Sid"+"}", PathSid); + + return new Request( + HttpMethod.Post, + Rest.Domain.Content, + path, + + contentType: EnumConstants.ContentTypeEnum.JSON, + body: options.GetBody(), + headerParams: null + ); + } + + /// create + /// Create ApprovalCreate parameters + /// Client to make requests to Twilio + /// A single instance of ApprovalCreate + public static ApprovalCreateResource Create(CreateApprovalCreateOptions options, ITwilioRestClient client = null) + { + client = client ?? TwilioClient.GetRestClient(); + var response = client.Request(BuildCreateRequest(options, client)); + return FromJson(response.Content); + } + + #if !NET35 + /// create + /// Create ApprovalCreate parameters + /// Client to make requests to Twilio + /// Task that resolves to A single instance of ApprovalCreate + public static async System.Threading.Tasks.Task CreateAsync(CreateApprovalCreateOptions options, + ITwilioRestClient client = null) + { + client = client ?? TwilioClient.GetRestClient(); + var response = await client.RequestAsync(BuildCreateRequest(options, client)); + return FromJson(response.Content); + } + #endif + + /// create + /// + /// + /// Client to make requests to Twilio + /// A single instance of ApprovalCreate + public static ApprovalCreateResource Create( + string pathSid, + ApprovalCreateResource.ContentApprovalRequest contentApprovalRequest, + ITwilioRestClient client = null) + { + var options = new CreateApprovalCreateOptions(pathSid, contentApprovalRequest){ }; + return Create(options, client); + } + + #if !NET35 + /// create + /// + /// + /// Client to make requests to Twilio + /// Task that resolves to A single instance of ApprovalCreate + public static async System.Threading.Tasks.Task CreateAsync( + string pathSid, + ApprovalCreateResource.ContentApprovalRequest contentApprovalRequest, + ITwilioRestClient client = null) + { + var options = new CreateApprovalCreateOptions(pathSid, contentApprovalRequest){ }; + return await CreateAsync(options, client); + } + #endif + + /// + /// Converts a JSON string into a ApprovalCreateResource object + /// + /// Raw JSON string + /// ApprovalCreateResource object represented by the provided JSON + public static ApprovalCreateResource FromJson(string json) + { + try + { + return JsonConvert.DeserializeObject(json); + } + catch (JsonException e) + { + throw new ApiException(e.Message, e); + } + } + /// + /// Converts an object into a json string + /// + /// C# model + /// JSON string + public static string ToJson(object model) + { + try + { + return JsonConvert.SerializeObject(model); + } + catch (JsonException e) + { + throw new ApiException(e.Message, e); + } + } + + + /// The name + [JsonProperty("name")] + public string Name { get; private set; } + + /// The category + [JsonProperty("category")] + public string Category { get; private set; } + + /// The content_type + [JsonProperty("content_type")] + public string ContentType { get; private set; } + + /// The status + [JsonProperty("status")] + public string Status { get; private set; } + + /// The rejection_reason + [JsonProperty("rejection_reason")] + public string RejectionReason { get; private set; } + + /// The allow_category_change + [JsonProperty("allow_category_change")] + public bool? AllowCategoryChange { get; private set; } + + + + private ApprovalCreateResource() { + + } + } +} + diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalFetchOptions.cs b/src/Twilio/Rest/Content/V1/Content/ApprovalFetchOptions.cs index 3653c6286..8a32b5520 100644 --- a/src/Twilio/Rest/Content/V1/Content/ApprovalFetchOptions.cs +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalFetchOptions.cs @@ -32,7 +32,7 @@ public class FetchApprovalFetchOptions : IOptions - /// Construct a new FetchApprovalFetchOptions + /// Construct a new FetchApprovalOptions /// The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. public FetchApprovalFetchOptions(string pathSid) { diff --git a/src/Twilio/Rest/Content/V1/ContentOptions.cs b/src/Twilio/Rest/Content/V1/ContentOptions.cs index 628b22f41..bcf7adec1 100644 --- a/src/Twilio/Rest/Content/V1/ContentOptions.cs +++ b/src/Twilio/Rest/Content/V1/ContentOptions.cs @@ -23,6 +23,37 @@ namespace Twilio.Rest.Content.V1 { + + /// Create a Content resource + public class CreateContentOptions : IOptions + { + + + public ContentResource.ContentCreateRequest ContentCreateRequest { get; } + + + /// Construct a new CreateContentOptions + /// + public CreateContentOptions(ContentResource.ContentCreateRequest contentCreateRequest) + { + ContentCreateRequest = contentCreateRequest; + } + + + /// Generate the request body + public string GetBody() + { + string body = ""; + + if (ContentCreateRequest != null) + { + body = ContentResource.ToJson(ContentCreateRequest); + } + return body; + } + + + } /// Deletes a Content resource public class DeleteContentOptions : IOptions { diff --git a/src/Twilio/Rest/Content/V1/ContentResource.cs b/src/Twilio/Rest/Content/V1/ContentResource.cs index 290bbe11b..7a3098381 100644 --- a/src/Twilio/Rest/Content/V1/ContentResource.cs +++ b/src/Twilio/Rest/Content/V1/ContentResource.cs @@ -22,7 +22,7 @@ using Twilio.Converters; using Twilio.Exceptions; using Twilio.Http; - +using Twilio.Types; namespace Twilio.Rest.Content.V1 @@ -30,9 +30,764 @@ namespace Twilio.Rest.Content.V1 public class ContentResource : Resource { + public class TwilioText + { + [JsonProperty("body")] + private string Body {get; set;} + public TwilioText() { } + public class Builder + { + private TwilioText _twilioText = new TwilioText(); + public Builder() + { + } + public Builder WithBody(string body) + { + _twilioText.Body= body; + return this; + } + public TwilioText Build() + { + return _twilioText; + } + } + } + public class TwilioMedia + { + [JsonProperty("body")] + private string Body {get; set;} + [JsonProperty("media")] + private List Media {get; set;} + public TwilioMedia() { } + public class Builder + { + private TwilioMedia _twilioMedia = new TwilioMedia(); + public Builder() + { + } + public Builder WithBody(string body) + { + _twilioMedia.Body= body; + return this; + } + public Builder WithMedia(List media) + { + _twilioMedia.Media= media; + return this; + } + public TwilioMedia Build() + { + return _twilioMedia; + } + } + } + public class TwilioLocation + { + [JsonProperty("latitude")] + private decimal? Latitude {get; set;} + [JsonProperty("longitude")] + private decimal? Longitude {get; set;} + [JsonProperty("label")] + private string Label {get; set;} + public TwilioLocation() { } + public class Builder + { + private TwilioLocation _twilioLocation = new TwilioLocation(); + public Builder() + { + } + public Builder WithLatitude(decimal? latitude) + { + _twilioLocation.Latitude= latitude; + return this; + } + public Builder WithLongitude(decimal? longitude) + { + _twilioLocation.Longitude= longitude; + return this; + } + public Builder WithLabel(string label) + { + _twilioLocation.Label= label; + return this; + } + public TwilioLocation Build() + { + return _twilioLocation; + } + } + } + public class ListItem + { + [JsonProperty("id")] + private string Id {get; set;} + [JsonProperty("item")] + private string Item {get; set;} + [JsonProperty("description")] + private string Description {get; set;} + public ListItem() { } + public class Builder + { + private ListItem _listItem = new ListItem(); + public Builder() + { + } + public Builder WithId(string id) + { + _listItem.Id= id; + return this; + } + public Builder WithItem(string item) + { + _listItem.Item= item; + return this; + } + public Builder WithDescription(string description) + { + _listItem.Description= description; + return this; + } + public ListItem Build() + { + return _listItem; + } + } + } + public class TwilioListPicker + { + [JsonProperty("body")] + private string Body {get; set;} + [JsonProperty("button")] + private string Button {get; set;} + [JsonProperty("items")] + private List Items {get; set;} + public TwilioListPicker() { } + public class Builder + { + private TwilioListPicker _twilioListPicker = new TwilioListPicker(); + public Builder() + { + } + public Builder WithBody(string body) + { + _twilioListPicker.Body= body; + return this; + } + public Builder WithButton(string button) + { + _twilioListPicker.Button= button; + return this; + } + public Builder WithItems(List items) + { + _twilioListPicker.Items= items; + return this; + } + public TwilioListPicker Build() + { + return _twilioListPicker; + } + } + } + public class CallToActionAction + { + [JsonConverter(typeof(StringEnumConverter))] + [JsonProperty("type")] + private ContentResource.CallToActionActionType Type {get; set;} + [JsonProperty("title")] + private string Title {get; set;} + [JsonProperty("url")] + private string Url {get; set;} + [JsonProperty("phone")] + private string Phone {get; set;} + [JsonProperty("id")] + private string Id {get; set;} + public CallToActionAction() { } + public class Builder + { + private CallToActionAction _callToActionAction = new CallToActionAction(); + public Builder() + { + } + public Builder WithType(ContentResource.CallToActionActionType type) + { + _callToActionAction.Type= type; + return this; + } + public Builder WithTitle(string title) + { + _callToActionAction.Title= title; + return this; + } + public Builder WithUrl(string url) + { + _callToActionAction.Url= url; + return this; + } + public Builder WithPhone(string phone) + { + _callToActionAction.Phone= phone; + return this; + } + public Builder WithId(string id) + { + _callToActionAction.Id= id; + return this; + } + public CallToActionAction Build() + { + return _callToActionAction; + } + } + } + public class TwilioCallToAction + { + [JsonProperty("body")] + private string Body {get; set;} + [JsonProperty("actions")] + private List Actions {get; set;} + public TwilioCallToAction() { } + public class Builder + { + private TwilioCallToAction _twilioCallToAction = new TwilioCallToAction(); + public Builder() + { + } + public Builder WithBody(string body) + { + _twilioCallToAction.Body= body; + return this; + } + public Builder WithActions(List actions) + { + _twilioCallToAction.Actions= actions; + return this; + } + public TwilioCallToAction Build() + { + return _twilioCallToAction; + } + } + } + public class QuickReplyAction + { + [JsonConverter(typeof(StringEnumConverter))] + [JsonProperty("type")] + private ContentResource.QuickReplyActionType Type {get; set;} + [JsonProperty("title")] + private string Title {get; set;} + [JsonProperty("id")] + private string Id {get; set;} + public QuickReplyAction() { } + public class Builder + { + private QuickReplyAction _quickReplyAction = new QuickReplyAction(); + public Builder() + { + } + public Builder WithType(ContentResource.QuickReplyActionType type) + { + _quickReplyAction.Type= type; + return this; + } + public Builder WithTitle(string title) + { + _quickReplyAction.Title= title; + return this; + } + public Builder WithId(string id) + { + _quickReplyAction.Id= id; + return this; + } + public QuickReplyAction Build() + { + return _quickReplyAction; + } + } + } + public class TwilioQuickReply + { + [JsonProperty("body")] + private string Body {get; set;} + [JsonProperty("actions")] + private List Actions {get; set;} + public TwilioQuickReply() { } + public class Builder + { + private TwilioQuickReply _twilioQuickReply = new TwilioQuickReply(); + public Builder() + { + } + public Builder WithBody(string body) + { + _twilioQuickReply.Body= body; + return this; + } + public Builder WithActions(List actions) + { + _twilioQuickReply.Actions= actions; + return this; + } + public TwilioQuickReply Build() + { + return _twilioQuickReply; + } + } + } + public class CardAction + { + [JsonConverter(typeof(StringEnumConverter))] + [JsonProperty("type")] + private ContentResource.CardActionType Type {get; set;} + [JsonProperty("title")] + private string Title {get; set;} + [JsonProperty("url")] + private string Url {get; set;} + [JsonProperty("phone")] + private string Phone {get; set;} + [JsonProperty("id")] + private string Id {get; set;} + public CardAction() { } + public class Builder + { + private CardAction _cardAction = new CardAction(); + public Builder() + { + } + public Builder WithType(ContentResource.CardActionType type) + { + _cardAction.Type= type; + return this; + } + public Builder WithTitle(string title) + { + _cardAction.Title= title; + return this; + } + public Builder WithUrl(string url) + { + _cardAction.Url= url; + return this; + } + public Builder WithPhone(string phone) + { + _cardAction.Phone= phone; + return this; + } + public Builder WithId(string id) + { + _cardAction.Id= id; + return this; + } + public CardAction Build() + { + return _cardAction; + } + } + } + public class TwilioCard + { + [JsonProperty("title")] + private string Title {get; set;} + [JsonProperty("subtitle")] + private string Subtitle {get; set;} + [JsonProperty("media")] + private List Media {get; set;} + [JsonProperty("actions")] + private List Actions {get; set;} + public TwilioCard() { } + public class Builder + { + private TwilioCard _twilioCard = new TwilioCard(); + public Builder() + { + } + public Builder WithTitle(string title) + { + _twilioCard.Title= title; + return this; + } + public Builder WithSubtitle(string subtitle) + { + _twilioCard.Subtitle= subtitle; + return this; + } + public Builder WithMedia(List media) + { + _twilioCard.Media= media; + return this; + } + public Builder WithActions(List actions) + { + _twilioCard.Actions= actions; + return this; + } + public TwilioCard Build() + { + return _twilioCard; + } + } + } + public class WhatsappCard + { + [JsonProperty("body")] + private string Body {get; set;} + [JsonProperty("footer")] + private string Footer {get; set;} + [JsonProperty("media")] + private List Media {get; set;} + [JsonProperty("header_text")] + private string HeaderText {get; set;} + [JsonProperty("actions")] + private List Actions {get; set;} + public WhatsappCard() { } + public class Builder + { + private WhatsappCard _whatsappCard = new WhatsappCard(); + public Builder() + { + } + public Builder WithBody(string body) + { + _whatsappCard.Body= body; + return this; + } + public Builder WithFooter(string footer) + { + _whatsappCard.Footer= footer; + return this; + } + public Builder WithMedia(List media) + { + _whatsappCard.Media= media; + return this; + } + public Builder WithHeaderText(string headerText) + { + _whatsappCard.HeaderText= headerText; + return this; + } + public Builder WithActions(List actions) + { + _whatsappCard.Actions= actions; + return this; + } + public WhatsappCard Build() + { + return _whatsappCard; + } + } + } + public class AuthenticationAction + { + [JsonConverter(typeof(StringEnumConverter))] + [JsonProperty("type")] + private ContentResource.AuthenticationActionType Type {get; set;} + [JsonProperty("copy_code_text")] + private string CopyCodeText {get; set;} + public AuthenticationAction() { } + public class Builder + { + private AuthenticationAction _authenticationAction = new AuthenticationAction(); + public Builder() + { + } + public Builder WithType(ContentResource.AuthenticationActionType type) + { + _authenticationAction.Type= type; + return this; + } + public Builder WithCopyCodeText(string copyCodeText) + { + _authenticationAction.CopyCodeText= copyCodeText; + return this; + } + public AuthenticationAction Build() + { + return _authenticationAction; + } + } + } + public class WhatsappAuthentication + { + [JsonProperty("add_security_recommendation")] + private bool? AddSecurityRecommendation {get; set;} + [JsonProperty("code_expiration_minutes")] + private decimal? CodeExpirationMinutes {get; set;} + [JsonProperty("actions")] + private List Actions {get; set;} + public WhatsappAuthentication() { } + public class Builder + { + private WhatsappAuthentication _whatsappAuthentication = new WhatsappAuthentication(); + public Builder() + { + } + public Builder WithAddSecurityRecommendation(bool? addSecurityRecommendation) + { + _whatsappAuthentication.AddSecurityRecommendation= addSecurityRecommendation; + return this; + } + public Builder WithCodeExpirationMinutes(decimal? codeExpirationMinutes) + { + _whatsappAuthentication.CodeExpirationMinutes= codeExpirationMinutes; + return this; + } + public Builder WithActions(List actions) + { + _whatsappAuthentication.Actions= actions; + return this; + } + public WhatsappAuthentication Build() + { + return _whatsappAuthentication; + } + } + } + public class Types + { + [JsonProperty("twilio/text")] + private TwilioText TwilioText {get; set;} + [JsonProperty("twilio/media")] + private TwilioMedia TwilioMedia {get; set;} + [JsonProperty("twilio/location")] + private TwilioLocation TwilioLocation {get; set;} + [JsonProperty("twilio/list-picker")] + private TwilioListPicker TwilioListPicker {get; set;} + [JsonProperty("twilio/call-to-action")] + private TwilioCallToAction TwilioCallToAction {get; set;} + [JsonProperty("twilio/quick-reply")] + private TwilioQuickReply TwilioQuickReply {get; set;} + [JsonProperty("twilio/card")] + private TwilioCard TwilioCard {get; set;} + [JsonProperty("whatsapp/card")] + private WhatsappCard WhatsappCard {get; set;} + [JsonProperty("whatsapp/authentication")] + private WhatsappAuthentication WhatsappAuthentication {get; set;} + public Types() { } + public class Builder + { + private Types _types = new Types(); + public Builder() + { + } + public Builder WithTwilioText(TwilioText twilioText) + { + _types.TwilioText= twilioText; + return this; + } + public Builder WithTwilioMedia(TwilioMedia twilioMedia) + { + _types.TwilioMedia= twilioMedia; + return this; + } + public Builder WithTwilioLocation(TwilioLocation twilioLocation) + { + _types.TwilioLocation= twilioLocation; + return this; + } + public Builder WithTwilioListPicker(TwilioListPicker twilioListPicker) + { + _types.TwilioListPicker= twilioListPicker; + return this; + } + public Builder WithTwilioCallToAction(TwilioCallToAction twilioCallToAction) + { + _types.TwilioCallToAction= twilioCallToAction; + return this; + } + public Builder WithTwilioQuickReply(TwilioQuickReply twilioQuickReply) + { + _types.TwilioQuickReply= twilioQuickReply; + return this; + } + public Builder WithTwilioCard(TwilioCard twilioCard) + { + _types.TwilioCard= twilioCard; + return this; + } + public Builder WithWhatsappCard(WhatsappCard whatsappCard) + { + _types.WhatsappCard= whatsappCard; + return this; + } + public Builder WithWhatsappAuthentication(WhatsappAuthentication whatsappAuthentication) + { + _types.WhatsappAuthentication= whatsappAuthentication; + return this; + } + public Types Build() + { + return _types; + } + } + } + public class ContentCreateRequest + { + [JsonProperty("friendly_name")] + private string FriendlyName {get; set;} + [JsonProperty("variables")] + private Dictionary Variables {get; set;} + [JsonProperty("language")] + private string Language {get; set;} + [JsonProperty("types")] + private Types Types {get; set;} + public ContentCreateRequest() { } + public class Builder + { + private ContentCreateRequest _contentCreateRequest = new ContentCreateRequest(); + public Builder() + { + } + public Builder WithFriendlyName(string friendlyName) + { + _contentCreateRequest.FriendlyName= friendlyName; + return this; + } + public Builder WithVariables(Dictionary variables) + { + _contentCreateRequest.Variables= variables; + return this; + } + public Builder WithLanguage(string language) + { + _contentCreateRequest.Language= language; + return this; + } + public Builder WithTypes(Types types) + { + _contentCreateRequest.Types= types; + return this; + } + public ContentCreateRequest Build() + { + return _contentCreateRequest; + } + } + } + [JsonConverter(typeof(StringEnumConverter))] + public sealed class AuthenticationActionType : StringEnum + { + private AuthenticationActionType(string value) : base(value) {} + public AuthenticationActionType() {} + public static implicit operator AuthenticationActionType(string value) + { + return new AuthenticationActionType(value); + } + public static readonly AuthenticationActionType CopyCode = new AuthenticationActionType("COPY_CODE"); + + } + [JsonConverter(typeof(StringEnumConverter))] + public sealed class CardActionType : StringEnum + { + private CardActionType(string value) : base(value) {} + public CardActionType() {} + public static implicit operator CardActionType(string value) + { + return new CardActionType(value); + } + public static readonly CardActionType Url = new CardActionType("URL"); + public static readonly CardActionType PhoneNumber = new CardActionType("PHONE_NUMBER"); + public static readonly CardActionType QuickReply = new CardActionType("QUICK_REPLY"); + + } + [JsonConverter(typeof(StringEnumConverter))] + public sealed class QuickReplyActionType : StringEnum + { + private QuickReplyActionType(string value) : base(value) {} + public QuickReplyActionType() {} + public static implicit operator QuickReplyActionType(string value) + { + return new QuickReplyActionType(value); + } + public static readonly QuickReplyActionType QuickReply = new QuickReplyActionType("QUICK_REPLY"); + + } + [JsonConverter(typeof(StringEnumConverter))] + public sealed class CallToActionActionType : StringEnum + { + private CallToActionActionType(string value) : base(value) {} + public CallToActionActionType() {} + public static implicit operator CallToActionActionType(string value) + { + return new CallToActionActionType(value); + } + public static readonly CallToActionActionType Url = new CallToActionActionType("URL"); + public static readonly CallToActionActionType PhoneNumber = new CallToActionActionType("PHONE_NUMBER"); + + } + + + private static Request BuildCreateRequest(CreateContentOptions options, ITwilioRestClient client) + { + + string path = "/v1/Content"; + + + return new Request( + HttpMethod.Post, + Rest.Domain.Content, + path, + + contentType: EnumConstants.ContentTypeEnum.JSON, + body: options.GetBody(), + headerParams: null + ); + } + + /// Create a Content resource + /// Create Content parameters + /// Client to make requests to Twilio + /// A single instance of Content + public static ContentResource Create(CreateContentOptions options, ITwilioRestClient client = null) + { + client = client ?? TwilioClient.GetRestClient(); + var response = client.Request(BuildCreateRequest(options, client)); + return FromJson(response.Content); + } + #if !NET35 + /// Create a Content resource + /// Create Content parameters + /// Client to make requests to Twilio + /// Task that resolves to A single instance of Content + public static async System.Threading.Tasks.Task CreateAsync(CreateContentOptions options, + ITwilioRestClient client = null) + { + client = client ?? TwilioClient.GetRestClient(); + var response = await client.RequestAsync(BuildCreateRequest(options, client)); + return FromJson(response.Content); + } + #endif + + /// Create a Content resource + /// + /// Client to make requests to Twilio + /// A single instance of Content + public static ContentResource Create( + ContentResource.ContentCreateRequest contentCreateRequest, + ITwilioRestClient client = null) + { + var options = new CreateContentOptions(contentCreateRequest){ }; + return Create(options, client); + } + + #if !NET35 + /// Create a Content resource + /// + /// Client to make requests to Twilio + /// Task that resolves to A single instance of Content + public static async System.Threading.Tasks.Task CreateAsync( + ContentResource.ContentCreateRequest contentCreateRequest, + ITwilioRestClient client = null) + { + var options = new CreateContentOptions(contentCreateRequest){ }; + return await CreateAsync(options, client); + } + #endif /// Deletes a Content resource /// Delete Content parameters @@ -351,7 +1106,7 @@ public static string ToJson(object model) /// The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. [JsonProperty("types")] - public object Types { get; private set; } + public object _Types { get; private set; } /// The URL of the resource, relative to `https://content.twilio.com`. [JsonProperty("url")] diff --git a/src/Twilio/Rest/Conversations/V1/Conversation/MessageOptions.cs b/src/Twilio/Rest/Conversations/V1/Conversation/MessageOptions.cs index 300c3b617..a36ec8a41 100644 --- a/src/Twilio/Rest/Conversations/V1/Conversation/MessageOptions.cs +++ b/src/Twilio/Rest/Conversations/V1/Conversation/MessageOptions.cs @@ -52,7 +52,7 @@ public class CreateMessageOptions : IOptions /// The Media SID to be attached to the new Message. public string MediaSid { get; set; } - /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. public string ContentSid { get; set; } /// A structurally valid JSON string that contains values to resolve Rich Content template variables. diff --git a/src/Twilio/Rest/Conversations/V1/Conversation/MessageResource.cs b/src/Twilio/Rest/Conversations/V1/Conversation/MessageResource.cs index c2bf2d2b0..d805da0a5 100644 --- a/src/Twilio/Rest/Conversations/V1/Conversation/MessageResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Conversation/MessageResource.cs @@ -108,7 +108,7 @@ public static async System.Threading.Tasks.Task CreateAsync(Cre /// The date that this resource was last updated. `null` if the message has not been edited. /// A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. /// The Media SID to be attached to the new Message. - /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. /// A structurally valid JSON string that contains values to resolve Rich Content template variables. /// The subject of the message, can be up to 256 characters long. /// The X-Twilio-Webhook-Enabled HTTP request header @@ -141,7 +141,7 @@ public static MessageResource Create( /// The date that this resource was last updated. `null` if the message has not been edited. /// A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. /// The Media SID to be attached to the new Message. - /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. /// A structurally valid JSON string that contains values to resolve Rich Content template variables. /// The subject of the message, can be up to 256 characters long. /// The X-Twilio-Webhook-Enabled HTTP request header @@ -632,7 +632,7 @@ public static string ToJson(object model) [JsonProperty("links")] public Dictionary Links { get; private set; } - /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template. + /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template. [JsonProperty("content_sid")] public string ContentSid { get; private set; } diff --git a/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageOptions.cs b/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageOptions.cs index 8b8210868..a66ed7684 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageOptions.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageOptions.cs @@ -55,7 +55,7 @@ public class CreateMessageOptions : IOptions /// The Media SID to be attached to the new Message. public string MediaSid { get; set; } - /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. public string ContentSid { get; set; } /// A structurally valid JSON string that contains values to resolve Rich Content template variables. diff --git a/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageResource.cs b/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageResource.cs index 6d16a3508..215f8557f 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageResource.cs +++ b/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageResource.cs @@ -111,7 +111,7 @@ public static async System.Threading.Tasks.Task CreateAsync(Cre /// The date that this resource was last updated. `null` if the message has not been edited. /// A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. /// The Media SID to be attached to the new Message. - /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. /// A structurally valid JSON string that contains values to resolve Rich Content template variables. /// The subject of the message, can be up to 256 characters long. /// The X-Twilio-Webhook-Enabled HTTP request header @@ -146,7 +146,7 @@ public static MessageResource Create( /// The date that this resource was last updated. `null` if the message has not been edited. /// A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. /// The Media SID to be attached to the new Message. - /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. /// A structurally valid JSON string that contains values to resolve Rich Content template variables. /// The subject of the message, can be up to 256 characters long. /// The X-Twilio-Webhook-Enabled HTTP request header @@ -663,7 +663,7 @@ public static string ToJson(object model) [JsonProperty("links")] public Dictionary Links { get; private set; } - /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template. + /// The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template. [JsonProperty("content_sid")] public string ContentSid { get; private set; } diff --git a/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventOptions.cs b/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventOptions.cs index ebdbea56f..348cc6a91 100644 --- a/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventOptions.cs +++ b/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventOptions.cs @@ -24,7 +24,7 @@ namespace Twilio.Rest.Events.V1.Subscription { - /// Create a new Subscribed Event type for the subscription + /// Add an event type to a Subscription. public class CreateSubscribedEventOptions : IOptions { @@ -34,7 +34,7 @@ public class CreateSubscribedEventOptions : IOptions /// Type of event being subscribed to. public string Type { get; } - /// The schema version that the subscription should use. + /// The schema version that the Subscription should use. public int? SchemaVersion { get; set; } @@ -67,7 +67,7 @@ public List> GetParams() } - /// Remove an event type from a subscription. + /// Remove an event type from a Subscription. public class DeleteSubscribedEventOptions : IOptions { @@ -180,7 +180,7 @@ public class UpdateSubscribedEventOptions : IOptions /// Type of event being subscribed to. public string PathType { get; } - /// The schema version that the subscription should use. + /// The schema version that the Subscription should use. public int? SchemaVersion { get; set; } diff --git a/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventResource.cs b/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventResource.cs index a496ac9c3..3266d48bc 100644 --- a/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventResource.cs +++ b/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventResource.cs @@ -51,7 +51,7 @@ private static Request BuildCreateRequest(CreateSubscribedEventOptions options, ); } - /// Create a new Subscribed Event type for the subscription + /// Add an event type to a Subscription. /// Create SubscribedEvent parameters /// Client to make requests to Twilio /// A single instance of SubscribedEvent @@ -63,7 +63,7 @@ public static SubscribedEventResource Create(CreateSubscribedEventOptions option } #if !NET35 - /// Create a new Subscribed Event type for the subscription + /// Add an event type to a Subscription. /// Create SubscribedEvent parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedEvent @@ -76,10 +76,10 @@ public static async System.Threading.Tasks.Task CreateA } #endif - /// Create a new Subscribed Event type for the subscription + /// Add an event type to a Subscription. /// The unique SID identifier of the Subscription. /// Type of event being subscribed to. - /// The schema version that the subscription should use. + /// The schema version that the Subscription should use. /// Client to make requests to Twilio /// A single instance of SubscribedEvent public static SubscribedEventResource Create( @@ -93,10 +93,10 @@ public static SubscribedEventResource Create( } #if !NET35 - /// Create a new Subscribed Event type for the subscription + /// Add an event type to a Subscription. /// The unique SID identifier of the Subscription. /// Type of event being subscribed to. - /// The schema version that the subscription should use. + /// The schema version that the Subscription should use. /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedEvent public static async System.Threading.Tasks.Task CreateAsync( @@ -110,7 +110,7 @@ public static async System.Threading.Tasks.Task CreateA } #endif - /// Remove an event type from a subscription. + /// Remove an event type from a Subscription. /// Delete SubscribedEvent parameters /// Client to make requests to Twilio /// A single instance of SubscribedEvent @@ -133,7 +133,7 @@ private static Request BuildDeleteRequest(DeleteSubscribedEventOptions options, ); } - /// Remove an event type from a subscription. + /// Remove an event type from a Subscription. /// Delete SubscribedEvent parameters /// Client to make requests to Twilio /// A single instance of SubscribedEvent @@ -145,7 +145,7 @@ public static bool Delete(DeleteSubscribedEventOptions options, ITwilioRestClien } #if !NET35 - /// Remove an event type from a subscription. + /// Remove an event type from a Subscription. /// Delete SubscribedEvent parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedEvent @@ -158,7 +158,7 @@ public static async System.Threading.Tasks.Task DeleteAsync(DeleteSubscrib } #endif - /// Remove an event type from a subscription. + /// Remove an event type from a Subscription. /// The unique SID identifier of the Subscription. /// Type of event being subscribed to. /// Client to make requests to Twilio @@ -170,7 +170,7 @@ public static bool Delete(string pathSubscriptionSid, string pathType, ITwilioRe } #if !NET35 - /// Remove an event type from a subscription. + /// Remove an event type from a Subscription. /// The unique SID identifier of the Subscription. /// Type of event being subscribed to. /// Client to make requests to Twilio @@ -425,7 +425,7 @@ public static async System.Threading.Tasks.Task UpdateA /// Update an Event for a Subscription. /// The unique SID identifier of the Subscription. /// Type of event being subscribed to. - /// The schema version that the subscription should use. + /// The schema version that the Subscription should use. /// Client to make requests to Twilio /// A single instance of SubscribedEvent public static SubscribedEventResource Update( @@ -442,7 +442,7 @@ public static SubscribedEventResource Update( /// Update an Event for a Subscription. /// The unique SID identifier of the Subscription. /// Type of event being subscribed to. - /// The schema version that the subscription should use. + /// The schema version that the Subscription should use. /// Client to make requests to Twilio /// Task that resolves to A single instance of SubscribedEvent public static async System.Threading.Tasks.Task UpdateAsync( @@ -498,7 +498,7 @@ public static string ToJson(object model) [JsonProperty("type")] public string Type { get; private set; } - /// The schema version that the subscription should use. + /// The schema version that the Subscription should use. [JsonProperty("schema_version")] public int? SchemaVersion { get; private set; } diff --git a/src/Twilio/Rest/FlexApi/V1/ConfigurationOptions.cs b/src/Twilio/Rest/FlexApi/V1/ConfigurationOptions.cs index c4b9c8bd3..740027ab2 100644 --- a/src/Twilio/Rest/FlexApi/V1/ConfigurationOptions.cs +++ b/src/Twilio/Rest/FlexApi/V1/ConfigurationOptions.cs @@ -55,6 +55,9 @@ public List> GetParams() public class UpdateConfigurationOptions : IOptions { + + public object Body { get; set; } + @@ -64,6 +67,10 @@ public List> GetParams() { var p = new List>(); + if (Body != null) + { + p.Add(new KeyValuePair("body", Serializers.JsonObject(Body))); + } return p; } diff --git a/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs b/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs index 0de74174d..d86a76f9a 100644 --- a/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs @@ -275,6 +275,10 @@ public static string ToJson(object model) [JsonProperty("flex_service_instance_sid")] public string FlexServiceInstanceSid { get; private set; } + /// The SID of the Flex instance. + [JsonProperty("flex_instance_sid")] + public string FlexInstanceSid { get; private set; } + /// The primary language of the Flex UI. [JsonProperty("ui_language")] public string UiLanguage { get; private set; } diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiOptions.cs b/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiOptions.cs deleted file mode 100644 index f5f4d5293..000000000 --- a/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiOptions.cs +++ /dev/null @@ -1,85 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Flex - * 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 -{ - /// Fetch Account Based Conversational AI Reports - public class FetchInsightsConversationalAiOptions : IOptions - { - - /// Sid of Flex Service Instance - public string PathInstanceSid { get; } - - /// Maximum number of rows to return - public int? MaxRows { get; set; } - - /// The type of report required to fetch.Like gauge,channel-metrics,queue-metrics - public string ReportId { get; set; } - - /// The time period for which report is needed - public InsightsConversationalAiResource.GranularityEnum Granularity { get; set; } - - /// A reference date that should be included in the returned period - public DateTime? IncludeDate { get; set; } - - - - /// Construct a new FetchInsightsConversationalAiOptions - /// Sid of Flex Service Instance - public FetchInsightsConversationalAiOptions(string pathInstanceSid) - { - PathInstanceSid = pathInstanceSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (MaxRows != null) - { - p.Add(new KeyValuePair("MaxRows", MaxRows.ToString())); - } - if (ReportId != null) - { - p.Add(new KeyValuePair("ReportId", ReportId)); - } - if (Granularity != null) - { - p.Add(new KeyValuePair("Granularity", Granularity.ToString())); - } - if (IncludeDate != null) - { - p.Add(new KeyValuePair("IncludeDate", Serializers.DateTimeIso8601(IncludeDate))); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiReportInsightsOptions.cs b/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiReportInsightsOptions.cs deleted file mode 100644 index 4c0081aec..000000000 --- a/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiReportInsightsOptions.cs +++ /dev/null @@ -1,85 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Flex - * 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 -{ - /// Fetch Instance Based Conversational AI Report Insights - public class FetchInsightsConversationalAiReportInsightsOptions : IOptions - { - - /// The Instance SID of the instance for which report insights will be fetched - public string PathInstanceSid { get; } - - /// Maximum number of rows to return - public int? MaxRows { get; set; } - - /// The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics - public string ReportId { get; set; } - - /// The time period for which report insights is needed - public string Granularity { get; set; } - - /// A reference date that should be included in the returned period - public DateTime? IncludeDate { get; set; } - - - - /// Construct a new FetchInsightsConversationalAiReportInsightsOptions - /// The Instance SID of the instance for which report insights will be fetched - public FetchInsightsConversationalAiReportInsightsOptions(string pathInstanceSid) - { - PathInstanceSid = pathInstanceSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (MaxRows != null) - { - p.Add(new KeyValuePair("MaxRows", MaxRows.ToString())); - } - if (ReportId != null) - { - p.Add(new KeyValuePair("ReportId", ReportId)); - } - if (Granularity != null) - { - p.Add(new KeyValuePair("Granularity", Granularity)); - } - if (IncludeDate != null) - { - p.Add(new KeyValuePair("IncludeDate", Serializers.DateTimeIso8601(IncludeDate))); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiReportInsightsResource.cs b/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiReportInsightsResource.cs deleted file mode 100644 index e29184cf7..000000000 --- a/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiReportInsightsResource.cs +++ /dev/null @@ -1,183 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Flex - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; - - - -namespace Twilio.Rest.FlexApi.V1 -{ - public class InsightsConversationalAiReportInsightsResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchInsightsConversationalAiReportInsightsOptions options, ITwilioRestClient client) - { - - string path = "/v1/Insights/Instances/{InstanceSid}/AI/ReportInsights"; - - string PathInstanceSid = options.PathInstanceSid; - path = path.Replace("{"+"InstanceSid"+"}", PathInstanceSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.FlexApi, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// Fetch Instance Based Conversational AI Report Insights - /// Fetch InsightsConversationalAiReportInsights parameters - /// Client to make requests to Twilio - /// A single instance of InsightsConversationalAiReportInsights - public static InsightsConversationalAiReportInsightsResource Fetch(FetchInsightsConversationalAiReportInsightsOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// Fetch Instance Based Conversational AI Report Insights - /// Fetch InsightsConversationalAiReportInsights parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of InsightsConversationalAiReportInsights - public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsConversationalAiReportInsightsOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// Fetch Instance Based Conversational AI Report Insights - /// The Instance SID of the instance for which report insights will be fetched - /// Maximum number of rows to return - /// The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics - /// The time period for which report insights is needed - /// A reference date that should be included in the returned period - /// Client to make requests to Twilio - /// A single instance of InsightsConversationalAiReportInsights - public static InsightsConversationalAiReportInsightsResource Fetch( - string pathInstanceSid, - int? maxRows = null, - string reportId = null, - string granularity = null, - DateTime? includeDate = null, - ITwilioRestClient client = null) - { - var options = new FetchInsightsConversationalAiReportInsightsOptions(pathInstanceSid){ MaxRows = maxRows,ReportId = reportId,Granularity = granularity,IncludeDate = includeDate }; - return Fetch(options, client); - } - - #if !NET35 - /// Fetch Instance Based Conversational AI Report Insights - /// The Instance SID of the instance for which report insights will be fetched - /// Maximum number of rows to return - /// The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics - /// The time period for which report insights is needed - /// A reference date that should be included in the returned period - /// Client to make requests to Twilio - /// Task that resolves to A single instance of InsightsConversationalAiReportInsights - public static async System.Threading.Tasks.Task FetchAsync(string pathInstanceSid, int? maxRows = null, string reportId = null, string granularity = null, DateTime? includeDate = null, ITwilioRestClient client = null) - { - var options = new FetchInsightsConversationalAiReportInsightsOptions(pathInstanceSid){ MaxRows = maxRows,ReportId = reportId,Granularity = granularity,IncludeDate = includeDate }; - return await FetchAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a InsightsConversationalAiReportInsightsResource object - /// - /// Raw JSON string - /// InsightsConversationalAiReportInsightsResource object represented by the provided JSON - public static InsightsConversationalAiReportInsightsResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The Instance SID of the instance for which report insights is fetched - [JsonProperty("instance_sid")] - public string InstanceSid { get; private set; } - - /// The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics - [JsonProperty("report_id")] - public string ReportId { get; private set; } - - /// The start date from which report insights data is included - [JsonProperty("period_start")] - public DateTime? PeriodStart { get; private set; } - - /// The end date till report insights data is included - [JsonProperty("period_end")] - public DateTime? PeriodEnd { get; private set; } - - /// Updated time of the report insights - [JsonProperty("updated")] - public DateTime? Updated { get; private set; } - - /// List of report insights breakdown - [JsonProperty("insights")] - public List Insights { get; private set; } - - /// The URL of this resource - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private InsightsConversationalAiReportInsightsResource() { - - } - } -} - diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiResource.cs b/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiResource.cs deleted file mode 100644 index 2304cb368..000000000 --- a/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiResource.cs +++ /dev/null @@ -1,211 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Flex - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; -using Twilio.Types; - - -namespace Twilio.Rest.FlexApi.V1 -{ - public class InsightsConversationalAiResource : Resource - { - - - - [JsonConverter(typeof(StringEnumConverter))] - public sealed class GranularityEnum : StringEnum - { - private GranularityEnum(string value) : base(value) {} - public GranularityEnum() {} - public static implicit operator GranularityEnum(string value) - { - return new GranularityEnum(value); - } - public static readonly GranularityEnum Days = new GranularityEnum("days"); - public static readonly GranularityEnum Weeks = new GranularityEnum("weeks"); - public static readonly GranularityEnum Months = new GranularityEnum("months"); - public static readonly GranularityEnum Quarters = new GranularityEnum("quarters"); - public static readonly GranularityEnum Years = new GranularityEnum("years"); - - } - - - private static Request BuildFetchRequest(FetchInsightsConversationalAiOptions options, ITwilioRestClient client) - { - - string path = "/v1/Insights/Instances/{InstanceSid}/AI/Reports"; - - string PathInstanceSid = options.PathInstanceSid; - path = path.Replace("{"+"InstanceSid"+"}", PathInstanceSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.FlexApi, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// Fetch Account Based Conversational AI Reports - /// Fetch InsightsConversationalAi parameters - /// Client to make requests to Twilio - /// A single instance of InsightsConversationalAi - public static InsightsConversationalAiResource Fetch(FetchInsightsConversationalAiOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// Fetch Account Based Conversational AI Reports - /// Fetch InsightsConversationalAi parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of InsightsConversationalAi - public static async System.Threading.Tasks.Task FetchAsync(FetchInsightsConversationalAiOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// Fetch Account Based Conversational AI Reports - /// Sid of Flex Service Instance - /// Maximum number of rows to return - /// The type of report required to fetch.Like gauge,channel-metrics,queue-metrics - /// The time period for which report is needed - /// A reference date that should be included in the returned period - /// Client to make requests to Twilio - /// A single instance of InsightsConversationalAi - public static InsightsConversationalAiResource Fetch( - string pathInstanceSid, - int? maxRows = null, - string reportId = null, - InsightsConversationalAiResource.GranularityEnum granularity = null, - DateTime? includeDate = null, - ITwilioRestClient client = null) - { - var options = new FetchInsightsConversationalAiOptions(pathInstanceSid){ MaxRows = maxRows,ReportId = reportId,Granularity = granularity,IncludeDate = includeDate }; - return Fetch(options, client); - } - - #if !NET35 - /// Fetch Account Based Conversational AI Reports - /// Sid of Flex Service Instance - /// Maximum number of rows to return - /// The type of report required to fetch.Like gauge,channel-metrics,queue-metrics - /// The time period for which report is needed - /// A reference date that should be included in the returned period - /// Client to make requests to Twilio - /// Task that resolves to A single instance of InsightsConversationalAi - public static async System.Threading.Tasks.Task FetchAsync(string pathInstanceSid, int? maxRows = null, string reportId = null, InsightsConversationalAiResource.GranularityEnum granularity = null, DateTime? includeDate = null, ITwilioRestClient client = null) - { - var options = new FetchInsightsConversationalAiOptions(pathInstanceSid){ MaxRows = maxRows,ReportId = reportId,Granularity = granularity,IncludeDate = includeDate }; - return await FetchAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a InsightsConversationalAiResource object - /// - /// Raw JSON string - /// InsightsConversationalAiResource object represented by the provided JSON - public static InsightsConversationalAiResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// Sid of Flex Service Instance - [JsonProperty("instance_sid")] - public string InstanceSid { get; private set; } - - /// The type of report required to fetch.Like gauge,channel-metrics,queue-metrics - [JsonProperty("report_id")] - public string ReportId { get; private set; } - - - [JsonProperty("granularity")] - public InsightsConversationalAiResource.GranularityEnum Granularity { get; private set; } - - /// The start date from which report data is included - [JsonProperty("period_start")] - public DateTime? PeriodStart { get; private set; } - - /// The end date till report data is included - [JsonProperty("period_end")] - public DateTime? PeriodEnd { get; private set; } - - /// Updated time of the report - [JsonProperty("updated")] - public DateTime? Updated { get; private set; } - - /// Represents total number of pages fetched report has - [JsonProperty("total_pages")] - public int? TotalPages { get; private set; } - - /// Page offset required for pagination - [JsonProperty("page")] - public int? Page { get; private set; } - - /// List of report breakdown - [JsonProperty("rows")] - public List Rows { get; private set; } - - /// The URL of this resource. - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private InsightsConversationalAiResource() { - - } - } -} - diff --git a/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantOptions.cs b/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantOptions.cs index 49c727aa1..aa67337ee 100644 --- a/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantOptions.cs +++ b/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantOptions.cs @@ -40,6 +40,9 @@ public class CreateInteractionChannelParticipantOptions : IOptions JSON representing the Media Properties for the new Participant. public object MediaProperties { get; } + /// Object representing the Routing Properties for the new Participant. + public object RoutingProperties { get; set; } + /// Construct a new CreateInteractionChannelParticipantOptions /// The Interaction Sid for the new Channel Participant. @@ -68,6 +71,10 @@ public List> GetParams() { p.Add(new KeyValuePair("MediaProperties", Serializers.JsonObject(MediaProperties))); } + if (RoutingProperties != null) + { + p.Add(new KeyValuePair("RoutingProperties", Serializers.JsonObject(RoutingProperties))); + } return p; } diff --git a/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantResource.cs b/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantResource.cs index 05b9d038f..6d8c7aa18 100644 --- a/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantResource.cs @@ -111,6 +111,7 @@ public static async System.Threading.Tasks.Task The Channel Sid for the new Channel Participant. /// /// JSON representing the Media Properties for the new Participant. + /// Object representing the Routing Properties for the new Participant. /// Client to make requests to Twilio /// A single instance of InteractionChannelParticipant public static InteractionChannelParticipantResource Create( @@ -118,9 +119,10 @@ public static InteractionChannelParticipantResource Create( string pathChannelSid, InteractionChannelParticipantResource.TypeEnum type, object mediaProperties, + object routingProperties = null, ITwilioRestClient client = null) { - var options = new CreateInteractionChannelParticipantOptions(pathInteractionSid, pathChannelSid, type, mediaProperties){ }; + var options = new CreateInteractionChannelParticipantOptions(pathInteractionSid, pathChannelSid, type, mediaProperties){ RoutingProperties = routingProperties }; return Create(options, client); } @@ -130,6 +132,7 @@ public static InteractionChannelParticipantResource Create( /// The Channel Sid for the new Channel Participant. /// /// JSON representing the Media Properties for the new Participant. + /// Object representing the Routing Properties for the new Participant. /// Client to make requests to Twilio /// Task that resolves to A single instance of InteractionChannelParticipant public static async System.Threading.Tasks.Task CreateAsync( @@ -137,9 +140,10 @@ public static async System.Threading.Tasks.Task The Participant's routing properties. + [JsonProperty("routing_properties")] + public object RoutingProperties { get; private set; } + private InteractionChannelParticipantResource() { diff --git a/src/Twilio/Rest/Intelligence/V2/ServiceOptions.cs b/src/Twilio/Rest/Intelligence/V2/ServiceOptions.cs index 5e4675b54..34bc9f8c9 100644 --- a/src/Twilio/Rest/Intelligence/V2/ServiceOptions.cs +++ b/src/Twilio/Rest/Intelligence/V2/ServiceOptions.cs @@ -34,7 +34,7 @@ public class CreateServiceOptions : IOptions /// Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. public bool? AutoTranscribe { get; set; } - /// Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + /// Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. public bool? DataLogging { get; set; } /// A human readable description of this resource, up to 64 characters. @@ -208,7 +208,7 @@ public class UpdateServiceOptions : IOptions /// Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. public bool? AutoTranscribe { get; set; } - /// Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + /// Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. public bool? DataLogging { get; set; } /// A human readable description of this resource, up to 64 characters. diff --git a/src/Twilio/Rest/Intelligence/V2/ServiceResource.cs b/src/Twilio/Rest/Intelligence/V2/ServiceResource.cs index 5fd1d7552..0aa668c73 100644 --- a/src/Twilio/Rest/Intelligence/V2/ServiceResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/ServiceResource.cs @@ -91,7 +91,7 @@ public static async System.Threading.Tasks.Task CreateAsync(Cre /// Create a new Service for the given Account /// Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. /// Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - /// Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + /// Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. /// A human readable description of this resource, up to 64 characters. /// The default language code of the audio. /// Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. @@ -120,7 +120,7 @@ public static ServiceResource Create( /// Create a new Service for the given Account /// Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. /// Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - /// Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + /// Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. /// A human readable description of this resource, up to 64 characters. /// The default language code of the audio. /// Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. @@ -444,7 +444,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(Upd /// Update a specific Service. /// A 34 character string that uniquely identifies this Service. /// Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - /// Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + /// Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. /// A human readable description of this resource, up to 64 characters. /// The default language code of the audio. /// Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. @@ -477,7 +477,7 @@ public static ServiceResource Update( /// Update a specific Service. /// A 34 character string that uniquely identifies this Service. /// Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - /// Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + /// Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. /// A human readable description of this resource, up to 64 characters. /// The default language code of the audio. /// Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. @@ -557,7 +557,7 @@ public static string ToJson(object model) [JsonProperty("auto_transcribe")] public bool? AutoTranscribe { get; private set; } - /// Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + /// Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. [JsonProperty("data_logging")] public bool? DataLogging { get; private set; } diff --git a/src/Twilio/Rest/Intelligence/V2/TranscriptResource.cs b/src/Twilio/Rest/Intelligence/V2/TranscriptResource.cs index 24a76ec3e..261eacd62 100644 --- a/src/Twilio/Rest/Intelligence/V2/TranscriptResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/TranscriptResource.cs @@ -475,7 +475,7 @@ public static string ToJson(object model) [JsonProperty("channel")] public object Channel { get; private set; } - /// Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + /// Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. [JsonProperty("data_logging")] public bool? DataLogging { get; private set; } diff --git a/src/Twilio/Rest/Lookups/V2/PhoneNumberOptions.cs b/src/Twilio/Rest/Lookups/V2/PhoneNumberOptions.cs index ff50cd7d8..8a829ada9 100644 --- a/src/Twilio/Rest/Lookups/V2/PhoneNumberOptions.cs +++ b/src/Twilio/Rest/Lookups/V2/PhoneNumberOptions.cs @@ -30,7 +30,7 @@ public class FetchPhoneNumberOptions : IOptions /// The phone number to lookup in E.164 or national format. Default country code is +1 (North America). public string PathPhoneNumber { get; } - /// A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number. + /// A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. public string Fields { get; set; } /// The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. diff --git a/src/Twilio/Rest/Lookups/V2/PhoneNumberResource.cs b/src/Twilio/Rest/Lookups/V2/PhoneNumberResource.cs index 958268999..1f0a5fc0e 100644 --- a/src/Twilio/Rest/Lookups/V2/PhoneNumberResource.cs +++ b/src/Twilio/Rest/Lookups/V2/PhoneNumberResource.cs @@ -94,7 +94,7 @@ public static async System.Threading.Tasks.Task FetchAsync( #endif /// fetch /// The phone number to lookup in E.164 or national format. Default country code is +1 (North America). - /// A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number. + /// A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. /// The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. /// User’s first name. This query parameter is only used (optionally) for identity_match package requests. /// User’s last name. This query parameter is only used (optionally) for identity_match package requests. @@ -133,7 +133,7 @@ public static PhoneNumberResource Fetch( #if !NET35 /// fetch /// The phone number to lookup in E.164 or national format. Default country code is +1 (North America). - /// A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number. + /// A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. /// The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. /// User’s first name. This query parameter is only used (optionally) for identity_match package requests. /// User’s last name. This query parameter is only used (optionally) for identity_match package requests. @@ -226,9 +226,9 @@ public static string ToJson(object model) [JsonProperty("call_forwarding")] public object CallForwarding { get; private set; } - /// An object that contains live activity information for a mobile phone number. - [JsonProperty("live_activity")] - public object LiveActivity { get; private set; } + /// An object that contains line status information for a mobile phone number. + [JsonProperty("line_status")] + public object LineStatus { get; private set; } /// An object that contains line type information including the carrier name, mobile country code, and mobile network code. [JsonProperty("line_type_intelligence")] diff --git a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonOptions.cs b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonOptions.cs index 5248f6f5f..862078f31 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonOptions.cs +++ b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonOptions.cs @@ -70,6 +70,15 @@ public class CreateUsAppToPersonOptions : IOptions /// End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. public List HelpKeywords { get; set; } + /// A boolean that specifies whether campaign has Subscriber Optin or not. + public bool? SubscriberOptIn { get; set; } + + /// A boolean that specifies whether campaign is age gated or not. + public bool? AgeGated { get; set; } + + /// A boolean that specifies whether campaign allows direct lending or not. + public bool? DirectLending { get; set; } + /// Construct a new CreateUsAppToPersonOptions /// The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to create the resources from. @@ -153,6 +162,18 @@ public List> GetParams() { p.AddRange(HelpKeywords.Select(HelpKeywords => new KeyValuePair("HelpKeywords", HelpKeywords))); } + if (SubscriberOptIn != null) + { + p.Add(new KeyValuePair("SubscriberOptIn", SubscriberOptIn.Value.ToString().ToLower())); + } + if (AgeGated != null) + { + p.Add(new KeyValuePair("AgeGated", AgeGated.Value.ToString().ToLower())); + } + if (DirectLending != null) + { + p.Add(new KeyValuePair("DirectLending", DirectLending.Value.ToString().ToLower())); + } return p; } @@ -262,5 +283,103 @@ public List> GetParams() } + /// update + public class UpdateUsAppToPersonOptions : IOptions + { + + /// The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api) to update the resource from. + public string PathMessagingServiceSid { get; } + + /// The SID of the US A2P Compliance resource to update `QE2c6890da8086d771620e9b13fadeba0b`. + public string PathSid { get; } + + /// Indicates that this SMS campaign will send messages that contain links. + public bool? HasEmbeddedLinks { get; } + + /// Indicates that this SMS campaign will send messages that contain phone numbers. + public bool? HasEmbeddedPhone { get; } + + /// An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + public List MessageSamples { get; } + + /// Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + public string MessageFlow { get; } + + /// A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + public string Description { get; } + + /// A boolean that specifies whether campaign requires age gate for federally legal content. + public bool? AgeGated { get; } + + /// A boolean that specifies whether campaign allows direct lending or not. + public bool? DirectLending { get; } + + + + /// Construct a new UpdateUsAppToPersonOptions + /// The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api) to update the resource from. + /// The SID of the US A2P Compliance resource to update `QE2c6890da8086d771620e9b13fadeba0b`. + /// Indicates that this SMS campaign will send messages that contain links. + /// Indicates that this SMS campaign will send messages that contain phone numbers. + /// An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + /// Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + /// A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + /// A boolean that specifies whether campaign requires age gate for federally legal content. + /// A boolean that specifies whether campaign allows direct lending or not. + public UpdateUsAppToPersonOptions(string pathMessagingServiceSid, string pathSid, bool? hasEmbeddedLinks, bool? hasEmbeddedPhone, List messageSamples, string messageFlow, string description, bool? ageGated, bool? directLending) + { + PathMessagingServiceSid = pathMessagingServiceSid; + PathSid = pathSid; + HasEmbeddedLinks = hasEmbeddedLinks; + HasEmbeddedPhone = hasEmbeddedPhone; + MessageSamples = messageSamples; + MessageFlow = messageFlow; + Description = description; + AgeGated = ageGated; + DirectLending = directLending; + } + + + /// Generate the necessary parameters + public List> GetParams() + { + var p = new List>(); + + if (HasEmbeddedLinks != null) + { + p.Add(new KeyValuePair("HasEmbeddedLinks", HasEmbeddedLinks.Value.ToString().ToLower())); + } + if (HasEmbeddedPhone != null) + { + p.Add(new KeyValuePair("HasEmbeddedPhone", HasEmbeddedPhone.Value.ToString().ToLower())); + } + if (MessageSamples != null) + { + p.AddRange(MessageSamples.Select(MessageSamples => new KeyValuePair("MessageSamples", MessageSamples))); + } + if (MessageFlow != null) + { + p.Add(new KeyValuePair("MessageFlow", MessageFlow)); + } + if (Description != null) + { + p.Add(new KeyValuePair("Description", Description)); + } + if (AgeGated != null) + { + p.Add(new KeyValuePair("AgeGated", AgeGated.Value.ToString().ToLower())); + } + if (DirectLending != null) + { + p.Add(new KeyValuePair("DirectLending", DirectLending.Value.ToString().ToLower())); + } + return p; + } + + + + } + + } diff --git a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonResource.cs b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonResource.cs index 56453a03a..4edf3c943 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonResource.cs +++ b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonResource.cs @@ -91,6 +91,9 @@ public static async System.Threading.Tasks.Task CreateAsy /// If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. /// End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. /// End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + /// A boolean that specifies whether campaign has Subscriber Optin or not. + /// A boolean that specifies whether campaign is age gated or not. + /// A boolean that specifies whether campaign allows direct lending or not. /// Client to make requests to Twilio /// A single instance of UsAppToPerson public static UsAppToPersonResource Create( @@ -108,9 +111,12 @@ public static UsAppToPersonResource Create( List optInKeywords = null, List optOutKeywords = null, List helpKeywords = null, + bool? subscriberOptIn = null, + bool? ageGated = null, + bool? directLending = null, ITwilioRestClient client = null) { - var options = new CreateUsAppToPersonOptions(pathMessagingServiceSid, brandRegistrationSid, description, messageFlow, messageSamples, usAppToPersonUsecase, hasEmbeddedLinks, hasEmbeddedPhone){ OptInMessage = optInMessage, OptOutMessage = optOutMessage, HelpMessage = helpMessage, OptInKeywords = optInKeywords, OptOutKeywords = optOutKeywords, HelpKeywords = helpKeywords }; + var options = new CreateUsAppToPersonOptions(pathMessagingServiceSid, brandRegistrationSid, description, messageFlow, messageSamples, usAppToPersonUsecase, hasEmbeddedLinks, hasEmbeddedPhone){ OptInMessage = optInMessage, OptOutMessage = optOutMessage, HelpMessage = helpMessage, OptInKeywords = optInKeywords, OptOutKeywords = optOutKeywords, HelpKeywords = helpKeywords, SubscriberOptIn = subscriberOptIn, AgeGated = ageGated, DirectLending = directLending }; return Create(options, client); } @@ -130,6 +136,9 @@ public static UsAppToPersonResource Create( /// If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. /// End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. /// End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + /// A boolean that specifies whether campaign has Subscriber Optin or not. + /// A boolean that specifies whether campaign is age gated or not. + /// A boolean that specifies whether campaign allows direct lending or not. /// Client to make requests to Twilio /// Task that resolves to A single instance of UsAppToPerson public static async System.Threading.Tasks.Task CreateAsync( @@ -147,9 +156,12 @@ public static async System.Threading.Tasks.Task CreateAsy List optInKeywords = null, List optOutKeywords = null, List helpKeywords = null, + bool? subscriberOptIn = null, + bool? ageGated = null, + bool? directLending = null, ITwilioRestClient client = null) { - var options = new CreateUsAppToPersonOptions(pathMessagingServiceSid, brandRegistrationSid, description, messageFlow, messageSamples, usAppToPersonUsecase, hasEmbeddedLinks, hasEmbeddedPhone){ OptInMessage = optInMessage, OptOutMessage = optOutMessage, HelpMessage = helpMessage, OptInKeywords = optInKeywords, OptOutKeywords = optOutKeywords, HelpKeywords = helpKeywords }; + var options = new CreateUsAppToPersonOptions(pathMessagingServiceSid, brandRegistrationSid, description, messageFlow, messageSamples, usAppToPersonUsecase, hasEmbeddedLinks, hasEmbeddedPhone){ OptInMessage = optInMessage, OptOutMessage = optOutMessage, HelpMessage = helpMessage, OptInKeywords = optInKeywords, OptOutKeywords = optOutKeywords, HelpKeywords = helpKeywords, SubscriberOptIn = subscriberOptIn, AgeGated = ageGated, DirectLending = directLending }; return await CreateAsync(options, client); } #endif @@ -421,6 +433,108 @@ public static Page PreviousPage(Page.FromJson("compliance", response.Content); } + + private static Request BuildUpdateRequest(UpdateUsAppToPersonOptions options, ITwilioRestClient client) + { + + string path = "/v1/Services/{MessagingServiceSid}/Compliance/Usa2p/{Sid}"; + + string PathMessagingServiceSid = options.PathMessagingServiceSid; + path = path.Replace("{"+"MessagingServiceSid"+"}", PathMessagingServiceSid); + string PathSid = options.PathSid; + path = path.Replace("{"+"Sid"+"}", PathSid); + + return new Request( + HttpMethod.Post, + Rest.Domain.Messaging, + path, + postParams: options.GetParams(), + headerParams: null + ); + } + + /// update + /// Update UsAppToPerson parameters + /// Client to make requests to Twilio + /// A single instance of UsAppToPerson + public static UsAppToPersonResource Update(UpdateUsAppToPersonOptions options, ITwilioRestClient client = null) + { + client = client ?? TwilioClient.GetRestClient(); + var response = client.Request(BuildUpdateRequest(options, client)); + return FromJson(response.Content); + } + + /// update + /// Update UsAppToPerson parameters + /// Client to make requests to Twilio + /// Task that resolves to A single instance of UsAppToPerson + #if !NET35 + public static async System.Threading.Tasks.Task UpdateAsync(UpdateUsAppToPersonOptions options, + ITwilioRestClient client = null) + { + client = client ?? TwilioClient.GetRestClient(); + var response = await client.RequestAsync(BuildUpdateRequest(options, client)); + return FromJson(response.Content); + } + #endif + + /// update + /// The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api) to update the resource from. + /// The SID of the US A2P Compliance resource to update `QE2c6890da8086d771620e9b13fadeba0b`. + /// Indicates that this SMS campaign will send messages that contain links. + /// Indicates that this SMS campaign will send messages that contain phone numbers. + /// An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + /// Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + /// A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + /// A boolean that specifies whether campaign requires age gate for federally legal content. + /// A boolean that specifies whether campaign allows direct lending or not. + /// Client to make requests to Twilio + /// A single instance of UsAppToPerson + public static UsAppToPersonResource Update( + string pathMessagingServiceSid, + string pathSid, + bool? hasEmbeddedLinks, + bool? hasEmbeddedPhone, + List messageSamples, + string messageFlow, + string description, + bool? ageGated, + bool? directLending, + ITwilioRestClient client = null) + { + var options = new UpdateUsAppToPersonOptions(pathMessagingServiceSid, pathSid, hasEmbeddedLinks, hasEmbeddedPhone, messageSamples, messageFlow, description, ageGated, directLending){ }; + return Update(options, client); + } + + #if !NET35 + /// update + /// The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api) to update the resource from. + /// The SID of the US A2P Compliance resource to update `QE2c6890da8086d771620e9b13fadeba0b`. + /// Indicates that this SMS campaign will send messages that contain links. + /// Indicates that this SMS campaign will send messages that contain phone numbers. + /// An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + /// Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + /// A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + /// A boolean that specifies whether campaign requires age gate for federally legal content. + /// A boolean that specifies whether campaign allows direct lending or not. + /// Client to make requests to Twilio + /// Task that resolves to A single instance of UsAppToPerson + public static async System.Threading.Tasks.Task UpdateAsync( + string pathMessagingServiceSid, + string pathSid, + bool? hasEmbeddedLinks, + bool? hasEmbeddedPhone, + List messageSamples, + string messageFlow, + string description, + bool? ageGated, + bool? directLending, + ITwilioRestClient client = null) + { + var options = new UpdateUsAppToPersonOptions(pathMessagingServiceSid, pathSid, hasEmbeddedLinks, hasEmbeddedPhone, messageSamples, messageFlow, description, ageGated, directLending){ }; + return await UpdateAsync(options, client); + } + #endif /// /// Converts a JSON string into a UsAppToPersonResource object @@ -492,6 +606,18 @@ public static string ToJson(object model) [JsonProperty("has_embedded_phone")] public bool? HasEmbeddedPhone { get; private set; } + /// A boolean that specifies whether campaign has Subscriber Optin or not. + [JsonProperty("subscriber_opt_in")] + public bool? SubscriberOptIn { get; private set; } + + /// A boolean that specifies whether campaign is age gated or not. + [JsonProperty("age_gated")] + public bool? AgeGated { get; private set; } + + /// A boolean that specifies whether campaign allows direct lending or not. + [JsonProperty("direct_lending")] + public bool? DirectLending { get; private set; } + /// Campaign status. Examples: IN_PROGRESS, VERIFIED, FAILED. [JsonProperty("campaign_status")] public string CampaignStatus { get; private set; } diff --git a/src/Twilio/Rest/Messaging/V1/TollfreeVerificationOptions.cs b/src/Twilio/Rest/Messaging/V1/TollfreeVerificationOptions.cs index 38e72d27e..bec45a93e 100644 --- a/src/Twilio/Rest/Messaging/V1/TollfreeVerificationOptions.cs +++ b/src/Twilio/Rest/Messaging/V1/TollfreeVerificationOptions.cs @@ -91,7 +91,7 @@ public class CreateTollfreeVerificationOptions : IOptions The email address of the contact for the business or organization using the Tollfree number. public string BusinessContactEmail { get; set; } - /// The phone number of the contact for the business or organization using the Tollfree number. + /// The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. public Types.PhoneNumber BusinessContactPhone { get; set; } /// An optional external reference ID supplied by customer and echoed back on status retrieval. @@ -389,7 +389,7 @@ public class UpdateTollfreeVerificationOptions : IOptions The email address of the contact for the business or organization using the Tollfree number. public string BusinessContactEmail { get; set; } - /// The phone number of the contact for the business or organization using the Tollfree number. + /// The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. public Types.PhoneNumber BusinessContactPhone { get; set; } /// Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. diff --git a/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs b/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs index ba2caee69..6ba089d58 100644 --- a/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs +++ b/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs @@ -127,7 +127,7 @@ public static async System.Threading.Tasks.Task Cr /// The first name of the contact for the business or organization using the Tollfree number. /// The last name of the contact for the business or organization using the Tollfree number. /// The email address of the contact for the business or organization using the Tollfree number. - /// The phone number of the contact for the business or organization using the Tollfree number. + /// The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. /// An optional external reference ID supplied by customer and echoed back on status retrieval. /// Client to make requests to Twilio /// A single instance of TollfreeVerification @@ -184,7 +184,7 @@ public static TollfreeVerificationResource Create( /// The first name of the contact for the business or organization using the Tollfree number. /// The last name of the contact for the business or organization using the Tollfree number. /// The email address of the contact for the business or organization using the Tollfree number. - /// The phone number of the contact for the business or organization using the Tollfree number. + /// The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. /// An optional external reference ID supplied by customer and echoed back on status retrieval. /// Client to make requests to Twilio /// Task that resolves to A single instance of TollfreeVerification @@ -543,7 +543,7 @@ public static async System.Threading.Tasks.Task Up /// The first name of the contact for the business or organization using the Tollfree number. /// The last name of the contact for the business or organization using the Tollfree number. /// The email address of the contact for the business or organization using the Tollfree number. - /// The phone number of the contact for the business or organization using the Tollfree number. + /// The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. /// Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. /// Client to make requests to Twilio /// A single instance of TollfreeVerification @@ -598,7 +598,7 @@ public static TollfreeVerificationResource Update( /// The first name of the contact for the business or organization using the Tollfree number. /// The last name of the contact for the business or organization using the Tollfree number. /// The email address of the contact for the business or organization using the Tollfree number. - /// The phone number of the contact for the business or organization using the Tollfree number. + /// The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. /// Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. /// Client to make requests to Twilio /// Task that resolves to A single instance of TollfreeVerification @@ -738,7 +738,7 @@ public static string ToJson(object model) [JsonProperty("business_contact_email")] public string BusinessContactEmail { get; private set; } - /// The phone number of the contact for the business or organization using the Tollfree number. + /// The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. [JsonProperty("business_contact_phone")] [JsonConverter(typeof(PhoneNumberConverter))] public Types.PhoneNumber BusinessContactPhone { get; private set; } @@ -803,6 +803,10 @@ public static string ToJson(object model) [JsonProperty("edit_allowed")] public bool? EditAllowed { get; private set; } + /// A list of rejection reasons and codes describing why a Tollfree Verification has been rejected. + [JsonProperty("rejection_reasons")] + public List RejectionReasons { get; private set; } + /// The URLs of the documents associated with the Tollfree Verification resource. [JsonProperty("resource_links")] public object ResourceLinks { get; private set; } diff --git a/src/Twilio/Rest/Notify/V1/Service/NotificationOptions.cs b/src/Twilio/Rest/Notify/V1/Service/NotificationOptions.cs index c8114241d..34d426b98 100644 --- a/src/Twilio/Rest/Notify/V1/Service/NotificationOptions.cs +++ b/src/Twilio/Rest/Notify/V1/Service/NotificationOptions.cs @@ -58,7 +58,7 @@ public class CreateNotificationOptions : IOptions /// The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). public object Gcm { get; set; } - /// The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/send-messages) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. + /// The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/quickstart) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. public object Sms { get; set; } /// Deprecated. diff --git a/src/Twilio/Rest/Notify/V1/Service/NotificationResource.cs b/src/Twilio/Rest/Notify/V1/Service/NotificationResource.cs index e40650abd..8afa0dd05 100644 --- a/src/Twilio/Rest/Notify/V1/Service/NotificationResource.cs +++ b/src/Twilio/Rest/Notify/V1/Service/NotificationResource.cs @@ -102,7 +102,7 @@ public static async System.Threading.Tasks.Task CreateAsyn /// The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. /// The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. /// The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). - /// The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/send-messages) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. + /// The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/quickstart) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. /// Deprecated. /// The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. /// The Segment resource is deprecated. Use the `tag` parameter, instead. @@ -151,7 +151,7 @@ public static NotificationResource Create( /// The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. /// The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. /// The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). - /// The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/send-messages) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. + /// The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/quickstart) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. /// Deprecated. /// The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. /// The Segment resource is deprecated. Use the `tag` parameter, instead. diff --git a/src/Twilio/Rest/Notify/V1/ServiceOptions.cs b/src/Twilio/Rest/Notify/V1/ServiceOptions.cs index cd3545f27..213cf79b9 100644 --- a/src/Twilio/Rest/Notify/V1/ServiceOptions.cs +++ b/src/Twilio/Rest/Notify/V1/ServiceOptions.cs @@ -37,7 +37,7 @@ public class CreateServiceOptions : IOptions /// The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. public string GcmCredentialSid { get; set; } - /// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + /// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. public string MessagingServiceSid { get; set; } /// Deprecated. @@ -247,7 +247,7 @@ public class UpdateServiceOptions : IOptions /// The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. public string GcmCredentialSid { get; set; } - /// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + /// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. public string MessagingServiceSid { get; set; } /// Deprecated. diff --git a/src/Twilio/Rest/Notify/V1/ServiceResource.cs b/src/Twilio/Rest/Notify/V1/ServiceResource.cs index 83a66a68f..fdebad4b4 100644 --- a/src/Twilio/Rest/Notify/V1/ServiceResource.cs +++ b/src/Twilio/Rest/Notify/V1/ServiceResource.cs @@ -78,7 +78,7 @@ public static async System.Threading.Tasks.Task CreateAsync(Cre /// A descriptive string that you create to describe the resource. It can be up to 64 characters long. /// The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. /// The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - /// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + /// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. /// Deprecated. /// The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. /// The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -117,7 +117,7 @@ public static ServiceResource Create( /// A descriptive string that you create to describe the resource. It can be up to 64 characters long. /// The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. /// The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - /// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + /// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. /// Deprecated. /// The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. /// The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -456,7 +456,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(Upd /// A descriptive string that you create to describe the resource. It can be up to 64 characters long. /// The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. /// The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - /// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + /// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. /// Deprecated. /// The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. /// The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -497,7 +497,7 @@ public static ServiceResource Update( /// A descriptive string that you create to describe the resource. It can be up to 64 characters long. /// The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. /// The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - /// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + /// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. /// Deprecated. /// The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. /// The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -599,7 +599,7 @@ public static string ToJson(object model) [JsonProperty("fcm_credential_sid")] public string FcmCredentialSid { get; private set; } - /// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. In order to send SMS notifications this parameter has to be set. + /// The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. In order to send SMS notifications this parameter has to be set. [JsonProperty("messaging_service_sid")] public string MessagingServiceSid { get; private set; } diff --git a/src/Twilio/Rest/Numbers/V1/BulkEligibilityOptions.cs b/src/Twilio/Rest/Numbers/V1/BulkEligibilityOptions.cs index a939be3b2..e5a0df6a2 100644 --- a/src/Twilio/Rest/Numbers/V1/BulkEligibilityOptions.cs +++ b/src/Twilio/Rest/Numbers/V1/BulkEligibilityOptions.cs @@ -28,17 +28,23 @@ namespace Twilio.Rest.Numbers.V1 public class CreateBulkEligibilityOptions : IOptions { + + public object Body { get; set; } + - /// Generate the necessary parameters - public List> GetParams() + /// Generate the request body + public string GetBody() { - var p = new List>(); + string body = ""; - return p; + if (Body != null) + { + body = BulkEligibilityResource.ToJson(Body); + } + return body; } - } diff --git a/src/Twilio/Rest/Numbers/V1/BulkEligibilityResource.cs b/src/Twilio/Rest/Numbers/V1/BulkEligibilityResource.cs index 696375da2..6359e5298 100644 --- a/src/Twilio/Rest/Numbers/V1/BulkEligibilityResource.cs +++ b/src/Twilio/Rest/Numbers/V1/BulkEligibilityResource.cs @@ -44,7 +44,9 @@ private static Request BuildCreateRequest(CreateBulkEligibilityOptions options, HttpMethod.Post, Rest.Domain.Numbers, path, - postParams: options.GetParams(), + + contentType: EnumConstants.ContentTypeEnum.JSON, + body: options.GetBody(), headerParams: null ); } diff --git a/src/Twilio/Rest/Numbers/V1/EligibilityOptions.cs b/src/Twilio/Rest/Numbers/V1/EligibilityOptions.cs index f6f3097e7..816c02210 100644 --- a/src/Twilio/Rest/Numbers/V1/EligibilityOptions.cs +++ b/src/Twilio/Rest/Numbers/V1/EligibilityOptions.cs @@ -28,17 +28,23 @@ namespace Twilio.Rest.Numbers.V1 public class CreateEligibilityOptions : IOptions { + + public object Body { get; set; } + - /// Generate the necessary parameters - public List> GetParams() + /// Generate the request body + public string GetBody() { - var p = new List>(); + string body = ""; - return p; + if (Body != null) + { + body = EligibilityResource.ToJson(Body); + } + return body; } - } diff --git a/src/Twilio/Rest/Numbers/V1/EligibilityResource.cs b/src/Twilio/Rest/Numbers/V1/EligibilityResource.cs index 37ae91e3f..3db533714 100644 --- a/src/Twilio/Rest/Numbers/V1/EligibilityResource.cs +++ b/src/Twilio/Rest/Numbers/V1/EligibilityResource.cs @@ -44,7 +44,9 @@ private static Request BuildCreateRequest(CreateEligibilityOptions options, ITwi HttpMethod.Post, Rest.Domain.Numbers, path, - postParams: options.GetParams(), + + contentType: EnumConstants.ContentTypeEnum.JSON, + body: options.GetBody(), headerParams: null ); } diff --git a/src/Twilio/Rest/Numbers/V1/PortingPortInOptions.cs b/src/Twilio/Rest/Numbers/V1/PortingPortInOptions.cs index e6701e9d0..d7b09aba9 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingPortInOptions.cs +++ b/src/Twilio/Rest/Numbers/V1/PortingPortInOptions.cs @@ -24,21 +24,27 @@ namespace Twilio.Rest.Numbers.V1 { - /// Allows to create a port in request + /// Allows to create a new port in request public class CreatePortingPortInOptions : IOptions { + + public object Body { get; set; } + - /// Generate the necessary parameters - public List> GetParams() + /// Generate the request body + public string GetBody() { - var p = new List>(); + string body = ""; - return p; + if (Body != null) + { + body = PortingPortInResource.ToJson(Body); + } + return body; } - } diff --git a/src/Twilio/Rest/Numbers/V1/PortingPortInResource.cs b/src/Twilio/Rest/Numbers/V1/PortingPortInResource.cs index 06e2c05d5..67d1bf144 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingPortInResource.cs +++ b/src/Twilio/Rest/Numbers/V1/PortingPortInResource.cs @@ -44,12 +44,14 @@ private static Request BuildCreateRequest(CreatePortingPortInOptions options, IT HttpMethod.Post, Rest.Domain.Numbers, path, - postParams: options.GetParams(), + + contentType: EnumConstants.ContentTypeEnum.JSON, + body: options.GetBody(), headerParams: null ); } - /// Allows to create a port in request + /// Allows to create a new port in request /// Create PortingPortIn parameters /// Client to make requests to Twilio /// A single instance of PortingPortIn @@ -61,7 +63,7 @@ public static PortingPortInResource Create(CreatePortingPortInOptions options, I } #if !NET35 - /// Allows to create a port in request + /// Allows to create a new port in request /// Create PortingPortIn parameters /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortIn @@ -74,7 +76,7 @@ public static async System.Threading.Tasks.Task CreateAsy } #endif - /// Allows to create a port in request + /// Allows to create a new port in request /// Client to make requests to Twilio /// A single instance of PortingPortIn public static PortingPortInResource Create( @@ -85,7 +87,7 @@ public static PortingPortInResource Create( } #if !NET35 - /// Allows to create a port in request + /// Allows to create a new port in request /// Client to make requests to Twilio /// Task that resolves to A single instance of PortingPortIn public static async System.Threading.Tasks.Task CreateAsync( @@ -130,7 +132,7 @@ public static string ToJson(object model) } - /// The SID of the Port In request, It is the request identifier + /// The SID of the Port In request. This is a unique identifier of the port in request. [JsonProperty("port_in_request_sid")] public string PortInRequestSid { get; private set; } diff --git a/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderOptions.cs b/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderOptions.cs index dd5c2927a..818f39eb4 100644 --- a/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderOptions.cs +++ b/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderOptions.cs @@ -28,17 +28,23 @@ namespace Twilio.Rest.Numbers.V2 public class CreateBulkHostedNumberOrderOptions : IOptions { + + public object Body { get; set; } + - /// Generate the necessary parameters - public List> GetParams() + /// Generate the request body + public string GetBody() { - var p = new List>(); + string body = ""; - return p; + if (Body != null) + { + body = BulkHostedNumberOrderResource.ToJson(Body); + } + return body; } - } diff --git a/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderResource.cs b/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderResource.cs index 1848abeff..248543dd9 100644 --- a/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderResource.cs +++ b/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderResource.cs @@ -58,7 +58,9 @@ private static Request BuildCreateRequest(CreateBulkHostedNumberOrderOptions opt HttpMethod.Post, Rest.Domain.Numbers, path, - postParams: options.GetParams(), + + contentType: EnumConstants.ContentTypeEnum.JSON, + body: options.GetBody(), headerParams: null ); } diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsOptions.cs b/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsOptions.cs deleted file mode 100644 index 88769ec72..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsOptions.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Preview.Understand.Assistant -{ - /// fetch - public class FetchAssistantFallbackActionsOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - - /// Construct a new FetchUnderstandAssistantFallbackActionsOptions - /// - public FetchAssistantFallbackActionsOptions(string pathAssistantSid) - { - PathAssistantSid = pathAssistantSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// update - public class UpdateAssistantFallbackActionsOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - public object FallbackActions { get; set; } - - - - /// Construct a new UpdateUnderstandAssistantFallbackActionsOptions - /// - public UpdateAssistantFallbackActionsOptions(string pathAssistantSid) - { - PathAssistantSid = pathAssistantSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (FallbackActions != null) - { - p.Add(new KeyValuePair("FallbackActions", Serializers.JsonObject(FallbackActions))); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsResource.cs b/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsResource.cs deleted file mode 100644 index b7b37826c..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsResource.cs +++ /dev/null @@ -1,231 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; - - - -namespace Twilio.Rest.Preview.Understand.Assistant -{ - public class AssistantFallbackActionsResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchAssistantFallbackActionsOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/FallbackActions"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// fetch - /// Fetch AssistantFallbackActions parameters - /// Client to make requests to Twilio - /// A single instance of AssistantFallbackActions - public static AssistantFallbackActionsResource Fetch(FetchAssistantFallbackActionsOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// fetch - /// Fetch AssistantFallbackActions parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of AssistantFallbackActions - public static async System.Threading.Tasks.Task FetchAsync(FetchAssistantFallbackActionsOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// fetch - /// - /// Client to make requests to Twilio - /// A single instance of AssistantFallbackActions - public static AssistantFallbackActionsResource Fetch( - string pathAssistantSid, - ITwilioRestClient client = null) - { - var options = new FetchAssistantFallbackActionsOptions(pathAssistantSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// fetch - /// - /// Client to make requests to Twilio - /// Task that resolves to A single instance of AssistantFallbackActions - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, ITwilioRestClient client = null) - { - var options = new FetchAssistantFallbackActionsOptions(pathAssistantSid){ }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildUpdateRequest(UpdateAssistantFallbackActionsOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/FallbackActions"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// update - /// Update AssistantFallbackActions parameters - /// Client to make requests to Twilio - /// A single instance of AssistantFallbackActions - public static AssistantFallbackActionsResource Update(UpdateAssistantFallbackActionsOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - - /// update - /// Update AssistantFallbackActions parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of AssistantFallbackActions - #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAssistantFallbackActionsOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// update - /// - /// - /// Client to make requests to Twilio - /// A single instance of AssistantFallbackActions - public static AssistantFallbackActionsResource Update( - string pathAssistantSid, - object fallbackActions = null, - ITwilioRestClient client = null) - { - var options = new UpdateAssistantFallbackActionsOptions(pathAssistantSid){ FallbackActions = fallbackActions }; - return Update(options, client); - } - - #if !NET35 - /// update - /// - /// - /// Client to make requests to Twilio - /// Task that resolves to A single instance of AssistantFallbackActions - public static async System.Threading.Tasks.Task UpdateAsync( - string pathAssistantSid, - object fallbackActions = null, - ITwilioRestClient client = null) - { - var options = new UpdateAssistantFallbackActionsOptions(pathAssistantSid){ FallbackActions = fallbackActions }; - return await UpdateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a AssistantFallbackActionsResource object - /// - /// Raw JSON string - /// AssistantFallbackActionsResource object represented by the provided JSON - public static AssistantFallbackActionsResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The account_sid - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The assistant_sid - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// The data - [JsonProperty("data")] - public object Data { get; private set; } - - - - private AssistantFallbackActionsResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsOptions.cs b/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsOptions.cs deleted file mode 100644 index 4a32917fd..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsOptions.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Preview.Understand.Assistant -{ - /// fetch - public class FetchAssistantInitiationActionsOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - - /// Construct a new FetchUnderstandAssistantInitiationActionsOptions - /// - public FetchAssistantInitiationActionsOptions(string pathAssistantSid) - { - PathAssistantSid = pathAssistantSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// update - public class UpdateAssistantInitiationActionsOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - public object InitiationActions { get; set; } - - - - /// Construct a new UpdateUnderstandAssistantInitiationActionsOptions - /// - public UpdateAssistantInitiationActionsOptions(string pathAssistantSid) - { - PathAssistantSid = pathAssistantSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (InitiationActions != null) - { - p.Add(new KeyValuePair("InitiationActions", Serializers.JsonObject(InitiationActions))); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsResource.cs b/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsResource.cs deleted file mode 100644 index b91542fc9..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsResource.cs +++ /dev/null @@ -1,231 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; - - - -namespace Twilio.Rest.Preview.Understand.Assistant -{ - public class AssistantInitiationActionsResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchAssistantInitiationActionsOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/InitiationActions"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// fetch - /// Fetch AssistantInitiationActions parameters - /// Client to make requests to Twilio - /// A single instance of AssistantInitiationActions - public static AssistantInitiationActionsResource Fetch(FetchAssistantInitiationActionsOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// fetch - /// Fetch AssistantInitiationActions parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of AssistantInitiationActions - public static async System.Threading.Tasks.Task FetchAsync(FetchAssistantInitiationActionsOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// fetch - /// - /// Client to make requests to Twilio - /// A single instance of AssistantInitiationActions - public static AssistantInitiationActionsResource Fetch( - string pathAssistantSid, - ITwilioRestClient client = null) - { - var options = new FetchAssistantInitiationActionsOptions(pathAssistantSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// fetch - /// - /// Client to make requests to Twilio - /// Task that resolves to A single instance of AssistantInitiationActions - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, ITwilioRestClient client = null) - { - var options = new FetchAssistantInitiationActionsOptions(pathAssistantSid){ }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildUpdateRequest(UpdateAssistantInitiationActionsOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/InitiationActions"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// update - /// Update AssistantInitiationActions parameters - /// Client to make requests to Twilio - /// A single instance of AssistantInitiationActions - public static AssistantInitiationActionsResource Update(UpdateAssistantInitiationActionsOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - - /// update - /// Update AssistantInitiationActions parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of AssistantInitiationActions - #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAssistantInitiationActionsOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// update - /// - /// - /// Client to make requests to Twilio - /// A single instance of AssistantInitiationActions - public static AssistantInitiationActionsResource Update( - string pathAssistantSid, - object initiationActions = null, - ITwilioRestClient client = null) - { - var options = new UpdateAssistantInitiationActionsOptions(pathAssistantSid){ InitiationActions = initiationActions }; - return Update(options, client); - } - - #if !NET35 - /// update - /// - /// - /// Client to make requests to Twilio - /// Task that resolves to A single instance of AssistantInitiationActions - public static async System.Threading.Tasks.Task UpdateAsync( - string pathAssistantSid, - object initiationActions = null, - ITwilioRestClient client = null) - { - var options = new UpdateAssistantInitiationActionsOptions(pathAssistantSid){ InitiationActions = initiationActions }; - return await UpdateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a AssistantInitiationActionsResource object - /// - /// Raw JSON string - /// AssistantInitiationActionsResource object represented by the provided JSON - public static AssistantInitiationActionsResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The account_sid - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The assistant_sid - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// The data - [JsonProperty("data")] - public object Data { get; private set; } - - - - private AssistantInitiationActionsResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/DialogueOptions.cs b/src/Twilio/Rest/Preview/Understand/Assistant/DialogueOptions.cs deleted file mode 100644 index 797f4c369..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/DialogueOptions.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Preview.Understand.Assistant -{ - /// fetch - public class FetchDialogueOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - public string PathSid { get; } - - - - /// Construct a new FetchUnderstandDialogueOptions - /// - /// - public FetchDialogueOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/DialogueResource.cs b/src/Twilio/Rest/Preview/Understand/Assistant/DialogueResource.cs deleted file mode 100644 index 49a2f4a4d..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/DialogueResource.cs +++ /dev/null @@ -1,168 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; - - - -namespace Twilio.Rest.Preview.Understand.Assistant -{ - public class DialogueResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchDialogueOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Dialogues/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// fetch - /// Fetch Dialogue parameters - /// Client to make requests to Twilio - /// A single instance of Dialogue - public static DialogueResource Fetch(FetchDialogueOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// fetch - /// Fetch Dialogue parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Dialogue - public static async System.Threading.Tasks.Task FetchAsync(FetchDialogueOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// fetch - /// - /// - /// Client to make requests to Twilio - /// A single instance of Dialogue - public static DialogueResource Fetch( - string pathAssistantSid, - string pathSid, - ITwilioRestClient client = null) - { - var options = new FetchDialogueOptions(pathAssistantSid, pathSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// fetch - /// - /// - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Dialogue - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new FetchDialogueOptions(pathAssistantSid, pathSid){ }; - return await FetchAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a DialogueResource object - /// - /// Raw JSON string - /// DialogueResource object represented by the provided JSON - public static DialogueResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The unique ID of the Account that created this Field. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The unique ID of the parent Assistant. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The unique ID of the Dialogue - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// The dialogue memory object as json - [JsonProperty("data")] - public object Data { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private DialogueResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueOptions.cs b/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueOptions.cs deleted file mode 100644 index 8b0610dfc..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueOptions.cs +++ /dev/null @@ -1,210 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Preview.Understand.Assistant.FieldType -{ - - /// create - public class CreateFieldValueOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - public string PathFieldTypeSid { get; } - - /// An ISO language-country string of the value. - public string Language { get; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - public string Value { get; } - - /// A value that indicates this field value is a synonym of. Empty if the value is not a synonym. - public string SynonymOf { get; set; } - - - /// Construct a new CreateUnderstandFieldValueOptions - /// - /// - /// An ISO language-country string of the value. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - public CreateFieldValueOptions(string pathAssistantSid, string pathFieldTypeSid, string language, string value) - { - PathAssistantSid = pathAssistantSid; - PathFieldTypeSid = pathFieldTypeSid; - Language = language; - Value = value; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (Language != null) - { - p.Add(new KeyValuePair("Language", Language)); - } - if (Value != null) - { - p.Add(new KeyValuePair("Value", Value)); - } - if (SynonymOf != null) - { - p.Add(new KeyValuePair("SynonymOf", SynonymOf)); - } - return p; - } - - - - } - /// delete - public class DeleteFieldValueOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - public string PathFieldTypeSid { get; } - - - public string PathSid { get; } - - - - /// Construct a new DeleteUnderstandFieldValueOptions - /// - /// - /// - public DeleteFieldValueOptions(string pathAssistantSid, string pathFieldTypeSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathFieldTypeSid = pathFieldTypeSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// fetch - public class FetchFieldValueOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - public string PathFieldTypeSid { get; } - - - public string PathSid { get; } - - - - /// Construct a new FetchUnderstandFieldValueOptions - /// - /// - /// - public FetchFieldValueOptions(string pathAssistantSid, string pathFieldTypeSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathFieldTypeSid = pathFieldTypeSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// read - public class ReadFieldValueOptions : ReadOptions - { - - - public string PathAssistantSid { get; } - - - public string PathFieldTypeSid { get; } - - /// An ISO language-country string of the value. For example: *en-US* - public string Language { get; set; } - - - - /// Construct a new ListUnderstandFieldValueOptions - /// - /// - public ReadFieldValueOptions(string pathAssistantSid, string pathFieldTypeSid) - { - PathAssistantSid = pathAssistantSid; - PathFieldTypeSid = pathFieldTypeSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (Language != null) - { - p.Add(new KeyValuePair("Language", Language)); - } - if (PageSize != null) - { - p.Add(new KeyValuePair("PageSize", PageSize.ToString())); - } - return p; - } - - - - } - -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueResource.cs b/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueResource.cs deleted file mode 100644 index b5fea161a..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueResource.cs +++ /dev/null @@ -1,491 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; - - - -namespace Twilio.Rest.Preview.Understand.Assistant.FieldType -{ - public class FieldValueResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateFieldValueOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/FieldTypes/{FieldTypeSid}/FieldValues"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathFieldTypeSid = options.PathFieldTypeSid; - path = path.Replace("{"+"FieldTypeSid"+"}", PathFieldTypeSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// create - /// Create FieldValue parameters - /// Client to make requests to Twilio - /// A single instance of FieldValue - public static FieldValueResource Create(CreateFieldValueOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// create - /// Create FieldValue parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldValue - public static async System.Threading.Tasks.Task CreateAsync(CreateFieldValueOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// create - /// - /// - /// An ISO language-country string of the value. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// A value that indicates this field value is a synonym of. Empty if the value is not a synonym. - /// Client to make requests to Twilio - /// A single instance of FieldValue - public static FieldValueResource Create( - string pathAssistantSid, - string pathFieldTypeSid, - string language, - string value, - string synonymOf = null, - ITwilioRestClient client = null) - { - var options = new CreateFieldValueOptions(pathAssistantSid, pathFieldTypeSid, language, value){ SynonymOf = synonymOf }; - return Create(options, client); - } - - #if !NET35 - /// create - /// - /// - /// An ISO language-country string of the value. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// A value that indicates this field value is a synonym of. Empty if the value is not a synonym. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldValue - public static async System.Threading.Tasks.Task CreateAsync( - string pathAssistantSid, - string pathFieldTypeSid, - string language, - string value, - string synonymOf = null, - ITwilioRestClient client = null) - { - var options = new CreateFieldValueOptions(pathAssistantSid, pathFieldTypeSid, language, value){ SynonymOf = synonymOf }; - return await CreateAsync(options, client); - } - #endif - - /// delete - /// Delete FieldValue parameters - /// Client to make requests to Twilio - /// A single instance of FieldValue - private static Request BuildDeleteRequest(DeleteFieldValueOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/FieldTypes/{FieldTypeSid}/FieldValues/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathFieldTypeSid = options.PathFieldTypeSid; - path = path.Replace("{"+"FieldTypeSid"+"}", PathFieldTypeSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Delete, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// delete - /// Delete FieldValue parameters - /// Client to make requests to Twilio - /// A single instance of FieldValue - public static bool Delete(DeleteFieldValueOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - - #if !NET35 - /// delete - /// Delete FieldValue parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldValue - public static async System.Threading.Tasks.Task DeleteAsync(DeleteFieldValueOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - #endif - - /// delete - /// - /// - /// - /// Client to make requests to Twilio - /// A single instance of FieldValue - public static bool Delete(string pathAssistantSid, string pathFieldTypeSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteFieldValueOptions(pathAssistantSid, pathFieldTypeSid, pathSid) ; - return Delete(options, client); - } - - #if !NET35 - /// delete - /// - /// - /// - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldValue - public static async System.Threading.Tasks.Task DeleteAsync(string pathAssistantSid, string pathFieldTypeSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteFieldValueOptions(pathAssistantSid, pathFieldTypeSid, pathSid) ; - return await DeleteAsync(options, client); - } - #endif - - private static Request BuildFetchRequest(FetchFieldValueOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/FieldTypes/{FieldTypeSid}/FieldValues/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathFieldTypeSid = options.PathFieldTypeSid; - path = path.Replace("{"+"FieldTypeSid"+"}", PathFieldTypeSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// fetch - /// Fetch FieldValue parameters - /// Client to make requests to Twilio - /// A single instance of FieldValue - public static FieldValueResource Fetch(FetchFieldValueOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// fetch - /// Fetch FieldValue parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldValue - public static async System.Threading.Tasks.Task FetchAsync(FetchFieldValueOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// fetch - /// - /// - /// - /// Client to make requests to Twilio - /// A single instance of FieldValue - public static FieldValueResource Fetch( - string pathAssistantSid, - string pathFieldTypeSid, - string pathSid, - ITwilioRestClient client = null) - { - var options = new FetchFieldValueOptions(pathAssistantSid, pathFieldTypeSid, pathSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// fetch - /// - /// - /// - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldValue - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, string pathFieldTypeSid, string pathSid, ITwilioRestClient client = null) - { - var options = new FetchFieldValueOptions(pathAssistantSid, pathFieldTypeSid, pathSid){ }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildReadRequest(ReadFieldValueOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/FieldTypes/{FieldTypeSid}/FieldValues"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathFieldTypeSid = options.PathFieldTypeSid; - path = path.Replace("{"+"FieldTypeSid"+"}", PathFieldTypeSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - /// read - /// Read FieldValue parameters - /// Client to make requests to Twilio - /// A single instance of FieldValue - public static ResourceSet Read(ReadFieldValueOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildReadRequest(options, client)); - var page = Page.FromJson("field_values", response.Content); - return new ResourceSet(page, options, client); - } - - #if !NET35 - /// read - /// Read FieldValue parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldValue - public static async System.Threading.Tasks.Task> ReadAsync(ReadFieldValueOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildReadRequest(options, client)); - - var page = Page.FromJson("field_values", response.Content); - return new ResourceSet(page, options, client); - } - #endif - /// read - /// - /// - /// An ISO language-country string of the value. For example: *en-US* - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// A single instance of FieldValue - public static ResourceSet Read( - string pathAssistantSid, - string pathFieldTypeSid, - string language = null, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadFieldValueOptions(pathAssistantSid, pathFieldTypeSid){ Language = language, PageSize = pageSize, Limit = limit}; - return Read(options, client); - } - - #if !NET35 - /// read - /// - /// - /// An ISO language-country string of the value. For example: *en-US* - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldValue - public static async System.Threading.Tasks.Task> ReadAsync( - string pathAssistantSid, - string pathFieldTypeSid, - string language = null, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadFieldValueOptions(pathAssistantSid, pathFieldTypeSid){ Language = language, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); - } - #endif - - - /// Fetch the target page of records - /// API-generated URL for the requested results page - /// Client to make requests to Twilio - /// The target page of records - public static Page GetPage(string targetUrl, ITwilioRestClient client) - { - client = client ?? TwilioClient.GetRestClient(); - - var request = new Request( - HttpMethod.Get, - targetUrl - ); - - var response = client.Request(request); - return Page.FromJson("field_values", response.Content); - } - - /// Fetch the next page of records - /// current page of records - /// Client to make requests to Twilio - /// The next page of records - public static Page NextPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetNextPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("field_values", response.Content); - } - - /// Fetch the previous page of records - /// current page of records - /// Client to make requests to Twilio - /// The previous page of records - public static Page PreviousPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetPreviousPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("field_values", response.Content); - } - - - /// - /// Converts a JSON string into a FieldValueResource object - /// - /// Raw JSON string - /// FieldValueResource object represented by the provided JSON - public static FieldValueResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The unique ID of the Account that created this Field Value. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The date that this resource was created - [JsonProperty("date_created")] - public DateTime? DateCreated { get; private set; } - - /// The date that this resource was last updated - [JsonProperty("date_updated")] - public DateTime? DateUpdated { get; private set; } - - /// The unique ID of the Field Type associated with this Field Value. - [JsonProperty("field_type_sid")] - public string FieldTypeSid { get; private set; } - - /// An ISO language-country string of the value. - [JsonProperty("language")] - public string Language { get; private set; } - - /// The unique ID of the Assistant. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// A 34 character string that uniquely identifies this resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// The Field Value itself. - [JsonProperty("value")] - public string Value { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// A value that indicates this field value is a synonym of. Empty if the value is not a synonym. - [JsonProperty("synonym_of")] - public string SynonymOf { get; private set; } - - - - private FieldValueResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypeOptions.cs b/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypeOptions.cs deleted file mode 100644 index 516cc459d..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypeOptions.cs +++ /dev/null @@ -1,223 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Preview.Understand.Assistant -{ - - /// create - public class CreateFieldTypeOptions : IOptions - { - - - public string PathAssistantSid { get; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - public string UniqueName { get; } - - /// A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - public string FriendlyName { get; set; } - - - /// Construct a new CreateUnderstandFieldTypeOptions - /// - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - public CreateFieldTypeOptions(string pathAssistantSid, string uniqueName) - { - PathAssistantSid = pathAssistantSid; - UniqueName = uniqueName; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (UniqueName != null) - { - p.Add(new KeyValuePair("UniqueName", UniqueName)); - } - if (FriendlyName != null) - { - p.Add(new KeyValuePair("FriendlyName", FriendlyName)); - } - return p; - } - - - - } - /// delete - public class DeleteFieldTypeOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - public string PathSid { get; } - - - - /// Construct a new DeleteUnderstandFieldTypeOptions - /// - /// - public DeleteFieldTypeOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// fetch - public class FetchFieldTypeOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - public string PathSid { get; } - - - - /// Construct a new FetchUnderstandFieldTypeOptions - /// - /// - public FetchFieldTypeOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// read - public class ReadFieldTypeOptions : ReadOptions - { - - - public string PathAssistantSid { get; } - - - - /// Construct a new ListUnderstandFieldTypeOptions - /// - public ReadFieldTypeOptions(string pathAssistantSid) - { - PathAssistantSid = pathAssistantSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (PageSize != null) - { - p.Add(new KeyValuePair("PageSize", PageSize.ToString())); - } - return p; - } - - - - } - - /// update - public class UpdateFieldTypeOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - public string PathSid { get; } - - /// A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - public string FriendlyName { get; set; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - public string UniqueName { get; set; } - - - - /// Construct a new UpdateUnderstandFieldTypeOptions - /// - /// - public UpdateFieldTypeOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (FriendlyName != null) - { - p.Add(new KeyValuePair("FriendlyName", FriendlyName)); - } - if (UniqueName != null) - { - p.Add(new KeyValuePair("UniqueName", UniqueName)); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypeResource.cs b/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypeResource.cs deleted file mode 100644 index 443e6a06f..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypeResource.cs +++ /dev/null @@ -1,540 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; - - - -namespace Twilio.Rest.Preview.Understand.Assistant -{ - public class FieldTypeResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateFieldTypeOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/FieldTypes"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// create - /// Create FieldType parameters - /// Client to make requests to Twilio - /// A single instance of FieldType - public static FieldTypeResource Create(CreateFieldTypeOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// create - /// Create FieldType parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldType - public static async System.Threading.Tasks.Task CreateAsync(CreateFieldTypeOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// create - /// - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - /// Client to make requests to Twilio - /// A single instance of FieldType - public static FieldTypeResource Create( - string pathAssistantSid, - string uniqueName, - string friendlyName = null, - ITwilioRestClient client = null) - { - var options = new CreateFieldTypeOptions(pathAssistantSid, uniqueName){ FriendlyName = friendlyName }; - return Create(options, client); - } - - #if !NET35 - /// create - /// - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldType - public static async System.Threading.Tasks.Task CreateAsync( - string pathAssistantSid, - string uniqueName, - string friendlyName = null, - ITwilioRestClient client = null) - { - var options = new CreateFieldTypeOptions(pathAssistantSid, uniqueName){ FriendlyName = friendlyName }; - return await CreateAsync(options, client); - } - #endif - - /// delete - /// Delete FieldType parameters - /// Client to make requests to Twilio - /// A single instance of FieldType - private static Request BuildDeleteRequest(DeleteFieldTypeOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/FieldTypes/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Delete, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// delete - /// Delete FieldType parameters - /// Client to make requests to Twilio - /// A single instance of FieldType - public static bool Delete(DeleteFieldTypeOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - - #if !NET35 - /// delete - /// Delete FieldType parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldType - public static async System.Threading.Tasks.Task DeleteAsync(DeleteFieldTypeOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - #endif - - /// delete - /// - /// - /// Client to make requests to Twilio - /// A single instance of FieldType - public static bool Delete(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteFieldTypeOptions(pathAssistantSid, pathSid) ; - return Delete(options, client); - } - - #if !NET35 - /// delete - /// - /// - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldType - public static async System.Threading.Tasks.Task DeleteAsync(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteFieldTypeOptions(pathAssistantSid, pathSid) ; - return await DeleteAsync(options, client); - } - #endif - - private static Request BuildFetchRequest(FetchFieldTypeOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/FieldTypes/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// fetch - /// Fetch FieldType parameters - /// Client to make requests to Twilio - /// A single instance of FieldType - public static FieldTypeResource Fetch(FetchFieldTypeOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// fetch - /// Fetch FieldType parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldType - public static async System.Threading.Tasks.Task FetchAsync(FetchFieldTypeOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// fetch - /// - /// - /// Client to make requests to Twilio - /// A single instance of FieldType - public static FieldTypeResource Fetch( - string pathAssistantSid, - string pathSid, - ITwilioRestClient client = null) - { - var options = new FetchFieldTypeOptions(pathAssistantSid, pathSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// fetch - /// - /// - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldType - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new FetchFieldTypeOptions(pathAssistantSid, pathSid){ }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildReadRequest(ReadFieldTypeOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/FieldTypes"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - /// read - /// Read FieldType parameters - /// Client to make requests to Twilio - /// A single instance of FieldType - public static ResourceSet Read(ReadFieldTypeOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildReadRequest(options, client)); - var page = Page.FromJson("field_types", response.Content); - return new ResourceSet(page, options, client); - } - - #if !NET35 - /// read - /// Read FieldType parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldType - public static async System.Threading.Tasks.Task> ReadAsync(ReadFieldTypeOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildReadRequest(options, client)); - - var page = Page.FromJson("field_types", response.Content); - return new ResourceSet(page, options, client); - } - #endif - /// read - /// - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// A single instance of FieldType - public static ResourceSet Read( - string pathAssistantSid, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadFieldTypeOptions(pathAssistantSid){ PageSize = pageSize, Limit = limit}; - return Read(options, client); - } - - #if !NET35 - /// read - /// - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldType - public static async System.Threading.Tasks.Task> ReadAsync( - string pathAssistantSid, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadFieldTypeOptions(pathAssistantSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); - } - #endif - - - /// Fetch the target page of records - /// API-generated URL for the requested results page - /// Client to make requests to Twilio - /// The target page of records - public static Page GetPage(string targetUrl, ITwilioRestClient client) - { - client = client ?? TwilioClient.GetRestClient(); - - var request = new Request( - HttpMethod.Get, - targetUrl - ); - - var response = client.Request(request); - return Page.FromJson("field_types", response.Content); - } - - /// Fetch the next page of records - /// current page of records - /// Client to make requests to Twilio - /// The next page of records - public static Page NextPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetNextPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("field_types", response.Content); - } - - /// Fetch the previous page of records - /// current page of records - /// Client to make requests to Twilio - /// The previous page of records - public static Page PreviousPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetPreviousPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("field_types", response.Content); - } - - - private static Request BuildUpdateRequest(UpdateFieldTypeOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/FieldTypes/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// update - /// Update FieldType parameters - /// Client to make requests to Twilio - /// A single instance of FieldType - public static FieldTypeResource Update(UpdateFieldTypeOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - - /// update - /// Update FieldType parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldType - #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateFieldTypeOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// update - /// - /// - /// A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// Client to make requests to Twilio - /// A single instance of FieldType - public static FieldTypeResource Update( - string pathAssistantSid, - string pathSid, - string friendlyName = null, - string uniqueName = null, - ITwilioRestClient client = null) - { - var options = new UpdateFieldTypeOptions(pathAssistantSid, pathSid){ FriendlyName = friendlyName, UniqueName = uniqueName }; - return Update(options, client); - } - - #if !NET35 - /// update - /// - /// - /// A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of FieldType - public static async System.Threading.Tasks.Task UpdateAsync( - string pathAssistantSid, - string pathSid, - string friendlyName = null, - string uniqueName = null, - ITwilioRestClient client = null) - { - var options = new UpdateFieldTypeOptions(pathAssistantSid, pathSid){ FriendlyName = friendlyName, UniqueName = uniqueName }; - return await UpdateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a FieldTypeResource object - /// - /// Raw JSON string - /// FieldTypeResource object represented by the provided JSON - public static FieldTypeResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The unique ID of the Account that created this Field Type. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The date that this resource was created - [JsonProperty("date_created")] - public DateTime? DateCreated { get; private set; } - - /// The date that this resource was last updated - [JsonProperty("date_updated")] - public DateTime? DateUpdated { get; private set; } - - /// A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - [JsonProperty("friendly_name")] - public string FriendlyName { get; private set; } - - /// The links - [JsonProperty("links")] - public Dictionary Links { get; private set; } - - /// The unique ID of the Assistant. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// A 34 character string that uniquely identifies this resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - [JsonProperty("unique_name")] - public string UniqueName { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private FieldTypeResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildOptions.cs b/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildOptions.cs deleted file mode 100644 index 5d78bb573..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildOptions.cs +++ /dev/null @@ -1,214 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Preview.Understand.Assistant -{ - - /// create - public class CreateModelBuildOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - public Uri StatusCallback { get; set; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - public string UniqueName { get; set; } - - - /// Construct a new CreateUnderstandModelBuildOptions - /// - public CreateModelBuildOptions(string pathAssistantSid) - { - PathAssistantSid = pathAssistantSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (StatusCallback != null) - { - p.Add(new KeyValuePair("StatusCallback", Serializers.Url(StatusCallback))); - } - if (UniqueName != null) - { - p.Add(new KeyValuePair("UniqueName", UniqueName)); - } - return p; - } - - - - } - /// delete - public class DeleteModelBuildOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - public string PathSid { get; } - - - - /// Construct a new DeleteUnderstandModelBuildOptions - /// - /// - public DeleteModelBuildOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// fetch - public class FetchModelBuildOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - public string PathSid { get; } - - - - /// Construct a new FetchUnderstandModelBuildOptions - /// - /// - public FetchModelBuildOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// read - public class ReadModelBuildOptions : ReadOptions - { - - - public string PathAssistantSid { get; } - - - - /// Construct a new ListUnderstandModelBuildOptions - /// - public ReadModelBuildOptions(string pathAssistantSid) - { - PathAssistantSid = pathAssistantSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (PageSize != null) - { - p.Add(new KeyValuePair("PageSize", PageSize.ToString())); - } - return p; - } - - - - } - - /// update - public class UpdateModelBuildOptions : IOptions - { - - - public string PathAssistantSid { get; } - - - public string PathSid { get; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - public string UniqueName { get; set; } - - - - /// Construct a new UpdateUnderstandModelBuildOptions - /// - /// - public UpdateModelBuildOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (UniqueName != null) - { - p.Add(new KeyValuePair("UniqueName", UniqueName)); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildResource.cs b/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildResource.cs deleted file mode 100644 index 5e1207dc8..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildResource.cs +++ /dev/null @@ -1,556 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; -using Twilio.Types; - - -namespace Twilio.Rest.Preview.Understand.Assistant -{ - public class ModelBuildResource : Resource - { - - - - [JsonConverter(typeof(StringEnumConverter))] - public sealed class StatusEnum : StringEnum - { - private StatusEnum(string value) : base(value) {} - public StatusEnum() {} - public static implicit operator StatusEnum(string value) - { - return new StatusEnum(value); - } - public static readonly StatusEnum Enqueued = new StatusEnum("enqueued"); - public static readonly StatusEnum Building = new StatusEnum("building"); - public static readonly StatusEnum Completed = new StatusEnum("completed"); - public static readonly StatusEnum Failed = new StatusEnum("failed"); - public static readonly StatusEnum Canceled = new StatusEnum("canceled"); - - } - - - private static Request BuildCreateRequest(CreateModelBuildOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/ModelBuilds"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// create - /// Create ModelBuild parameters - /// Client to make requests to Twilio - /// A single instance of ModelBuild - public static ModelBuildResource Create(CreateModelBuildOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// create - /// Create ModelBuild parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of ModelBuild - public static async System.Threading.Tasks.Task CreateAsync(CreateModelBuildOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// create - /// - /// - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - /// Client to make requests to Twilio - /// A single instance of ModelBuild - public static ModelBuildResource Create( - string pathAssistantSid, - Uri statusCallback = null, - string uniqueName = null, - ITwilioRestClient client = null) - { - var options = new CreateModelBuildOptions(pathAssistantSid){ StatusCallback = statusCallback, UniqueName = uniqueName }; - return Create(options, client); - } - - #if !NET35 - /// create - /// - /// - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - /// Client to make requests to Twilio - /// Task that resolves to A single instance of ModelBuild - public static async System.Threading.Tasks.Task CreateAsync( - string pathAssistantSid, - Uri statusCallback = null, - string uniqueName = null, - ITwilioRestClient client = null) - { - var options = new CreateModelBuildOptions(pathAssistantSid){ StatusCallback = statusCallback, UniqueName = uniqueName }; - return await CreateAsync(options, client); - } - #endif - - /// delete - /// Delete ModelBuild parameters - /// Client to make requests to Twilio - /// A single instance of ModelBuild - private static Request BuildDeleteRequest(DeleteModelBuildOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/ModelBuilds/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Delete, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// delete - /// Delete ModelBuild parameters - /// Client to make requests to Twilio - /// A single instance of ModelBuild - public static bool Delete(DeleteModelBuildOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - - #if !NET35 - /// delete - /// Delete ModelBuild parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of ModelBuild - public static async System.Threading.Tasks.Task DeleteAsync(DeleteModelBuildOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - #endif - - /// delete - /// - /// - /// Client to make requests to Twilio - /// A single instance of ModelBuild - public static bool Delete(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteModelBuildOptions(pathAssistantSid, pathSid) ; - return Delete(options, client); - } - - #if !NET35 - /// delete - /// - /// - /// Client to make requests to Twilio - /// Task that resolves to A single instance of ModelBuild - public static async System.Threading.Tasks.Task DeleteAsync(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteModelBuildOptions(pathAssistantSid, pathSid) ; - return await DeleteAsync(options, client); - } - #endif - - private static Request BuildFetchRequest(FetchModelBuildOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/ModelBuilds/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// fetch - /// Fetch ModelBuild parameters - /// Client to make requests to Twilio - /// A single instance of ModelBuild - public static ModelBuildResource Fetch(FetchModelBuildOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// fetch - /// Fetch ModelBuild parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of ModelBuild - public static async System.Threading.Tasks.Task FetchAsync(FetchModelBuildOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// fetch - /// - /// - /// Client to make requests to Twilio - /// A single instance of ModelBuild - public static ModelBuildResource Fetch( - string pathAssistantSid, - string pathSid, - ITwilioRestClient client = null) - { - var options = new FetchModelBuildOptions(pathAssistantSid, pathSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// fetch - /// - /// - /// Client to make requests to Twilio - /// Task that resolves to A single instance of ModelBuild - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new FetchModelBuildOptions(pathAssistantSid, pathSid){ }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildReadRequest(ReadModelBuildOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/ModelBuilds"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - /// read - /// Read ModelBuild parameters - /// Client to make requests to Twilio - /// A single instance of ModelBuild - public static ResourceSet Read(ReadModelBuildOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildReadRequest(options, client)); - var page = Page.FromJson("model_builds", response.Content); - return new ResourceSet(page, options, client); - } - - #if !NET35 - /// read - /// Read ModelBuild parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of ModelBuild - public static async System.Threading.Tasks.Task> ReadAsync(ReadModelBuildOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildReadRequest(options, client)); - - var page = Page.FromJson("model_builds", response.Content); - return new ResourceSet(page, options, client); - } - #endif - /// read - /// - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// A single instance of ModelBuild - public static ResourceSet Read( - string pathAssistantSid, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadModelBuildOptions(pathAssistantSid){ PageSize = pageSize, Limit = limit}; - return Read(options, client); - } - - #if !NET35 - /// read - /// - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// Task that resolves to A single instance of ModelBuild - public static async System.Threading.Tasks.Task> ReadAsync( - string pathAssistantSid, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadModelBuildOptions(pathAssistantSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); - } - #endif - - - /// Fetch the target page of records - /// API-generated URL for the requested results page - /// Client to make requests to Twilio - /// The target page of records - public static Page GetPage(string targetUrl, ITwilioRestClient client) - { - client = client ?? TwilioClient.GetRestClient(); - - var request = new Request( - HttpMethod.Get, - targetUrl - ); - - var response = client.Request(request); - return Page.FromJson("model_builds", response.Content); - } - - /// Fetch the next page of records - /// current page of records - /// Client to make requests to Twilio - /// The next page of records - public static Page NextPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetNextPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("model_builds", response.Content); - } - - /// Fetch the previous page of records - /// current page of records - /// Client to make requests to Twilio - /// The previous page of records - public static Page PreviousPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetPreviousPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("model_builds", response.Content); - } - - - private static Request BuildUpdateRequest(UpdateModelBuildOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/ModelBuilds/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// update - /// Update ModelBuild parameters - /// Client to make requests to Twilio - /// A single instance of ModelBuild - public static ModelBuildResource Update(UpdateModelBuildOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - - /// update - /// Update ModelBuild parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of ModelBuild - #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateModelBuildOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// update - /// - /// - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - /// Client to make requests to Twilio - /// A single instance of ModelBuild - public static ModelBuildResource Update( - string pathAssistantSid, - string pathSid, - string uniqueName = null, - ITwilioRestClient client = null) - { - var options = new UpdateModelBuildOptions(pathAssistantSid, pathSid){ UniqueName = uniqueName }; - return Update(options, client); - } - - #if !NET35 - /// update - /// - /// - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - /// Client to make requests to Twilio - /// Task that resolves to A single instance of ModelBuild - public static async System.Threading.Tasks.Task UpdateAsync( - string pathAssistantSid, - string pathSid, - string uniqueName = null, - ITwilioRestClient client = null) - { - var options = new UpdateModelBuildOptions(pathAssistantSid, pathSid){ UniqueName = uniqueName }; - return await UpdateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a ModelBuildResource object - /// - /// Raw JSON string - /// ModelBuildResource object represented by the provided JSON - public static ModelBuildResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The unique ID of the Account that created this Model Build. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The date that this resource was created - [JsonProperty("date_created")] - public DateTime? DateCreated { get; private set; } - - /// The date that this resource was last updated - [JsonProperty("date_updated")] - public DateTime? DateUpdated { get; private set; } - - /// The unique ID of the parent Assistant. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// A 34 character string that uniquely identifies this resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - - [JsonProperty("status")] - public ModelBuildResource.StatusEnum Status { get; private set; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - [JsonProperty("unique_name")] - public string UniqueName { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// The time in seconds it took to build the model. - [JsonProperty("build_duration")] - public int? BuildDuration { get; private set; } - - /// The error_code - [JsonProperty("error_code")] - public int? ErrorCode { get; private set; } - - - - private ModelBuildResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/QueryOptions.cs b/src/Twilio/Rest/Preview/Understand/Assistant/QueryOptions.cs deleted file mode 100644 index 4e827e5dd..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/QueryOptions.cs +++ /dev/null @@ -1,267 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Preview.Understand.Assistant -{ - - /// create - public class CreateQueryOptions : IOptions - { - - /// The unique ID of the parent Assistant. - public string PathAssistantSid { get; } - - /// An ISO language-country string of the sample. - public string Language { get; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. It can be up to 2048 characters long. - public string Query { get; } - - /// Constraints the query to a set of tasks. Useful when you need to constrain the paths the user can take. Tasks should be comma separated *task-unique-name-1*, *task-unique-name-2* - public string Tasks { get; set; } - - /// The Model Build Sid or unique name of the Model Build to be queried. - public string ModelBuild { get; set; } - - /// Constraints the query to a given Field with an task. Useful when you know the Field you are expecting. It accepts one field in the format *task-unique-name-1*:*field-unique-name* - public string Field { get; set; } - - - /// Construct a new CreateUnderstandQueryOptions - /// The unique ID of the parent Assistant. - /// An ISO language-country string of the sample. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. It can be up to 2048 characters long. - public CreateQueryOptions(string pathAssistantSid, string language, string query) - { - PathAssistantSid = pathAssistantSid; - Language = language; - Query = query; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (Language != null) - { - p.Add(new KeyValuePair("Language", Language)); - } - if (Query != null) - { - p.Add(new KeyValuePair("Query", Query)); - } - if (Tasks != null) - { - p.Add(new KeyValuePair("Tasks", Tasks)); - } - if (ModelBuild != null) - { - p.Add(new KeyValuePair("ModelBuild", ModelBuild)); - } - if (Field != null) - { - p.Add(new KeyValuePair("Field", Field)); - } - return p; - } - - - - } - /// delete - public class DeleteQueryOptions : IOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - - - /// Construct a new DeleteUnderstandQueryOptions - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - public DeleteQueryOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// fetch - public class FetchQueryOptions : IOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - - - /// Construct a new FetchUnderstandQueryOptions - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - public FetchQueryOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// read - public class ReadQueryOptions : ReadOptions - { - - /// The unique ID of the parent Assistant. - public string PathAssistantSid { get; } - - /// An ISO language-country string of the sample. - public string Language { get; set; } - - /// The Model Build Sid or unique name of the Model Build to be queried. - public string ModelBuild { get; set; } - - /// A string that described the query status. The values can be: pending_review, reviewed, discarded - public string Status { get; set; } - - - - /// Construct a new ListUnderstandQueryOptions - /// The unique ID of the parent Assistant. - public ReadQueryOptions(string pathAssistantSid) - { - PathAssistantSid = pathAssistantSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (Language != null) - { - p.Add(new KeyValuePair("Language", Language)); - } - if (ModelBuild != null) - { - p.Add(new KeyValuePair("ModelBuild", ModelBuild)); - } - if (Status != null) - { - p.Add(new KeyValuePair("Status", Status)); - } - if (PageSize != null) - { - p.Add(new KeyValuePair("PageSize", PageSize.ToString())); - } - return p; - } - - - - } - - /// update - public class UpdateQueryOptions : IOptions - { - - /// The unique ID of the parent Assistant. - public string PathAssistantSid { get; } - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - /// An optional reference to the Sample created from this query. - public string SampleSid { get; set; } - - /// A string that described the query status. The values can be: pending_review, reviewed, discarded - public string Status { get; set; } - - - - /// Construct a new UpdateUnderstandQueryOptions - /// The unique ID of the parent Assistant. - /// A 34 character string that uniquely identifies this resource. - public UpdateQueryOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (SampleSid != null) - { - p.Add(new KeyValuePair("SampleSid", SampleSid)); - } - if (Status != null) - { - p.Add(new KeyValuePair("Status", Status)); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/QueryResource.cs b/src/Twilio/Rest/Preview/Understand/Assistant/QueryResource.cs deleted file mode 100644 index 5f4469f86..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/QueryResource.cs +++ /dev/null @@ -1,580 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; - - - -namespace Twilio.Rest.Preview.Understand.Assistant -{ - public class QueryResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateQueryOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Queries"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// create - /// Create Query parameters - /// Client to make requests to Twilio - /// A single instance of Query - public static QueryResource Create(CreateQueryOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// create - /// Create Query parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Query - public static async System.Threading.Tasks.Task CreateAsync(CreateQueryOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// create - /// The unique ID of the parent Assistant. - /// An ISO language-country string of the sample. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. It can be up to 2048 characters long. - /// Constraints the query to a set of tasks. Useful when you need to constrain the paths the user can take. Tasks should be comma separated *task-unique-name-1*, *task-unique-name-2* - /// The Model Build Sid or unique name of the Model Build to be queried. - /// Constraints the query to a given Field with an task. Useful when you know the Field you are expecting. It accepts one field in the format *task-unique-name-1*:*field-unique-name* - /// Client to make requests to Twilio - /// A single instance of Query - public static QueryResource Create( - string pathAssistantSid, - string language, - string query, - string tasks = null, - string modelBuild = null, - string field = null, - ITwilioRestClient client = null) - { - var options = new CreateQueryOptions(pathAssistantSid, language, query){ Tasks = tasks, ModelBuild = modelBuild, Field = field }; - return Create(options, client); - } - - #if !NET35 - /// create - /// The unique ID of the parent Assistant. - /// An ISO language-country string of the sample. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. It can be up to 2048 characters long. - /// Constraints the query to a set of tasks. Useful when you need to constrain the paths the user can take. Tasks should be comma separated *task-unique-name-1*, *task-unique-name-2* - /// The Model Build Sid or unique name of the Model Build to be queried. - /// Constraints the query to a given Field with an task. Useful when you know the Field you are expecting. It accepts one field in the format *task-unique-name-1*:*field-unique-name* - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Query - public static async System.Threading.Tasks.Task CreateAsync( - string pathAssistantSid, - string language, - string query, - string tasks = null, - string modelBuild = null, - string field = null, - ITwilioRestClient client = null) - { - var options = new CreateQueryOptions(pathAssistantSid, language, query){ Tasks = tasks, ModelBuild = modelBuild, Field = field }; - return await CreateAsync(options, client); - } - #endif - - /// delete - /// Delete Query parameters - /// Client to make requests to Twilio - /// A single instance of Query - private static Request BuildDeleteRequest(DeleteQueryOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Queries/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Delete, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// delete - /// Delete Query parameters - /// Client to make requests to Twilio - /// A single instance of Query - public static bool Delete(DeleteQueryOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - - #if !NET35 - /// delete - /// Delete Query parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Query - public static async System.Threading.Tasks.Task DeleteAsync(DeleteQueryOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - #endif - - /// delete - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// A single instance of Query - public static bool Delete(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteQueryOptions(pathAssistantSid, pathSid) ; - return Delete(options, client); - } - - #if !NET35 - /// delete - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Query - public static async System.Threading.Tasks.Task DeleteAsync(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteQueryOptions(pathAssistantSid, pathSid) ; - return await DeleteAsync(options, client); - } - #endif - - private static Request BuildFetchRequest(FetchQueryOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Queries/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// fetch - /// Fetch Query parameters - /// Client to make requests to Twilio - /// A single instance of Query - public static QueryResource Fetch(FetchQueryOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// fetch - /// Fetch Query parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Query - public static async System.Threading.Tasks.Task FetchAsync(FetchQueryOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// fetch - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// A single instance of Query - public static QueryResource Fetch( - string pathAssistantSid, - string pathSid, - ITwilioRestClient client = null) - { - var options = new FetchQueryOptions(pathAssistantSid, pathSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// fetch - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Query - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new FetchQueryOptions(pathAssistantSid, pathSid){ }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildReadRequest(ReadQueryOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Queries"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - /// read - /// Read Query parameters - /// Client to make requests to Twilio - /// A single instance of Query - public static ResourceSet Read(ReadQueryOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildReadRequest(options, client)); - var page = Page.FromJson("queries", response.Content); - return new ResourceSet(page, options, client); - } - - #if !NET35 - /// read - /// Read Query parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Query - public static async System.Threading.Tasks.Task> ReadAsync(ReadQueryOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildReadRequest(options, client)); - - var page = Page.FromJson("queries", response.Content); - return new ResourceSet(page, options, client); - } - #endif - /// read - /// The unique ID of the parent Assistant. - /// An ISO language-country string of the sample. - /// The Model Build Sid or unique name of the Model Build to be queried. - /// A string that described the query status. The values can be: pending_review, reviewed, discarded - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// A single instance of Query - public static ResourceSet Read( - string pathAssistantSid, - string language = null, - string modelBuild = null, - string status = null, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadQueryOptions(pathAssistantSid){ Language = language, ModelBuild = modelBuild, Status = status, PageSize = pageSize, Limit = limit}; - return Read(options, client); - } - - #if !NET35 - /// read - /// The unique ID of the parent Assistant. - /// An ISO language-country string of the sample. - /// The Model Build Sid or unique name of the Model Build to be queried. - /// A string that described the query status. The values can be: pending_review, reviewed, discarded - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Query - public static async System.Threading.Tasks.Task> ReadAsync( - string pathAssistantSid, - string language = null, - string modelBuild = null, - string status = null, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadQueryOptions(pathAssistantSid){ Language = language, ModelBuild = modelBuild, Status = status, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); - } - #endif - - - /// Fetch the target page of records - /// API-generated URL for the requested results page - /// Client to make requests to Twilio - /// The target page of records - public static Page GetPage(string targetUrl, ITwilioRestClient client) - { - client = client ?? TwilioClient.GetRestClient(); - - var request = new Request( - HttpMethod.Get, - targetUrl - ); - - var response = client.Request(request); - return Page.FromJson("queries", response.Content); - } - - /// Fetch the next page of records - /// current page of records - /// Client to make requests to Twilio - /// The next page of records - public static Page NextPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetNextPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("queries", response.Content); - } - - /// Fetch the previous page of records - /// current page of records - /// Client to make requests to Twilio - /// The previous page of records - public static Page PreviousPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetPreviousPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("queries", response.Content); - } - - - private static Request BuildUpdateRequest(UpdateQueryOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Queries/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// update - /// Update Query parameters - /// Client to make requests to Twilio - /// A single instance of Query - public static QueryResource Update(UpdateQueryOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - - /// update - /// Update Query parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Query - #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateQueryOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// update - /// The unique ID of the parent Assistant. - /// A 34 character string that uniquely identifies this resource. - /// An optional reference to the Sample created from this query. - /// A string that described the query status. The values can be: pending_review, reviewed, discarded - /// Client to make requests to Twilio - /// A single instance of Query - public static QueryResource Update( - string pathAssistantSid, - string pathSid, - string sampleSid = null, - string status = null, - ITwilioRestClient client = null) - { - var options = new UpdateQueryOptions(pathAssistantSid, pathSid){ SampleSid = sampleSid, Status = status }; - return Update(options, client); - } - - #if !NET35 - /// update - /// The unique ID of the parent Assistant. - /// A 34 character string that uniquely identifies this resource. - /// An optional reference to the Sample created from this query. - /// A string that described the query status. The values can be: pending_review, reviewed, discarded - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Query - public static async System.Threading.Tasks.Task UpdateAsync( - string pathAssistantSid, - string pathSid, - string sampleSid = null, - string status = null, - ITwilioRestClient client = null) - { - var options = new UpdateQueryOptions(pathAssistantSid, pathSid){ SampleSid = sampleSid, Status = status }; - return await UpdateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a QueryResource object - /// - /// Raw JSON string - /// QueryResource object represented by the provided JSON - public static QueryResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The unique ID of the Account that created this Query. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The date that this resource was created - [JsonProperty("date_created")] - public DateTime? DateCreated { get; private set; } - - /// The date that this resource was last updated - [JsonProperty("date_updated")] - public DateTime? DateUpdated { get; private set; } - - /// The natural language analysis results which include the Task recognized, the confidence score and a list of identified Fields. - [JsonProperty("results")] - public object Results { get; private set; } - - /// An ISO language-country string of the sample. - [JsonProperty("language")] - public string Language { get; private set; } - - /// The unique ID of the Model Build queried. - [JsonProperty("model_build_sid")] - public string ModelBuildSid { get; private set; } - - /// The end-user's natural language input. - [JsonProperty("query")] - public string Query { get; private set; } - - /// An optional reference to the Sample created from this query. - [JsonProperty("sample_sid")] - public string SampleSid { get; private set; } - - /// The unique ID of the parent Assistant. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// A 34 character string that uniquely identifies this resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// A string that described the query status. The values can be: pending_review, reviewed, discarded - [JsonProperty("status")] - public string Status { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// The communication channel where this end-user input came from - [JsonProperty("source_channel")] - public string SourceChannel { get; private set; } - - - - private QueryResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetOptions.cs b/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetOptions.cs deleted file mode 100644 index a967090a1..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetOptions.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Preview.Understand.Assistant -{ - /// Returns Style sheet JSON object for this Assistant - public class FetchStyleSheetOptions : IOptions - { - - /// The unique ID of the Assistant - public string PathAssistantSid { get; } - - - - /// Construct a new FetchUnderstandStyleSheetOptions - /// The unique ID of the Assistant - public FetchStyleSheetOptions(string pathAssistantSid) - { - PathAssistantSid = pathAssistantSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// Updates the style sheet for an assistant identified by {AssistantSid} or {AssistantUniqueName}. - public class UpdateStyleSheetOptions : IOptions - { - - /// The unique ID of the Assistant - public string PathAssistantSid { get; } - - /// The JSON Style sheet string - public object StyleSheet { get; set; } - - - - /// Construct a new UpdateUnderstandStyleSheetOptions - /// The unique ID of the Assistant - public UpdateStyleSheetOptions(string pathAssistantSid) - { - PathAssistantSid = pathAssistantSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (StyleSheet != null) - { - p.Add(new KeyValuePair("StyleSheet", Serializers.JsonObject(StyleSheet))); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetResource.cs b/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetResource.cs deleted file mode 100644 index d206950e1..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetResource.cs +++ /dev/null @@ -1,231 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; - - - -namespace Twilio.Rest.Preview.Understand.Assistant -{ - public class StyleSheetResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchStyleSheetOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/StyleSheet"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// Returns Style sheet JSON object for this Assistant - /// Fetch StyleSheet parameters - /// Client to make requests to Twilio - /// A single instance of StyleSheet - public static StyleSheetResource Fetch(FetchStyleSheetOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// Returns Style sheet JSON object for this Assistant - /// Fetch StyleSheet parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of StyleSheet - public static async System.Threading.Tasks.Task FetchAsync(FetchStyleSheetOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// Returns Style sheet JSON object for this Assistant - /// The unique ID of the Assistant - /// Client to make requests to Twilio - /// A single instance of StyleSheet - public static StyleSheetResource Fetch( - string pathAssistantSid, - ITwilioRestClient client = null) - { - var options = new FetchStyleSheetOptions(pathAssistantSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// Returns Style sheet JSON object for this Assistant - /// The unique ID of the Assistant - /// Client to make requests to Twilio - /// Task that resolves to A single instance of StyleSheet - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, ITwilioRestClient client = null) - { - var options = new FetchStyleSheetOptions(pathAssistantSid){ }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildUpdateRequest(UpdateStyleSheetOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/StyleSheet"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// Updates the style sheet for an assistant identified by {AssistantSid} or {AssistantUniqueName}. - /// Update StyleSheet parameters - /// Client to make requests to Twilio - /// A single instance of StyleSheet - public static StyleSheetResource Update(UpdateStyleSheetOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - - /// Updates the style sheet for an assistant identified by {AssistantSid} or {AssistantUniqueName}. - /// Update StyleSheet parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of StyleSheet - #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateStyleSheetOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// Updates the style sheet for an assistant identified by {AssistantSid} or {AssistantUniqueName}. - /// The unique ID of the Assistant - /// The JSON Style sheet string - /// Client to make requests to Twilio - /// A single instance of StyleSheet - public static StyleSheetResource Update( - string pathAssistantSid, - object styleSheet = null, - ITwilioRestClient client = null) - { - var options = new UpdateStyleSheetOptions(pathAssistantSid){ StyleSheet = styleSheet }; - return Update(options, client); - } - - #if !NET35 - /// Updates the style sheet for an assistant identified by {AssistantSid} or {AssistantUniqueName}. - /// The unique ID of the Assistant - /// The JSON Style sheet string - /// Client to make requests to Twilio - /// Task that resolves to A single instance of StyleSheet - public static async System.Threading.Tasks.Task UpdateAsync( - string pathAssistantSid, - object styleSheet = null, - ITwilioRestClient client = null) - { - var options = new UpdateStyleSheetOptions(pathAssistantSid){ StyleSheet = styleSheet }; - return await UpdateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a StyleSheetResource object - /// - /// Raw JSON string - /// StyleSheetResource object represented by the provided JSON - public static StyleSheetResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The unique ID of the Account that created this Assistant - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The unique ID of the Assistant - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// The JSON style sheet object - [JsonProperty("data")] - public object Data { get; private set; } - - - - private StyleSheetResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/Task/FieldOptions.cs b/src/Twilio/Rest/Preview/Understand/Assistant/Task/FieldOptions.cs deleted file mode 100644 index 1b74d1187..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/Task/FieldOptions.cs +++ /dev/null @@ -1,196 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Preview.Understand.Assistant.Task -{ - - /// create - public class CreateFieldOptions : IOptions - { - - /// The unique ID of the parent Assistant. - public string PathAssistantSid { get; } - - /// The unique ID of the Task associated with this Field. - public string PathTaskSid { get; } - - /// The unique name or sid of the FieldType. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or the Field Type sid of a custom Field Type. - public string FieldType { get; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - public string UniqueName { get; } - - - /// Construct a new CreateUnderstandFieldOptions - /// The unique ID of the parent Assistant. - /// The unique ID of the Task associated with this Field. - /// The unique name or sid of the FieldType. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or the Field Type sid of a custom Field Type. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - public CreateFieldOptions(string pathAssistantSid, string pathTaskSid, string fieldType, string uniqueName) - { - PathAssistantSid = pathAssistantSid; - PathTaskSid = pathTaskSid; - FieldType = fieldType; - UniqueName = uniqueName; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (FieldType != null) - { - p.Add(new KeyValuePair("FieldType", FieldType)); - } - if (UniqueName != null) - { - p.Add(new KeyValuePair("UniqueName", UniqueName)); - } - return p; - } - - - - } - /// delete - public class DeleteFieldOptions : IOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - /// The unique ID of the Task associated with this Field. - public string PathTaskSid { get; } - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - - - /// Construct a new DeleteUnderstandFieldOptions - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Field. - /// A 34 character string that uniquely identifies this resource. - public DeleteFieldOptions(string pathAssistantSid, string pathTaskSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathTaskSid = pathTaskSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// fetch - public class FetchFieldOptions : IOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - /// The unique ID of the Task associated with this Field. - public string PathTaskSid { get; } - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - - - /// Construct a new FetchUnderstandFieldOptions - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Field. - /// A 34 character string that uniquely identifies this resource. - public FetchFieldOptions(string pathAssistantSid, string pathTaskSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathTaskSid = pathTaskSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// read - public class ReadFieldOptions : ReadOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - /// The unique ID of the Task associated with this Field. - public string PathTaskSid { get; } - - - - /// Construct a new ListUnderstandFieldOptions - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Field. - public ReadFieldOptions(string pathAssistantSid, string pathTaskSid) - { - PathAssistantSid = pathAssistantSid; - PathTaskSid = pathTaskSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (PageSize != null) - { - p.Add(new KeyValuePair("PageSize", PageSize.ToString())); - } - return p; - } - - - - } - -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/Task/FieldResource.cs b/src/Twilio/Rest/Preview/Understand/Assistant/Task/FieldResource.cs deleted file mode 100644 index 65a471ea9..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/Task/FieldResource.cs +++ /dev/null @@ -1,479 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; - - - -namespace Twilio.Rest.Preview.Understand.Assistant.Task -{ - public class FieldResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateFieldOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{TaskSid}/Fields"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathTaskSid = options.PathTaskSid; - path = path.Replace("{"+"TaskSid"+"}", PathTaskSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// create - /// Create Field parameters - /// Client to make requests to Twilio - /// A single instance of Field - public static FieldResource Create(CreateFieldOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// create - /// Create Field parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Field - public static async System.Threading.Tasks.Task CreateAsync(CreateFieldOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// create - /// The unique ID of the parent Assistant. - /// The unique ID of the Task associated with this Field. - /// The unique name or sid of the FieldType. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or the Field Type sid of a custom Field Type. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// Client to make requests to Twilio - /// A single instance of Field - public static FieldResource Create( - string pathAssistantSid, - string pathTaskSid, - string fieldType, - string uniqueName, - ITwilioRestClient client = null) - { - var options = new CreateFieldOptions(pathAssistantSid, pathTaskSid, fieldType, uniqueName){ }; - return Create(options, client); - } - - #if !NET35 - /// create - /// The unique ID of the parent Assistant. - /// The unique ID of the Task associated with this Field. - /// The unique name or sid of the FieldType. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or the Field Type sid of a custom Field Type. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Field - public static async System.Threading.Tasks.Task CreateAsync( - string pathAssistantSid, - string pathTaskSid, - string fieldType, - string uniqueName, - ITwilioRestClient client = null) - { - var options = new CreateFieldOptions(pathAssistantSid, pathTaskSid, fieldType, uniqueName){ }; - return await CreateAsync(options, client); - } - #endif - - /// delete - /// Delete Field parameters - /// Client to make requests to Twilio - /// A single instance of Field - private static Request BuildDeleteRequest(DeleteFieldOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{TaskSid}/Fields/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathTaskSid = options.PathTaskSid; - path = path.Replace("{"+"TaskSid"+"}", PathTaskSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Delete, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// delete - /// Delete Field parameters - /// Client to make requests to Twilio - /// A single instance of Field - public static bool Delete(DeleteFieldOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - - #if !NET35 - /// delete - /// Delete Field parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Field - public static async System.Threading.Tasks.Task DeleteAsync(DeleteFieldOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - #endif - - /// delete - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Field. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// A single instance of Field - public static bool Delete(string pathAssistantSid, string pathTaskSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteFieldOptions(pathAssistantSid, pathTaskSid, pathSid) ; - return Delete(options, client); - } - - #if !NET35 - /// delete - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Field. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Field - public static async System.Threading.Tasks.Task DeleteAsync(string pathAssistantSid, string pathTaskSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteFieldOptions(pathAssistantSid, pathTaskSid, pathSid) ; - return await DeleteAsync(options, client); - } - #endif - - private static Request BuildFetchRequest(FetchFieldOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{TaskSid}/Fields/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathTaskSid = options.PathTaskSid; - path = path.Replace("{"+"TaskSid"+"}", PathTaskSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// fetch - /// Fetch Field parameters - /// Client to make requests to Twilio - /// A single instance of Field - public static FieldResource Fetch(FetchFieldOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// fetch - /// Fetch Field parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Field - public static async System.Threading.Tasks.Task FetchAsync(FetchFieldOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// fetch - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Field. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// A single instance of Field - public static FieldResource Fetch( - string pathAssistantSid, - string pathTaskSid, - string pathSid, - ITwilioRestClient client = null) - { - var options = new FetchFieldOptions(pathAssistantSid, pathTaskSid, pathSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// fetch - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Field. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Field - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, string pathTaskSid, string pathSid, ITwilioRestClient client = null) - { - var options = new FetchFieldOptions(pathAssistantSid, pathTaskSid, pathSid){ }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildReadRequest(ReadFieldOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{TaskSid}/Fields"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathTaskSid = options.PathTaskSid; - path = path.Replace("{"+"TaskSid"+"}", PathTaskSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - /// read - /// Read Field parameters - /// Client to make requests to Twilio - /// A single instance of Field - public static ResourceSet Read(ReadFieldOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildReadRequest(options, client)); - var page = Page.FromJson("fields", response.Content); - return new ResourceSet(page, options, client); - } - - #if !NET35 - /// read - /// Read Field parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Field - public static async System.Threading.Tasks.Task> ReadAsync(ReadFieldOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildReadRequest(options, client)); - - var page = Page.FromJson("fields", response.Content); - return new ResourceSet(page, options, client); - } - #endif - /// read - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Field. - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// A single instance of Field - public static ResourceSet Read( - string pathAssistantSid, - string pathTaskSid, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadFieldOptions(pathAssistantSid, pathTaskSid){ PageSize = pageSize, Limit = limit}; - return Read(options, client); - } - - #if !NET35 - /// read - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Field. - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Field - public static async System.Threading.Tasks.Task> ReadAsync( - string pathAssistantSid, - string pathTaskSid, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadFieldOptions(pathAssistantSid, pathTaskSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); - } - #endif - - - /// Fetch the target page of records - /// API-generated URL for the requested results page - /// Client to make requests to Twilio - /// The target page of records - public static Page GetPage(string targetUrl, ITwilioRestClient client) - { - client = client ?? TwilioClient.GetRestClient(); - - var request = new Request( - HttpMethod.Get, - targetUrl - ); - - var response = client.Request(request); - return Page.FromJson("fields", response.Content); - } - - /// Fetch the next page of records - /// current page of records - /// Client to make requests to Twilio - /// The next page of records - public static Page NextPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetNextPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("fields", response.Content); - } - - /// Fetch the previous page of records - /// current page of records - /// Client to make requests to Twilio - /// The previous page of records - public static Page PreviousPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetPreviousPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("fields", response.Content); - } - - - /// - /// Converts a JSON string into a FieldResource object - /// - /// Raw JSON string - /// FieldResource object represented by the provided JSON - public static FieldResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The unique ID of the Account that created this Field. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The date that this resource was created - [JsonProperty("date_created")] - public DateTime? DateCreated { get; private set; } - - /// The date that this resource was last updated - [JsonProperty("date_updated")] - public DateTime? DateUpdated { get; private set; } - - /// The Field Type of this field. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or sid of a custom Field Type. - [JsonProperty("field_type")] - public string FieldType { get; private set; } - - /// The unique ID of the Task associated with this Field. - [JsonProperty("task_sid")] - public string TaskSid { get; private set; } - - /// The unique ID of the parent Assistant. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// A 34 character string that uniquely identifies this resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - [JsonProperty("unique_name")] - public string UniqueName { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private FieldResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/Task/SampleOptions.cs b/src/Twilio/Rest/Preview/Understand/Assistant/Task/SampleOptions.cs deleted file mode 100644 index 8a19c253a..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/Task/SampleOptions.cs +++ /dev/null @@ -1,271 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Preview.Understand.Assistant.Task -{ - - /// create - public class CreateSampleOptions : IOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - /// The unique ID of the Task associated with this Sample. - public string PathTaskSid { get; } - - /// An ISO language-country string of the sample. - public string Language { get; } - - /// The text example of how end-users may express this task. The sample may contain Field tag blocks. - public string TaggedText { get; } - - /// The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - public string SourceChannel { get; set; } - - - /// Construct a new CreateUnderstandSampleOptions - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - /// An ISO language-country string of the sample. - /// The text example of how end-users may express this task. The sample may contain Field tag blocks. - public CreateSampleOptions(string pathAssistantSid, string pathTaskSid, string language, string taggedText) - { - PathAssistantSid = pathAssistantSid; - PathTaskSid = pathTaskSid; - Language = language; - TaggedText = taggedText; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (Language != null) - { - p.Add(new KeyValuePair("Language", Language)); - } - if (TaggedText != null) - { - p.Add(new KeyValuePair("TaggedText", TaggedText)); - } - if (SourceChannel != null) - { - p.Add(new KeyValuePair("SourceChannel", SourceChannel)); - } - return p; - } - - - - } - /// delete - public class DeleteSampleOptions : IOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - /// The unique ID of the Task associated with this Sample. - public string PathTaskSid { get; } - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - - - /// Construct a new DeleteUnderstandSampleOptions - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - /// A 34 character string that uniquely identifies this resource. - public DeleteSampleOptions(string pathAssistantSid, string pathTaskSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathTaskSid = pathTaskSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// fetch - public class FetchSampleOptions : IOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - /// The unique ID of the Task associated with this Sample. - public string PathTaskSid { get; } - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - - - /// Construct a new FetchUnderstandSampleOptions - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - /// A 34 character string that uniquely identifies this resource. - public FetchSampleOptions(string pathAssistantSid, string pathTaskSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathTaskSid = pathTaskSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// read - public class ReadSampleOptions : ReadOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - /// The unique ID of the Task associated with this Sample. - public string PathTaskSid { get; } - - /// An ISO language-country string of the sample. - public string Language { get; set; } - - - - /// Construct a new ListUnderstandSampleOptions - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - public ReadSampleOptions(string pathAssistantSid, string pathTaskSid) - { - PathAssistantSid = pathAssistantSid; - PathTaskSid = pathTaskSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (Language != null) - { - p.Add(new KeyValuePair("Language", Language)); - } - if (PageSize != null) - { - p.Add(new KeyValuePair("PageSize", PageSize.ToString())); - } - return p; - } - - - - } - - /// update - public class UpdateSampleOptions : IOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - /// The unique ID of the Task associated with this Sample. - public string PathTaskSid { get; } - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - /// An ISO language-country string of the sample. - public string Language { get; set; } - - /// The text example of how end-users may express this task. The sample may contain Field tag blocks. - public string TaggedText { get; set; } - - /// The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - public string SourceChannel { get; set; } - - - - /// Construct a new UpdateUnderstandSampleOptions - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - /// A 34 character string that uniquely identifies this resource. - public UpdateSampleOptions(string pathAssistantSid, string pathTaskSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathTaskSid = pathTaskSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (Language != null) - { - p.Add(new KeyValuePair("Language", Language)); - } - if (TaggedText != null) - { - p.Add(new KeyValuePair("TaggedText", TaggedText)); - } - if (SourceChannel != null) - { - p.Add(new KeyValuePair("SourceChannel", SourceChannel)); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/Task/SampleResource.cs b/src/Twilio/Rest/Preview/Understand/Assistant/Task/SampleResource.cs deleted file mode 100644 index 7679597cc..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/Task/SampleResource.cs +++ /dev/null @@ -1,583 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; - - - -namespace Twilio.Rest.Preview.Understand.Assistant.Task -{ - public class SampleResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateSampleOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{TaskSid}/Samples"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathTaskSid = options.PathTaskSid; - path = path.Replace("{"+"TaskSid"+"}", PathTaskSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// create - /// Create Sample parameters - /// Client to make requests to Twilio - /// A single instance of Sample - public static SampleResource Create(CreateSampleOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// create - /// Create Sample parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Sample - public static async System.Threading.Tasks.Task CreateAsync(CreateSampleOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// create - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - /// An ISO language-country string of the sample. - /// The text example of how end-users may express this task. The sample may contain Field tag blocks. - /// The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - /// Client to make requests to Twilio - /// A single instance of Sample - public static SampleResource Create( - string pathAssistantSid, - string pathTaskSid, - string language, - string taggedText, - string sourceChannel = null, - ITwilioRestClient client = null) - { - var options = new CreateSampleOptions(pathAssistantSid, pathTaskSid, language, taggedText){ SourceChannel = sourceChannel }; - return Create(options, client); - } - - #if !NET35 - /// create - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - /// An ISO language-country string of the sample. - /// The text example of how end-users may express this task. The sample may contain Field tag blocks. - /// The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Sample - public static async System.Threading.Tasks.Task CreateAsync( - string pathAssistantSid, - string pathTaskSid, - string language, - string taggedText, - string sourceChannel = null, - ITwilioRestClient client = null) - { - var options = new CreateSampleOptions(pathAssistantSid, pathTaskSid, language, taggedText){ SourceChannel = sourceChannel }; - return await CreateAsync(options, client); - } - #endif - - /// delete - /// Delete Sample parameters - /// Client to make requests to Twilio - /// A single instance of Sample - private static Request BuildDeleteRequest(DeleteSampleOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{TaskSid}/Samples/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathTaskSid = options.PathTaskSid; - path = path.Replace("{"+"TaskSid"+"}", PathTaskSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Delete, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// delete - /// Delete Sample parameters - /// Client to make requests to Twilio - /// A single instance of Sample - public static bool Delete(DeleteSampleOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - - #if !NET35 - /// delete - /// Delete Sample parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Sample - public static async System.Threading.Tasks.Task DeleteAsync(DeleteSampleOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - #endif - - /// delete - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// A single instance of Sample - public static bool Delete(string pathAssistantSid, string pathTaskSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteSampleOptions(pathAssistantSid, pathTaskSid, pathSid) ; - return Delete(options, client); - } - - #if !NET35 - /// delete - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Sample - public static async System.Threading.Tasks.Task DeleteAsync(string pathAssistantSid, string pathTaskSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteSampleOptions(pathAssistantSid, pathTaskSid, pathSid) ; - return await DeleteAsync(options, client); - } - #endif - - private static Request BuildFetchRequest(FetchSampleOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{TaskSid}/Samples/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathTaskSid = options.PathTaskSid; - path = path.Replace("{"+"TaskSid"+"}", PathTaskSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// fetch - /// Fetch Sample parameters - /// Client to make requests to Twilio - /// A single instance of Sample - public static SampleResource Fetch(FetchSampleOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// fetch - /// Fetch Sample parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Sample - public static async System.Threading.Tasks.Task FetchAsync(FetchSampleOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// fetch - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// A single instance of Sample - public static SampleResource Fetch( - string pathAssistantSid, - string pathTaskSid, - string pathSid, - ITwilioRestClient client = null) - { - var options = new FetchSampleOptions(pathAssistantSid, pathTaskSid, pathSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// fetch - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Sample - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, string pathTaskSid, string pathSid, ITwilioRestClient client = null) - { - var options = new FetchSampleOptions(pathAssistantSid, pathTaskSid, pathSid){ }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildReadRequest(ReadSampleOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{TaskSid}/Samples"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathTaskSid = options.PathTaskSid; - path = path.Replace("{"+"TaskSid"+"}", PathTaskSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - /// read - /// Read Sample parameters - /// Client to make requests to Twilio - /// A single instance of Sample - public static ResourceSet Read(ReadSampleOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildReadRequest(options, client)); - var page = Page.FromJson("samples", response.Content); - return new ResourceSet(page, options, client); - } - - #if !NET35 - /// read - /// Read Sample parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Sample - public static async System.Threading.Tasks.Task> ReadAsync(ReadSampleOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildReadRequest(options, client)); - - var page = Page.FromJson("samples", response.Content); - return new ResourceSet(page, options, client); - } - #endif - /// read - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - /// An ISO language-country string of the sample. - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// A single instance of Sample - public static ResourceSet Read( - string pathAssistantSid, - string pathTaskSid, - string language = null, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadSampleOptions(pathAssistantSid, pathTaskSid){ Language = language, PageSize = pageSize, Limit = limit}; - return Read(options, client); - } - - #if !NET35 - /// read - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - /// An ISO language-country string of the sample. - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Sample - public static async System.Threading.Tasks.Task> ReadAsync( - string pathAssistantSid, - string pathTaskSid, - string language = null, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadSampleOptions(pathAssistantSid, pathTaskSid){ Language = language, PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); - } - #endif - - - /// Fetch the target page of records - /// API-generated URL for the requested results page - /// Client to make requests to Twilio - /// The target page of records - public static Page GetPage(string targetUrl, ITwilioRestClient client) - { - client = client ?? TwilioClient.GetRestClient(); - - var request = new Request( - HttpMethod.Get, - targetUrl - ); - - var response = client.Request(request); - return Page.FromJson("samples", response.Content); - } - - /// Fetch the next page of records - /// current page of records - /// Client to make requests to Twilio - /// The next page of records - public static Page NextPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetNextPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("samples", response.Content); - } - - /// Fetch the previous page of records - /// current page of records - /// Client to make requests to Twilio - /// The previous page of records - public static Page PreviousPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetPreviousPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("samples", response.Content); - } - - - private static Request BuildUpdateRequest(UpdateSampleOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{TaskSid}/Samples/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathTaskSid = options.PathTaskSid; - path = path.Replace("{"+"TaskSid"+"}", PathTaskSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// update - /// Update Sample parameters - /// Client to make requests to Twilio - /// A single instance of Sample - public static SampleResource Update(UpdateSampleOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - - /// update - /// Update Sample parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Sample - #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateSampleOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// update - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - /// A 34 character string that uniquely identifies this resource. - /// An ISO language-country string of the sample. - /// The text example of how end-users may express this task. The sample may contain Field tag blocks. - /// The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - /// Client to make requests to Twilio - /// A single instance of Sample - public static SampleResource Update( - string pathAssistantSid, - string pathTaskSid, - string pathSid, - string language = null, - string taggedText = null, - string sourceChannel = null, - ITwilioRestClient client = null) - { - var options = new UpdateSampleOptions(pathAssistantSid, pathTaskSid, pathSid){ Language = language, TaggedText = taggedText, SourceChannel = sourceChannel }; - return Update(options, client); - } - - #if !NET35 - /// update - /// The unique ID of the Assistant. - /// The unique ID of the Task associated with this Sample. - /// A 34 character string that uniquely identifies this resource. - /// An ISO language-country string of the sample. - /// The text example of how end-users may express this task. The sample may contain Field tag blocks. - /// The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Sample - public static async System.Threading.Tasks.Task UpdateAsync( - string pathAssistantSid, - string pathTaskSid, - string pathSid, - string language = null, - string taggedText = null, - string sourceChannel = null, - ITwilioRestClient client = null) - { - var options = new UpdateSampleOptions(pathAssistantSid, pathTaskSid, pathSid){ Language = language, TaggedText = taggedText, SourceChannel = sourceChannel }; - return await UpdateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a SampleResource object - /// - /// Raw JSON string - /// SampleResource object represented by the provided JSON - public static SampleResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The unique ID of the Account that created this Sample. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The date that this resource was created - [JsonProperty("date_created")] - public DateTime? DateCreated { get; private set; } - - /// The date that this resource was last updated - [JsonProperty("date_updated")] - public DateTime? DateUpdated { get; private set; } - - /// The unique ID of the Task associated with this Sample. - [JsonProperty("task_sid")] - public string TaskSid { get; private set; } - - /// An ISO language-country string of the sample. - [JsonProperty("language")] - public string Language { get; private set; } - - /// The unique ID of the Assistant. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// A 34 character string that uniquely identifies this resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// The text example of how end-users may express this task. The sample may contain Field tag blocks. - [JsonProperty("tagged_text")] - public string TaggedText { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - [JsonProperty("source_channel")] - public string SourceChannel { get; private set; } - - - - private SampleResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsOptions.cs b/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsOptions.cs deleted file mode 100644 index 201535d68..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsOptions.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Preview.Understand.Assistant.Task -{ - /// Returns JSON actions for this Task. - public class FetchTaskActionsOptions : IOptions - { - - /// The unique ID of the parent Assistant. - public string PathAssistantSid { get; } - - /// The unique ID of the Task. - public string PathTaskSid { get; } - - - - /// Construct a new FetchUnderstandTaskActionsOptions - /// The unique ID of the parent Assistant. - /// The unique ID of the Task. - public FetchTaskActionsOptions(string pathAssistantSid, string pathTaskSid) - { - PathAssistantSid = pathAssistantSid; - PathTaskSid = pathTaskSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// Updates the actions of an Task identified by {TaskSid} or {TaskUniqueName}. - public class UpdateTaskActionsOptions : IOptions - { - - /// The unique ID of the parent Assistant. - public string PathAssistantSid { get; } - - /// The unique ID of the Task. - public string PathTaskSid { get; } - - /// The JSON actions that instruct the Assistant how to perform this task. - public object Actions { get; set; } - - - - /// Construct a new UpdateUnderstandTaskActionsOptions - /// The unique ID of the parent Assistant. - /// The unique ID of the Task. - public UpdateTaskActionsOptions(string pathAssistantSid, string pathTaskSid) - { - PathAssistantSid = pathAssistantSid; - PathTaskSid = pathTaskSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (Actions != null) - { - p.Add(new KeyValuePair("Actions", Serializers.JsonObject(Actions))); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsResource.cs b/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsResource.cs deleted file mode 100644 index 6d9cc6215..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsResource.cs +++ /dev/null @@ -1,246 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; - - - -namespace Twilio.Rest.Preview.Understand.Assistant.Task -{ - public class TaskActionsResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchTaskActionsOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{TaskSid}/Actions"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathTaskSid = options.PathTaskSid; - path = path.Replace("{"+"TaskSid"+"}", PathTaskSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// Returns JSON actions for this Task. - /// Fetch TaskActions parameters - /// Client to make requests to Twilio - /// A single instance of TaskActions - public static TaskActionsResource Fetch(FetchTaskActionsOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// Returns JSON actions for this Task. - /// Fetch TaskActions parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of TaskActions - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskActionsOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// Returns JSON actions for this Task. - /// The unique ID of the parent Assistant. - /// The unique ID of the Task. - /// Client to make requests to Twilio - /// A single instance of TaskActions - public static TaskActionsResource Fetch( - string pathAssistantSid, - string pathTaskSid, - ITwilioRestClient client = null) - { - var options = new FetchTaskActionsOptions(pathAssistantSid, pathTaskSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// Returns JSON actions for this Task. - /// The unique ID of the parent Assistant. - /// The unique ID of the Task. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of TaskActions - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, string pathTaskSid, ITwilioRestClient client = null) - { - var options = new FetchTaskActionsOptions(pathAssistantSid, pathTaskSid){ }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildUpdateRequest(UpdateTaskActionsOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{TaskSid}/Actions"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathTaskSid = options.PathTaskSid; - path = path.Replace("{"+"TaskSid"+"}", PathTaskSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// Updates the actions of an Task identified by {TaskSid} or {TaskUniqueName}. - /// Update TaskActions parameters - /// Client to make requests to Twilio - /// A single instance of TaskActions - public static TaskActionsResource Update(UpdateTaskActionsOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - - /// Updates the actions of an Task identified by {TaskSid} or {TaskUniqueName}. - /// Update TaskActions parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of TaskActions - #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateTaskActionsOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// Updates the actions of an Task identified by {TaskSid} or {TaskUniqueName}. - /// The unique ID of the parent Assistant. - /// The unique ID of the Task. - /// The JSON actions that instruct the Assistant how to perform this task. - /// Client to make requests to Twilio - /// A single instance of TaskActions - public static TaskActionsResource Update( - string pathAssistantSid, - string pathTaskSid, - object actions = null, - ITwilioRestClient client = null) - { - var options = new UpdateTaskActionsOptions(pathAssistantSid, pathTaskSid){ Actions = actions }; - return Update(options, client); - } - - #if !NET35 - /// Updates the actions of an Task identified by {TaskSid} or {TaskUniqueName}. - /// The unique ID of the parent Assistant. - /// The unique ID of the Task. - /// The JSON actions that instruct the Assistant how to perform this task. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of TaskActions - public static async System.Threading.Tasks.Task UpdateAsync( - string pathAssistantSid, - string pathTaskSid, - object actions = null, - ITwilioRestClient client = null) - { - var options = new UpdateTaskActionsOptions(pathAssistantSid, pathTaskSid){ Actions = actions }; - return await UpdateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a TaskActionsResource object - /// - /// Raw JSON string - /// TaskActionsResource object represented by the provided JSON - public static TaskActionsResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The unique ID of the Account that created this Field. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The unique ID of the parent Assistant. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The unique ID of the Task. - [JsonProperty("task_sid")] - public string TaskSid { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// The data - [JsonProperty("data")] - public object Data { get; private set; } - - - - private TaskActionsResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsOptions.cs b/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsOptions.cs deleted file mode 100644 index 0693a0b0b..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsOptions.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Preview.Understand.Assistant.Task -{ - /// fetch - public class FetchTaskStatisticsOptions : IOptions - { - - /// The unique ID of the parent Assistant. - public string PathAssistantSid { get; } - - /// The unique ID of the Task associated with this Field. - public string PathTaskSid { get; } - - - - /// Construct a new FetchUnderstandTaskStatisticsOptions - /// The unique ID of the parent Assistant. - /// The unique ID of the Task associated with this Field. - public FetchTaskStatisticsOptions(string pathAssistantSid, string pathTaskSid) - { - PathAssistantSid = pathAssistantSid; - PathTaskSid = pathTaskSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsResource.cs b/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsResource.cs deleted file mode 100644 index c4fc034ce..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsResource.cs +++ /dev/null @@ -1,172 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; - - - -namespace Twilio.Rest.Preview.Understand.Assistant.Task -{ - public class TaskStatisticsResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchTaskStatisticsOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{TaskSid}/Statistics"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathTaskSid = options.PathTaskSid; - path = path.Replace("{"+"TaskSid"+"}", PathTaskSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// fetch - /// Fetch TaskStatistics parameters - /// Client to make requests to Twilio - /// A single instance of TaskStatistics - public static TaskStatisticsResource Fetch(FetchTaskStatisticsOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// fetch - /// Fetch TaskStatistics parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of TaskStatistics - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskStatisticsOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// fetch - /// The unique ID of the parent Assistant. - /// The unique ID of the Task associated with this Field. - /// Client to make requests to Twilio - /// A single instance of TaskStatistics - public static TaskStatisticsResource Fetch( - string pathAssistantSid, - string pathTaskSid, - ITwilioRestClient client = null) - { - var options = new FetchTaskStatisticsOptions(pathAssistantSid, pathTaskSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// fetch - /// The unique ID of the parent Assistant. - /// The unique ID of the Task associated with this Field. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of TaskStatistics - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, string pathTaskSid, ITwilioRestClient client = null) - { - var options = new FetchTaskStatisticsOptions(pathAssistantSid, pathTaskSid){ }; - return await FetchAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a TaskStatisticsResource object - /// - /// Raw JSON string - /// TaskStatisticsResource object represented by the provided JSON - public static TaskStatisticsResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The unique ID of the Account that created this Field. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The unique ID of the parent Assistant. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The unique ID of the Task associated with this Field. - [JsonProperty("task_sid")] - public string TaskSid { get; private set; } - - /// The total number of Samples associated with this Task. - [JsonProperty("samples_count")] - public int? SamplesCount { get; private set; } - - /// The total number of Fields associated with this Task. - [JsonProperty("fields_count")] - public int? FieldsCount { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private TaskStatisticsResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/TaskOptions.cs b/src/Twilio/Rest/Preview/Understand/Assistant/TaskOptions.cs deleted file mode 100644 index 3f48e1f2a..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/TaskOptions.cs +++ /dev/null @@ -1,251 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Preview.Understand.Assistant -{ - - /// create - public class CreateTaskOptions : IOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - public string UniqueName { get; } - - /// A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - public string FriendlyName { get; set; } - - /// A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - public object Actions { get; set; } - - /// User-provided HTTP endpoint where from the assistant fetches actions - public Uri ActionsUrl { get; set; } - - - /// Construct a new CreateUnderstandTaskOptions - /// The unique ID of the Assistant. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - public CreateTaskOptions(string pathAssistantSid, string uniqueName) - { - PathAssistantSid = pathAssistantSid; - UniqueName = uniqueName; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (UniqueName != null) - { - p.Add(new KeyValuePair("UniqueName", UniqueName)); - } - if (FriendlyName != null) - { - p.Add(new KeyValuePair("FriendlyName", FriendlyName)); - } - if (Actions != null) - { - p.Add(new KeyValuePair("Actions", Serializers.JsonObject(Actions))); - } - if (ActionsUrl != null) - { - p.Add(new KeyValuePair("ActionsUrl", Serializers.Url(ActionsUrl))); - } - return p; - } - - - - } - /// delete - public class DeleteTaskOptions : IOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - - - /// Construct a new DeleteUnderstandTaskOptions - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - public DeleteTaskOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// fetch - public class FetchTaskOptions : IOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - - - /// Construct a new FetchUnderstandTaskOptions - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - public FetchTaskOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// read - public class ReadTaskOptions : ReadOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - - - /// Construct a new ListUnderstandTaskOptions - /// The unique ID of the Assistant. - public ReadTaskOptions(string pathAssistantSid) - { - PathAssistantSid = pathAssistantSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (PageSize != null) - { - p.Add(new KeyValuePair("PageSize", PageSize.ToString())); - } - return p; - } - - - - } - - /// update - public class UpdateTaskOptions : IOptions - { - - /// The unique ID of the Assistant. - public string PathAssistantSid { get; } - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - /// A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - public string FriendlyName { get; set; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - public string UniqueName { get; set; } - - /// A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - public object Actions { get; set; } - - /// User-provided HTTP endpoint where from the assistant fetches actions - public Uri ActionsUrl { get; set; } - - - - /// Construct a new UpdateUnderstandTaskOptions - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - public UpdateTaskOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (FriendlyName != null) - { - p.Add(new KeyValuePair("FriendlyName", FriendlyName)); - } - if (UniqueName != null) - { - p.Add(new KeyValuePair("UniqueName", UniqueName)); - } - if (Actions != null) - { - p.Add(new KeyValuePair("Actions", Serializers.JsonObject(Actions))); - } - if (ActionsUrl != null) - { - p.Add(new KeyValuePair("ActionsUrl", Serializers.Url(ActionsUrl))); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/TaskResource.cs b/src/Twilio/Rest/Preview/Understand/Assistant/TaskResource.cs deleted file mode 100644 index 6ee4d10c4..000000000 --- a/src/Twilio/Rest/Preview/Understand/Assistant/TaskResource.cs +++ /dev/null @@ -1,560 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; - - - -namespace Twilio.Rest.Preview.Understand.Assistant -{ - public class TaskResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateTaskOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// create - /// Create Task parameters - /// Client to make requests to Twilio - /// A single instance of Task - public static TaskResource Create(CreateTaskOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// create - /// Create Task parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task CreateAsync(CreateTaskOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// create - /// The unique ID of the Assistant. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - /// A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - /// User-provided HTTP endpoint where from the assistant fetches actions - /// Client to make requests to Twilio - /// A single instance of Task - public static TaskResource Create( - string pathAssistantSid, - string uniqueName, - string friendlyName = null, - object actions = null, - Uri actionsUrl = null, - ITwilioRestClient client = null) - { - var options = new CreateTaskOptions(pathAssistantSid, uniqueName){ FriendlyName = friendlyName, Actions = actions, ActionsUrl = actionsUrl }; - return Create(options, client); - } - - #if !NET35 - /// create - /// The unique ID of the Assistant. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - /// A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - /// User-provided HTTP endpoint where from the assistant fetches actions - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task CreateAsync( - string pathAssistantSid, - string uniqueName, - string friendlyName = null, - object actions = null, - Uri actionsUrl = null, - ITwilioRestClient client = null) - { - var options = new CreateTaskOptions(pathAssistantSid, uniqueName){ FriendlyName = friendlyName, Actions = actions, ActionsUrl = actionsUrl }; - return await CreateAsync(options, client); - } - #endif - - /// delete - /// Delete Task parameters - /// Client to make requests to Twilio - /// A single instance of Task - private static Request BuildDeleteRequest(DeleteTaskOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Delete, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// delete - /// Delete Task parameters - /// Client to make requests to Twilio - /// A single instance of Task - public static bool Delete(DeleteTaskOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - - #if !NET35 - /// delete - /// Delete Task parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task DeleteAsync(DeleteTaskOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - #endif - - /// delete - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// A single instance of Task - public static bool Delete(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteTaskOptions(pathAssistantSid, pathSid) ; - return Delete(options, client); - } - - #if !NET35 - /// delete - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task DeleteAsync(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteTaskOptions(pathAssistantSid, pathSid) ; - return await DeleteAsync(options, client); - } - #endif - - private static Request BuildFetchRequest(FetchTaskOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// fetch - /// Fetch Task parameters - /// Client to make requests to Twilio - /// A single instance of Task - public static TaskResource Fetch(FetchTaskOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// fetch - /// Fetch Task parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task FetchAsync(FetchTaskOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// fetch - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// A single instance of Task - public static TaskResource Fetch( - string pathAssistantSid, - string pathSid, - ITwilioRestClient client = null) - { - var options = new FetchTaskOptions(pathAssistantSid, pathSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// fetch - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new FetchTaskOptions(pathAssistantSid, pathSid){ }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildReadRequest(ReadTaskOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - /// read - /// Read Task parameters - /// Client to make requests to Twilio - /// A single instance of Task - public static ResourceSet Read(ReadTaskOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildReadRequest(options, client)); - var page = Page.FromJson("tasks", response.Content); - return new ResourceSet(page, options, client); - } - - #if !NET35 - /// read - /// Read Task parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task> ReadAsync(ReadTaskOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildReadRequest(options, client)); - - var page = Page.FromJson("tasks", response.Content); - return new ResourceSet(page, options, client); - } - #endif - /// read - /// The unique ID of the Assistant. - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// A single instance of Task - public static ResourceSet Read( - string pathAssistantSid, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadTaskOptions(pathAssistantSid){ PageSize = pageSize, Limit = limit}; - return Read(options, client); - } - - #if !NET35 - /// read - /// The unique ID of the Assistant. - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task> ReadAsync( - string pathAssistantSid, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadTaskOptions(pathAssistantSid){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); - } - #endif - - - /// Fetch the target page of records - /// API-generated URL for the requested results page - /// Client to make requests to Twilio - /// The target page of records - public static Page GetPage(string targetUrl, ITwilioRestClient client) - { - client = client ?? TwilioClient.GetRestClient(); - - var request = new Request( - HttpMethod.Get, - targetUrl - ); - - var response = client.Request(request); - return Page.FromJson("tasks", response.Content); - } - - /// Fetch the next page of records - /// current page of records - /// Client to make requests to Twilio - /// The next page of records - public static Page NextPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetNextPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("tasks", response.Content); - } - - /// Fetch the previous page of records - /// current page of records - /// Client to make requests to Twilio - /// The previous page of records - public static Page PreviousPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetPreviousPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("tasks", response.Content); - } - - - private static Request BuildUpdateRequest(UpdateTaskOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{AssistantSid}/Tasks/{Sid}"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// update - /// Update Task parameters - /// Client to make requests to Twilio - /// A single instance of Task - public static TaskResource Update(UpdateTaskOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - - /// update - /// Update Task parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Task - #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateTaskOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// update - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - /// A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - /// User-provided HTTP endpoint where from the assistant fetches actions - /// Client to make requests to Twilio - /// A single instance of Task - public static TaskResource Update( - string pathAssistantSid, - string pathSid, - string friendlyName = null, - string uniqueName = null, - object actions = null, - Uri actionsUrl = null, - ITwilioRestClient client = null) - { - var options = new UpdateTaskOptions(pathAssistantSid, pathSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Actions = actions, ActionsUrl = actionsUrl }; - return Update(options, client); - } - - #if !NET35 - /// update - /// The unique ID of the Assistant. - /// A 34 character string that uniquely identifies this resource. - /// A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - /// User-provided HTTP endpoint where from the assistant fetches actions - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Task - public static async System.Threading.Tasks.Task UpdateAsync( - string pathAssistantSid, - string pathSid, - string friendlyName = null, - string uniqueName = null, - object actions = null, - Uri actionsUrl = null, - ITwilioRestClient client = null) - { - var options = new UpdateTaskOptions(pathAssistantSid, pathSid){ FriendlyName = friendlyName, UniqueName = uniqueName, Actions = actions, ActionsUrl = actionsUrl }; - return await UpdateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a TaskResource object - /// - /// Raw JSON string - /// TaskResource object represented by the provided JSON - public static TaskResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The unique ID of the Account that created this Task. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The date that this resource was created - [JsonProperty("date_created")] - public DateTime? DateCreated { get; private set; } - - /// The date that this resource was last updated - [JsonProperty("date_updated")] - public DateTime? DateUpdated { get; private set; } - - /// A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - [JsonProperty("friendly_name")] - public string FriendlyName { get; private set; } - - /// The links - [JsonProperty("links")] - public Dictionary Links { get; private set; } - - /// The unique ID of the Assistant. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// A 34 character string that uniquely identifies this resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - [JsonProperty("unique_name")] - public string UniqueName { get; private set; } - - /// User-provided HTTP endpoint where from the assistant fetches actions - [JsonProperty("actions_url")] - public Uri ActionsUrl { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private TaskResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Preview/Understand/AssistantOptions.cs b/src/Twilio/Rest/Preview/Understand/AssistantOptions.cs deleted file mode 100644 index 408be3721..000000000 --- a/src/Twilio/Rest/Preview/Understand/AssistantOptions.cs +++ /dev/null @@ -1,272 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Preview.Understand -{ - - /// create - public class CreateAssistantOptions : IOptions - { - - /// A text description for the Assistant. It is non-unique and can up to 255 characters long. - public string FriendlyName { get; set; } - - /// A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - public bool? LogQueries { get; set; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - public string UniqueName { get; set; } - - /// A user-provided URL to send event callbacks to. - public Uri CallbackUrl { get; set; } - - /// Space-separated list of callback events that will trigger callbacks. - public string CallbackEvents { get; set; } - - /// The JSON actions to be executed when the user's input is not recognized as matching any Task. - public object FallbackActions { get; set; } - - /// The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - public object InitiationActions { get; set; } - - /// The JSON object that holds the style sheet for the assistant - public object StyleSheet { get; set; } - - - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (FriendlyName != null) - { - p.Add(new KeyValuePair("FriendlyName", FriendlyName)); - } - if (LogQueries != null) - { - p.Add(new KeyValuePair("LogQueries", LogQueries.Value.ToString().ToLower())); - } - if (UniqueName != null) - { - p.Add(new KeyValuePair("UniqueName", UniqueName)); - } - if (CallbackUrl != null) - { - p.Add(new KeyValuePair("CallbackUrl", Serializers.Url(CallbackUrl))); - } - if (CallbackEvents != null) - { - p.Add(new KeyValuePair("CallbackEvents", CallbackEvents)); - } - if (FallbackActions != null) - { - p.Add(new KeyValuePair("FallbackActions", Serializers.JsonObject(FallbackActions))); - } - if (InitiationActions != null) - { - p.Add(new KeyValuePair("InitiationActions", Serializers.JsonObject(InitiationActions))); - } - if (StyleSheet != null) - { - p.Add(new KeyValuePair("StyleSheet", Serializers.JsonObject(StyleSheet))); - } - return p; - } - - - - } - /// delete - public class DeleteAssistantOptions : IOptions - { - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - - - /// Construct a new DeleteUnderstandAssistantOptions - /// A 34 character string that uniquely identifies this resource. - public DeleteAssistantOptions(string pathSid) - { - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// fetch - public class FetchAssistantOptions : IOptions - { - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - - - /// Construct a new FetchUnderstandAssistantOptions - /// A 34 character string that uniquely identifies this resource. - public FetchAssistantOptions(string pathSid) - { - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// read - public class ReadAssistantOptions : ReadOptions - { - - - - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (PageSize != null) - { - p.Add(new KeyValuePair("PageSize", PageSize.ToString())); - } - return p; - } - - - - } - - /// update - public class UpdateAssistantOptions : IOptions - { - - /// A 34 character string that uniquely identifies this resource. - public string PathSid { get; } - - /// A text description for the Assistant. It is non-unique and can up to 255 characters long. - public string FriendlyName { get; set; } - - /// A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - public bool? LogQueries { get; set; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - public string UniqueName { get; set; } - - /// A user-provided URL to send event callbacks to. - public Uri CallbackUrl { get; set; } - - /// Space-separated list of callback events that will trigger callbacks. - public string CallbackEvents { get; set; } - - /// The JSON actions to be executed when the user's input is not recognized as matching any Task. - public object FallbackActions { get; set; } - - /// The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - public object InitiationActions { get; set; } - - /// The JSON object that holds the style sheet for the assistant - public object StyleSheet { get; set; } - - - - /// Construct a new UpdateUnderstandAssistantOptions - /// A 34 character string that uniquely identifies this resource. - public UpdateAssistantOptions(string pathSid) - { - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (FriendlyName != null) - { - p.Add(new KeyValuePair("FriendlyName", FriendlyName)); - } - if (LogQueries != null) - { - p.Add(new KeyValuePair("LogQueries", LogQueries.Value.ToString().ToLower())); - } - if (UniqueName != null) - { - p.Add(new KeyValuePair("UniqueName", UniqueName)); - } - if (CallbackUrl != null) - { - p.Add(new KeyValuePair("CallbackUrl", Serializers.Url(CallbackUrl))); - } - if (CallbackEvents != null) - { - p.Add(new KeyValuePair("CallbackEvents", CallbackEvents)); - } - if (FallbackActions != null) - { - p.Add(new KeyValuePair("FallbackActions", Serializers.JsonObject(FallbackActions))); - } - if (InitiationActions != null) - { - p.Add(new KeyValuePair("InitiationActions", Serializers.JsonObject(InitiationActions))); - } - if (StyleSheet != null) - { - p.Add(new KeyValuePair("StyleSheet", Serializers.JsonObject(StyleSheet))); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Preview/Understand/AssistantResource.cs b/src/Twilio/Rest/Preview/Understand/AssistantResource.cs deleted file mode 100644 index 7646ca327..000000000 --- a/src/Twilio/Rest/Preview/Understand/AssistantResource.cs +++ /dev/null @@ -1,573 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Preview - * 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.Constant; -using Twilio.Converters; -using Twilio.Exceptions; -using Twilio.Http; - - - -namespace Twilio.Rest.Preview.Understand -{ - public class AssistantResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateAssistantOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants"; - - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// create - /// Create Assistant parameters - /// Client to make requests to Twilio - /// A single instance of Assistant - public static AssistantResource Create(CreateAssistantOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// create - /// Create Assistant parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task CreateAsync(CreateAssistantOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// create - /// A text description for the Assistant. It is non-unique and can up to 255 characters long. - /// A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// A user-provided URL to send event callbacks to. - /// Space-separated list of callback events that will trigger callbacks. - /// The JSON actions to be executed when the user's input is not recognized as matching any Task. - /// The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - /// The JSON object that holds the style sheet for the assistant - /// Client to make requests to Twilio - /// A single instance of Assistant - public static AssistantResource Create( - string friendlyName = null, - bool? logQueries = null, - string uniqueName = null, - Uri callbackUrl = null, - string callbackEvents = null, - object fallbackActions = null, - object initiationActions = null, - object styleSheet = null, - ITwilioRestClient client = null) - { - var options = new CreateAssistantOptions(){ FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents, FallbackActions = fallbackActions, InitiationActions = initiationActions, StyleSheet = styleSheet }; - return Create(options, client); - } - - #if !NET35 - /// create - /// A text description for the Assistant. It is non-unique and can up to 255 characters long. - /// A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// A user-provided URL to send event callbacks to. - /// Space-separated list of callback events that will trigger callbacks. - /// The JSON actions to be executed when the user's input is not recognized as matching any Task. - /// The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - /// The JSON object that holds the style sheet for the assistant - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task CreateAsync( - string friendlyName = null, - bool? logQueries = null, - string uniqueName = null, - Uri callbackUrl = null, - string callbackEvents = null, - object fallbackActions = null, - object initiationActions = null, - object styleSheet = null, - ITwilioRestClient client = null) - { - var options = new CreateAssistantOptions(){ FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents, FallbackActions = fallbackActions, InitiationActions = initiationActions, StyleSheet = styleSheet }; - return await CreateAsync(options, client); - } - #endif - - /// delete - /// Delete Assistant parameters - /// Client to make requests to Twilio - /// A single instance of Assistant - private static Request BuildDeleteRequest(DeleteAssistantOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{Sid}"; - - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Delete, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// delete - /// Delete Assistant parameters - /// Client to make requests to Twilio - /// A single instance of Assistant - public static bool Delete(DeleteAssistantOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - - #if !NET35 - /// delete - /// Delete Assistant parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task DeleteAsync(DeleteAssistantOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildDeleteRequest(options, client)); - return response.StatusCode == System.Net.HttpStatusCode.NoContent; - } - #endif - - /// delete - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// A single instance of Assistant - public static bool Delete(string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteAssistantOptions(pathSid) ; - return Delete(options, client); - } - - #if !NET35 - /// delete - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteAssistantOptions(pathSid) ; - return await DeleteAsync(options, client); - } - #endif - - private static Request BuildFetchRequest(FetchAssistantOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{Sid}"; - - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// fetch - /// Fetch Assistant parameters - /// Client to make requests to Twilio - /// A single instance of Assistant - public static AssistantResource Fetch(FetchAssistantOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// fetch - /// Fetch Assistant parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task FetchAsync(FetchAssistantOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// fetch - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// A single instance of Assistant - public static AssistantResource Fetch( - string pathSid, - ITwilioRestClient client = null) - { - var options = new FetchAssistantOptions(pathSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// fetch - /// A 34 character string that uniquely identifies this resource. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task FetchAsync(string pathSid, ITwilioRestClient client = null) - { - var options = new FetchAssistantOptions(pathSid){ }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildReadRequest(ReadAssistantOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants"; - - - return new Request( - HttpMethod.Get, - Rest.Domain.Preview, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - /// read - /// Read Assistant parameters - /// Client to make requests to Twilio - /// A single instance of Assistant - public static ResourceSet Read(ReadAssistantOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildReadRequest(options, client)); - var page = Page.FromJson("assistants", response.Content); - return new ResourceSet(page, options, client); - } - - #if !NET35 - /// read - /// Read Assistant parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task> ReadAsync(ReadAssistantOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildReadRequest(options, client)); - - var page = Page.FromJson("assistants", response.Content); - return new ResourceSet(page, options, client); - } - #endif - /// read - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// A single instance of Assistant - public static ResourceSet Read( - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadAssistantOptions(){ PageSize = pageSize, Limit = limit}; - return Read(options, client); - } - - #if !NET35 - /// read - /// How many resources to return in each list page. The default is 50, and the maximum is 1000. - /// Record limit - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task> ReadAsync( - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadAssistantOptions(){ PageSize = pageSize, Limit = limit}; - return await ReadAsync(options, client); - } - #endif - - - /// Fetch the target page of records - /// API-generated URL for the requested results page - /// Client to make requests to Twilio - /// The target page of records - public static Page GetPage(string targetUrl, ITwilioRestClient client) - { - client = client ?? TwilioClient.GetRestClient(); - - var request = new Request( - HttpMethod.Get, - targetUrl - ); - - var response = client.Request(request); - return Page.FromJson("assistants", response.Content); - } - - /// Fetch the next page of records - /// current page of records - /// Client to make requests to Twilio - /// The next page of records - public static Page NextPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetNextPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("assistants", response.Content); - } - - /// Fetch the previous page of records - /// current page of records - /// Client to make requests to Twilio - /// The previous page of records - public static Page PreviousPage(Page page, ITwilioRestClient client) - { - var request = new Request( - HttpMethod.Get, - page.GetPreviousPageUrl(Rest.Domain.Api) - ); - - var response = client.Request(request); - return Page.FromJson("assistants", response.Content); - } - - - private static Request BuildUpdateRequest(UpdateAssistantOptions options, ITwilioRestClient client) - { - - string path = "/understand/Assistants/{Sid}"; - - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Preview, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// update - /// Update Assistant parameters - /// Client to make requests to Twilio - /// A single instance of Assistant - public static AssistantResource Update(UpdateAssistantOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - - /// update - /// Update Assistant parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Assistant - #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateAssistantOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// update - /// A 34 character string that uniquely identifies this resource. - /// A text description for the Assistant. It is non-unique and can up to 255 characters long. - /// A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// A user-provided URL to send event callbacks to. - /// Space-separated list of callback events that will trigger callbacks. - /// The JSON actions to be executed when the user's input is not recognized as matching any Task. - /// The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - /// The JSON object that holds the style sheet for the assistant - /// Client to make requests to Twilio - /// A single instance of Assistant - public static AssistantResource Update( - string pathSid, - string friendlyName = null, - bool? logQueries = null, - string uniqueName = null, - Uri callbackUrl = null, - string callbackEvents = null, - object fallbackActions = null, - object initiationActions = null, - object styleSheet = null, - ITwilioRestClient client = null) - { - var options = new UpdateAssistantOptions(pathSid){ FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents, FallbackActions = fallbackActions, InitiationActions = initiationActions, StyleSheet = styleSheet }; - return Update(options, client); - } - - #if !NET35 - /// update - /// A 34 character string that uniquely identifies this resource. - /// A text description for the Assistant. It is non-unique and can up to 255 characters long. - /// A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - /// A user-provided URL to send event callbacks to. - /// Space-separated list of callback events that will trigger callbacks. - /// The JSON actions to be executed when the user's input is not recognized as matching any Task. - /// The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - /// The JSON object that holds the style sheet for the assistant - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Assistant - public static async System.Threading.Tasks.Task UpdateAsync( - string pathSid, - string friendlyName = null, - bool? logQueries = null, - string uniqueName = null, - Uri callbackUrl = null, - string callbackEvents = null, - object fallbackActions = null, - object initiationActions = null, - object styleSheet = null, - ITwilioRestClient client = null) - { - var options = new UpdateAssistantOptions(pathSid){ FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents, FallbackActions = fallbackActions, InitiationActions = initiationActions, StyleSheet = styleSheet }; - return await UpdateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a AssistantResource object - /// - /// Raw JSON string - /// AssistantResource object represented by the provided JSON - public static AssistantResource FromJson(string json) - { - try - { - return JsonConvert.DeserializeObject(json); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - /// - /// Converts an object into a json string - /// - /// C# model - /// JSON string - public static string ToJson(object model) - { - try - { - return JsonConvert.SerializeObject(model); - } - catch (JsonException e) - { - throw new ApiException(e.Message, e); - } - } - - - /// The unique ID of the Account that created this Assistant. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The date that this resource was created - [JsonProperty("date_created")] - public DateTime? DateCreated { get; private set; } - - /// The date that this resource was last updated - [JsonProperty("date_updated")] - public DateTime? DateUpdated { get; private set; } - - /// A text description for the Assistant. It is non-unique and can up to 255 characters long. - [JsonProperty("friendly_name")] - public string FriendlyName { get; private set; } - - /// The unique ID (Sid) of the latest model build. Null if no model has been built. - [JsonProperty("latest_model_build_sid")] - public string LatestModelBuildSid { get; private set; } - - /// The links - [JsonProperty("links")] - public Dictionary Links { get; private set; } - - /// A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. - [JsonProperty("log_queries")] - public bool? LogQueries { get; private set; } - - /// A 34 character string that uniquely identifies this resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// A user-provided string that uniquely identifies this resource as an alternative to the sid. You can use the unique name in the URL path. Unique up to 64 characters long. - [JsonProperty("unique_name")] - public string UniqueName { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// A user-provided URL to send event callbacks to. - [JsonProperty("callback_url")] - public Uri CallbackUrl { get; private set; } - - /// Space-separated list of callback events that will trigger callbacks. - [JsonProperty("callback_events")] - public string CallbackEvents { get; private set; } - - - - private AssistantResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Supersim/V1/EsimProfileOptions.cs b/src/Twilio/Rest/Supersim/V1/EsimProfileOptions.cs index 4e31ae22d..ba2cd2cb7 100644 --- a/src/Twilio/Rest/Supersim/V1/EsimProfileOptions.cs +++ b/src/Twilio/Rest/Supersim/V1/EsimProfileOptions.cs @@ -107,7 +107,7 @@ public class ReadEsimProfileOptions : ReadOptions /// List the eSIM Profiles that have been associated with an EId. public string Eid { get; set; } - /// Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + /// Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. public string SimSid { get; set; } /// List the eSIM Profiles that are in a given status. diff --git a/src/Twilio/Rest/Supersim/V1/EsimProfileResource.cs b/src/Twilio/Rest/Supersim/V1/EsimProfileResource.cs index 5bd956423..7106e813e 100644 --- a/src/Twilio/Rest/Supersim/V1/EsimProfileResource.cs +++ b/src/Twilio/Rest/Supersim/V1/EsimProfileResource.cs @@ -237,7 +237,7 @@ public static async System.Threading.Tasks.Task #endif /// Retrieve a list of eSIM Profiles. /// List the eSIM Profiles that have been associated with an EId. - /// Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + /// Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. /// List the eSIM Profiles that are in a given status. /// How many resources to return in each list page. The default is 50, and the maximum is 1000. /// Record limit @@ -258,7 +258,7 @@ public static ResourceSet Read( #if !NET35 /// Retrieve a list of eSIM Profiles. /// List the eSIM Profiles that have been associated with an EId. - /// Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + /// Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. /// List the eSIM Profiles that are in a given status. /// How many resources to return in each list page. The default is 50, and the maximum is 1000. /// Record limit @@ -372,7 +372,7 @@ public static string ToJson(object model) [JsonProperty("iccid")] public string Iccid { get; private set; } - /// The SID of the [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource that this eSIM Profile controls. + /// The SID of the [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource that this eSIM Profile controls. [JsonProperty("sim_sid")] public string SimSid { get; private set; } diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationOptions.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationOptions.cs index 6e55ec273..56ab25bc6 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationOptions.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationOptions.cs @@ -290,6 +290,9 @@ public class UpdateReservationOptions : IOptions /// Whether to play a notification beep when the customer joins. public bool? BeepOnCustomerEntrance { get; set; } + /// The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. + public string JitterBufferSize { get; set; } + /// Construct a new UpdateTaskReservationOptions @@ -524,6 +527,10 @@ public List> GetParams() { p.Add(new KeyValuePair("BeepOnCustomerEntrance", BeepOnCustomerEntrance.Value.ToString().ToLower())); } + if (JitterBufferSize != null) + { + p.Add(new KeyValuePair("JitterBufferSize", JitterBufferSize)); + } return p; } diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationResource.cs index cd1610b26..e845a60bf 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationResource.cs @@ -415,6 +415,7 @@ public static async System.Threading.Tasks.Task UpdateAsync /// The Supervisor SID/URI when executing the Supervise instruction. /// Whether to end the conference when the customer leaves. /// Whether to play a notification beep when the customer joins. + /// The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. /// The If-Match HTTP request header /// Client to make requests to Twilio /// A single instance of Reservation @@ -475,10 +476,11 @@ public static ReservationResource Update( string supervisor = null, bool? endConferenceOnCustomerExit = null, bool? beepOnCustomerEntrance = null, + string jitterBufferSize = null, string ifMatch = null, ITwilioRestClient client = null) { - var options = new UpdateReservationOptions(pathWorkspaceSid, pathTaskSid, pathSid){ ReservationStatus = reservationStatus, WorkerActivitySid = workerActivitySid, Instruction = instruction, DequeuePostWorkActivitySid = dequeuePostWorkActivitySid, DequeueFrom = dequeueFrom, DequeueRecord = dequeueRecord, DequeueTimeout = dequeueTimeout, DequeueTo = dequeueTo, DequeueStatusCallbackUrl = dequeueStatusCallbackUrl, CallFrom = callFrom, CallRecord = callRecord, CallTimeout = callTimeout, CallTo = callTo, CallUrl = callUrl, CallStatusCallbackUrl = callStatusCallbackUrl, CallAccept = callAccept, RedirectCallSid = redirectCallSid, RedirectAccept = redirectAccept, RedirectUrl = redirectUrl, To = to, From = from, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, Region = region, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, DequeueStatusCallbackEvent = dequeueStatusCallbackEvent, PostWorkActivitySid = postWorkActivitySid, SupervisorMode = supervisorMode, Supervisor = supervisor, EndConferenceOnCustomerExit = endConferenceOnCustomerExit, BeepOnCustomerEntrance = beepOnCustomerEntrance, IfMatch = ifMatch }; + var options = new UpdateReservationOptions(pathWorkspaceSid, pathTaskSid, pathSid){ ReservationStatus = reservationStatus, WorkerActivitySid = workerActivitySid, Instruction = instruction, DequeuePostWorkActivitySid = dequeuePostWorkActivitySid, DequeueFrom = dequeueFrom, DequeueRecord = dequeueRecord, DequeueTimeout = dequeueTimeout, DequeueTo = dequeueTo, DequeueStatusCallbackUrl = dequeueStatusCallbackUrl, CallFrom = callFrom, CallRecord = callRecord, CallTimeout = callTimeout, CallTo = callTo, CallUrl = callUrl, CallStatusCallbackUrl = callStatusCallbackUrl, CallAccept = callAccept, RedirectCallSid = redirectCallSid, RedirectAccept = redirectAccept, RedirectUrl = redirectUrl, To = to, From = from, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, Region = region, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, DequeueStatusCallbackEvent = dequeueStatusCallbackEvent, PostWorkActivitySid = postWorkActivitySid, SupervisorMode = supervisorMode, Supervisor = supervisor, EndConferenceOnCustomerExit = endConferenceOnCustomerExit, BeepOnCustomerEntrance = beepOnCustomerEntrance, JitterBufferSize = jitterBufferSize, IfMatch = ifMatch }; return Update(options, client); } @@ -540,6 +542,7 @@ public static ReservationResource Update( /// The Supervisor SID/URI when executing the Supervise instruction. /// Whether to end the conference when the customer leaves. /// Whether to play a notification beep when the customer joins. + /// The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. /// The If-Match HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Reservation @@ -600,10 +603,11 @@ public static async System.Threading.Tasks.Task UpdateAsync string supervisor = null, bool? endConferenceOnCustomerExit = null, bool? beepOnCustomerEntrance = null, + string jitterBufferSize = null, string ifMatch = null, ITwilioRestClient client = null) { - var options = new UpdateReservationOptions(pathWorkspaceSid, pathTaskSid, pathSid){ ReservationStatus = reservationStatus, WorkerActivitySid = workerActivitySid, Instruction = instruction, DequeuePostWorkActivitySid = dequeuePostWorkActivitySid, DequeueFrom = dequeueFrom, DequeueRecord = dequeueRecord, DequeueTimeout = dequeueTimeout, DequeueTo = dequeueTo, DequeueStatusCallbackUrl = dequeueStatusCallbackUrl, CallFrom = callFrom, CallRecord = callRecord, CallTimeout = callTimeout, CallTo = callTo, CallUrl = callUrl, CallStatusCallbackUrl = callStatusCallbackUrl, CallAccept = callAccept, RedirectCallSid = redirectCallSid, RedirectAccept = redirectAccept, RedirectUrl = redirectUrl, To = to, From = from, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, Region = region, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, DequeueStatusCallbackEvent = dequeueStatusCallbackEvent, PostWorkActivitySid = postWorkActivitySid, SupervisorMode = supervisorMode, Supervisor = supervisor, EndConferenceOnCustomerExit = endConferenceOnCustomerExit, BeepOnCustomerEntrance = beepOnCustomerEntrance, IfMatch = ifMatch }; + var options = new UpdateReservationOptions(pathWorkspaceSid, pathTaskSid, pathSid){ ReservationStatus = reservationStatus, WorkerActivitySid = workerActivitySid, Instruction = instruction, DequeuePostWorkActivitySid = dequeuePostWorkActivitySid, DequeueFrom = dequeueFrom, DequeueRecord = dequeueRecord, DequeueTimeout = dequeueTimeout, DequeueTo = dequeueTo, DequeueStatusCallbackUrl = dequeueStatusCallbackUrl, CallFrom = callFrom, CallRecord = callRecord, CallTimeout = callTimeout, CallTo = callTo, CallUrl = callUrl, CallStatusCallbackUrl = callStatusCallbackUrl, CallAccept = callAccept, RedirectCallSid = redirectCallSid, RedirectAccept = redirectAccept, RedirectUrl = redirectUrl, To = to, From = from, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, Region = region, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, DequeueStatusCallbackEvent = dequeueStatusCallbackEvent, PostWorkActivitySid = postWorkActivitySid, SupervisorMode = supervisorMode, Supervisor = supervisor, EndConferenceOnCustomerExit = endConferenceOnCustomerExit, BeepOnCustomerEntrance = beepOnCustomerEntrance, JitterBufferSize = jitterBufferSize, IfMatch = ifMatch }; return await UpdateAsync(options, client); } #endif diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsOptions.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsOptions.cs index 8fd3065e8..b5503f94c 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsOptions.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsOptions.cs @@ -31,6 +31,9 @@ public class CreateTaskQueueBulkRealTimeStatisticsOptions : IOptions The unique SID identifier of the Workspace. public string PathWorkspaceSid { get; } + + public object Body { get; set; } + /// Construct a new CreateTaskQueueBulkRealTimeStatisticsOptions /// The unique SID identifier of the Workspace. @@ -40,14 +43,17 @@ public CreateTaskQueueBulkRealTimeStatisticsOptions(string pathWorkspaceSid) } - /// Generate the necessary parameters - public List> GetParams() + /// Generate the request body + public string GetBody() { - var p = new List>(); + string body = ""; - return p; + if (Body != null) + { + body = TaskQueueBulkRealTimeStatisticsResource.ToJson(Body); + } + return body; } - } diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsResource.cs index c5d9f6c1b..710b19235 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsResource.cs @@ -46,7 +46,9 @@ private static Request BuildCreateRequest(CreateTaskQueueBulkRealTimeStatisticsO HttpMethod.Post, Rest.Domain.Taskrouter, path, - postParams: options.GetParams(), + + contentType: EnumConstants.ContentTypeEnum.JSON, + body: options.GetBody(), headerParams: null ); } @@ -144,7 +146,7 @@ public static string ToJson(object model) [JsonProperty("workspace_sid")] public string WorkspaceSid { get; private set; } - /// The real time statistics for each requested TaskQueue SID. `task_queue_data` returns the following attributes: `task_queue_sid`: The SID of the TaskQueue from which these statistics were calculated. `total_available_workers`: The total number of Workers available for Tasks in the TaskQueue. `total_eligible_workers`: The total number of Workers eligible for Tasks in the TaskQueue, regardless of their Activity state. `total_tasks`: The total number of Tasks. `longest_task_waiting_age`: The age of the longest waiting Task. `longest_task_waiting_sid`: The SID of the longest waiting Task. `tasks_by_status`: The number of Tasks grouped by their current status. `tasks_by_priority`: The number of Tasks grouped by priority. `activity_statistics`: The number of current Workers grouped by Activity. + /// The real-time statistics for each requested TaskQueue SID. `task_queue_data` returns the following attributes: `task_queue_sid`: The SID of the TaskQueue from which these statistics were calculated. `total_available_workers`: The total number of Workers available for Tasks in the TaskQueue. `total_eligible_workers`: The total number of Workers eligible for Tasks in the TaskQueue, regardless of their Activity state. `total_tasks`: The total number of Tasks. `longest_task_waiting_age`: The age of the longest waiting Task. `longest_task_waiting_sid`: The SID of the longest waiting Task. `tasks_by_status`: The number of Tasks grouped by their current status. `tasks_by_priority`: The number of Tasks grouped by priority. `activity_statistics`: The number of current Workers grouped by Activity. [JsonProperty("task_queue_data")] public List TaskQueueData { get; private set; } diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationOptions.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationOptions.cs index fcf5f6707..f21b57b57 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationOptions.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationOptions.cs @@ -277,6 +277,9 @@ public class UpdateReservationOptions : IOptions /// Whether to play a notification beep when the customer joins. public bool? BeepOnCustomerEntrance { get; set; } + /// The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. + public string JitterBufferSize { get; set; } + /// Construct a new UpdateWorkerReservationOptions @@ -503,6 +506,10 @@ public List> GetParams() { p.Add(new KeyValuePair("BeepOnCustomerEntrance", BeepOnCustomerEntrance.Value.ToString().ToLower())); } + if (JitterBufferSize != null) + { + p.Add(new KeyValuePair("JitterBufferSize", JitterBufferSize)); + } return p; } diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationResource.cs index c80a8e327..aeeb6f419 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationResource.cs @@ -396,6 +396,7 @@ public static async System.Threading.Tasks.Task UpdateAsync /// The new worker activity SID after executing a Conference instruction. /// Whether to end the conference when the customer leaves. /// Whether to play a notification beep when the customer joins. + /// The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. /// The If-Match HTTP request header /// Client to make requests to Twilio /// A single instance of Reservation @@ -454,10 +455,11 @@ public static ReservationResource Update( string postWorkActivitySid = null, bool? endConferenceOnCustomerExit = null, bool? beepOnCustomerEntrance = null, + string jitterBufferSize = null, string ifMatch = null, ITwilioRestClient client = null) { - var options = new UpdateReservationOptions(pathWorkspaceSid, pathWorkerSid, pathSid){ ReservationStatus = reservationStatus, WorkerActivitySid = workerActivitySid, Instruction = instruction, DequeuePostWorkActivitySid = dequeuePostWorkActivitySid, DequeueFrom = dequeueFrom, DequeueRecord = dequeueRecord, DequeueTimeout = dequeueTimeout, DequeueTo = dequeueTo, DequeueStatusCallbackUrl = dequeueStatusCallbackUrl, CallFrom = callFrom, CallRecord = callRecord, CallTimeout = callTimeout, CallTo = callTo, CallUrl = callUrl, CallStatusCallbackUrl = callStatusCallbackUrl, CallAccept = callAccept, RedirectCallSid = redirectCallSid, RedirectAccept = redirectAccept, RedirectUrl = redirectUrl, To = to, From = from, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, Region = region, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, DequeueStatusCallbackEvent = dequeueStatusCallbackEvent, PostWorkActivitySid = postWorkActivitySid, EndConferenceOnCustomerExit = endConferenceOnCustomerExit, BeepOnCustomerEntrance = beepOnCustomerEntrance, IfMatch = ifMatch }; + var options = new UpdateReservationOptions(pathWorkspaceSid, pathWorkerSid, pathSid){ ReservationStatus = reservationStatus, WorkerActivitySid = workerActivitySid, Instruction = instruction, DequeuePostWorkActivitySid = dequeuePostWorkActivitySid, DequeueFrom = dequeueFrom, DequeueRecord = dequeueRecord, DequeueTimeout = dequeueTimeout, DequeueTo = dequeueTo, DequeueStatusCallbackUrl = dequeueStatusCallbackUrl, CallFrom = callFrom, CallRecord = callRecord, CallTimeout = callTimeout, CallTo = callTo, CallUrl = callUrl, CallStatusCallbackUrl = callStatusCallbackUrl, CallAccept = callAccept, RedirectCallSid = redirectCallSid, RedirectAccept = redirectAccept, RedirectUrl = redirectUrl, To = to, From = from, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, Region = region, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, DequeueStatusCallbackEvent = dequeueStatusCallbackEvent, PostWorkActivitySid = postWorkActivitySid, EndConferenceOnCustomerExit = endConferenceOnCustomerExit, BeepOnCustomerEntrance = beepOnCustomerEntrance, JitterBufferSize = jitterBufferSize, IfMatch = ifMatch }; return Update(options, client); } @@ -517,6 +519,7 @@ public static ReservationResource Update( /// The new worker activity SID after executing a Conference instruction. /// Whether to end the conference when the customer leaves. /// Whether to play a notification beep when the customer joins. + /// The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. /// The If-Match HTTP request header /// Client to make requests to Twilio /// Task that resolves to A single instance of Reservation @@ -575,10 +578,11 @@ public static async System.Threading.Tasks.Task UpdateAsync string postWorkActivitySid = null, bool? endConferenceOnCustomerExit = null, bool? beepOnCustomerEntrance = null, + string jitterBufferSize = null, string ifMatch = null, ITwilioRestClient client = null) { - var options = new UpdateReservationOptions(pathWorkspaceSid, pathWorkerSid, pathSid){ ReservationStatus = reservationStatus, WorkerActivitySid = workerActivitySid, Instruction = instruction, DequeuePostWorkActivitySid = dequeuePostWorkActivitySid, DequeueFrom = dequeueFrom, DequeueRecord = dequeueRecord, DequeueTimeout = dequeueTimeout, DequeueTo = dequeueTo, DequeueStatusCallbackUrl = dequeueStatusCallbackUrl, CallFrom = callFrom, CallRecord = callRecord, CallTimeout = callTimeout, CallTo = callTo, CallUrl = callUrl, CallStatusCallbackUrl = callStatusCallbackUrl, CallAccept = callAccept, RedirectCallSid = redirectCallSid, RedirectAccept = redirectAccept, RedirectUrl = redirectUrl, To = to, From = from, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, Region = region, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, DequeueStatusCallbackEvent = dequeueStatusCallbackEvent, PostWorkActivitySid = postWorkActivitySid, EndConferenceOnCustomerExit = endConferenceOnCustomerExit, BeepOnCustomerEntrance = beepOnCustomerEntrance, IfMatch = ifMatch }; + var options = new UpdateReservationOptions(pathWorkspaceSid, pathWorkerSid, pathSid){ ReservationStatus = reservationStatus, WorkerActivitySid = workerActivitySid, Instruction = instruction, DequeuePostWorkActivitySid = dequeuePostWorkActivitySid, DequeueFrom = dequeueFrom, DequeueRecord = dequeueRecord, DequeueTimeout = dequeueTimeout, DequeueTo = dequeueTo, DequeueStatusCallbackUrl = dequeueStatusCallbackUrl, CallFrom = callFrom, CallRecord = callRecord, CallTimeout = callTimeout, CallTo = callTo, CallUrl = callUrl, CallStatusCallbackUrl = callStatusCallbackUrl, CallAccept = callAccept, RedirectCallSid = redirectCallSid, RedirectAccept = redirectAccept, RedirectUrl = redirectUrl, To = to, From = from, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, Region = region, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, DequeueStatusCallbackEvent = dequeueStatusCallbackEvent, PostWorkActivitySid = postWorkActivitySid, EndConferenceOnCustomerExit = endConferenceOnCustomerExit, BeepOnCustomerEntrance = beepOnCustomerEntrance, JitterBufferSize = jitterBufferSize, IfMatch = ifMatch }; return await UpdateAsync(options, client); } #endif diff --git a/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesOptions.cs b/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesOptions.cs index 975b8d407..4cd5a098d 100644 --- a/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesOptions.cs +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesOptions.cs @@ -31,6 +31,9 @@ public class CreateComplianceInquiriesOptions : IOptions The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. public string PrimaryProfileSid { get; } + /// The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. + public string NotificationEmail { get; set; } + /// Construct a new CreateComplianceInquiryOptions /// The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. @@ -49,6 +52,10 @@ public List> GetParams() { p.Add(new KeyValuePair("PrimaryProfileSid", PrimaryProfileSid)); } + if (NotificationEmail != null) + { + p.Add(new KeyValuePair("NotificationEmail", NotificationEmail)); + } return p; } diff --git a/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesResource.cs b/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesResource.cs index f2fdd9a11..3cf2bdef5 100644 --- a/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesResource.cs @@ -76,26 +76,30 @@ public static async System.Threading.Tasks.Task Cre /// Create a new Compliance Inquiry for the authenticated account. This is necessary to start a new embedded session. /// The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. + /// The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. /// Client to make requests to Twilio /// A single instance of ComplianceInquiries public static ComplianceInquiriesResource Create( string primaryProfileSid, + string notificationEmail = null, ITwilioRestClient client = null) { - var options = new CreateComplianceInquiriesOptions(primaryProfileSid){ }; + var options = new CreateComplianceInquiriesOptions(primaryProfileSid){ NotificationEmail = notificationEmail }; return Create(options, client); } #if !NET35 /// Create a new Compliance Inquiry for the authenticated account. This is necessary to start a new embedded session. /// The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. + /// The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. /// Client to make requests to Twilio /// Task that resolves to A single instance of ComplianceInquiries public static async System.Threading.Tasks.Task CreateAsync( string primaryProfileSid, + string notificationEmail = null, ITwilioRestClient client = null) { - var options = new CreateComplianceInquiriesOptions(primaryProfileSid){ }; + var options = new CreateComplianceInquiriesOptions(primaryProfileSid){ NotificationEmail = notificationEmail }; return await CreateAsync(options, client); } #endif diff --git a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesOptions.cs b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesOptions.cs index 35ead1c20..52078ecc4 100644 --- a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesOptions.cs +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesOptions.cs @@ -37,8 +37,8 @@ public class CreateComplianceRegistrationInquiriesOptions : IOptions The authority that registered the business - public string BusinessRegistrationAuthority { get; set; } + + public ComplianceRegistrationInquiriesResource.BusinessRegistrationAuthorityEnum BusinessRegistrationAuthority { get; set; } /// he name of the business or organization using the Tollfree number. public string BusinessLegalName { get; set; } @@ -118,6 +118,24 @@ public class CreateComplianceRegistrationInquiriesOptions : IOptions The verification document to upload public string File { get; set; } + /// The first name of the Individual User. + public string FirstName { get; set; } + + /// The last name of the Individual User. + public string LastName { get; set; } + + /// The date of birth of the Individual User. + public string DateOfBirth { get; set; } + + /// The email address of the Individual User. + public string IndividualEmail { get; set; } + + /// The phone number of the Individual User. + public string IndividualPhone { get; set; } + + /// Indicates if the inquiry is being started from an ISV embedded component. + public bool? IsIsvEmbed { get; set; } + /// Construct a new CreateComplianceRegistrationOptions /// @@ -148,7 +166,7 @@ public List> GetParams() } if (BusinessRegistrationAuthority != null) { - p.Add(new KeyValuePair("BusinessRegistrationAuthority", BusinessRegistrationAuthority)); + p.Add(new KeyValuePair("BusinessRegistrationAuthority", BusinessRegistrationAuthority.ToString())); } if (BusinessLegalName != null) { @@ -254,6 +272,30 @@ public List> GetParams() { p.Add(new KeyValuePair("File", File)); } + if (FirstName != null) + { + p.Add(new KeyValuePair("FirstName", FirstName)); + } + if (LastName != null) + { + p.Add(new KeyValuePair("LastName", LastName)); + } + if (DateOfBirth != null) + { + p.Add(new KeyValuePair("DateOfBirth", DateOfBirth)); + } + if (IndividualEmail != null) + { + p.Add(new KeyValuePair("IndividualEmail", IndividualEmail)); + } + if (IndividualPhone != null) + { + p.Add(new KeyValuePair("IndividualPhone", IndividualPhone)); + } + if (IsIsvEmbed != null) + { + p.Add(new KeyValuePair("IsIsvEmbed", IsIsvEmbed.Value.ToString().ToLower())); + } return p; } diff --git a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs index 3fba32328..0fca63867 100644 --- a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs @@ -45,6 +45,21 @@ public static implicit operator PhoneNumberTypeEnum(string value) public static readonly PhoneNumberTypeEnum Mobile = new PhoneNumberTypeEnum("mobile"); public static readonly PhoneNumberTypeEnum TollFree = new PhoneNumberTypeEnum("toll-free"); + } + public sealed class BusinessRegistrationAuthorityEnum : StringEnum + { + private BusinessRegistrationAuthorityEnum(string value) : base(value) {} + public BusinessRegistrationAuthorityEnum() {} + public static implicit operator BusinessRegistrationAuthorityEnum(string value) + { + return new BusinessRegistrationAuthorityEnum(value); + } + public static readonly BusinessRegistrationAuthorityEnum UkCrn = new BusinessRegistrationAuthorityEnum("UK:CRN"); + public static readonly BusinessRegistrationAuthorityEnum UsEin = new BusinessRegistrationAuthorityEnum("US:EIN"); + public static readonly BusinessRegistrationAuthorityEnum CaCbn = new BusinessRegistrationAuthorityEnum("CA:CBN"); + public static readonly BusinessRegistrationAuthorityEnum AuAcn = new BusinessRegistrationAuthorityEnum("AU:ACN"); + public static readonly BusinessRegistrationAuthorityEnum Other = new BusinessRegistrationAuthorityEnum("Other"); + } public sealed class EndUserTypeEnum : StringEnum { @@ -117,7 +132,7 @@ public static async System.Threading.Tasks.Task /// /// - /// The authority that registered the business + /// /// he name of the business or organization using the Tollfree number. /// he email address to receive the notification about the verification result. /// The email address to receive the notification about the verification result. @@ -144,13 +159,19 @@ public static async System.Threading.Tasks.Task Use the business address as the emergency address /// The name of the verification document to upload /// The verification document to upload + /// The first name of the Individual User. + /// The last name of the Individual User. + /// The date of birth of the Individual User. + /// The email address of the Individual User. + /// The phone number of the Individual User. + /// Indicates if the inquiry is being started from an ISV embedded component. /// Client to make requests to Twilio /// A single instance of ComplianceRegistrationInquiries public static ComplianceRegistrationInquiriesResource Create( ComplianceRegistrationInquiriesResource.EndUserTypeEnum endUserType, ComplianceRegistrationInquiriesResource.PhoneNumberTypeEnum phoneNumberType, ComplianceRegistrationInquiriesResource.BusinessIdentityTypeEnum businessIdentityType = null, - string businessRegistrationAuthority = null, + ComplianceRegistrationInquiriesResource.BusinessRegistrationAuthorityEnum businessRegistrationAuthority = null, string businessLegalName = null, string notificationEmail = null, bool? acceptedNotificationReceipt = null, @@ -177,9 +198,15 @@ public static ComplianceRegistrationInquiriesResource Create( bool? useAddressAsEmergencyAddress = null, string fileName = null, string file = null, + string firstName = null, + string lastName = null, + string dateOfBirth = null, + string individualEmail = null, + string individualPhone = null, + bool? isIsvEmbed = null, ITwilioRestClient client = null) { - var options = new CreateComplianceRegistrationInquiriesOptions(endUserType, phoneNumberType){ BusinessIdentityType = businessIdentityType, BusinessRegistrationAuthority = businessRegistrationAuthority, BusinessLegalName = businessLegalName, NotificationEmail = notificationEmail, AcceptedNotificationReceipt = acceptedNotificationReceipt, BusinessRegistrationNumber = businessRegistrationNumber, BusinessWebsiteUrl = businessWebsiteUrl, FriendlyName = friendlyName, AuthorizedRepresentative1FirstName = authorizedRepresentative1FirstName, AuthorizedRepresentative1LastName = authorizedRepresentative1LastName, AuthorizedRepresentative1Phone = authorizedRepresentative1Phone, AuthorizedRepresentative1Email = authorizedRepresentative1Email, AuthorizedRepresentative1DateOfBirth = authorizedRepresentative1DateOfBirth, AddressStreet = addressStreet, AddressStreetSecondary = addressStreetSecondary, AddressCity = addressCity, AddressSubdivision = addressSubdivision, AddressPostalCode = addressPostalCode, AddressCountryCode = addressCountryCode, EmergencyAddressStreet = emergencyAddressStreet, EmergencyAddressStreetSecondary = emergencyAddressStreetSecondary, EmergencyAddressCity = emergencyAddressCity, EmergencyAddressSubdivision = emergencyAddressSubdivision, EmergencyAddressPostalCode = emergencyAddressPostalCode, EmergencyAddressCountryCode = emergencyAddressCountryCode, UseAddressAsEmergencyAddress = useAddressAsEmergencyAddress, FileName = fileName, File = file }; + var options = new CreateComplianceRegistrationInquiriesOptions(endUserType, phoneNumberType){ BusinessIdentityType = businessIdentityType, BusinessRegistrationAuthority = businessRegistrationAuthority, BusinessLegalName = businessLegalName, NotificationEmail = notificationEmail, AcceptedNotificationReceipt = acceptedNotificationReceipt, BusinessRegistrationNumber = businessRegistrationNumber, BusinessWebsiteUrl = businessWebsiteUrl, FriendlyName = friendlyName, AuthorizedRepresentative1FirstName = authorizedRepresentative1FirstName, AuthorizedRepresentative1LastName = authorizedRepresentative1LastName, AuthorizedRepresentative1Phone = authorizedRepresentative1Phone, AuthorizedRepresentative1Email = authorizedRepresentative1Email, AuthorizedRepresentative1DateOfBirth = authorizedRepresentative1DateOfBirth, AddressStreet = addressStreet, AddressStreetSecondary = addressStreetSecondary, AddressCity = addressCity, AddressSubdivision = addressSubdivision, AddressPostalCode = addressPostalCode, AddressCountryCode = addressCountryCode, EmergencyAddressStreet = emergencyAddressStreet, EmergencyAddressStreetSecondary = emergencyAddressStreetSecondary, EmergencyAddressCity = emergencyAddressCity, EmergencyAddressSubdivision = emergencyAddressSubdivision, EmergencyAddressPostalCode = emergencyAddressPostalCode, EmergencyAddressCountryCode = emergencyAddressCountryCode, UseAddressAsEmergencyAddress = useAddressAsEmergencyAddress, FileName = fileName, File = file, FirstName = firstName, LastName = lastName, DateOfBirth = dateOfBirth, IndividualEmail = individualEmail, IndividualPhone = individualPhone, IsIsvEmbed = isIsvEmbed }; return Create(options, client); } @@ -188,7 +215,7 @@ public static ComplianceRegistrationInquiriesResource Create( /// /// /// - /// The authority that registered the business + /// /// he name of the business or organization using the Tollfree number. /// he email address to receive the notification about the verification result. /// The email address to receive the notification about the verification result. @@ -215,13 +242,19 @@ public static ComplianceRegistrationInquiriesResource Create( /// Use the business address as the emergency address /// The name of the verification document to upload /// The verification document to upload + /// The first name of the Individual User. + /// The last name of the Individual User. + /// The date of birth of the Individual User. + /// The email address of the Individual User. + /// The phone number of the Individual User. + /// Indicates if the inquiry is being started from an ISV embedded component. /// Client to make requests to Twilio /// Task that resolves to A single instance of ComplianceRegistrationInquiries public static async System.Threading.Tasks.Task CreateAsync( ComplianceRegistrationInquiriesResource.EndUserTypeEnum endUserType, ComplianceRegistrationInquiriesResource.PhoneNumberTypeEnum phoneNumberType, ComplianceRegistrationInquiriesResource.BusinessIdentityTypeEnum businessIdentityType = null, - string businessRegistrationAuthority = null, + ComplianceRegistrationInquiriesResource.BusinessRegistrationAuthorityEnum businessRegistrationAuthority = null, string businessLegalName = null, string notificationEmail = null, bool? acceptedNotificationReceipt = null, @@ -248,9 +281,15 @@ public static async System.Threading.Tasks.Task The Tollfree phone number to be verified public Types.PhoneNumber TollfreePhoneNumber { get; } - /// The notification email to be triggered when verification status is changed + /// The email address to receive the notification about the verification result. public string NotificationEmail { get; } + /// The name of the business or organization using the Tollfree number. + public string BusinessName { get; set; } + + /// The website of the business or organization using the Tollfree number. + public string BusinessWebsite { get; set; } + + /// The category of the use case for the Tollfree Number. List as many are applicable.. + public List UseCaseCategories { get; set; } + + /// Use this to further explain how messaging is used by the business or organization. + public string UseCaseSummary { get; set; } + + /// An example of message content, i.e. a sample message. + public string ProductionMessageSample { get; set; } + + /// Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + public List OptInImageUrls { get; set; } + + + public ComplianceTollfreeInquiriesResource.OptInTypeEnum OptInType { get; set; } + + /// Estimate monthly volume of messages from the Tollfree Number. + public string MessageVolume { get; set; } + + /// The address of the business or organization using the Tollfree number. + public string BusinessStreetAddress { get; set; } + + /// The address of the business or organization using the Tollfree number. + public string BusinessStreetAddress2 { get; set; } + + /// The city of the business or organization using the Tollfree number. + public string BusinessCity { get; set; } + + /// The state/province/region of the business or organization using the Tollfree number. + public string BusinessStateProvinceRegion { get; set; } + + /// The postal code of the business or organization using the Tollfree number. + public string BusinessPostalCode { get; set; } + + /// The country of the business or organization using the Tollfree number. + public string BusinessCountry { get; set; } + + /// Additional information to be provided for verification. + public string AdditionalInformation { get; set; } + + /// The first name of the contact for the business or organization using the Tollfree number. + public string BusinessContactFirstName { get; set; } + + /// The last name of the contact for the business or organization using the Tollfree number. + public string BusinessContactLastName { get; set; } + + /// The email address of the contact for the business or organization using the Tollfree number. + public string BusinessContactEmail { get; set; } + + /// The phone number of the contact for the business or organization using the Tollfree number. + public Types.PhoneNumber BusinessContactPhone { get; set; } + /// Construct a new CreateComplianceTollfreeInquiryOptions /// The Tollfree phone number to be verified - /// The notification email to be triggered when verification status is changed + /// The email address to receive the notification about the verification result. public CreateComplianceTollfreeInquiriesOptions(Types.PhoneNumber tollfreePhoneNumber, string notificationEmail) { TollfreePhoneNumber = tollfreePhoneNumber; NotificationEmail = notificationEmail; + UseCaseCategories = new List(); + OptInImageUrls = new List(); } @@ -58,6 +117,82 @@ public List> GetParams() { p.Add(new KeyValuePair("NotificationEmail", NotificationEmail)); } + if (BusinessName != null) + { + p.Add(new KeyValuePair("BusinessName", BusinessName)); + } + if (BusinessWebsite != null) + { + p.Add(new KeyValuePair("BusinessWebsite", BusinessWebsite)); + } + if (UseCaseCategories != null) + { + p.AddRange(UseCaseCategories.Select(UseCaseCategories => new KeyValuePair("UseCaseCategories", UseCaseCategories))); + } + if (UseCaseSummary != null) + { + p.Add(new KeyValuePair("UseCaseSummary", UseCaseSummary)); + } + if (ProductionMessageSample != null) + { + p.Add(new KeyValuePair("ProductionMessageSample", ProductionMessageSample)); + } + if (OptInImageUrls != null) + { + p.AddRange(OptInImageUrls.Select(OptInImageUrls => new KeyValuePair("OptInImageUrls", OptInImageUrls))); + } + if (OptInType != null) + { + p.Add(new KeyValuePair("OptInType", OptInType.ToString())); + } + if (MessageVolume != null) + { + p.Add(new KeyValuePair("MessageVolume", MessageVolume)); + } + if (BusinessStreetAddress != null) + { + p.Add(new KeyValuePair("BusinessStreetAddress", BusinessStreetAddress)); + } + if (BusinessStreetAddress2 != null) + { + p.Add(new KeyValuePair("BusinessStreetAddress2", BusinessStreetAddress2)); + } + if (BusinessCity != null) + { + p.Add(new KeyValuePair("BusinessCity", BusinessCity)); + } + if (BusinessStateProvinceRegion != null) + { + p.Add(new KeyValuePair("BusinessStateProvinceRegion", BusinessStateProvinceRegion)); + } + if (BusinessPostalCode != null) + { + p.Add(new KeyValuePair("BusinessPostalCode", BusinessPostalCode)); + } + if (BusinessCountry != null) + { + p.Add(new KeyValuePair("BusinessCountry", BusinessCountry)); + } + if (AdditionalInformation != null) + { + p.Add(new KeyValuePair("AdditionalInformation", AdditionalInformation)); + } + if (BusinessContactFirstName != null) + { + p.Add(new KeyValuePair("BusinessContactFirstName", BusinessContactFirstName)); + } + if (BusinessContactLastName != null) + { + p.Add(new KeyValuePair("BusinessContactLastName", BusinessContactLastName)); + } + if (BusinessContactEmail != null) + { + p.Add(new KeyValuePair("BusinessContactEmail", BusinessContactEmail)); + } + if (BusinessContactPhone != null) + { + p.Add(new KeyValuePair("BusinessContactPhone", BusinessContactPhone.ToString())); + } return p; } diff --git a/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesResource.cs b/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesResource.cs index 7bdd27662..153ad9924 100644 --- a/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesResource.cs +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesResource.cs @@ -22,7 +22,7 @@ using Twilio.Converters; using Twilio.Exceptions; using Twilio.Http; - +using Twilio.Types; namespace Twilio.Rest.Trusthub.V1 @@ -32,6 +32,21 @@ public class ComplianceTollfreeInquiriesResource : Resource + public sealed class OptInTypeEnum : StringEnum + { + private OptInTypeEnum(string value) : base(value) {} + public OptInTypeEnum() {} + public static implicit operator OptInTypeEnum(string value) + { + return new OptInTypeEnum(value); + } + public static readonly OptInTypeEnum Verbal = new OptInTypeEnum("VERBAL"); + public static readonly OptInTypeEnum WebForm = new OptInTypeEnum("WEB_FORM"); + public static readonly OptInTypeEnum PaperForm = new OptInTypeEnum("PAPER_FORM"); + public static readonly OptInTypeEnum ViaText = new OptInTypeEnum("VIA_TEXT"); + public static readonly OptInTypeEnum MobileQrCode = new OptInTypeEnum("MOBILE_QR_CODE"); + + } private static Request BuildCreateRequest(CreateComplianceTollfreeInquiriesOptions options, ITwilioRestClient client) @@ -76,30 +91,106 @@ public static async System.Threading.Tasks.Task Create a new Compliance Tollfree Verification Inquiry for the authenticated account. This is necessary to start a new embedded session. /// The Tollfree phone number to be verified - /// The notification email to be triggered when verification status is changed + /// The email address to receive the notification about the verification result. + /// The name of the business or organization using the Tollfree number. + /// The website of the business or organization using the Tollfree number. + /// The category of the use case for the Tollfree Number. List as many are applicable.. + /// Use this to further explain how messaging is used by the business or organization. + /// An example of message content, i.e. a sample message. + /// Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + /// + /// Estimate monthly volume of messages from the Tollfree Number. + /// The address of the business or organization using the Tollfree number. + /// The address of the business or organization using the Tollfree number. + /// The city of the business or organization using the Tollfree number. + /// The state/province/region of the business or organization using the Tollfree number. + /// The postal code of the business or organization using the Tollfree number. + /// The country of the business or organization using the Tollfree number. + /// Additional information to be provided for verification. + /// The first name of the contact for the business or organization using the Tollfree number. + /// The last name of the contact for the business or organization using the Tollfree number. + /// The email address of the contact for the business or organization using the Tollfree number. + /// The phone number of the contact for the business or organization using the Tollfree number. /// Client to make requests to Twilio /// A single instance of ComplianceTollfreeInquiries public static ComplianceTollfreeInquiriesResource Create( Types.PhoneNumber tollfreePhoneNumber, string notificationEmail, + string businessName = null, + string businessWebsite = null, + List useCaseCategories = null, + string useCaseSummary = null, + string productionMessageSample = null, + List optInImageUrls = null, + ComplianceTollfreeInquiriesResource.OptInTypeEnum optInType = null, + string messageVolume = null, + string businessStreetAddress = null, + string businessStreetAddress2 = null, + string businessCity = null, + string businessStateProvinceRegion = null, + string businessPostalCode = null, + string businessCountry = null, + string additionalInformation = null, + string businessContactFirstName = null, + string businessContactLastName = null, + string businessContactEmail = null, + Types.PhoneNumber businessContactPhone = null, ITwilioRestClient client = null) { - var options = new CreateComplianceTollfreeInquiriesOptions(tollfreePhoneNumber, notificationEmail){ }; + var options = new CreateComplianceTollfreeInquiriesOptions(tollfreePhoneNumber, notificationEmail){ BusinessName = businessName, BusinessWebsite = businessWebsite, UseCaseCategories = useCaseCategories, UseCaseSummary = useCaseSummary, ProductionMessageSample = productionMessageSample, OptInImageUrls = optInImageUrls, OptInType = optInType, MessageVolume = messageVolume, BusinessStreetAddress = businessStreetAddress, BusinessStreetAddress2 = businessStreetAddress2, BusinessCity = businessCity, BusinessStateProvinceRegion = businessStateProvinceRegion, BusinessPostalCode = businessPostalCode, BusinessCountry = businessCountry, AdditionalInformation = additionalInformation, BusinessContactFirstName = businessContactFirstName, BusinessContactLastName = businessContactLastName, BusinessContactEmail = businessContactEmail, BusinessContactPhone = businessContactPhone }; return Create(options, client); } #if !NET35 /// Create a new Compliance Tollfree Verification Inquiry for the authenticated account. This is necessary to start a new embedded session. /// The Tollfree phone number to be verified - /// The notification email to be triggered when verification status is changed + /// The email address to receive the notification about the verification result. + /// The name of the business or organization using the Tollfree number. + /// The website of the business or organization using the Tollfree number. + /// The category of the use case for the Tollfree Number. List as many are applicable.. + /// Use this to further explain how messaging is used by the business or organization. + /// An example of message content, i.e. a sample message. + /// Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + /// + /// Estimate monthly volume of messages from the Tollfree Number. + /// The address of the business or organization using the Tollfree number. + /// The address of the business or organization using the Tollfree number. + /// The city of the business or organization using the Tollfree number. + /// The state/province/region of the business or organization using the Tollfree number. + /// The postal code of the business or organization using the Tollfree number. + /// The country of the business or organization using the Tollfree number. + /// Additional information to be provided for verification. + /// The first name of the contact for the business or organization using the Tollfree number. + /// The last name of the contact for the business or organization using the Tollfree number. + /// The email address of the contact for the business or organization using the Tollfree number. + /// The phone number of the contact for the business or organization using the Tollfree number. /// Client to make requests to Twilio /// Task that resolves to A single instance of ComplianceTollfreeInquiries public static async System.Threading.Tasks.Task CreateAsync( Types.PhoneNumber tollfreePhoneNumber, string notificationEmail, + string businessName = null, + string businessWebsite = null, + List useCaseCategories = null, + string useCaseSummary = null, + string productionMessageSample = null, + List optInImageUrls = null, + ComplianceTollfreeInquiriesResource.OptInTypeEnum optInType = null, + string messageVolume = null, + string businessStreetAddress = null, + string businessStreetAddress2 = null, + string businessCity = null, + string businessStateProvinceRegion = null, + string businessPostalCode = null, + string businessCountry = null, + string additionalInformation = null, + string businessContactFirstName = null, + string businessContactLastName = null, + string businessContactEmail = null, + Types.PhoneNumber businessContactPhone = null, ITwilioRestClient client = null) { - var options = new CreateComplianceTollfreeInquiriesOptions(tollfreePhoneNumber, notificationEmail){ }; + var options = new CreateComplianceTollfreeInquiriesOptions(tollfreePhoneNumber, notificationEmail){ BusinessName = businessName, BusinessWebsite = businessWebsite, UseCaseCategories = useCaseCategories, UseCaseSummary = useCaseSummary, ProductionMessageSample = productionMessageSample, OptInImageUrls = optInImageUrls, OptInType = optInType, MessageVolume = messageVolume, BusinessStreetAddress = businessStreetAddress, BusinessStreetAddress2 = businessStreetAddress2, BusinessCity = businessCity, BusinessStateProvinceRegion = businessStateProvinceRegion, BusinessPostalCode = businessPostalCode, BusinessCountry = businessCountry, AdditionalInformation = additionalInformation, BusinessContactFirstName = businessContactFirstName, BusinessContactLastName = businessContactLastName, BusinessContactEmail = businessContactEmail, BusinessContactPhone = businessContactPhone }; return await CreateAsync(options, client); } #endif diff --git a/src/Twilio/Rest/Verify/V2/ServiceOptions.cs b/src/Twilio/Rest/Verify/V2/ServiceOptions.cs index 6c28e8f1d..6aa430fa6 100644 --- a/src/Twilio/Rest/Verify/V2/ServiceOptions.cs +++ b/src/Twilio/Rest/Verify/V2/ServiceOptions.cs @@ -79,6 +79,9 @@ public class CreateServiceOptions : IOptions /// The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. public string DefaultTemplateSid { get; set; } + /// Whether to allow verifications from the service to reach the stream-events sinks if configured + public bool? VerifyEventSubscriptionEnabled { get; set; } + /// Construct a new CreateServiceOptions /// A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** @@ -161,6 +164,10 @@ public List> GetParams() { p.Add(new KeyValuePair("DefaultTemplateSid", DefaultTemplateSid)); } + if (VerifyEventSubscriptionEnabled != null) + { + p.Add(new KeyValuePair("VerifyEventSubscriptionEnabled", VerifyEventSubscriptionEnabled.Value.ToString().ToLower())); + } return p; } @@ -309,6 +316,9 @@ public class UpdateServiceOptions : IOptions /// The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. public string DefaultTemplateSid { get; set; } + /// Whether to allow verifications from the service to reach the stream-events sinks if configured + public bool? VerifyEventSubscriptionEnabled { get; set; } + /// Construct a new UpdateServiceOptions @@ -392,6 +402,10 @@ public List> GetParams() { p.Add(new KeyValuePair("DefaultTemplateSid", DefaultTemplateSid)); } + if (VerifyEventSubscriptionEnabled != null) + { + p.Add(new KeyValuePair("VerifyEventSubscriptionEnabled", VerifyEventSubscriptionEnabled.Value.ToString().ToLower())); + } return p; } diff --git a/src/Twilio/Rest/Verify/V2/ServiceResource.cs b/src/Twilio/Rest/Verify/V2/ServiceResource.cs index 3b2a704d1..248cfb131 100644 --- a/src/Twilio/Rest/Verify/V2/ServiceResource.cs +++ b/src/Twilio/Rest/Verify/V2/ServiceResource.cs @@ -92,6 +92,7 @@ public static async System.Threading.Tasks.Task CreateAsync(Cre /// Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 /// Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 /// The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + /// Whether to allow verifications from the service to reach the stream-events sinks if configured /// Client to make requests to Twilio /// A single instance of Service public static ServiceResource Create( @@ -112,9 +113,10 @@ public static ServiceResource Create( int? totpCodeLength = null, int? totpSkew = null, string defaultTemplateSid = null, + bool? verifyEventSubscriptionEnabled = null, ITwilioRestClient client = null) { - var options = new CreateServiceOptions(friendlyName){ CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled, DoNotShareWarningEnabled = doNotShareWarningEnabled, CustomCodeEnabled = customCodeEnabled, PushIncludeDate = pushIncludeDate, PushApnCredentialSid = pushApnCredentialSid, PushFcmCredentialSid = pushFcmCredentialSid, TotpIssuer = totpIssuer, TotpTimeStep = totpTimeStep, TotpCodeLength = totpCodeLength, TotpSkew = totpSkew, DefaultTemplateSid = defaultTemplateSid }; + var options = new CreateServiceOptions(friendlyName){ CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled, DoNotShareWarningEnabled = doNotShareWarningEnabled, CustomCodeEnabled = customCodeEnabled, PushIncludeDate = pushIncludeDate, PushApnCredentialSid = pushApnCredentialSid, PushFcmCredentialSid = pushFcmCredentialSid, TotpIssuer = totpIssuer, TotpTimeStep = totpTimeStep, TotpCodeLength = totpCodeLength, TotpSkew = totpSkew, DefaultTemplateSid = defaultTemplateSid, VerifyEventSubscriptionEnabled = verifyEventSubscriptionEnabled }; return Create(options, client); } @@ -137,6 +139,7 @@ public static ServiceResource Create( /// Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 /// Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 /// The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + /// Whether to allow verifications from the service to reach the stream-events sinks if configured /// Client to make requests to Twilio /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task CreateAsync( @@ -157,9 +160,10 @@ public static async System.Threading.Tasks.Task CreateAsync( int? totpCodeLength = null, int? totpSkew = null, string defaultTemplateSid = null, + bool? verifyEventSubscriptionEnabled = null, ITwilioRestClient client = null) { - var options = new CreateServiceOptions(friendlyName){ CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled, DoNotShareWarningEnabled = doNotShareWarningEnabled, CustomCodeEnabled = customCodeEnabled, PushIncludeDate = pushIncludeDate, PushApnCredentialSid = pushApnCredentialSid, PushFcmCredentialSid = pushFcmCredentialSid, TotpIssuer = totpIssuer, TotpTimeStep = totpTimeStep, TotpCodeLength = totpCodeLength, TotpSkew = totpSkew, DefaultTemplateSid = defaultTemplateSid }; + var options = new CreateServiceOptions(friendlyName){ CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled, DoNotShareWarningEnabled = doNotShareWarningEnabled, CustomCodeEnabled = customCodeEnabled, PushIncludeDate = pushIncludeDate, PushApnCredentialSid = pushApnCredentialSid, PushFcmCredentialSid = pushFcmCredentialSid, TotpIssuer = totpIssuer, TotpTimeStep = totpTimeStep, TotpCodeLength = totpCodeLength, TotpSkew = totpSkew, DefaultTemplateSid = defaultTemplateSid, VerifyEventSubscriptionEnabled = verifyEventSubscriptionEnabled }; return await CreateAsync(options, client); } #endif @@ -478,6 +482,7 @@ public static async System.Threading.Tasks.Task UpdateAsync(Upd /// Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 /// Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 /// The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + /// Whether to allow verifications from the service to reach the stream-events sinks if configured /// Client to make requests to Twilio /// A single instance of Service public static ServiceResource Update( @@ -499,9 +504,10 @@ public static ServiceResource Update( int? totpCodeLength = null, int? totpSkew = null, string defaultTemplateSid = null, + bool? verifyEventSubscriptionEnabled = null, ITwilioRestClient client = null) { - var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled, DoNotShareWarningEnabled = doNotShareWarningEnabled, CustomCodeEnabled = customCodeEnabled, PushIncludeDate = pushIncludeDate, PushApnCredentialSid = pushApnCredentialSid, PushFcmCredentialSid = pushFcmCredentialSid, TotpIssuer = totpIssuer, TotpTimeStep = totpTimeStep, TotpCodeLength = totpCodeLength, TotpSkew = totpSkew, DefaultTemplateSid = defaultTemplateSid }; + var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled, DoNotShareWarningEnabled = doNotShareWarningEnabled, CustomCodeEnabled = customCodeEnabled, PushIncludeDate = pushIncludeDate, PushApnCredentialSid = pushApnCredentialSid, PushFcmCredentialSid = pushFcmCredentialSid, TotpIssuer = totpIssuer, TotpTimeStep = totpTimeStep, TotpCodeLength = totpCodeLength, TotpSkew = totpSkew, DefaultTemplateSid = defaultTemplateSid, VerifyEventSubscriptionEnabled = verifyEventSubscriptionEnabled }; return Update(options, client); } @@ -525,6 +531,7 @@ public static ServiceResource Update( /// Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 /// Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 /// The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + /// Whether to allow verifications from the service to reach the stream-events sinks if configured /// Client to make requests to Twilio /// Task that resolves to A single instance of Service public static async System.Threading.Tasks.Task UpdateAsync( @@ -546,9 +553,10 @@ public static async System.Threading.Tasks.Task UpdateAsync( int? totpCodeLength = null, int? totpSkew = null, string defaultTemplateSid = null, + bool? verifyEventSubscriptionEnabled = null, ITwilioRestClient client = null) { - var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled, DoNotShareWarningEnabled = doNotShareWarningEnabled, CustomCodeEnabled = customCodeEnabled, PushIncludeDate = pushIncludeDate, PushApnCredentialSid = pushApnCredentialSid, PushFcmCredentialSid = pushFcmCredentialSid, TotpIssuer = totpIssuer, TotpTimeStep = totpTimeStep, TotpCodeLength = totpCodeLength, TotpSkew = totpSkew, DefaultTemplateSid = defaultTemplateSid }; + var options = new UpdateServiceOptions(pathSid){ FriendlyName = friendlyName, CodeLength = codeLength, LookupEnabled = lookupEnabled, SkipSmsToLandlines = skipSmsToLandlines, DtmfInputRequired = dtmfInputRequired, TtsName = ttsName, Psd2Enabled = psd2Enabled, DoNotShareWarningEnabled = doNotShareWarningEnabled, CustomCodeEnabled = customCodeEnabled, PushIncludeDate = pushIncludeDate, PushApnCredentialSid = pushApnCredentialSid, PushFcmCredentialSid = pushFcmCredentialSid, TotpIssuer = totpIssuer, TotpTimeStep = totpTimeStep, TotpCodeLength = totpCodeLength, TotpSkew = totpSkew, DefaultTemplateSid = defaultTemplateSid, VerifyEventSubscriptionEnabled = verifyEventSubscriptionEnabled }; return await UpdateAsync(options, client); } #endif @@ -643,6 +651,10 @@ public static string ToJson(object model) [JsonProperty("default_template_sid")] public string DefaultTemplateSid { get; private set; } + /// Whether to allow verifications from the service to reach the stream-events sinks if configured + [JsonProperty("verify_event_subscription_enabled")] + public bool? VerifyEventSubscriptionEnabled { get; private set; } + /// The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. [JsonProperty("date_created")] public DateTime? DateCreated { get; private set; } diff --git a/src/Twilio/Rest/Video/V1/CompositionSettingsOptions.cs b/src/Twilio/Rest/Video/V1/CompositionSettingsOptions.cs index 091aa8188..6f23abf75 100644 --- a/src/Twilio/Rest/Video/V1/CompositionSettingsOptions.cs +++ b/src/Twilio/Rest/Video/V1/CompositionSettingsOptions.cs @@ -37,7 +37,7 @@ public class CreateCompositionSettingsOptions : IOptions The SID of the Public Key resource to use for encryption. public string EncryptionKeySid { get; set; } - /// The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + /// The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). public Uri AwsS3Url { get; set; } /// Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. diff --git a/src/Twilio/Rest/Video/V1/CompositionSettingsResource.cs b/src/Twilio/Rest/Video/V1/CompositionSettingsResource.cs index c653df604..0d338f943 100644 --- a/src/Twilio/Rest/Video/V1/CompositionSettingsResource.cs +++ b/src/Twilio/Rest/Video/V1/CompositionSettingsResource.cs @@ -78,7 +78,7 @@ public static async System.Threading.Tasks.Task Cre /// A descriptive string that you create to describe the resource and show to the user in the console /// The SID of the stored Credential resource. /// The SID of the Public Key resource to use for encryption. - /// The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + /// The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). /// Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. /// Whether all compositions should be stored in an encrypted form. The default is `false`. /// Client to make requests to Twilio @@ -101,7 +101,7 @@ public static CompositionSettingsResource Create( /// A descriptive string that you create to describe the resource and show to the user in the console /// The SID of the stored Credential resource. /// The SID of the Public Key resource to use for encryption. - /// The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + /// The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). /// Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. /// Whether all compositions should be stored in an encrypted form. The default is `false`. /// Client to make requests to Twilio @@ -226,7 +226,7 @@ public static string ToJson(object model) [JsonProperty("aws_credentials_sid")] public string AwsCredentialsSid { get; private set; } - /// The URL of the AWS S3 bucket where the compositions are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + /// The URL of the AWS S3 bucket where the compositions are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). [JsonProperty("aws_s3_url")] public Uri AwsS3Url { get; private set; } diff --git a/src/Twilio/Rest/Video/V1/RecordingSettingsOptions.cs b/src/Twilio/Rest/Video/V1/RecordingSettingsOptions.cs index 0fbf98298..91965a5d0 100644 --- a/src/Twilio/Rest/Video/V1/RecordingSettingsOptions.cs +++ b/src/Twilio/Rest/Video/V1/RecordingSettingsOptions.cs @@ -37,7 +37,7 @@ public class CreateRecordingSettingsOptions : IOptions The SID of the Public Key resource to use for encryption. public string EncryptionKeySid { get; set; } - /// The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + /// The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). public Uri AwsS3Url { get; set; } /// Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. diff --git a/src/Twilio/Rest/Video/V1/RecordingSettingsResource.cs b/src/Twilio/Rest/Video/V1/RecordingSettingsResource.cs index 03807a4de..07eece795 100644 --- a/src/Twilio/Rest/Video/V1/RecordingSettingsResource.cs +++ b/src/Twilio/Rest/Video/V1/RecordingSettingsResource.cs @@ -78,7 +78,7 @@ public static async System.Threading.Tasks.Task Creat /// A descriptive string that you create to describe the resource and be shown to users in the console /// The SID of the stored Credential resource. /// The SID of the Public Key resource to use for encryption. - /// The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + /// The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). /// Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. /// Whether all recordings should be stored in an encrypted form. The default is `false`. /// Client to make requests to Twilio @@ -101,7 +101,7 @@ public static RecordingSettingsResource Create( /// A descriptive string that you create to describe the resource and be shown to users in the console /// The SID of the stored Credential resource. /// The SID of the Public Key resource to use for encryption. - /// The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + /// The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). /// Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. /// Whether all recordings should be stored in an encrypted form. The default is `false`. /// Client to make requests to Twilio @@ -226,7 +226,7 @@ public static string ToJson(object model) [JsonProperty("aws_credentials_sid")] public string AwsCredentialsSid { get; private set; } - /// The URL of the AWS S3 bucket where the recordings are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + /// The URL of the AWS S3 bucket where the recordings are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). [JsonProperty("aws_s3_url")] public Uri AwsS3Url { get; private set; } diff --git a/src/Twilio/TwiML/Voice/Say.cs b/src/Twilio/TwiML/Voice/Say.cs index f3184486c..2dfd43848 100644 --- a/src/Twilio/TwiML/Voice/Say.cs +++ b/src/Twilio/TwiML/Voice/Say.cs @@ -30,6 +30,10 @@ public static implicit operator VoiceEnum(string value) public static readonly VoiceEnum Woman = new VoiceEnum("woman"); public static readonly VoiceEnum Alice = new VoiceEnum("alice"); public static readonly VoiceEnum GoogleAfZaStandardA = new VoiceEnum("Google.af-ZA-Standard-A"); + public static readonly VoiceEnum GoogleAmEtStandardA = new VoiceEnum("Google.am-ET-Standard-A"); + public static readonly VoiceEnum GoogleAmEtStandardB = new VoiceEnum("Google.am-ET-Standard-B"); + public static readonly VoiceEnum GoogleAmEtWavenetA = new VoiceEnum("Google.am-ET-Wavenet-A"); + public static readonly VoiceEnum GoogleAmEtWavenetB = new VoiceEnum("Google.am-ET-Wavenet-B"); public static readonly VoiceEnum GoogleArXaStandardA = new VoiceEnum("Google.ar-XA-Standard-A"); public static readonly VoiceEnum GoogleArXaStandardB = new VoiceEnum("Google.ar-XA-Standard-B"); public static readonly VoiceEnum GoogleArXaStandardC = new VoiceEnum("Google.ar-XA-Standard-C"); @@ -39,6 +43,10 @@ public static implicit operator VoiceEnum(string value) public static readonly VoiceEnum GoogleArXaWavenetC = new VoiceEnum("Google.ar-XA-Wavenet-C"); public static readonly VoiceEnum GoogleArXaWavenetD = new VoiceEnum("Google.ar-XA-Wavenet-D"); public static readonly VoiceEnum GoogleBgBgStandardA = new VoiceEnum("Google.bg-BG-Standard-A"); + public static readonly VoiceEnum GoogleBnInStandardC = new VoiceEnum("Google.bn-IN-Standard-C"); + public static readonly VoiceEnum GoogleBnInStandardD = new VoiceEnum("Google.bn-IN-Standard-D"); + public static readonly VoiceEnum GoogleBnInWavenetC = new VoiceEnum("Google.bn-IN-Wavenet-C"); + public static readonly VoiceEnum GoogleBnInWavenetD = new VoiceEnum("Google.bn-IN-Wavenet-D"); public static readonly VoiceEnum GoogleCaEsStandardA = new VoiceEnum("Google.ca-ES-Standard-A"); public static readonly VoiceEnum GoogleCmnCnStandardA = new VoiceEnum("Google.cmn-CN-Standard-A"); public static readonly VoiceEnum GoogleCmnCnStandardB = new VoiceEnum("Google.cmn-CN-Standard-B"); @@ -66,6 +74,7 @@ public static implicit operator VoiceEnum(string value) public static readonly VoiceEnum GoogleDaDkWavenetC = new VoiceEnum("Google.da-DK-Wavenet-C"); public static readonly VoiceEnum GoogleDaDkWavenetD = new VoiceEnum("Google.da-DK-Wavenet-D"); public static readonly VoiceEnum GoogleDaDkWavenetE = new VoiceEnum("Google.da-DK-Wavenet-E"); + public static readonly VoiceEnum GoogleDeDeNeural2A = new VoiceEnum("Google.de-DE-Neural2-A"); public static readonly VoiceEnum GoogleDeDeNeural2B = new VoiceEnum("Google.de-DE-Neural2-B"); public static readonly VoiceEnum GoogleDeDeNeural2C = new VoiceEnum("Google.de-DE-Neural2-C"); public static readonly VoiceEnum GoogleDeDeNeural2D = new VoiceEnum("Google.de-DE-Neural2-D"); @@ -111,6 +120,10 @@ public static implicit operator VoiceEnum(string value) public static readonly VoiceEnum GoogleEnGbWavenetC = new VoiceEnum("Google.en-GB-Wavenet-C"); public static readonly VoiceEnum GoogleEnGbWavenetD = new VoiceEnum("Google.en-GB-Wavenet-D"); public static readonly VoiceEnum GoogleEnGbWavenetF = new VoiceEnum("Google.en-GB-Wavenet-F"); + public static readonly VoiceEnum GoogleEnInNeural2A = new VoiceEnum("Google.en-IN-Neural2-A"); + public static readonly VoiceEnum GoogleEnInNeural2B = new VoiceEnum("Google.en-IN-Neural2-B"); + public static readonly VoiceEnum GoogleEnInNeural2C = new VoiceEnum("Google.en-IN-Neural2-C"); + public static readonly VoiceEnum GoogleEnInNeural2D = new VoiceEnum("Google.en-IN-Neural2-D"); public static readonly VoiceEnum GoogleEnInStandardA = new VoiceEnum("Google.en-IN-Standard-A"); public static readonly VoiceEnum GoogleEnInStandardB = new VoiceEnum("Google.en-IN-Standard-B"); public static readonly VoiceEnum GoogleEnInStandardC = new VoiceEnum("Google.en-IN-Standard-C"); @@ -260,6 +273,10 @@ public static implicit operator VoiceEnum(string value) public static readonly VoiceEnum GoogleJaJpWavenetB = new VoiceEnum("Google.ja-JP-Wavenet-B"); public static readonly VoiceEnum GoogleJaJpWavenetC = new VoiceEnum("Google.ja-JP-Wavenet-C"); public static readonly VoiceEnum GoogleJaJpWavenetD = new VoiceEnum("Google.ja-JP-Wavenet-D"); + public static readonly VoiceEnum GoogleKnInStandardC = new VoiceEnum("Google.kn-IN-Standard-C"); + public static readonly VoiceEnum GoogleKnInStandardD = new VoiceEnum("Google.kn-IN-Standard-D"); + public static readonly VoiceEnum GoogleKnInWavenetC = new VoiceEnum("Google.kn-IN-Wavenet-C"); + public static readonly VoiceEnum GoogleKnInWavenetD = new VoiceEnum("Google.kn-IN-Wavenet-D"); public static readonly VoiceEnum GoogleKoKrNeural2A = new VoiceEnum("Google.ko-KR-Neural2-A"); public static readonly VoiceEnum GoogleKoKrNeural2B = new VoiceEnum("Google.ko-KR-Neural2-B"); public static readonly VoiceEnum GoogleKoKrNeural2C = new VoiceEnum("Google.ko-KR-Neural2-C"); @@ -482,14 +499,17 @@ public static implicit operator VoiceEnum(string value) public static readonly VoiceEnum PollyBrianNeural = new VoiceEnum("Polly.Brian-Neural"); public static readonly VoiceEnum PollyCamilaNeural = new VoiceEnum("Polly.Camila-Neural"); public static readonly VoiceEnum PollyDanielNeural = new VoiceEnum("Polly.Daniel-Neural"); + public static readonly VoiceEnum PollyDanielleNeural = new VoiceEnum("Polly.Danielle-Neural"); public static readonly VoiceEnum PollyElinNeural = new VoiceEnum("Polly.Elin-Neural"); public static readonly VoiceEnum PollyEmmaNeural = new VoiceEnum("Polly.Emma-Neural"); public static readonly VoiceEnum PollyGabrielleNeural = new VoiceEnum("Polly.Gabrielle-Neural"); + public static readonly VoiceEnum PollyGregoryNeural = new VoiceEnum("Polly.Gregory-Neural"); public static readonly VoiceEnum PollyHalaNeural = new VoiceEnum("Polly.Hala-Neural"); public static readonly VoiceEnum PollyHannahNeural = new VoiceEnum("Polly.Hannah-Neural"); public static readonly VoiceEnum PollyHiujinNeural = new VoiceEnum("Polly.Hiujin-Neural"); public static readonly VoiceEnum PollyIdaNeural = new VoiceEnum("Polly.Ida-Neural"); public static readonly VoiceEnum PollyInesNeural = new VoiceEnum("Polly.Ines-Neural"); + public static readonly VoiceEnum PollyIsabelleNeural = new VoiceEnum("Polly.Isabelle-Neural"); public static readonly VoiceEnum PollyIvyNeural = new VoiceEnum("Polly.Ivy-Neural"); public static readonly VoiceEnum PollyJoannaNeural = new VoiceEnum("Polly.Joanna-Neural"); public static readonly VoiceEnum PollyJoeyNeural = new VoiceEnum("Polly.Joey-Neural"); @@ -502,6 +522,7 @@ public static implicit operator VoiceEnum(string value) public static readonly VoiceEnum PollyLauraNeural = new VoiceEnum("Polly.Laura-Neural"); public static readonly VoiceEnum PollyLeaNeural = new VoiceEnum("Polly.Lea-Neural"); public static readonly VoiceEnum PollyLiamNeural = new VoiceEnum("Polly.Liam-Neural"); + public static readonly VoiceEnum PollyLisaNeural = new VoiceEnum("Polly.Lisa-Neural"); public static readonly VoiceEnum PollyLuciaNeural = new VoiceEnum("Polly.Lucia-Neural"); public static readonly VoiceEnum PollyLupeNeural = new VoiceEnum("Polly.Lupe-Neural"); public static readonly VoiceEnum PollyMatthewNeural = new VoiceEnum("Polly.Matthew-Neural"); @@ -521,6 +542,7 @@ public static implicit operator VoiceEnum(string value) public static readonly VoiceEnum PollyThiagoNeural = new VoiceEnum("Polly.Thiago-Neural"); public static readonly VoiceEnum PollyVickiNeural = new VoiceEnum("Polly.Vicki-Neural"); public static readonly VoiceEnum PollyVitoriaNeural = new VoiceEnum("Polly.Vitoria-Neural"); + public static readonly VoiceEnum PollyZaydNeural = new VoiceEnum("Polly.Zayd-Neural"); public static readonly VoiceEnum PollyZhiyuNeural = new VoiceEnum("Polly.Zhiyu-Neural"); } @@ -534,6 +556,8 @@ public static implicit operator LanguageEnum(string value) } public static readonly LanguageEnum AfZa = new LanguageEnum("af-ZA"); + public static readonly LanguageEnum AmEt = new LanguageEnum("am-ET"); + public static readonly LanguageEnum ArAe = new LanguageEnum("ar-AE"); public static readonly LanguageEnum ArXa = new LanguageEnum("ar-XA"); public static readonly LanguageEnum Arb = new LanguageEnum("arb"); public static readonly LanguageEnum BgBg = new LanguageEnum("bg-BG"); @@ -562,6 +586,7 @@ public static implicit operator LanguageEnum(string value) public static readonly LanguageEnum FilPh = new LanguageEnum("fil-PH"); public static readonly LanguageEnum FrCa = new LanguageEnum("fr-CA"); public static readonly LanguageEnum FrFr = new LanguageEnum("fr-FR"); + public static readonly LanguageEnum FrBe = new LanguageEnum("fr-BE"); public static readonly LanguageEnum GuIn = new LanguageEnum("gu-IN"); public static readonly LanguageEnum HeIl = new LanguageEnum("he-IL"); public static readonly LanguageEnum HiIn = new LanguageEnum("hi-IN");