diff --git a/CHANGES.md b/CHANGES.md index 595fb6b8e..769e0ee4b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,71 @@ twilio-csharp Changelog ======================= +[2024-02-09] Version 6.18.0 +--------------------------- +**Library - Chore** +- [PR #718](https://github.com/twilio/twilio-csharp/pull/718): added code-signing-workflow. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! +- [PR #719](https://github.com/twilio/twilio-csharp/pull/719): disable cluster test. Thanks to [@sbansla](https://github.com/sbansla)! +- [PR #717](https://github.com/twilio/twilio-csharp/pull/717): setup java17 in test workflow. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Api** +- Updated service base url for connect apps and authorized connect apps APIs **(breaking change)** +- Update documentation to reflect RiskCheck GA +- Added optional parameter `CallToken` for create participant api + +**Events** +- Marked as GA + +**Flex** +- Adding `flex_instance_sid` to Flex Configuration +- Adding `provisioning_status` for Email Manager +- Adding `offline_config` to Flex Configuration + +**Insights** +- add flag to restrict access to unapid customers +- decommission voice-qualitystats-endpoint role + +**Intelligence** +- Add text-generation operator (for example conversation summary) results to existing OperatorResults collection. + +**Lookups** +- Remove `carrier` field from `sms_pumping_risk` and leave `carrier_risk_category` **(breaking change)** +- Remove carrier information from call forwarding package **(breaking change)** + +**Messaging** +- Add update instance endpoints to us_app_to_person api +- Add tollfree edit_allowed and edit_reason fields +- Update Phone Number, Short Code, Alpha Sender, US A2P and Channel Sender documentation +- Add DELETE support to Tollfree Verification resource + +**Numbers** +- Add Get Port In request api + +**Push** +- Migrated to new Push API V4 with Resilient Notification Delivery. + +**Serverless** +- Add node18 as a valid Build runtime + +**Taskrouter** +- Add `jitter_buffer_size` param in update reservation +- Add container attribute to task_queue_bulk_real_time_statistics endpoint +- Remove beta_feature check on task_queue_bulk_real_time_statistics endpoint + +**Trusthub** +- Add optional field NotificationEmail to the POST /v1/ComplianceInquiries/Customers/Initialize API +- Add additional optional fields in compliance_tollfree_inquiry.json +- Rename did to tollfree_phone_number in compliance_tollfree_inquiry.json +- Add new optional field notification_email to compliance_tollfree_inquiry.json + +**Verify** +- `Tags` property added again to Public Docs **(breaking change)** +- Remove `Tags` from Public Docs **(breaking change)** +- Add `VerifyEventSubscriptionEnabled` parameter to service create and update endpoints. +- Add `Tags` optional parameter on Verification creation. +- Update Verify TOTP maturity to GA. + + [2024-01-25] Version 6.17.0 --------------------------- **Oauth** diff --git a/src/Twilio/Properties/AssemblyInfo.cs b/src/Twilio/Properties/AssemblyInfo.cs index 8f9a7e693..6ded43e09 100644 --- a/src/Twilio/Properties/AssemblyInfo.cs +++ b/src/Twilio/Properties/AssemblyInfo.cs @@ -10,5 +10,5 @@ internal class AssemblyInfomation { - public const string AssemblyInformationalVersion = "6.17.0"; + public const string AssemblyInformationalVersion = "6.18.0"; } 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/Conference/ParticipantOptions.cs b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.cs index e5ab0b798..854462057 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.cs @@ -175,6 +175,9 @@ public class CreateParticipantOptions : IOptions /// Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. public string Trim { get; set; } + /// A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. + public string CallToken { get; set; } + /// Construct a new CreateParticipantOptions /// The SID of the participant's conference. @@ -385,6 +388,10 @@ public List> GetParams() { p.Add(new KeyValuePair("Trim", Trim)); } + if (CallToken != null) + { + p.Add(new KeyValuePair("CallToken", CallToken)); + } return p; } diff --git a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs index 69baaa081..42a3abf4b 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs @@ -145,6 +145,7 @@ public static async System.Threading.Tasks.Task CreateAsync /// The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. /// The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. /// Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + /// A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. /// Client to make requests to Twilio /// A single instance of Participant public static ParticipantResource Create( @@ -197,9 +198,10 @@ public static ParticipantResource Create( Uri amdStatusCallback = null, Twilio.Http.HttpMethod amdStatusCallbackMethod = null, string trim = null, + string callToken = null, ITwilioRestClient client = null) { - var options = new CreateParticipantOptions(pathConferenceSid, from, to){ PathAccountSid = pathAccountSid, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Label = label, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, Region = region, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, ConferenceRecordingStatusCallbackEvent = conferenceRecordingStatusCallbackEvent, Coaching = coaching, CallSidToCoach = callSidToCoach, JitterBufferSize = jitterBufferSize, Byoc = byoc, CallerId = callerId, CallReason = callReason, RecordingTrack = recordingTrack, TimeLimit = timeLimit, MachineDetection = machineDetection, MachineDetectionTimeout = machineDetectionTimeout, MachineDetectionSpeechThreshold = machineDetectionSpeechThreshold, MachineDetectionSpeechEndThreshold = machineDetectionSpeechEndThreshold, MachineDetectionSilenceTimeout = machineDetectionSilenceTimeout, AmdStatusCallback = amdStatusCallback, AmdStatusCallbackMethod = amdStatusCallbackMethod, Trim = trim }; + var options = new CreateParticipantOptions(pathConferenceSid, from, to){ PathAccountSid = pathAccountSid, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Label = label, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, Region = region, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, ConferenceRecordingStatusCallbackEvent = conferenceRecordingStatusCallbackEvent, Coaching = coaching, CallSidToCoach = callSidToCoach, JitterBufferSize = jitterBufferSize, Byoc = byoc, CallerId = callerId, CallReason = callReason, RecordingTrack = recordingTrack, TimeLimit = timeLimit, MachineDetection = machineDetection, MachineDetectionTimeout = machineDetectionTimeout, MachineDetectionSpeechThreshold = machineDetectionSpeechThreshold, MachineDetectionSpeechEndThreshold = machineDetectionSpeechEndThreshold, MachineDetectionSilenceTimeout = machineDetectionSilenceTimeout, AmdStatusCallback = amdStatusCallback, AmdStatusCallbackMethod = amdStatusCallbackMethod, Trim = trim, CallToken = callToken }; return Create(options, client); } @@ -254,6 +256,7 @@ public static ParticipantResource Create( /// The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. /// The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. /// Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + /// A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant public static async System.Threading.Tasks.Task CreateAsync( @@ -306,9 +309,10 @@ public static async System.Threading.Tasks.Task CreateAsync Uri amdStatusCallback = null, Twilio.Http.HttpMethod amdStatusCallbackMethod = null, string trim = null, + string callToken = null, ITwilioRestClient client = null) { - var options = new CreateParticipantOptions(pathConferenceSid, from, to){ PathAccountSid = pathAccountSid, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Label = label, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, Region = region, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, ConferenceRecordingStatusCallbackEvent = conferenceRecordingStatusCallbackEvent, Coaching = coaching, CallSidToCoach = callSidToCoach, JitterBufferSize = jitterBufferSize, Byoc = byoc, CallerId = callerId, CallReason = callReason, RecordingTrack = recordingTrack, TimeLimit = timeLimit, MachineDetection = machineDetection, MachineDetectionTimeout = machineDetectionTimeout, MachineDetectionSpeechThreshold = machineDetectionSpeechThreshold, MachineDetectionSpeechEndThreshold = machineDetectionSpeechEndThreshold, MachineDetectionSilenceTimeout = machineDetectionSilenceTimeout, AmdStatusCallback = amdStatusCallback, AmdStatusCallbackMethod = amdStatusCallbackMethod, Trim = trim }; + var options = new CreateParticipantOptions(pathConferenceSid, from, to){ PathAccountSid = pathAccountSid, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Label = label, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, Region = region, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, ConferenceRecordingStatusCallbackEvent = conferenceRecordingStatusCallbackEvent, Coaching = coaching, CallSidToCoach = callSidToCoach, JitterBufferSize = jitterBufferSize, Byoc = byoc, CallerId = callerId, CallReason = callReason, RecordingTrack = recordingTrack, TimeLimit = timeLimit, MachineDetection = machineDetection, MachineDetectionTimeout = machineDetectionTimeout, MachineDetectionSpeechThreshold = machineDetectionSpeechThreshold, MachineDetectionSpeechEndThreshold = machineDetectionSpeechEndThreshold, MachineDetectionSilenceTimeout = machineDetectionSilenceTimeout, AmdStatusCallback = amdStatusCallback, AmdStatusCallbackMethod = amdStatusCallbackMethod, Trim = trim, CallToken = callToken }; return await CreateAsync(options, client); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/MessageOptions.cs b/src/Twilio/Rest/Api/V2010/Account/MessageOptions.cs index 431bcc8b9..e07b06dae 100644 --- a/src/Twilio/Rest/Api/V2010/Account/MessageOptions.cs +++ b/src/Twilio/Rest/Api/V2010/Account/MessageOptions.cs @@ -67,7 +67,7 @@ public class CreateMessageOptions : IOptions /// Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). public List PersistentAction { get; set; } - /// For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/how-to-configure-link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. + /// For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. public bool? ShortenUrls { get; set; } @@ -85,7 +85,7 @@ public class CreateMessageOptions : IOptions public MessageResource.RiskCheckEnum RiskCheck { get; set; } - /// The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/docs/sms/api/short-code), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. + /// The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. public Types.PhoneNumber From { get; set; } /// The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. @@ -94,7 +94,7 @@ public class CreateMessageOptions : IOptions /// The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). public string Body { get; set; } - /// The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. + /// The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. public List MediaUrl { get; set; } /// For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). diff --git a/src/Twilio/Rest/Api/V2010/Account/MessageResource.cs b/src/Twilio/Rest/Api/V2010/Account/MessageResource.cs index 4e6b51d33..ab26d9bd8 100644 --- a/src/Twilio/Rest/Api/V2010/Account/MessageResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/MessageResource.cs @@ -176,10 +176,10 @@ public static async System.Threading.Tasks.Task CreateAsync(Cre /// Send a message /// The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`. /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) creating the Message resource. - /// The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/docs/sms/api/short-code), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. + /// The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. /// The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. /// The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). - /// The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. + /// The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. /// For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). /// The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). /// The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). If this parameter is provided, the `status_callback` parameter of this request is ignored; [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. @@ -192,7 +192,7 @@ public static async System.Threading.Tasks.Task CreateAsync(Cre /// /// Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. /// Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). - /// For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/how-to-configure-link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. + /// For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. /// /// The time that Twilio will send the message. Must be in ISO 8601 format. /// If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. @@ -235,10 +235,10 @@ public static MessageResource Create( /// Send a message /// The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`. /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) creating the Message resource. - /// The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/docs/sms/api/short-code), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. + /// The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. /// The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. /// The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). - /// The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. + /// The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. /// For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). /// The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). /// The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). If this parameter is provided, the `status_callback` parameter of this request is ignored; [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. @@ -251,7 +251,7 @@ public static MessageResource Create( /// /// Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. /// Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). - /// For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/how-to-configure-link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. + /// For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. /// /// The time that Twilio will send the message. Must be in ISO 8601 format. /// If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. @@ -707,7 +707,7 @@ public static string ToJson(object model) [JsonProperty("direction")] public MessageResource.DirectionEnum Direction { get; private set; } - /// The sender's phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/docs/sms/api/short-code), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). For incoming messages, this is the number or channel address of the sender. For outgoing messages, this value is a Twilio phone number, alphanumeric sender ID, short code, or channel address from which the message is sent. + /// The sender's phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). For incoming messages, this is the number or channel address of the sender. For outgoing messages, this value is a Twilio phone number, alphanumeric sender ID, short code, or channel address from which the message is sent. [JsonProperty("from")] [JsonConverter(typeof(PhoneNumberConverter))] public Types.PhoneNumber From { get; private set; } diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsOptions.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsOptions.cs deleted file mode 100644 index f9363ca0a..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsOptions.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - /// fetch - public class FetchDefaultsOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - public string PathAssistantSid { get; } - - - - /// Construct a new FetchDefaultsOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - public FetchDefaultsOptions(string pathAssistantSid) - { - PathAssistantSid = pathAssistantSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// update - public class UpdateDefaultsOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - public string PathAssistantSid { get; } - - /// A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. - public object Defaults { get; set; } - - - - /// Construct a new UpdateDefaultsOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - public UpdateDefaultsOptions(string pathAssistantSid) - { - PathAssistantSid = pathAssistantSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (Defaults != null) - { - p.Add(new KeyValuePair("Defaults", Serializers.JsonObject(Defaults))); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsResource.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsResource.cs deleted file mode 100644 index 3420b0167..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsResource.cs +++ /dev/null @@ -1,231 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - public class DefaultsResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchDefaultsOptions options, ITwilioRestClient client) - { - - string path = "/v1/Assistants/{AssistantSid}/Defaults"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Autopilot, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// fetch - /// Fetch Defaults parameters - /// Client to make requests to Twilio - /// A single instance of Defaults - public static DefaultsResource Fetch(FetchDefaultsOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// fetch - /// Fetch Defaults parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Defaults - public static async System.Threading.Tasks.Task FetchAsync(FetchDefaultsOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// fetch - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// Client to make requests to Twilio - /// A single instance of Defaults - public static DefaultsResource Fetch( - string pathAssistantSid, - ITwilioRestClient client = null) - { - var options = new FetchDefaultsOptions(pathAssistantSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// fetch - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Defaults - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, ITwilioRestClient client = null) - { - var options = new FetchDefaultsOptions(pathAssistantSid){ }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildUpdateRequest(UpdateDefaultsOptions options, ITwilioRestClient client) - { - - string path = "/v1/Assistants/{AssistantSid}/Defaults"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Autopilot, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// update - /// Update Defaults parameters - /// Client to make requests to Twilio - /// A single instance of Defaults - public static DefaultsResource Update(UpdateDefaultsOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - - /// update - /// Update Defaults parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Defaults - #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateDefaultsOptions 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 [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. - /// Client to make requests to Twilio - /// A single instance of Defaults - public static DefaultsResource Update( - string pathAssistantSid, - object defaults = null, - ITwilioRestClient client = null) - { - var options = new UpdateDefaultsOptions(pathAssistantSid){ Defaults = defaults }; - return Update(options, client); - } - - #if !NET35 - /// update - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Defaults - public static async System.Threading.Tasks.Task UpdateAsync( - string pathAssistantSid, - object defaults = null, - ITwilioRestClient client = null) - { - var options = new UpdateDefaultsOptions(pathAssistantSid){ Defaults = defaults }; - return await UpdateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a DefaultsResource object - /// - /// Raw JSON string - /// DefaultsResource object represented by the provided JSON - public static DefaultsResource 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 SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Defaults resource. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The absolute URL of the Defaults resource. - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// The JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. - [JsonProperty("data")] - public object Data { get; private set; } - - - - private DefaultsResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/DialogueOptions.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/DialogueOptions.cs deleted file mode 100644 index 7aa41e47f..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/DialogueOptions.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - /// fetch - public class FetchDialogueOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the Dialogue resource to fetch. - public string PathSid { get; } - - - - /// Construct a new FetchDialogueOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the Dialogue resource to fetch. - 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/Autopilot/V1/Assistant/DialogueResource.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/DialogueResource.cs deleted file mode 100644 index fea7f9fba..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/DialogueResource.cs +++ /dev/null @@ -1,168 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - public class DialogueResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchDialogueOptions options, ITwilioRestClient client) - { - - string path = "/v1/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.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the Dialogue resource to 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the Dialogue resource to 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 SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Dialogue resource. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The unique string that we created to identify the Dialogue resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// The JSON string that describes the dialogue session object. - [JsonProperty("data")] - public object Data { get; private set; } - - /// The absolute URL of the Dialogue resource. - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private DialogueResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueOptions.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueOptions.cs deleted file mode 100644 index 6b05f9f7d..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueOptions.cs +++ /dev/null @@ -1,210 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant.FieldType -{ - - /// create - public class CreateFieldValueOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the new resource. - public string PathAssistantSid { get; } - - /// The SID of the Field Type associated with the Field Value. - public string PathFieldTypeSid { get; } - - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - public string Language { get; } - - /// The Field Value data. - public string Value { get; } - - /// The string value that indicates which word the field value is a synonym of. - public string SynonymOf { get; set; } - - - /// Construct a new CreateFieldValueOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the new resource. - /// The SID of the Field Type associated with the Field Value. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - /// The Field Value data. - 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 - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resources to delete. - public string PathAssistantSid { get; } - - /// The SID of the Field Type associated with the Field Value to delete. - public string PathFieldTypeSid { get; } - - /// The Twilio-provided string that uniquely identifies the FieldValue resource to delete. - public string PathSid { get; } - - - - /// Construct a new DeleteFieldValueOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resources to delete. - /// The SID of the Field Type associated with the Field Value to delete. - /// The Twilio-provided string that uniquely identifies the FieldValue resource to delete. - 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 - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resource to fetch. - public string PathAssistantSid { get; } - - /// The SID of the Field Type associated with the Field Value to fetch. - public string PathFieldTypeSid { get; } - - /// The Twilio-provided string that uniquely identifies the FieldValue resource to fetch. - public string PathSid { get; } - - - - /// Construct a new FetchFieldValueOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resource to fetch. - /// The SID of the Field Type associated with the Field Value to fetch. - /// The Twilio-provided string that uniquely identifies the FieldValue resource to fetch. - 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 - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resources to read. - public string PathAssistantSid { get; } - - /// The SID of the Field Type associated with the Field Value to read. - public string PathFieldTypeSid { get; } - - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - public string Language { get; set; } - - - - /// Construct a new ListFieldValueOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resources to read. - /// The SID of the Field Type associated with the Field Value to read. - 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/Autopilot/V1/Assistant/FieldType/FieldValueResource.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueResource.cs deleted file mode 100644 index e46031b52..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueResource.cs +++ /dev/null @@ -1,491 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant.FieldType -{ - public class FieldValueResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateFieldValueOptions options, ITwilioRestClient client) - { - - string path = "/v1/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.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the new resource. - /// The SID of the Field Type associated with the Field Value. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - /// The Field Value data. - /// The string value that indicates which word the field value is a synonym of. - /// 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the new resource. - /// The SID of the Field Type associated with the Field Value. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - /// The Field Value data. - /// The string value that indicates which word the field value is a synonym of. - /// 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 = "/v1/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.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resources to delete. - /// The SID of the Field Type associated with the Field Value to delete. - /// The Twilio-provided string that uniquely identifies the FieldValue resource to 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resources to delete. - /// The SID of the Field Type associated with the Field Value to delete. - /// The Twilio-provided string that uniquely identifies the FieldValue resource to 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 = "/v1/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.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resource to fetch. - /// The SID of the Field Type associated with the Field Value to fetch. - /// The Twilio-provided string that uniquely identifies the FieldValue resource to 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resource to fetch. - /// The SID of the Field Type associated with the Field Value to fetch. - /// The Twilio-provided string that uniquely identifies the FieldValue resource to 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 = "/v1/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.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resources to read. - /// The SID of the Field Type associated with the Field Value to read. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resources to read. - /// The SID of the Field Type associated with the Field Value to read. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `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 SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the FieldValue resource. - [JsonProperty("account_sid")] - public string AccountSid { 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; } - - /// The date and time in GMT when 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 SID of the Field Type associated with the Field Value. - [JsonProperty("field_type_sid")] - public string FieldTypeSid { get; private set; } - - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - [JsonProperty("language")] - public string Language { get; private set; } - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resource. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The unique string that we created to identify the FieldValue resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// The Field Value data. - [JsonProperty("value")] - public string Value { get; private set; } - - /// The absolute URL of the FieldValue resource. - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// The word for which the field value is a synonym of. - [JsonProperty("synonym_of")] - public string SynonymOf { get; private set; } - - - - private FieldValueResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeOptions.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeOptions.cs deleted file mode 100644 index 99cdd13ee..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeOptions.cs +++ /dev/null @@ -1,223 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - - /// create - public class CreateFieldTypeOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - public string PathAssistantSid { get; } - - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - public string UniqueName { get; } - - /// A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - public string FriendlyName { get; set; } - - - /// Construct a new CreateFieldTypeOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - 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 - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the FieldType resource to delete. - public string PathSid { get; } - - - - /// Construct a new DeleteFieldTypeOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the FieldType resource to delete. - 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 - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the FieldType resource to fetch. - public string PathSid { get; } - - - - /// Construct a new FetchFieldTypeOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the FieldType resource to fetch. - 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 - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - public string PathAssistantSid { get; } - - - - /// Construct a new ListFieldTypeOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - 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 - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the to update. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the FieldType resource to update. - public string PathSid { get; } - - /// A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - public string FriendlyName { get; set; } - - /// An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - public string UniqueName { get; set; } - - - - /// Construct a new UpdateFieldTypeOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the to update. - /// The Twilio-provided string that uniquely identifies the FieldType resource to update. - 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/Autopilot/V1/Assistant/FieldTypeResource.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeResource.cs deleted file mode 100644 index b3eb8b84f..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeResource.cs +++ /dev/null @@ -1,540 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - public class FieldTypeResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateFieldTypeOptions options, ITwilioRestClient client) - { - - string path = "/v1/Assistants/{AssistantSid}/FieldTypes"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - /// A descriptive string that you create to describe the new resource. It is not unique and can be 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - /// A descriptive string that you create to describe the new resource. It is not unique and can be 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 = "/v1/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.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the FieldType resource to 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the FieldType resource to 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 = "/v1/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.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the FieldType resource to 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the FieldType resource to 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 = "/v1/Assistants/{AssistantSid}/FieldTypes"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to 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 = "/v1/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.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the to update. - /// The Twilio-provided string that uniquely identifies the FieldType resource to update. - /// A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - /// An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - /// 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the to update. - /// The Twilio-provided string that uniquely identifies the FieldType resource to update. - /// A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - /// An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - /// 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 SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the FieldType resource. - [JsonProperty("account_sid")] - public string AccountSid { 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; } - - /// The date and time in GMT when 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 string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - [JsonProperty("friendly_name")] - public string FriendlyName { get; private set; } - - /// A list of the URLs of related resources. - [JsonProperty("links")] - public Dictionary Links { get; private set; } - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The unique string that we created to identify the FieldType resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - [JsonProperty("unique_name")] - public string UniqueName { get; private set; } - - /// The absolute URL of the FieldType resource. - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private FieldTypeResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildOptions.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildOptions.cs deleted file mode 100644 index bf5f521fe..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildOptions.cs +++ /dev/null @@ -1,214 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - - /// create - public class CreateModelBuildOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - public string PathAssistantSid { get; } - - /// The URL we should call using a POST method to send status information to your application. - public Uri StatusCallback { get; set; } - - /// An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - public string UniqueName { get; set; } - - - /// Construct a new CreateModelBuildOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - 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 - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the ModelBuild resource to delete. - public string PathSid { get; } - - - - /// Construct a new DeleteModelBuildOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the ModelBuild resource to delete. - 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 - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the ModelBuild resource to fetch. - public string PathSid { get; } - - - - /// Construct a new FetchModelBuildOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the ModelBuild resource to fetch. - 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 - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - public string PathAssistantSid { get; } - - - - /// Construct a new ListModelBuildOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - 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 - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the ModelBuild resource to update. - public string PathSid { get; } - - /// An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - public string UniqueName { get; set; } - - - - /// Construct a new UpdateModelBuildOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// The Twilio-provided string that uniquely identifies the ModelBuild resource to update. - 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/Autopilot/V1/Assistant/ModelBuildResource.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildResource.cs deleted file mode 100644 index 9d5e156c0..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildResource.cs +++ /dev/null @@ -1,556 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.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 = "/v1/Assistants/{AssistantSid}/ModelBuilds"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - /// The URL we should call using a POST method to send status information to your application. - /// An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - /// 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - /// The URL we should call using a POST method to send status information to your application. - /// An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - /// 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 = "/v1/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.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the ModelBuild resource to 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the ModelBuild resource to 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 = "/v1/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.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the ModelBuild resource to 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the ModelBuild resource to 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 = "/v1/Assistants/{AssistantSid}/ModelBuilds"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to 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 = "/v1/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.Autopilot, - 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// The Twilio-provided string that uniquely identifies the ModelBuild resource to update. - /// An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - /// 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 - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// The Twilio-provided string that uniquely identifies the ModelBuild resource to update. - /// An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - /// 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 SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ModelBuild resource. - [JsonProperty("account_sid")] - public string AccountSid { 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; } - - /// The date and time in GMT when 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The unique string that we created to identify the ModelBuild resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - - [JsonProperty("status")] - public ModelBuildResource.StatusEnum Status { get; private set; } - - /// An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. - [JsonProperty("unique_name")] - public string UniqueName { get; private set; } - - /// The absolute URL of the ModelBuild resource. - [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; } - - /// If the `status` for the model build is `failed`, this value is a code to more information about the failure. This value will be null for all other statuses. See [error code dictionary](https://www.twilio.com/docs/api/errors) for a description of the error. - [JsonProperty("error_code")] - public int? ErrorCode { get; private set; } - - - - private ModelBuildResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/QueryOptions.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/QueryOptions.cs deleted file mode 100644 index 28bf950f2..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/QueryOptions.cs +++ /dev/null @@ -1,267 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - - /// create - public class CreateQueryOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - public string PathAssistantSid { get; } - - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new query. For example: `en-US`. - public string Language { get; } - - /// The end-user's natural language input. It can be up to 2048 characters long. - public string Query { get; } - - /// The list of tasks to limit the new query to. Tasks are expressed as a comma-separated list of task `unique_name` values. For example, `task-unique_name-1, task-unique_name-2`. Listing specific tasks is useful to constrain the paths that a user can take. - public string Tasks { get; set; } - - /// The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - public string ModelBuild { get; set; } - - - /// Construct a new CreateQueryOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new query. For example: `en-US`. - /// The end-user's natural language input. 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)); - } - return p; - } - - - - } - /// delete - public class DeleteQueryOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the Query resource to delete. - public string PathSid { get; } - - - - /// Construct a new DeleteQueryOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the Query resource to delete. - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the Query resource to fetch. - public string PathSid { get; } - - - - /// Construct a new FetchQueryOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the Query resource to fetch. - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - public string PathAssistantSid { get; } - - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - public string Language { get; set; } - - /// The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - public string ModelBuild { get; set; } - - /// The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - public string Status { get; set; } - - /// The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - public string DialogueSid { get; set; } - - - - /// Construct a new ListQueryOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - 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 (DialogueSid != null) - { - p.Add(new KeyValuePair("DialogueSid", DialogueSid)); - } - if (PageSize != null) - { - p.Add(new KeyValuePair("PageSize", PageSize.ToString())); - } - return p; - } - - - - } - - /// update - public class UpdateQueryOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the Query resource to update. - public string PathSid { get; } - - /// The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - public string SampleSid { get; set; } - - /// The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` - public string Status { get; set; } - - - - /// Construct a new UpdateQueryOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// The Twilio-provided string that uniquely identifies the Query resource to update. - 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/Autopilot/V1/Assistant/QueryResource.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/QueryResource.cs deleted file mode 100644 index 10ac07dd6..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/QueryResource.cs +++ /dev/null @@ -1,584 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - public class QueryResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateQueryOptions options, ITwilioRestClient client) - { - - string path = "/v1/Assistants/{AssistantSid}/Queries"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new query. For example: `en-US`. - /// The end-user's natural language input. It can be up to 2048 characters long. - /// The list of tasks to limit the new query to. Tasks are expressed as a comma-separated list of task `unique_name` values. For example, `task-unique_name-1, task-unique_name-2`. Listing specific tasks is useful to constrain the paths that a user can take. - /// The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - /// 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, - ITwilioRestClient client = null) - { - var options = new CreateQueryOptions(pathAssistantSid, language, query){ Tasks = tasks, ModelBuild = modelBuild }; - return Create(options, client); - } - - #if !NET35 - /// create - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new query. For example: `en-US`. - /// The end-user's natural language input. It can be up to 2048 characters long. - /// The list of tasks to limit the new query to. Tasks are expressed as a comma-separated list of task `unique_name` values. For example, `task-unique_name-1, task-unique_name-2`. Listing specific tasks is useful to constrain the paths that a user can take. - /// The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - /// 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, - ITwilioRestClient client = null) - { - var options = new CreateQueryOptions(pathAssistantSid, language, query){ Tasks = tasks, ModelBuild = modelBuild }; - 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 = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the Query resource to delete. - /// 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the Query resource to delete. - /// 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 = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the Query resource to fetch. - /// 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the Query resource to fetch. - /// 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 = "/v1/Assistants/{AssistantSid}/Queries"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - /// The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - /// The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - /// The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - /// 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, - string dialogueSid = null, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadQueryOptions(pathAssistantSid){ Language = language, ModelBuild = modelBuild, Status = status, DialogueSid = dialogueSid, PageSize = pageSize, Limit = limit}; - return Read(options, client); - } - - #if !NET35 - /// read - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - /// The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - /// The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - /// The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - /// 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, - string dialogueSid = null, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadQueryOptions(pathAssistantSid){ Language = language, ModelBuild = modelBuild, Status = status, DialogueSid = dialogueSid, 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 = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// The Twilio-provided string that uniquely identifies the Query resource to update. - /// The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - /// The new status of the resource. Can be: `pending-review`, `reviewed`, or `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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// The Twilio-provided string that uniquely identifies the Query resource to update. - /// The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - /// The new status of the resource. Can be: `pending-review`, `reviewed`, or `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 SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Query resource. - [JsonProperty("account_sid")] - public string AccountSid { 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; } - - /// The date and time in GMT when 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 natural language analysis results that include the [Task](https://www.twilio.com/docs/autopilot/api/task) recognized and a list of identified [Fields](https://www.twilio.com/docs/autopilot/api/task-field). - [JsonProperty("results")] - public object Results { get; private set; } - - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query. For example: `en-US`. - [JsonProperty("language")] - public string Language { get; private set; } - - /// The SID of the [Model Build](https://www.twilio.com/docs/autopilot/api/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; } - - /// The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - [JsonProperty("sample_sid")] - public string SampleSid { get; private set; } - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The unique string that we created to identify the Query resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// The status of the Query. Can be: `pending-review`, `reviewed`, or `discarded` - [JsonProperty("status")] - public string Status { get; private set; } - - /// The absolute URL of the Query resource. - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// The communication channel from where the end-user input came. - [JsonProperty("source_channel")] - public string SourceChannel { get; private set; } - - /// The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - [JsonProperty("dialogue_sid")] - public string DialogueSid { get; private set; } - - - - private QueryResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetOptions.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetOptions.cs deleted file mode 100644 index 022a1c5f2..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetOptions.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - /// Returns Style sheet JSON object for the Assistant - public class FetchStyleSheetOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - public string PathAssistantSid { get; } - - - - /// Construct a new FetchStyleSheetOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - 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 `assistant_sid`. - public class UpdateStyleSheetOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - public string PathAssistantSid { get; } - - /// The JSON string that describes the style sheet object. - public object StyleSheet { get; set; } - - - - /// Construct a new UpdateStyleSheetOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - 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/Autopilot/V1/Assistant/StyleSheetResource.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetResource.cs deleted file mode 100644 index f219cf26b..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetResource.cs +++ /dev/null @@ -1,231 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - public class StyleSheetResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchStyleSheetOptions options, ITwilioRestClient client) - { - - string path = "/v1/Assistants/{AssistantSid}/StyleSheet"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Autopilot, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// Returns Style sheet JSON object for the 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 the 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 the Assistant - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// 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 the Assistant - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// 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 = "/v1/Assistants/{AssistantSid}/StyleSheet"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Autopilot, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// Updates the style sheet for an Assistant identified by `assistant_sid`. - /// 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 `assistant_sid`. - /// 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 `assistant_sid`. - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// The JSON string that describes the style sheet object. - /// 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 `assistant_sid`. - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// The JSON string that describes the style sheet object. - /// 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 SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the StyleSheet resource. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The absolute URL of the StyleSheet resource. - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// The JSON string that describes the style sheet object. - [JsonProperty("data")] - public object Data { get; private set; } - - - - private StyleSheetResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldOptions.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldOptions.cs deleted file mode 100644 index 4ef6f7e68..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldOptions.cs +++ /dev/null @@ -1,196 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant.Task -{ - - /// create - public class CreateFieldOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the new resource. - public string PathAssistantSid { get; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the new Field resource. - public string PathTaskSid { get; } - - /// The Field Type of the new field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the `unique_name`, or the `sid` of a custom Field Type. - public string FieldType { get; } - - /// An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - public string UniqueName { get; } - - - /// Construct a new CreateFieldOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the new resource. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the new Field resource. - /// The Field Type of the new field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the `unique_name`, or the `sid` of a custom Field Type. - /// An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to delete. - public string PathAssistantSid { get; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resource to delete. - public string PathTaskSid { get; } - - /// The Twilio-provided string that uniquely identifies the Field resource to delete. - public string PathSid { get; } - - - - /// Construct a new DeleteFieldOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to delete. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resource to delete. - /// The Twilio-provided string that uniquely identifies the Field resource to delete. - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to fetch. - public string PathAssistantSid { get; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resource to fetch. - public string PathTaskSid { get; } - - /// The Twilio-provided string that uniquely identifies the Field resource to fetch. - public string PathSid { get; } - - - - /// Construct a new FetchFieldOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to fetch. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resource to fetch. - /// The Twilio-provided string that uniquely identifies the Field resource to fetch. - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to read. - public string PathAssistantSid { get; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resources to read. - public string PathTaskSid { get; } - - - - /// Construct a new ListFieldOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to read. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resources to read. - 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/Autopilot/V1/Assistant/Task/FieldResource.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldResource.cs deleted file mode 100644 index 7b5d5b4da..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldResource.cs +++ /dev/null @@ -1,479 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant.Task -{ - public class FieldResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateFieldOptions options, ITwilioRestClient client) - { - - string path = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the new resource. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the new Field resource. - /// The Field Type of the new field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the `unique_name`, or the `sid` of a custom Field Type. - /// An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - /// 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the new resource. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the new Field resource. - /// The Field Type of the new field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the `unique_name`, or the `sid` of a custom Field Type. - /// An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - /// 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 = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to delete. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resource to delete. - /// The Twilio-provided string that uniquely identifies the Field resource to delete. - /// 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to delete. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resource to delete. - /// The Twilio-provided string that uniquely identifies the Field resource to delete. - /// 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 = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to fetch. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resource to fetch. - /// The Twilio-provided string that uniquely identifies the Field resource to fetch. - /// 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to fetch. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resource to fetch. - /// The Twilio-provided string that uniquely identifies the Field resource to fetch. - /// 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 = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to read. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resources to 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 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to read. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resources to 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 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 SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Field resource. - [JsonProperty("account_sid")] - public string AccountSid { 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; } - - /// The date and time in GMT when 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 Field Type of the field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the unique_name, or the SID of a custom Field Type. - [JsonProperty("field_type")] - public string FieldType { get; private set; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with this Field. - [JsonProperty("task_sid")] - public string TaskSid { get; private set; } - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The unique string that we created to identify the Field resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - [JsonProperty("unique_name")] - public string UniqueName { get; private set; } - - /// The absolute URL of the Field resource. - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private FieldResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleOptions.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleOptions.cs deleted file mode 100644 index 81acfa8a1..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleOptions.cs +++ /dev/null @@ -1,271 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant.Task -{ - - /// create - public class CreateSampleOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the new resource. - public string PathAssistantSid { get; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to create. - public string PathTaskSid { get; } - - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new sample. For example: `en-US`. - public string Language { get; } - - /// The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - public string TaggedText { get; } - - /// The communication channel from which the new sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - public string SourceChannel { get; set; } - - - /// Construct a new CreateSampleOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the new resource. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to create. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new sample. For example: `en-US`. - /// The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to delete. - public string PathAssistantSid { get; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to delete. - public string PathTaskSid { get; } - - /// The Twilio-provided string that uniquely identifies the Sample resource to delete. - public string PathSid { get; } - - - - /// Construct a new DeleteSampleOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to delete. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to delete. - /// The Twilio-provided string that uniquely identifies the Sample resource to delete. - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to fetch. - public string PathAssistantSid { get; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to create. - public string PathTaskSid { get; } - - /// The Twilio-provided string that uniquely identifies the Sample resource to fetch. - public string PathSid { get; } - - - - /// Construct a new FetchSampleOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to fetch. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to create. - /// The Twilio-provided string that uniquely identifies the Sample resource to fetch. - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to read. - public string PathAssistantSid { get; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resources to read. - public string PathTaskSid { get; } - - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - public string Language { get; set; } - - - - /// Construct a new ListSampleOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to read. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resources to read. - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to update. - public string PathAssistantSid { get; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to update. - public string PathTaskSid { get; } - - /// The Twilio-provided string that uniquely identifies the Sample resource to update. - public string PathSid { get; } - - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - public string Language { get; set; } - - /// The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - public string TaggedText { get; set; } - - /// The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - public string SourceChannel { get; set; } - - - - /// Construct a new UpdateSampleOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to update. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to update. - /// The Twilio-provided string that uniquely identifies the Sample resource to update. - 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/Autopilot/V1/Assistant/Task/SampleResource.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleResource.cs deleted file mode 100644 index 5805ff4c6..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleResource.cs +++ /dev/null @@ -1,583 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant.Task -{ - public class SampleResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateSampleOptions options, ITwilioRestClient client) - { - - string path = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the new resource. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to create. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new sample. For example: `en-US`. - /// The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - /// The communication channel from which the new sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - /// 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the new resource. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to create. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new sample. For example: `en-US`. - /// The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - /// The communication channel from which the new sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - /// 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 = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to delete. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to delete. - /// The Twilio-provided string that uniquely identifies the Sample resource to delete. - /// 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to delete. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to delete. - /// The Twilio-provided string that uniquely identifies the Sample resource to delete. - /// 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 = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to fetch. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to create. - /// The Twilio-provided string that uniquely identifies the Sample resource to fetch. - /// 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to fetch. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to create. - /// The Twilio-provided string that uniquely identifies the Sample resource to fetch. - /// 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 = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to read. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resources to read. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. 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 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to read. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resources to read. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. 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 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 = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to update. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to update. - /// The Twilio-provided string that uniquely identifies the Sample resource to update. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - /// The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - /// The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - /// 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to update. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to update. - /// The Twilio-provided string that uniquely identifies the Sample resource to update. - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - /// The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - /// The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - /// 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 SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Sample resource. - [JsonProperty("account_sid")] - public string AccountSid { 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; } - - /// The date and time in GMT when 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 SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the resource. - [JsonProperty("task_sid")] - public string TaskSid { get; private set; } - - /// The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - [JsonProperty("language")] - public string Language { get; private set; } - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The unique string that we created to identify the Sample resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - [JsonProperty("tagged_text")] - public string TaggedText { get; private set; } - - /// The absolute URL of the Sample resource. - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - [JsonProperty("source_channel")] - public string SourceChannel { get; private set; } - - - - private SampleResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsOptions.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsOptions.cs deleted file mode 100644 index 0ee4d04d6..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsOptions.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant.Task -{ - /// Returns JSON actions for the Task. - public class FetchTaskActionsOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task for which the task actions to fetch were defined. - public string PathAssistantSid { get; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the task actions to fetch were defined. - public string PathTaskSid { get; } - - - - /// Construct a new FetchTaskActionsOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task for which the task actions to fetch were defined. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the task actions to fetch were defined. - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task for which the task actions to update were defined. - public string PathAssistantSid { get; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the task actions to update were defined. - public string PathTaskSid { get; } - - /// The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - public object Actions { get; set; } - - - - /// Construct a new UpdateTaskActionsOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task for which the task actions to update were defined. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the task actions to update were defined. - 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/Autopilot/V1/Assistant/Task/TaskActionsResource.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsResource.cs deleted file mode 100644 index 7a9c074c0..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsResource.cs +++ /dev/null @@ -1,246 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant.Task -{ - public class TaskActionsResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchTaskActionsOptions options, ITwilioRestClient client) - { - - string path = "/v1/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.Autopilot, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// Returns JSON actions for the 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 the 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 the Task. - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task for which the task actions to fetch were defined. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the task actions to fetch were defined. - /// 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 the Task. - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task for which the task actions to fetch were defined. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the task actions to fetch were defined. - /// 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 = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task for which the task actions to update were defined. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the task actions to update were defined. - /// The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task for which the task actions to update were defined. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the task actions to update were defined. - /// The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the 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 SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskActions resource. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the resource. - [JsonProperty("task_sid")] - public string TaskSid { get; private set; } - - /// The absolute URL of the TaskActions resource. - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - [JsonProperty("data")] - public object Data { get; private set; } - - - - private TaskActionsResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsOptions.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsOptions.cs deleted file mode 100644 index a1eadef0f..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsOptions.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant.Task -{ - /// fetch - public class FetchTaskStatisticsOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - public string PathAssistantSid { get; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) that is associated with the resource to fetch. - public string PathTaskSid { get; } - - - - /// Construct a new FetchTaskStatisticsOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) that is associated with the resource to fetch. - 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/Autopilot/V1/Assistant/Task/TaskStatisticsResource.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsResource.cs deleted file mode 100644 index 8e302c095..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsResource.cs +++ /dev/null @@ -1,172 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant.Task -{ - public class TaskStatisticsResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchTaskStatisticsOptions options, ITwilioRestClient client) - { - - string path = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) that is associated with the resource to fetch. - /// 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) that is associated with the resource to fetch. - /// 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 SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskStatistics resource. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the statistics were collected. - [JsonProperty("task_sid")] - public string TaskSid { get; private set; } - - /// The total number of [Samples](https://www.twilio.com/docs/autopilot/api/task-sample) associated with the Task. - [JsonProperty("samples_count")] - public int? SamplesCount { get; private set; } - - /// The total number of [Fields](https://www.twilio.com/docs/autopilot/api/task-field) associated with the Task. - [JsonProperty("fields_count")] - public int? FieldsCount { get; private set; } - - /// The absolute URL of the TaskStatistics resource. - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private TaskStatisticsResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/TaskOptions.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/TaskOptions.cs deleted file mode 100644 index 60afb8517..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/TaskOptions.cs +++ /dev/null @@ -1,251 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - - /// create - public class CreateTaskOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - public string PathAssistantSid { get; } - - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - public string UniqueName { get; } - - /// A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - public string FriendlyName { get; set; } - - /// The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. It is optional and not unique. - public object Actions { get; set; } - - /// The URL from which the Assistant can fetch actions. - public Uri ActionsUrl { get; set; } - - - /// Construct a new CreateTaskOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the Task resource to delete. - public string PathSid { get; } - - - - /// Construct a new DeleteTaskOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the Task resource to delete. - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the Task resource to fetch. - public string PathSid { get; } - - - - /// Construct a new FetchTaskOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the Task resource to fetch. - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - public string PathAssistantSid { get; } - - - - /// Construct a new ListTaskOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the Task resource to update. - public string PathSid { get; } - - /// A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - public string FriendlyName { get; set; } - - /// An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. - public string UniqueName { get; set; } - - /// The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - public object Actions { get; set; } - - /// The URL from which the Assistant can fetch actions. - public Uri ActionsUrl { get; set; } - - - - /// Construct a new UpdateTaskOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// The Twilio-provided string that uniquely identifies the Task resource to update. - 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/Autopilot/V1/Assistant/TaskResource.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/TaskResource.cs deleted file mode 100644 index 625ad7cda..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/TaskResource.cs +++ /dev/null @@ -1,560 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - public class TaskResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateTaskOptions options, ITwilioRestClient client) - { - - string path = "/v1/Assistants/{AssistantSid}/Tasks"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - /// A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - /// The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. It is optional and not unique. - /// The URL from which the Assistant can fetch 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - /// A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - /// The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. It is optional and not unique. - /// The URL from which the Assistant can fetch 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 = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the Task resource to delete. - /// 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the Task resource to delete. - /// 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 = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the Task resource to fetch. - /// 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the Task resource to fetch. - /// 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 = "/v1/Assistants/{AssistantSid}/Tasks"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to 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 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to 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 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 = "/v1/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.Autopilot, - 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// The Twilio-provided string that uniquely identifies the Task resource to update. - /// A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - /// An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. - /// The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - /// The URL from which the Assistant can fetch 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// The Twilio-provided string that uniquely identifies the Task resource to update. - /// A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - /// An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. - /// The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - /// The URL from which the Assistant can fetch 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 SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Task resource. - [JsonProperty("account_sid")] - public string AccountSid { 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; } - - /// The date and time in GMT when 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 string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - [JsonProperty("friendly_name")] - public string FriendlyName { get; private set; } - - /// A list of the URLs of related resources. - [JsonProperty("links")] - public Dictionary Links { get; private set; } - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The unique string that we created to identify the Task resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - [JsonProperty("unique_name")] - public string UniqueName { get; private set; } - - /// The URL from which the Assistant can fetch actions. - [JsonProperty("actions_url")] - public Uri ActionsUrl { get; private set; } - - /// The absolute URL of the Task resource. - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private TaskResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookOptions.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookOptions.cs deleted file mode 100644 index 2f193f078..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookOptions.cs +++ /dev/null @@ -1,255 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - - /// create - public class CreateWebhookOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - public string PathAssistantSid { get; } - - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - public string UniqueName { get; } - - /// The list of space-separated events that this Webhook will subscribe to. - public string Events { get; } - - /// The URL associated with this Webhook. - public Uri WebhookUrl { get; } - - /// The method to be used when calling the webhook's URL. - public string WebhookMethod { get; set; } - - - /// Construct a new CreateWebhookOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - /// The list of space-separated events that this Webhook will subscribe to. - /// The URL associated with this Webhook. - public CreateWebhookOptions(string pathAssistantSid, string uniqueName, string events, Uri webhookUrl) - { - PathAssistantSid = pathAssistantSid; - UniqueName = uniqueName; - Events = events; - WebhookUrl = webhookUrl; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (UniqueName != null) - { - p.Add(new KeyValuePair("UniqueName", UniqueName)); - } - if (Events != null) - { - p.Add(new KeyValuePair("Events", Events)); - } - if (WebhookUrl != null) - { - p.Add(new KeyValuePair("WebhookUrl", Serializers.Url(WebhookUrl))); - } - if (WebhookMethod != null) - { - p.Add(new KeyValuePair("WebhookMethod", WebhookMethod)); - } - return p; - } - - - - } - /// delete - public class DeleteWebhookOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the Webhook resource to delete. - public string PathSid { get; } - - - - /// Construct a new DeleteWebhookOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the Webhook resource to delete. - public DeleteWebhookOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// fetch - public class FetchWebhookOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the Webhook resource to fetch. - public string PathSid { get; } - - - - /// Construct a new FetchWebhookOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the Webhook resource to fetch. - public FetchWebhookOptions(string pathAssistantSid, string pathSid) - { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// read - public class ReadWebhookOptions : ReadOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - public string PathAssistantSid { get; } - - - - /// Construct a new ListWebhookOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - public ReadWebhookOptions(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 UpdateWebhookOptions : IOptions - { - - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - public string PathAssistantSid { get; } - - /// The Twilio-provided string that uniquely identifies the Webhook resource to update. - public string PathSid { get; } - - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - public string UniqueName { get; set; } - - /// The list of space-separated events that this Webhook will subscribe to. - public string Events { get; set; } - - /// The URL associated with this Webhook. - public Uri WebhookUrl { get; set; } - - /// The method to be used when calling the webhook's URL. - public string WebhookMethod { get; set; } - - - - /// Construct a new UpdateWebhookOptions - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// The Twilio-provided string that uniquely identifies the Webhook resource to update. - public UpdateWebhookOptions(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)); - } - if (Events != null) - { - p.Add(new KeyValuePair("Events", Events)); - } - if (WebhookUrl != null) - { - p.Add(new KeyValuePair("WebhookUrl", Serializers.Url(WebhookUrl))); - } - if (WebhookMethod != null) - { - p.Add(new KeyValuePair("WebhookMethod", WebhookMethod)); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookResource.cs b/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookResource.cs deleted file mode 100644 index b5e1b158e..000000000 --- a/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookResource.cs +++ /dev/null @@ -1,560 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1.Assistant -{ - public class WebhookResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateWebhookOptions options, ITwilioRestClient client) - { - - string path = "/v1/Assistants/{AssistantSid}/Webhooks"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Autopilot, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// create - /// Create Webhook parameters - /// Client to make requests to Twilio - /// A single instance of Webhook - public static WebhookResource Create(CreateWebhookOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// create - /// Create Webhook parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task CreateAsync(CreateWebhookOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// create - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - /// The list of space-separated events that this Webhook will subscribe to. - /// The URL associated with this Webhook. - /// The method to be used when calling the webhook's URL. - /// Client to make requests to Twilio - /// A single instance of Webhook - public static WebhookResource Create( - string pathAssistantSid, - string uniqueName, - string events, - Uri webhookUrl, - string webhookMethod = null, - ITwilioRestClient client = null) - { - var options = new CreateWebhookOptions(pathAssistantSid, uniqueName, events, webhookUrl){ WebhookMethod = webhookMethod }; - return Create(options, client); - } - - #if !NET35 - /// create - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the new resource. - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - /// The list of space-separated events that this Webhook will subscribe to. - /// The URL associated with this Webhook. - /// The method to be used when calling the webhook's URL. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task CreateAsync( - string pathAssistantSid, - string uniqueName, - string events, - Uri webhookUrl, - string webhookMethod = null, - ITwilioRestClient client = null) - { - var options = new CreateWebhookOptions(pathAssistantSid, uniqueName, events, webhookUrl){ WebhookMethod = webhookMethod }; - return await CreateAsync(options, client); - } - #endif - - /// delete - /// Delete Webhook parameters - /// Client to make requests to Twilio - /// A single instance of Webhook - private static Request BuildDeleteRequest(DeleteWebhookOptions options, ITwilioRestClient client) - { - - string path = "/v1/Assistants/{AssistantSid}/Webhooks/{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.Autopilot, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// delete - /// Delete Webhook parameters - /// Client to make requests to Twilio - /// A single instance of Webhook - public static bool Delete(DeleteWebhookOptions 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 Webhook parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task DeleteAsync(DeleteWebhookOptions 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the Webhook resource to delete. - /// Client to make requests to Twilio - /// A single instance of Webhook - public static bool Delete(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteWebhookOptions(pathAssistantSid, pathSid) ; - return Delete(options, client); - } - - #if !NET35 - /// delete - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to delete. - /// The Twilio-provided string that uniquely identifies the Webhook resource to delete. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task DeleteAsync(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new DeleteWebhookOptions(pathAssistantSid, pathSid) ; - return await DeleteAsync(options, client); - } - #endif - - private static Request BuildFetchRequest(FetchWebhookOptions options, ITwilioRestClient client) - { - - string path = "/v1/Assistants/{AssistantSid}/Webhooks/{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.Autopilot, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// fetch - /// Fetch Webhook parameters - /// Client to make requests to Twilio - /// A single instance of Webhook - public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// fetch - /// Fetch Webhook parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(FetchWebhookOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// fetch - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the Webhook resource to fetch. - /// Client to make requests to Twilio - /// A single instance of Webhook - public static WebhookResource Fetch( - string pathAssistantSid, - string pathSid, - ITwilioRestClient client = null) - { - var options = new FetchWebhookOptions(pathAssistantSid, pathSid){ }; - return Fetch(options, client); - } - - #if !NET35 - /// fetch - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - /// The Twilio-provided string that uniquely identifies the Webhook resource to fetch. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task FetchAsync(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) - { - var options = new FetchWebhookOptions(pathAssistantSid, pathSid){ }; - return await FetchAsync(options, client); - } - #endif - - private static Request BuildReadRequest(ReadWebhookOptions options, ITwilioRestClient client) - { - - string path = "/v1/Assistants/{AssistantSid}/Webhooks"; - - string PathAssistantSid = options.PathAssistantSid; - path = path.Replace("{"+"AssistantSid"+"}", PathAssistantSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Autopilot, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - /// read - /// Read Webhook parameters - /// Client to make requests to Twilio - /// A single instance of Webhook - public static ResourceSet Read(ReadWebhookOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildReadRequest(options, client)); - var page = Page.FromJson("webhooks", response.Content); - return new ResourceSet(page, options, client); - } - - #if !NET35 - /// read - /// Read Webhook parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task> ReadAsync(ReadWebhookOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildReadRequest(options, client)); - - var page = Page.FromJson("webhooks", response.Content); - return new ResourceSet(page, options, client); - } - #endif - /// read - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to 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 Webhook - public static ResourceSet Read( - string pathAssistantSid, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadWebhookOptions(pathAssistantSid){ PageSize = pageSize, Limit = limit}; - return Read(options, client); - } - - #if !NET35 - /// read - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to 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 Webhook - public static async System.Threading.Tasks.Task> ReadAsync( - string pathAssistantSid, - int? pageSize = null, - long? limit = null, - ITwilioRestClient client = null) - { - var options = new ReadWebhookOptions(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("webhooks", 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("webhooks", 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("webhooks", response.Content); - } - - - private static Request BuildUpdateRequest(UpdateWebhookOptions options, ITwilioRestClient client) - { - - string path = "/v1/Assistants/{AssistantSid}/Webhooks/{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.Autopilot, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// update - /// Update Webhook parameters - /// Client to make requests to Twilio - /// A single instance of Webhook - public static WebhookResource Update(UpdateWebhookOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - - /// update - /// Update Webhook parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Webhook - #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateWebhookOptions 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 [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// The Twilio-provided string that uniquely identifies the Webhook resource to update. - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - /// The list of space-separated events that this Webhook will subscribe to. - /// The URL associated with this Webhook. - /// The method to be used when calling the webhook's URL. - /// Client to make requests to Twilio - /// A single instance of Webhook - public static WebhookResource Update( - string pathAssistantSid, - string pathSid, - string uniqueName = null, - string events = null, - Uri webhookUrl = null, - string webhookMethod = null, - ITwilioRestClient client = null) - { - var options = new UpdateWebhookOptions(pathAssistantSid, pathSid){ UniqueName = uniqueName, Events = events, WebhookUrl = webhookUrl, WebhookMethod = webhookMethod }; - return Update(options, client); - } - - #if !NET35 - /// update - /// The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - /// The Twilio-provided string that uniquely identifies the Webhook resource to update. - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - /// The list of space-separated events that this Webhook will subscribe to. - /// The URL associated with this Webhook. - /// The method to be used when calling the webhook's URL. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Webhook - public static async System.Threading.Tasks.Task UpdateAsync( - string pathAssistantSid, - string pathSid, - string uniqueName = null, - string events = null, - Uri webhookUrl = null, - string webhookMethod = null, - ITwilioRestClient client = null) - { - var options = new UpdateWebhookOptions(pathAssistantSid, pathSid){ UniqueName = uniqueName, Events = events, WebhookUrl = webhookUrl, WebhookMethod = webhookMethod }; - return await UpdateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a WebhookResource object - /// - /// Raw JSON string - /// WebhookResource object represented by the provided JSON - public static WebhookResource 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 absolute URL of the Webhook resource. - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Webhook resource. - [JsonProperty("account_sid")] - public string AccountSid { 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; } - - /// The date and time in GMT when 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 SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - [JsonProperty("assistant_sid")] - public string AssistantSid { get; private set; } - - /// The unique string that we created to identify the Webhook resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - [JsonProperty("unique_name")] - public string UniqueName { get; private set; } - - /// The list of space-separated events that this Webhook is subscribed to. - [JsonProperty("events")] - public string Events { get; private set; } - - /// The URL associated with this Webhook. - [JsonProperty("webhook_url")] - public Uri WebhookUrl { get; private set; } - - /// The method used when calling the webhook's URL. - [JsonProperty("webhook_method")] - public string WebhookMethod { get; private set; } - - - - private WebhookResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Autopilot/V1/AssistantOptions.cs b/src/Twilio/Rest/Autopilot/V1/AssistantOptions.cs deleted file mode 100644 index 4aaea3ebd..000000000 --- a/src/Twilio/Rest/Autopilot/V1/AssistantOptions.cs +++ /dev/null @@ -1,265 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1 -{ - - /// create - public class CreateAssistantOptions : IOptions - { - - /// A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - public string FriendlyName { get; set; } - - /// Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - public bool? LogQueries { get; set; } - - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - public string UniqueName { get; set; } - - /// Reserved. - public Uri CallbackUrl { get; set; } - - /// Reserved. - public string CallbackEvents { get; set; } - - /// The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - public object StyleSheet { get; set; } - - /// A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - public object Defaults { 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 (StyleSheet != null) - { - p.Add(new KeyValuePair("StyleSheet", Serializers.JsonObject(StyleSheet))); - } - if (Defaults != null) - { - p.Add(new KeyValuePair("Defaults", Serializers.JsonObject(Defaults))); - } - return p; - } - - - - } - /// delete - public class DeleteAssistantOptions : IOptions - { - - /// The Twilio-provided string that uniquely identifies the Assistant resource to delete. - public string PathSid { get; } - - - - /// Construct a new DeleteAssistantOptions - /// The Twilio-provided string that uniquely identifies the Assistant resource to delete. - public DeleteAssistantOptions(string pathSid) - { - PathSid = pathSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - - /// fetch - public class FetchAssistantOptions : IOptions - { - - /// The Twilio-provided string that uniquely identifies the Assistant resource to fetch. - public string PathSid { get; } - - - - /// Construct a new FetchAssistantOptions - /// The Twilio-provided string that uniquely identifies the Assistant resource to fetch. - 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 - { - - /// The Twilio-provided string that uniquely identifies the Assistant resource to update. - public string PathSid { get; } - - /// A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - public string FriendlyName { get; set; } - - /// Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - public bool? LogQueries { get; set; } - - /// An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - public string UniqueName { get; set; } - - /// Reserved. - public Uri CallbackUrl { get; set; } - - /// Reserved. - public string CallbackEvents { get; set; } - - /// The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - public object StyleSheet { get; set; } - - /// A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - public object Defaults { get; set; } - - /// A string describing the state of the assistant. - public string DevelopmentStage { get; set; } - - - - /// Construct a new UpdateAssistantOptions - /// The Twilio-provided string that uniquely identifies the Assistant resource to update. - 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 (StyleSheet != null) - { - p.Add(new KeyValuePair("StyleSheet", Serializers.JsonObject(StyleSheet))); - } - if (Defaults != null) - { - p.Add(new KeyValuePair("Defaults", Serializers.JsonObject(Defaults))); - } - if (DevelopmentStage != null) - { - p.Add(new KeyValuePair("DevelopmentStage", DevelopmentStage)); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Autopilot/V1/AssistantResource.cs b/src/Twilio/Rest/Autopilot/V1/AssistantResource.cs deleted file mode 100644 index 832e1f01c..000000000 --- a/src/Twilio/Rest/Autopilot/V1/AssistantResource.cs +++ /dev/null @@ -1,577 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1 -{ - public class AssistantResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateAssistantOptions options, ITwilioRestClient client) - { - - string path = "/v1/Assistants"; - - - return new Request( - HttpMethod.Post, - Rest.Domain.Autopilot, - 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 descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - /// Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - /// Reserved. - /// Reserved. - /// The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - /// A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - /// 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 styleSheet = null, - object defaults = null, - ITwilioRestClient client = null) - { - var options = new CreateAssistantOptions(){ FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents, StyleSheet = styleSheet, Defaults = defaults }; - return Create(options, client); - } - - #if !NET35 - /// create - /// A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - /// Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - /// An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - /// Reserved. - /// Reserved. - /// The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - /// A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - /// 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 styleSheet = null, - object defaults = null, - ITwilioRestClient client = null) - { - var options = new CreateAssistantOptions(){ FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents, StyleSheet = styleSheet, Defaults = defaults }; - 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 = "/v1/Assistants/{Sid}"; - - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Delete, - Rest.Domain.Autopilot, - 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 - /// The Twilio-provided string that uniquely identifies the Assistant resource to delete. - /// 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 - /// The Twilio-provided string that uniquely identifies the Assistant resource to delete. - /// 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 = "/v1/Assistants/{Sid}"; - - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Get, - Rest.Domain.Autopilot, - 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 - /// The Twilio-provided string that uniquely identifies the Assistant resource to fetch. - /// 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 - /// The Twilio-provided string that uniquely identifies the Assistant resource to fetch. - /// 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 = "/v1/Assistants"; - - - return new Request( - HttpMethod.Get, - Rest.Domain.Autopilot, - 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 = "/v1/Assistants/{Sid}"; - - string PathSid = options.PathSid; - path = path.Replace("{"+"Sid"+"}", PathSid); - - return new Request( - HttpMethod.Post, - Rest.Domain.Autopilot, - 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 - /// The Twilio-provided string that uniquely identifies the Assistant resource to update. - /// A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - /// Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - /// An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - /// Reserved. - /// Reserved. - /// The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - /// A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - /// A string describing the state of 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 styleSheet = null, - object defaults = null, - string developmentStage = null, - ITwilioRestClient client = null) - { - var options = new UpdateAssistantOptions(pathSid){ FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents, StyleSheet = styleSheet, Defaults = defaults, DevelopmentStage = developmentStage }; - return Update(options, client); - } - - #if !NET35 - /// update - /// The Twilio-provided string that uniquely identifies the Assistant resource to update. - /// A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - /// Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - /// An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - /// Reserved. - /// Reserved. - /// The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - /// A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - /// A string describing the state of 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 styleSheet = null, - object defaults = null, - string developmentStage = null, - ITwilioRestClient client = null) - { - var options = new UpdateAssistantOptions(pathSid){ FriendlyName = friendlyName, LogQueries = logQueries, UniqueName = uniqueName, CallbackUrl = callbackUrl, CallbackEvents = callbackEvents, StyleSheet = styleSheet, Defaults = defaults, DevelopmentStage = developmentStage }; - 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 SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Assistant resource. - [JsonProperty("account_sid")] - public string AccountSid { 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; } - - /// The date and time in GMT when 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 string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - [JsonProperty("friendly_name")] - public string FriendlyName { get; private set; } - - /// Reserved. - [JsonProperty("latest_model_build_sid")] - public string LatestModelBuildSid { get; private set; } - - /// A list of the URLs of the Assistant's related resources. - [JsonProperty("links")] - public Dictionary Links { get; private set; } - - /// Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - [JsonProperty("log_queries")] - public bool? LogQueries { get; private set; } - - /// A string describing the state of the assistant. - [JsonProperty("development_stage")] - public string DevelopmentStage { get; private set; } - - /// Whether model needs to be rebuilt. - [JsonProperty("needs_model_build")] - public bool? NeedsModelBuild { get; private set; } - - /// The unique string that we created to identify the Assistant resource. - [JsonProperty("sid")] - public string Sid { get; private set; } - - /// An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. It can be up to 64 characters long. - [JsonProperty("unique_name")] - public string UniqueName { get; private set; } - - /// The absolute URL of the Assistant resource. - [JsonProperty("url")] - public Uri Url { get; private set; } - - /// Reserved. - [JsonProperty("callback_url")] - public Uri CallbackUrl { get; private set; } - - /// Reserved. - [JsonProperty("callback_events")] - public string CallbackEvents { get; private set; } - - - - private AssistantResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Autopilot/V1/RestoreAssistantOptions.cs b/src/Twilio/Rest/Autopilot/V1/RestoreAssistantOptions.cs deleted file mode 100644 index 6896b2c29..000000000 --- a/src/Twilio/Rest/Autopilot/V1/RestoreAssistantOptions.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1 -{ - /// update - public class UpdateRestoreAssistantOptions : IOptions - { - - /// The Twilio-provided string that uniquely identifies the Assistant resource to restore. - public string Assistant { get; } - - - - /// Construct a new UpdateRestoreAssistantOptions - /// The Twilio-provided string that uniquely identifies the Assistant resource to restore. - public UpdateRestoreAssistantOptions(string assistant) - { - Assistant = assistant; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (Assistant != null) - { - p.Add(new KeyValuePair("Assistant", Assistant)); - } - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Autopilot/V1/RestoreAssistantResource.cs b/src/Twilio/Rest/Autopilot/V1/RestoreAssistantResource.cs deleted file mode 100644 index b1df917f8..000000000 --- a/src/Twilio/Rest/Autopilot/V1/RestoreAssistantResource.cs +++ /dev/null @@ -1,192 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Autopilot - * 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.Autopilot.V1 -{ - public class RestoreAssistantResource : Resource - { - - - - - - private static Request BuildUpdateRequest(UpdateRestoreAssistantOptions options, ITwilioRestClient client) - { - - string path = "/v1/Assistants/Restore"; - - - return new Request( - HttpMethod.Post, - Rest.Domain.Autopilot, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// update - /// Update RestoreAssistant parameters - /// Client to make requests to Twilio - /// A single instance of RestoreAssistant - public static RestoreAssistantResource Update(UpdateRestoreAssistantOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - - /// update - /// Update RestoreAssistant parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of RestoreAssistant - #if !NET35 - public static async System.Threading.Tasks.Task UpdateAsync(UpdateRestoreAssistantOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildUpdateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// update - /// The Twilio-provided string that uniquely identifies the Assistant resource to restore. - /// Client to make requests to Twilio - /// A single instance of RestoreAssistant - public static RestoreAssistantResource Update( - string assistant, - ITwilioRestClient client = null) - { - var options = new UpdateRestoreAssistantOptions(assistant){ }; - return Update(options, client); - } - - #if !NET35 - /// update - /// The Twilio-provided string that uniquely identifies the Assistant resource to restore. - /// Client to make requests to Twilio - /// Task that resolves to A single instance of RestoreAssistant - public static async System.Threading.Tasks.Task UpdateAsync( - string assistant, - ITwilioRestClient client = null) - { - var options = new UpdateRestoreAssistantOptions(assistant){ }; - return await UpdateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a RestoreAssistantResource object - /// - /// Raw JSON string - /// RestoreAssistantResource object represented by the provided JSON - public static RestoreAssistantResource 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 SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Assistant resource. - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - - /// The unique string that we created to identify the Assistant resource. - [JsonProperty("sid")] - public string Sid { 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; } - - /// The date and time in GMT when 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; } - - /// An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - [JsonProperty("unique_name")] - public string UniqueName { get; private set; } - - /// The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - [JsonProperty("friendly_name")] - public string FriendlyName { get; private set; } - - /// Whether model needs to be rebuilt. - [JsonProperty("needs_model_build")] - public bool? NeedsModelBuild { get; private set; } - - /// Reserved. - [JsonProperty("latest_model_build_sid")] - public string LatestModelBuildSid { get; private set; } - - /// Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - [JsonProperty("log_queries")] - public bool? LogQueries { get; private set; } - - /// A string describing the state of the assistant. - [JsonProperty("development_stage")] - public string DevelopmentStage { get; private set; } - - /// Reserved. - [JsonProperty("callback_url")] - public Uri CallbackUrl { get; private set; } - - /// Reserved. - [JsonProperty("callback_events")] - public string CallbackEvents { get; private set; } - - - - private RestoreAssistantResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Content/V1/ContentAndApprovalsResource.cs b/src/Twilio/Rest/Content/V1/ContentAndApprovalsResource.cs index 659d0af8e..d47f62901 100644 --- a/src/Twilio/Rest/Content/V1/ContentAndApprovalsResource.cs +++ b/src/Twilio/Rest/Content/V1/ContentAndApprovalsResource.cs @@ -216,7 +216,7 @@ public static string ToJson(object model) [JsonProperty("variables")] public object Variables { get; private set; } - /// The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + /// The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. [JsonProperty("types")] public object Types { get; private set; } diff --git a/src/Twilio/Rest/Content/V1/ContentResource.cs b/src/Twilio/Rest/Content/V1/ContentResource.cs index 290bbe11b..d28720696 100644 --- a/src/Twilio/Rest/Content/V1/ContentResource.cs +++ b/src/Twilio/Rest/Content/V1/ContentResource.cs @@ -349,7 +349,7 @@ public static string ToJson(object model) [JsonProperty("variables")] public object Variables { get; private set; } - /// The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + /// The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. [JsonProperty("types")] public object Types { get; private set; } diff --git a/src/Twilio/Rest/Content/V1/LegacyContentResource.cs b/src/Twilio/Rest/Content/V1/LegacyContentResource.cs index 2655b5a9f..aab6a6ab8 100644 --- a/src/Twilio/Rest/Content/V1/LegacyContentResource.cs +++ b/src/Twilio/Rest/Content/V1/LegacyContentResource.cs @@ -216,7 +216,7 @@ public static string ToJson(object model) [JsonProperty("variables")] public object Variables { get; private set; } - /// The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + /// The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. [JsonProperty("types")] public object Types { get; private set; } 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/Domain.cs b/src/Twilio/Rest/Domain.cs index 0a1763d93..1c418a190 100644 --- a/src/Twilio/Rest/Domain.cs +++ b/src/Twilio/Rest/Domain.cs @@ -24,7 +24,6 @@ public static implicit operator Domain(string value) public static readonly Domain Accounts = new Domain("accounts"); public static readonly Domain Api = new Domain("api"); - public static readonly Domain Autopilot = new Domain("autopilot"); public static readonly Domain Bulkexports = new Domain("bulkexports"); public static readonly Domain Chat = new Domain("chat"); public static readonly Domain Content = new Domain("content"); @@ -42,7 +41,6 @@ public static implicit operator Domain(string value) public static readonly Domain Monitor = new Domain("monitor"); public static readonly Domain Notify = new Domain("notify"); public static readonly Domain Numbers = new Domain("numbers"); - public static readonly Domain Oauth = new Domain("oauth"); public static readonly Domain Preview = new Domain("preview"); public static readonly Domain Pricing = new Domain("pricing"); public static readonly Domain Proxy = new Domain("proxy"); 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/ConfigurationResource.cs b/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs index 0555e08d3..2a034c25f 100644 --- a/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/ConfigurationResource.cs @@ -213,6 +213,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; } @@ -333,6 +337,10 @@ public static string ToJson(object model) [JsonProperty("citrix_voice_vdi")] public object CitrixVoiceVdi { get; private set; } + /// Presence and presence ttl configuration + [JsonProperty("offline_config")] + public object OfflineConfig { get; private set; } + private ConfigurationResource() { diff --git a/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiOptions.cs b/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiOptions.cs new file mode 100644 index 000000000..f5f4d5293 --- /dev/null +++ b/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiOptions.cs @@ -0,0 +1,85 @@ +/* + * 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 new file mode 100644 index 000000000..4c0081aec --- /dev/null +++ b/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiReportInsightsOptions.cs @@ -0,0 +1,85 @@ +/* + * 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 new file mode 100644 index 000000000..e29184cf7 --- /dev/null +++ b/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiReportInsightsResource.cs @@ -0,0 +1,183 @@ +/* + * 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 new file mode 100644 index 000000000..2304cb368 --- /dev/null +++ b/src/Twilio/Rest/FlexApi/V1/InsightsConversationalAiResource.cs @@ -0,0 +1,211 @@ +/* + * 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/Oauth/V1/OauthOptions.cs b/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusOptions.cs similarity index 83% rename from src/Twilio/Rest/Oauth/V1/OauthOptions.cs rename to src/Twilio/Rest/FlexApi/V1/ProvisioningStatusOptions.cs index e5b96962f..fbd631e25 100644 --- a/src/Twilio/Rest/Oauth/V1/OauthOptions.cs +++ b/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusOptions.cs @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Oauth + * Twilio - Flex * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -21,10 +21,10 @@ -namespace Twilio.Rest.Oauth.V1 +namespace Twilio.Rest.FlexApi.V1 { - /// Fetches public JWKs - public class FetchOauthOptions : IOptions + /// fetch + public class FetchProvisioningStatusOptions : IOptions { diff --git a/src/Twilio/Rest/Preview/Understand/Assistant/DialogueResource.cs b/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusResource.cs similarity index 52% rename from src/Twilio/Rest/Preview/Understand/Assistant/DialogueResource.cs rename to src/Twilio/Rest/FlexApi/V1/ProvisioningStatusResource.cs index 49a2f4a4d..9e58f2427 100644 --- a/src/Twilio/Rest/Preview/Understand/Assistant/DialogueResource.cs +++ b/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusResource.cs @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Preview + * Twilio - Flex * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -22,31 +22,42 @@ using Twilio.Converters; using Twilio.Exceptions; using Twilio.Http; +using Twilio.Types; - -namespace Twilio.Rest.Preview.Understand.Assistant +namespace Twilio.Rest.FlexApi.V1 { - public class DialogueResource : Resource + public class ProvisioningStatusResource : 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 Active = new StatusEnum("active"); + public static readonly StatusEnum InProgress = new StatusEnum("in-progress"); + public static readonly StatusEnum NotConfigured = new StatusEnum("not-configured"); + public static readonly StatusEnum Failed = new StatusEnum("failed"); + + } - private static Request BuildFetchRequest(FetchDialogueOptions options, ITwilioRestClient client) + private static Request BuildFetchRequest(FetchProvisioningStatusOptions options, ITwilioRestClient client) { - string path = "/understand/Assistants/{AssistantSid}/Dialogues/{Sid}"; + string path = "/v1/account/provision/status"; - 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, + Rest.Domain.FlexApi, path, queryParams: options.GetParams(), headerParams: null @@ -54,10 +65,10 @@ private static Request BuildFetchRequest(FetchDialogueOptions options, ITwilioRe } /// fetch - /// Fetch Dialogue parameters + /// Fetch ProvisioningStatus parameters /// Client to make requests to Twilio - /// A single instance of Dialogue - public static DialogueResource Fetch(FetchDialogueOptions options, ITwilioRestClient client = null) + /// A single instance of ProvisioningStatus + public static ProvisioningStatusResource Fetch(FetchProvisioningStatusOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); @@ -66,10 +77,10 @@ public static DialogueResource Fetch(FetchDialogueOptions options, ITwilioRestCl #if !NET35 /// fetch - /// Fetch Dialogue parameters + /// Fetch ProvisioningStatus 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, + /// Task that resolves to A single instance of ProvisioningStatus + public static async System.Threading.Tasks.Task FetchAsync(FetchProvisioningStatusOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); @@ -78,42 +89,36 @@ public static async System.Threading.Tasks.Task FetchAsync(Fet } #endif /// fetch - /// - /// /// Client to make requests to Twilio - /// A single instance of Dialogue - public static DialogueResource Fetch( - string pathAssistantSid, - string pathSid, + /// A single instance of ProvisioningStatus + public static ProvisioningStatusResource Fetch( ITwilioRestClient client = null) { - var options = new FetchDialogueOptions(pathAssistantSid, pathSid){ }; + var options = new FetchProvisioningStatusOptions(){ }; 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) + /// Task that resolves to A single instance of ProvisioningStatus + public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null) { - var options = new FetchDialogueOptions(pathAssistantSid, pathSid){ }; + var options = new FetchProvisioningStatusOptions(){ }; return await FetchAsync(options, client); } #endif /// - /// Converts a JSON string into a DialogueResource object + /// Converts a JSON string into a ProvisioningStatusResource object /// /// Raw JSON string - /// DialogueResource object represented by the provided JSON - public static DialogueResource FromJson(string json) + /// ProvisioningStatusResource object represented by the provided JSON + public static ProvisioningStatusResource FromJson(string json) { try { - return JsonConvert.DeserializeObject(json); + return JsonConvert.DeserializeObject(json); } catch (JsonException e) { @@ -138,29 +143,17 @@ public static string ToJson(object model) } - /// 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; } + + [JsonProperty("status")] + public ProvisioningStatusResource.StatusEnum Status { get; private set; } - /// The url + /// The absolute URL of the resource. [JsonProperty("url")] public Uri Url { get; private set; } - private DialogueResource() { + private ProvisioningStatusResource() { } } diff --git a/src/Twilio/Rest/Insights/V1/Call/AnnotationResource.cs b/src/Twilio/Rest/Insights/V1/Call/AnnotationResource.cs index a56f5752e..92be00299 100644 --- a/src/Twilio/Rest/Insights/V1/Call/AnnotationResource.cs +++ b/src/Twilio/Rest/Insights/V1/Call/AnnotationResource.cs @@ -296,7 +296,7 @@ public static string ToJson(object model) [JsonProperty("incident")] public string Incident { get; private set; } - /// The URL of this resource. + /// The url [JsonProperty("url")] public Uri Url { get; private set; } 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/Transcript/OperatorResultResource.cs b/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultResource.cs index 205991cc9..56cadf85f 100644 --- a/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultResource.cs +++ b/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultResource.cs @@ -335,6 +335,10 @@ public static string ToJson(object model) [JsonProperty("extract_results")] public object ExtractResults { get; private set; } + /// Output of a text generation operator for example Conversation Sumamary. + [JsonProperty("text_generation_results")] + public object TextGenerationResults { get; private set; } + /// A 34 character string that uniquely identifies this Transcript. [JsonProperty("transcript_sid")] public string TranscriptSid { 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/Messaging/V1/Service/ChannelSenderResource.cs b/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderResource.cs index dbf9470b7..1ba0ed783 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderResource.cs +++ b/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderResource.cs @@ -296,7 +296,7 @@ public static string ToJson(object model) [JsonProperty("date_updated")] public DateTime? DateUpdated { get; private set; } - /// The url + /// The absolute URL of the ChannelSender resource. [JsonProperty("url")] public Uri Url { get; private set; } 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 178e76559..38e72d27e 100644 --- a/src/Twilio/Rest/Messaging/V1/TollfreeVerificationOptions.cs +++ b/src/Twilio/Rest/Messaging/V1/TollfreeVerificationOptions.cs @@ -227,6 +227,36 @@ public List> GetParams() } + /// delete + public class DeleteTollfreeVerificationOptions : IOptions + { + + /// The unique string to identify Tollfree Verification. + public string PathSid { get; } + + + + /// Construct a new DeleteTollfreeVerificationOptions + /// The unique string to identify Tollfree Verification. + public DeleteTollfreeVerificationOptions(string pathSid) + { + PathSid = pathSid; + } + + + /// Generate the necessary parameters + public List> GetParams() + { + var p = new List>(); + + return p; + } + + + + } + + /// fetch public class FetchTollfreeVerificationOptions : IOptions { @@ -362,6 +392,9 @@ public class UpdateTollfreeVerificationOptions : IOptions The 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'. + public string EditReason { get; set; } + /// Construct a new UpdateTollfreeVerificationOptions @@ -459,6 +492,10 @@ public List> GetParams() { p.Add(new KeyValuePair("BusinessContactPhone", BusinessContactPhone.ToString())); } + if (EditReason != null) + { + p.Add(new KeyValuePair("EditReason", EditReason)); + } return p; } diff --git a/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs b/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs index cab77367d..ba2caee69 100644 --- a/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs +++ b/src/Twilio/Rest/Messaging/V1/TollfreeVerificationResource.cs @@ -219,6 +219,74 @@ public static async System.Threading.Tasks.Task Cr } #endif + /// delete + /// Delete TollfreeVerification parameters + /// Client to make requests to Twilio + /// A single instance of TollfreeVerification + private static Request BuildDeleteRequest(DeleteTollfreeVerificationOptions options, ITwilioRestClient client) + { + + string path = "/v1/Tollfree/Verifications/{Sid}"; + + string PathSid = options.PathSid; + path = path.Replace("{"+"Sid"+"}", PathSid); + + return new Request( + HttpMethod.Delete, + Rest.Domain.Messaging, + path, + queryParams: options.GetParams(), + headerParams: null + ); + } + + /// delete + /// Delete TollfreeVerification parameters + /// Client to make requests to Twilio + /// A single instance of TollfreeVerification + public static bool Delete(DeleteTollfreeVerificationOptions 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 TollfreeVerification parameters + /// Client to make requests to Twilio + /// Task that resolves to A single instance of TollfreeVerification + public static async System.Threading.Tasks.Task DeleteAsync(DeleteTollfreeVerificationOptions 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 string to identify Tollfree Verification. + /// Client to make requests to Twilio + /// A single instance of TollfreeVerification + public static bool Delete(string pathSid, ITwilioRestClient client = null) + { + var options = new DeleteTollfreeVerificationOptions(pathSid) ; + return Delete(options, client); + } + + #if !NET35 + /// delete + /// The unique string to identify Tollfree Verification. + /// Client to make requests to Twilio + /// Task that resolves to A single instance of TollfreeVerification + public static async System.Threading.Tasks.Task DeleteAsync(string pathSid, ITwilioRestClient client = null) + { + var options = new DeleteTollfreeVerificationOptions(pathSid) ; + return await DeleteAsync(options, client); + } + #endif + private static Request BuildFetchRequest(FetchTollfreeVerificationOptions options, ITwilioRestClient client) { @@ -476,6 +544,7 @@ public static async System.Threading.Tasks.Task Up /// 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. + /// 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 public static TollfreeVerificationResource Update( @@ -500,9 +569,10 @@ public static TollfreeVerificationResource Update( string businessContactLastName = null, string businessContactEmail = null, Types.PhoneNumber businessContactPhone = null, + string editReason = null, ITwilioRestClient client = null) { - var options = new UpdateTollfreeVerificationOptions(pathSid){ BusinessName = businessName, BusinessWebsite = businessWebsite, NotificationEmail = notificationEmail, 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 }; + var options = new UpdateTollfreeVerificationOptions(pathSid){ BusinessName = businessName, BusinessWebsite = businessWebsite, NotificationEmail = notificationEmail, 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, EditReason = editReason }; return Update(options, client); } @@ -529,6 +599,7 @@ public static TollfreeVerificationResource Update( /// 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. + /// 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 public static async System.Threading.Tasks.Task UpdateAsync( @@ -553,9 +624,10 @@ public static async System.Threading.Tasks.Task Up string businessContactLastName = null, string businessContactEmail = null, Types.PhoneNumber businessContactPhone = null, + string editReason = null, ITwilioRestClient client = null) { - var options = new UpdateTollfreeVerificationOptions(pathSid){ BusinessName = businessName, BusinessWebsite = businessWebsite, NotificationEmail = notificationEmail, 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 }; + var options = new UpdateTollfreeVerificationOptions(pathSid){ BusinessName = businessName, BusinessWebsite = businessWebsite, NotificationEmail = notificationEmail, 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, EditReason = editReason }; return await UpdateAsync(options, client); } #endif @@ -727,6 +799,10 @@ public static string ToJson(object model) [JsonProperty("edit_expiration")] public DateTime? EditExpiration { get; private set; } + /// If a rejected verification is allowed to be edited/resubmitted. Some rejection reasons allow editing and some do not. + [JsonProperty("edit_allowed")] + public bool? EditAllowed { 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/Preview/Understand/Assistant/DialogueOptions.cs b/src/Twilio/Rest/Numbers/V1/PortingPortInFetchOptions.cs similarity index 55% rename from src/Twilio/Rest/Preview/Understand/Assistant/DialogueOptions.cs rename to src/Twilio/Rest/Numbers/V1/PortingPortInFetchOptions.cs index 797f4c369..99c3c2ea6 100644 --- a/src/Twilio/Rest/Preview/Understand/Assistant/DialogueOptions.cs +++ b/src/Twilio/Rest/Numbers/V1/PortingPortInFetchOptions.cs @@ -4,7 +4,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Preview + * Twilio - Numbers * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -21,27 +21,22 @@ -namespace Twilio.Rest.Preview.Understand.Assistant +namespace Twilio.Rest.Numbers.V1 { - /// fetch - public class FetchDialogueOptions : IOptions + /// Fetch a port in request by SID + public class FetchPortingPortInFetchOptions : IOptions { - - public string PathAssistantSid { get; } - - - public string PathSid { get; } + /// The SID of the Port In request. This is a unique identifier of the port in request. + public string PathPortInRequestSid { get; } - /// Construct a new FetchUnderstandDialogueOptions - /// - /// - public FetchDialogueOptions(string pathAssistantSid, string pathSid) + /// Construct a new FetchPortingPortInFetchOptions + /// The SID of the Port In request. This is a unique identifier of the port in request. + public FetchPortingPortInFetchOptions(string pathPortInRequestSid) { - PathAssistantSid = pathAssistantSid; - PathSid = pathSid; + PathPortInRequestSid = pathPortInRequestSid; } diff --git a/src/Twilio/Rest/Numbers/V1/PortingPortInFetchResource.cs b/src/Twilio/Rest/Numbers/V1/PortingPortInFetchResource.cs new file mode 100644 index 000000000..cf03b8d00 --- /dev/null +++ b/src/Twilio/Rest/Numbers/V1/PortingPortInFetchResource.cs @@ -0,0 +1,183 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Numbers + * 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.Numbers.V1 +{ + public class PortingPortInFetchResource : Resource + { + + + + + + private static Request BuildFetchRequest(FetchPortingPortInFetchOptions options, ITwilioRestClient client) + { + + string path = "/v1/Porting/PortIn/{PortInRequestSid}"; + + string PathPortInRequestSid = options.PathPortInRequestSid; + path = path.Replace("{"+"PortInRequestSid"+"}", PathPortInRequestSid); + + return new Request( + HttpMethod.Get, + Rest.Domain.Numbers, + path, + queryParams: options.GetParams(), + headerParams: null + ); + } + + /// Fetch a port in request by SID + /// Fetch PortingPortInFetch parameters + /// Client to make requests to Twilio + /// A single instance of PortingPortInFetch + public static PortingPortInFetchResource Fetch(FetchPortingPortInFetchOptions options, ITwilioRestClient client = null) + { + client = client ?? TwilioClient.GetRestClient(); + var response = client.Request(BuildFetchRequest(options, client)); + return FromJson(response.Content); + } + + #if !NET35 + /// Fetch a port in request by SID + /// Fetch PortingPortInFetch parameters + /// Client to make requests to Twilio + /// Task that resolves to A single instance of PortingPortInFetch + public static async System.Threading.Tasks.Task FetchAsync(FetchPortingPortInFetchOptions options, + ITwilioRestClient client = null) + { + client = client ?? TwilioClient.GetRestClient(); + var response = await client.RequestAsync(BuildFetchRequest(options, client)); + return FromJson(response.Content); + } + #endif + /// Fetch a port in request by SID + /// The SID of the Port In request. This is a unique identifier of the port in request. + /// Client to make requests to Twilio + /// A single instance of PortingPortInFetch + public static PortingPortInFetchResource Fetch( + string pathPortInRequestSid, + ITwilioRestClient client = null) + { + var options = new FetchPortingPortInFetchOptions(pathPortInRequestSid){ }; + return Fetch(options, client); + } + + #if !NET35 + /// Fetch a port in request by SID + /// The SID of the Port In request. This is a unique identifier of the port in request. + /// Client to make requests to Twilio + /// Task that resolves to A single instance of PortingPortInFetch + public static async System.Threading.Tasks.Task FetchAsync(string pathPortInRequestSid, ITwilioRestClient client = null) + { + var options = new FetchPortingPortInFetchOptions(pathPortInRequestSid){ }; + return await FetchAsync(options, client); + } + #endif + + /// + /// Converts a JSON string into a PortingPortInFetchResource object + /// + /// Raw JSON string + /// PortingPortInFetchResource object represented by the provided JSON + public static PortingPortInFetchResource 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 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; } + + /// The URL of this Port In request + [JsonProperty("url")] + public Uri Url { get; private set; } + + /// The Account SID that the numbers will be added to after they are ported into Twilio. + [JsonProperty("account_sid")] + public string AccountSid { get; private set; } + + /// List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails. + [JsonProperty("notification_emails")] + public List NotificationEmails { get; private set; } + + /// Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation. + [JsonProperty("target_port_in_date")] + public DateTime? TargetPortInDate { get; private set; } + + /// Minimum hour in the future needs to be established with the Ops team for validation. + [JsonProperty("target_port_in_time_range_start")] + public string TargetPortInTimeRangeStart { get; private set; } + + /// Maximum hour in the future needs to be established with the Ops team for validation. + [JsonProperty("target_port_in_time_range_end")] + public string TargetPortInTimeRangeEnd { get; private set; } + + /// The information for the losing carrier. + [JsonProperty("losing_carrier_information")] + public object LosingCarrierInformation { get; private set; } + + /// The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212). + [JsonProperty("phone_numbers")] + public List PhoneNumbers { get; private set; } + + /// The list of documents SID referencing a utility bills + [JsonProperty("documents")] + public List Documents { get; private set; } + + + + private PortingPortInFetchResource() { + + } + } +} + diff --git a/src/Twilio/Rest/Oauth/V1/DeviceCodeOptions.cs b/src/Twilio/Rest/Oauth/V1/DeviceCodeOptions.cs deleted file mode 100644 index 2885aaea1..000000000 --- a/src/Twilio/Rest/Oauth/V1/DeviceCodeOptions.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * 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.Oauth.V1 -{ - - /// Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant - public class CreateDeviceCodeOptions : IOptions - { - - /// A 34 character string that uniquely identifies this OAuth App. - public string ClientSid { get; } - - /// An Array of scopes for authorization request - public List Scopes { get; } - - /// An array of intended audiences for token requests - public List Audiences { get; set; } - - - /// Construct a new CreateDeviceCodeOptions - /// A 34 character string that uniquely identifies this OAuth App. - /// An Array of scopes for authorization request - public CreateDeviceCodeOptions(string clientSid, List scopes) - { - ClientSid = clientSid; - Scopes = scopes; - Audiences = new List(); - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (ClientSid != null) - { - p.Add(new KeyValuePair("ClientSid", ClientSid)); - } - if (Scopes != null) - { - p.AddRange(Scopes.Select(Scopes => new KeyValuePair("Scopes", Scopes))); - } - if (Audiences != null) - { - p.AddRange(Audiences.Select(Audiences => new KeyValuePair("Audiences", Audiences))); - } - return p; - } - - - - } -} - diff --git a/src/Twilio/Rest/Oauth/V1/DeviceCodeResource.cs b/src/Twilio/Rest/Oauth/V1/DeviceCodeResource.cs deleted file mode 100644 index 2e6f6dea7..000000000 --- a/src/Twilio/Rest/Oauth/V1/DeviceCodeResource.cs +++ /dev/null @@ -1,176 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * 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.Oauth.V1 -{ - public class DeviceCodeResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateDeviceCodeOptions options, ITwilioRestClient client) - { - - string path = "/v1/device/code"; - - - return new Request( - HttpMethod.Post, - Rest.Domain.Oauth, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant - /// Create DeviceCode parameters - /// Client to make requests to Twilio - /// A single instance of DeviceCode - public static DeviceCodeResource Create(CreateDeviceCodeOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant - /// Create DeviceCode parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of DeviceCode - public static async System.Threading.Tasks.Task CreateAsync(CreateDeviceCodeOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant - /// A 34 character string that uniquely identifies this OAuth App. - /// An Array of scopes for authorization request - /// An array of intended audiences for token requests - /// Client to make requests to Twilio - /// A single instance of DeviceCode - public static DeviceCodeResource Create( - string clientSid, - List scopes, - List audiences = null, - ITwilioRestClient client = null) - { - var options = new CreateDeviceCodeOptions(clientSid, scopes){ Audiences = audiences }; - return Create(options, client); - } - - #if !NET35 - /// Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant - /// A 34 character string that uniquely identifies this OAuth App. - /// An Array of scopes for authorization request - /// An array of intended audiences for token requests - /// Client to make requests to Twilio - /// Task that resolves to A single instance of DeviceCode - public static async System.Threading.Tasks.Task CreateAsync( - string clientSid, - List scopes, - List audiences = null, - ITwilioRestClient client = null) - { - var options = new CreateDeviceCodeOptions(clientSid, scopes){ Audiences = audiences }; - return await CreateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a DeviceCodeResource object - /// - /// Raw JSON string - /// DeviceCodeResource object represented by the provided JSON - public static DeviceCodeResource 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 device verification code. - [JsonProperty("device_code")] - public string DeviceCode { get; private set; } - - /// The verification code which end user uses to verify authorization request. - [JsonProperty("user_code")] - public string UserCode { get; private set; } - - /// The URI that the end user visits to verify authorization request. - [JsonProperty("verification_uri")] - public string VerificationUri { get; private set; } - - /// The URI with user_code that the end-user alternatively visits to verify authorization request. - [JsonProperty("verification_uri_complete")] - public string VerificationUriComplete { get; private set; } - - /// The expiration time of the device_code and user_code in seconds. - [JsonProperty("expires_in")] - public long? ExpiresIn { get; private set; } - - /// The minimum amount of time in seconds that the client should wait between polling requests to the token endpoint. - [JsonProperty("interval")] - public int? Interval { get; private set; } - - - - private DeviceCodeResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Oauth/V1/OauthResource.cs b/src/Twilio/Rest/Oauth/V1/OauthResource.cs deleted file mode 100644 index 3211e8a12..000000000 --- a/src/Twilio/Rest/Oauth/V1/OauthResource.cs +++ /dev/null @@ -1,146 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * 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.Oauth.V1 -{ - public class OauthResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchOauthOptions options, ITwilioRestClient client) - { - - string path = "/v1/certs"; - - - return new Request( - HttpMethod.Get, - Rest.Domain.Oauth, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// Fetches public JWKs - /// Fetch Oauth parameters - /// Client to make requests to Twilio - /// A single instance of Oauth - public static OauthResource Fetch(FetchOauthOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// Fetches public JWKs - /// Fetch Oauth parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Oauth - public static async System.Threading.Tasks.Task FetchAsync(FetchOauthOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// Fetches public JWKs - /// Client to make requests to Twilio - /// A single instance of Oauth - public static OauthResource Fetch( - ITwilioRestClient client = null) - { - var options = new FetchOauthOptions(){ }; - return Fetch(options, client); - } - - #if !NET35 - /// Fetches public JWKs - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Oauth - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null) - { - var options = new FetchOauthOptions(){ }; - return await FetchAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a OauthResource object - /// - /// Raw JSON string - /// OauthResource object represented by the provided JSON - public static OauthResource 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); - } - } - - - /// A collection of certificates where are signed Twilio-issued tokens. - [JsonProperty("keys")] - public object Keys { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private OauthResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Oauth/V1/OpenidDiscoveryOptions.cs b/src/Twilio/Rest/Oauth/V1/OpenidDiscoveryOptions.cs deleted file mode 100644 index 54e80dcd5..000000000 --- a/src/Twilio/Rest/Oauth/V1/OpenidDiscoveryOptions.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * 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.Oauth.V1 -{ - /// Fetch configuration details about the OpenID Connect Authorization Server - public class FetchOpenidDiscoveryOptions : IOptions - { - - - - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Oauth/V1/OpenidDiscoveryResource.cs b/src/Twilio/Rest/Oauth/V1/OpenidDiscoveryResource.cs deleted file mode 100644 index 16f9076ce..000000000 --- a/src/Twilio/Rest/Oauth/V1/OpenidDiscoveryResource.cs +++ /dev/null @@ -1,190 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * 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.Oauth.V1 -{ - public class OpenidDiscoveryResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchOpenidDiscoveryOptions options, ITwilioRestClient client) - { - - string path = "/v1/.well-known/openid-configuration"; - - - return new Request( - HttpMethod.Get, - Rest.Domain.Oauth, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// Fetch configuration details about the OpenID Connect Authorization Server - /// Fetch OpenidDiscovery parameters - /// Client to make requests to Twilio - /// A single instance of OpenidDiscovery - public static OpenidDiscoveryResource Fetch(FetchOpenidDiscoveryOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// Fetch configuration details about the OpenID Connect Authorization Server - /// Fetch OpenidDiscovery parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of OpenidDiscovery - public static async System.Threading.Tasks.Task FetchAsync(FetchOpenidDiscoveryOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// Fetch configuration details about the OpenID Connect Authorization Server - /// Client to make requests to Twilio - /// A single instance of OpenidDiscovery - public static OpenidDiscoveryResource Fetch( - ITwilioRestClient client = null) - { - var options = new FetchOpenidDiscoveryOptions(){ }; - return Fetch(options, client); - } - - #if !NET35 - /// Fetch configuration details about the OpenID Connect Authorization Server - /// Client to make requests to Twilio - /// Task that resolves to A single instance of OpenidDiscovery - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null) - { - var options = new FetchOpenidDiscoveryOptions(){ }; - return await FetchAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a OpenidDiscoveryResource object - /// - /// Raw JSON string - /// OpenidDiscoveryResource object represented by the provided JSON - public static OpenidDiscoveryResource 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 URL of the party that will create the token and sign it with its private key. - [JsonProperty("issuer")] - public Uri Issuer { get; private set; } - - /// The endpoint that validates all authorization requests. - [JsonProperty("authorization_endpoint")] - public Uri AuthorizationEndpoint { get; private set; } - - /// The endpoint that validates all device code related authorization requests. - [JsonProperty("device_authorization_endpoint")] - public Uri DeviceAuthorizationEndpoint { get; private set; } - - /// The URL of the token endpoint. After a client has received an authorization code, that code is presented to the token endpoint and exchanged for an identity token, an access token, and a refresh token. - [JsonProperty("token_endpoint")] - public Uri TokenEndpoint { get; private set; } - - /// The URL of the user info endpoint, which returns user profile information to a client. Keep in mind that the user info endpoint returns only the information that has been requested. - [JsonProperty("userinfo_endpoint")] - public Uri UserinfoEndpoint { get; private set; } - - /// The endpoint used to revoke access or refresh tokens issued by the authorization server. - [JsonProperty("revocation_endpoint")] - public Uri RevocationEndpoint { get; private set; } - - /// The URL of your JSON Web Key Set. This set is a collection of JSON Web Keys, a standard method for representing cryptographic keys in a JSON structure. - [JsonProperty("jwk_uri")] - public Uri JwkUri { get; private set; } - - /// A collection of response type supported by authorization server. - [JsonProperty("response_type_supported")] - public List ResponseTypeSupported { get; private set; } - - /// A collection of subject by authorization server. - [JsonProperty("subject_type_supported")] - public List SubjectTypeSupported { get; private set; } - - /// A collection of JWS signing algorithms supported by authorization server to sign identity token. - [JsonProperty("id_token_signing_alg_values_supported")] - public List IdTokenSigningAlgValuesSupported { get; private set; } - - /// A collection of scopes supported by authorization server for identity token - [JsonProperty("scopes_supported")] - public List ScopesSupported { get; private set; } - - /// A collection of claims supported by authorization server for identity token - [JsonProperty("claims_supported")] - public List ClaimsSupported { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private OpenidDiscoveryResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Oauth/V1/TokenOptions.cs b/src/Twilio/Rest/Oauth/V1/TokenOptions.cs deleted file mode 100644 index 146153d29..000000000 --- a/src/Twilio/Rest/Oauth/V1/TokenOptions.cs +++ /dev/null @@ -1,110 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * 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.Oauth.V1 -{ - - /// Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant - public class CreateTokenOptions : IOptions - { - - /// Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. - public string GrantType { get; } - - /// A 34 character string that uniquely identifies this OAuth App. - public string ClientSid { get; } - - /// The credential for confidential OAuth App. - public string ClientSecret { get; set; } - - /// JWT token related to the authorization code grant type. - public string Code { get; set; } - - /// A code which is generation cryptographically. - public string CodeVerifier { get; set; } - - /// JWT token related to the device code grant type. - public string DeviceCode { get; set; } - - /// JWT token related to the refresh token grant type. - public string RefreshToken { get; set; } - - /// The Id of the device associated with the token (refresh token). - public string DeviceId { get; set; } - - - /// Construct a new CreateTokenOptions - /// Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. - /// A 34 character string that uniquely identifies this OAuth App. - public CreateTokenOptions(string grantType, string clientSid) - { - GrantType = grantType; - ClientSid = clientSid; - } - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - if (GrantType != null) - { - p.Add(new KeyValuePair("GrantType", GrantType)); - } - if (ClientSid != null) - { - p.Add(new KeyValuePair("ClientSid", ClientSid)); - } - if (ClientSecret != null) - { - p.Add(new KeyValuePair("ClientSecret", ClientSecret)); - } - if (Code != null) - { - p.Add(new KeyValuePair("Code", Code)); - } - if (CodeVerifier != null) - { - p.Add(new KeyValuePair("CodeVerifier", CodeVerifier)); - } - if (DeviceCode != null) - { - p.Add(new KeyValuePair("DeviceCode", DeviceCode)); - } - if (RefreshToken != null) - { - p.Add(new KeyValuePair("RefreshToken", RefreshToken)); - } - if (DeviceId != null) - { - p.Add(new KeyValuePair("DeviceId", DeviceId)); - } - return p; - } - - - - } -} - diff --git a/src/Twilio/Rest/Oauth/V1/TokenResource.cs b/src/Twilio/Rest/Oauth/V1/TokenResource.cs deleted file mode 100644 index bd3fef174..000000000 --- a/src/Twilio/Rest/Oauth/V1/TokenResource.cs +++ /dev/null @@ -1,192 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * 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.Oauth.V1 -{ - public class TokenResource : Resource - { - - - - - - private static Request BuildCreateRequest(CreateTokenOptions options, ITwilioRestClient client) - { - - string path = "/v1/token"; - - - return new Request( - HttpMethod.Post, - Rest.Domain.Oauth, - path, - postParams: options.GetParams(), - headerParams: null - ); - } - - /// Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant - /// Create Token parameters - /// Client to make requests to Twilio - /// A single instance of Token - public static TokenResource Create(CreateTokenOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant - /// Create Token parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Token - public static async System.Threading.Tasks.Task CreateAsync(CreateTokenOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildCreateRequest(options, client)); - return FromJson(response.Content); - } - #endif - - /// Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant - /// Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. - /// A 34 character string that uniquely identifies this OAuth App. - /// The credential for confidential OAuth App. - /// JWT token related to the authorization code grant type. - /// A code which is generation cryptographically. - /// JWT token related to the device code grant type. - /// JWT token related to the refresh token grant type. - /// The Id of the device associated with the token (refresh token). - /// Client to make requests to Twilio - /// A single instance of Token - public static TokenResource Create( - string grantType, - string clientSid, - string clientSecret = null, - string code = null, - string codeVerifier = null, - string deviceCode = null, - string refreshToken = null, - string deviceId = null, - ITwilioRestClient client = null) - { - var options = new CreateTokenOptions(grantType, clientSid){ ClientSecret = clientSecret, Code = code, CodeVerifier = codeVerifier, DeviceCode = deviceCode, RefreshToken = refreshToken, DeviceId = deviceId }; - return Create(options, client); - } - - #if !NET35 - /// Issues a new Access token (optionally identity_token & refresh_token) in exchange of Oauth grant - /// Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. - /// A 34 character string that uniquely identifies this OAuth App. - /// The credential for confidential OAuth App. - /// JWT token related to the authorization code grant type. - /// A code which is generation cryptographically. - /// JWT token related to the device code grant type. - /// JWT token related to the refresh token grant type. - /// The Id of the device associated with the token (refresh token). - /// Client to make requests to Twilio - /// Task that resolves to A single instance of Token - public static async System.Threading.Tasks.Task CreateAsync( - string grantType, - string clientSid, - string clientSecret = null, - string code = null, - string codeVerifier = null, - string deviceCode = null, - string refreshToken = null, - string deviceId = null, - ITwilioRestClient client = null) - { - var options = new CreateTokenOptions(grantType, clientSid){ ClientSecret = clientSecret, Code = code, CodeVerifier = codeVerifier, DeviceCode = deviceCode, RefreshToken = refreshToken, DeviceId = deviceId }; - return await CreateAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a TokenResource object - /// - /// Raw JSON string - /// TokenResource object represented by the provided JSON - public static TokenResource 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); - } - } - - - /// Token which carries the necessary information to access a Twilio resource directly. - [JsonProperty("access_token")] - public string AccessToken { get; private set; } - - /// Token which carries the information necessary to get a new access token. - [JsonProperty("refresh_token")] - public string RefreshToken { get; private set; } - - /// The id_token - [JsonProperty("id_token")] - public string IdToken { get; private set; } - - /// The date and time in GMT when the refresh token expires in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - [JsonProperty("refresh_token_expires_at")] - public DateTime? RefreshTokenExpiresAt { get; private set; } - - /// The date and time in GMT when the refresh token expires in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - [JsonProperty("access_token_expires_at")] - public DateTime? AccessTokenExpiresAt { get; private set; } - - - - private TokenResource() { - - } - } -} - diff --git a/src/Twilio/Rest/Oauth/V1/UserInfoOptions.cs b/src/Twilio/Rest/Oauth/V1/UserInfoOptions.cs deleted file mode 100644 index 84f8f5d67..000000000 --- a/src/Twilio/Rest/Oauth/V1/UserInfoOptions.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * 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.Oauth.V1 -{ - /// Retrieves the consented UserInfo and other claims about the logged-in subject (end-user). - public class FetchUserInfoOptions : IOptions - { - - - - - - /// Generate the necessary parameters - public List> GetParams() - { - var p = new List>(); - - return p; - } - - - - } - - -} - diff --git a/src/Twilio/Rest/Oauth/V1/UserInfoResource.cs b/src/Twilio/Rest/Oauth/V1/UserInfoResource.cs deleted file mode 100644 index 0a127fbf6..000000000 --- a/src/Twilio/Rest/Oauth/V1/UserInfoResource.cs +++ /dev/null @@ -1,162 +0,0 @@ -/* - * This code was generated by - * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - * - * Twilio - Oauth - * 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.Oauth.V1 -{ - public class UserInfoResource : Resource - { - - - - - - private static Request BuildFetchRequest(FetchUserInfoOptions options, ITwilioRestClient client) - { - - string path = "/v1/userinfo"; - - - return new Request( - HttpMethod.Get, - Rest.Domain.Oauth, - path, - queryParams: options.GetParams(), - headerParams: null - ); - } - - /// Retrieves the consented UserInfo and other claims about the logged-in subject (end-user). - /// Fetch UserInfo parameters - /// Client to make requests to Twilio - /// A single instance of UserInfo - public static UserInfoResource Fetch(FetchUserInfoOptions options, ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = client.Request(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - - #if !NET35 - /// Retrieves the consented UserInfo and other claims about the logged-in subject (end-user). - /// Fetch UserInfo parameters - /// Client to make requests to Twilio - /// Task that resolves to A single instance of UserInfo - public static async System.Threading.Tasks.Task FetchAsync(FetchUserInfoOptions options, - ITwilioRestClient client = null) - { - client = client ?? TwilioClient.GetRestClient(); - var response = await client.RequestAsync(BuildFetchRequest(options, client)); - return FromJson(response.Content); - } - #endif - /// Retrieves the consented UserInfo and other claims about the logged-in subject (end-user). - /// Client to make requests to Twilio - /// A single instance of UserInfo - public static UserInfoResource Fetch( - ITwilioRestClient client = null) - { - var options = new FetchUserInfoOptions(){ }; - return Fetch(options, client); - } - - #if !NET35 - /// Retrieves the consented UserInfo and other claims about the logged-in subject (end-user). - /// Client to make requests to Twilio - /// Task that resolves to A single instance of UserInfo - public static async System.Threading.Tasks.Task FetchAsync(ITwilioRestClient client = null) - { - var options = new FetchUserInfoOptions(){ }; - return await FetchAsync(options, client); - } - #endif - - /// - /// Converts a JSON string into a UserInfoResource object - /// - /// Raw JSON string - /// UserInfoResource object represented by the provided JSON - public static UserInfoResource 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 URL of the party that will create the token and sign it with its private key. - [JsonProperty("user_sid")] - public string UserSid { get; private set; } - - /// The first name of the end-user. - [JsonProperty("first_name")] - public string FirstName { get; private set; } - - /// The last name of the end-user. - [JsonProperty("last_name")] - public string LastName { get; private set; } - - /// The friendly name of the end-user. - [JsonProperty("friendly_name")] - public string FriendlyName { get; private set; } - - /// The end-user's preferred email address. - [JsonProperty("email")] - public string Email { get; private set; } - - /// The url - [JsonProperty("url")] - public Uri Url { get; private set; } - - - - private UserInfoResource() { - - } - } -} - 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/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/Proxy/V1/Service/Session/InteractionResource.cs b/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionResource.cs index 8b1172c25..9ae90c21a 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionResource.cs +++ b/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionResource.cs @@ -425,7 +425,7 @@ public static string ToJson(object model) [JsonProperty("inbound_participant_sid")] public string InboundParticipantSid { get; private set; } - /// The SID of the inbound resource; either the [Call](https://www.twilio.com/docs/voice/api/call-resource) or [Message](https://www.twilio.com/docs/sms/api/message. + /// The SID of the inbound resource; either the [Call](https://www.twilio.com/docs/voice/api/call-resource) or [Message](https://www.twilio.com/docs/sms/api/message-resource). [JsonProperty("inbound_resource_sid")] public string InboundResourceSid { get; private set; } diff --git a/src/Twilio/Rest/Proxy/V1/Service/ShortCodeOptions.cs b/src/Twilio/Rest/Proxy/V1/Service/ShortCodeOptions.cs index 29176342c..adfa15d80 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/ShortCodeOptions.cs +++ b/src/Twilio/Rest/Proxy/V1/Service/ShortCodeOptions.cs @@ -31,13 +31,13 @@ public class CreateShortCodeOptions : IOptions /// The SID of the parent [Service](https://www.twilio.com/docs/proxy/api/service) resource. public string PathServiceSid { get; } - /// The SID of a Twilio [ShortCode](https://www.twilio.com/docs/sms/api/short-code) resource that represents the short code you would like to assign to your Proxy Service. + /// The SID of a Twilio [ShortCode](https://www.twilio.com/en-us/messaging/channels/sms/short-codes) resource that represents the short code you would like to assign to your Proxy Service. public string Sid { get; } /// Construct a new CreateShortCodeOptions /// The SID of the parent [Service](https://www.twilio.com/docs/proxy/api/service) resource. - /// The SID of a Twilio [ShortCode](https://www.twilio.com/docs/sms/api/short-code) resource that represents the short code you would like to assign to your Proxy Service. + /// The SID of a Twilio [ShortCode](https://www.twilio.com/en-us/messaging/channels/sms/short-codes) resource that represents the short code you would like to assign to your Proxy Service. public CreateShortCodeOptions(string pathServiceSid, string sid) { PathServiceSid = pathServiceSid; diff --git a/src/Twilio/Rest/Proxy/V1/Service/ShortCodeResource.cs b/src/Twilio/Rest/Proxy/V1/Service/ShortCodeResource.cs index c2b873bf6..c38585afd 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/ShortCodeResource.cs +++ b/src/Twilio/Rest/Proxy/V1/Service/ShortCodeResource.cs @@ -78,7 +78,7 @@ public static async System.Threading.Tasks.Task CreateAsync(C /// Add a Short Code to the Proxy Number Pool for the Service. /// The SID of the parent [Service](https://www.twilio.com/docs/proxy/api/service) resource. - /// The SID of a Twilio [ShortCode](https://www.twilio.com/docs/sms/api/short-code) resource that represents the short code you would like to assign to your Proxy Service. + /// The SID of a Twilio [ShortCode](https://www.twilio.com/en-us/messaging/channels/sms/short-codes) resource that represents the short code you would like to assign to your Proxy Service. /// Client to make requests to Twilio /// A single instance of ShortCode public static ShortCodeResource Create( @@ -93,7 +93,7 @@ public static ShortCodeResource Create( #if !NET35 /// Add a Short Code to the Proxy Number Pool for the Service. /// The SID of the parent [Service](https://www.twilio.com/docs/proxy/api/service) resource. - /// The SID of a Twilio [ShortCode](https://www.twilio.com/docs/sms/api/short-code) resource that represents the short code you would like to assign to your Proxy Service. + /// The SID of a Twilio [ShortCode](https://www.twilio.com/en-us/messaging/channels/sms/short-codes) resource that represents the short code you would like to assign to your Proxy Service. /// Client to make requests to Twilio /// Task that resolves to A single instance of ShortCode public static async System.Threading.Tasks.Task CreateAsync( diff --git a/src/Twilio/Rest/Serverless/V1/Service/BuildResource.cs b/src/Twilio/Rest/Serverless/V1/Service/BuildResource.cs index 73ce3afe5..482013714 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/BuildResource.cs +++ b/src/Twilio/Rest/Serverless/V1/Service/BuildResource.cs @@ -60,6 +60,7 @@ public static implicit operator RuntimeEnum(string value) public static readonly RuntimeEnum Node12 = new RuntimeEnum("node12"); public static readonly RuntimeEnum Node14 = new RuntimeEnum("node14"); public static readonly RuntimeEnum Node16 = new RuntimeEnum("node16"); + public static readonly RuntimeEnum Node18 = new RuntimeEnum("node18"); } 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/TaskOptions.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskOptions.cs index fd8204207..ccbe5e376 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskOptions.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskOptions.cs @@ -207,7 +207,7 @@ public class ReadTaskOptions : ReadOptions /// How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. public string Ordering { get; set; } - /// Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. + /// Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. public bool? HasAddons { get; set; } diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskResource.cs index a51a1eaf4..67a51d0d5 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskResource.cs @@ -340,7 +340,7 @@ public static async System.Threading.Tasks.Task> ReadA /// The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. /// The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. /// How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. - /// Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. + /// Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. /// 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 @@ -375,7 +375,7 @@ public static ResourceSet Read( /// The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. /// The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. /// How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. - /// Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. + /// Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. /// 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 @@ -601,7 +601,7 @@ public static string ToJson(object model) [JsonProperty("attributes")] public string Attributes { get; private set; } - /// An object that contains the [addon](https://www.twilio.com/docs/taskrouter/marketplace) data for all installed addons. + /// An object that contains the [Add-on](https://www.twilio.com/docs/add-ons) data for all installed Add-ons. [JsonProperty("addons")] public string Addons { 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 new file mode 100644 index 000000000..35ead1c20 --- /dev/null +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesOptions.cs @@ -0,0 +1,264 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * 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.Trusthub.V1 +{ + + /// Create a new Compliance Registration Inquiry for the authenticated account. This is necessary to start a new embedded session. + public class CreateComplianceRegistrationInquiriesOptions : IOptions + { + + + public ComplianceRegistrationInquiriesResource.EndUserTypeEnum EndUserType { get; } + + + public ComplianceRegistrationInquiriesResource.PhoneNumberTypeEnum PhoneNumberType { get; } + + + public ComplianceRegistrationInquiriesResource.BusinessIdentityTypeEnum BusinessIdentityType { get; set; } + + /// The authority that registered the business + public string BusinessRegistrationAuthority { get; set; } + + /// he name of the business or organization using the Tollfree number. + public string BusinessLegalName { get; set; } + + /// he email address to receive the notification about the verification result. + public string NotificationEmail { get; set; } + + /// The email address to receive the notification about the verification result. + public bool? AcceptedNotificationReceipt { get; set; } + + /// Business registration number of the business + public string BusinessRegistrationNumber { get; set; } + + /// The URL of the business website + public string BusinessWebsiteUrl { get; set; } + + /// Friendly name for your business information + public string FriendlyName { get; set; } + + /// First name of the authorized representative + public string AuthorizedRepresentative1FirstName { get; set; } + + /// Last name of the authorized representative + public string AuthorizedRepresentative1LastName { get; set; } + + /// Phone number of the authorized representative + public string AuthorizedRepresentative1Phone { get; set; } + + /// Email address of the authorized representative + public string AuthorizedRepresentative1Email { get; set; } + + /// Birthdate of the authorized representative + public string AuthorizedRepresentative1DateOfBirth { get; set; } + + /// Street address of the business + public string AddressStreet { get; set; } + + /// Street address of the business + public string AddressStreetSecondary { get; set; } + + /// City of the business + public string AddressCity { get; set; } + + /// State or province of the business + public string AddressSubdivision { get; set; } + + /// Postal code of the business + public string AddressPostalCode { get; set; } + + /// Country code of the business + public string AddressCountryCode { get; set; } + + /// Street address of the business + public string EmergencyAddressStreet { get; set; } + + /// Street address of the business + public string EmergencyAddressStreetSecondary { get; set; } + + /// City of the business + public string EmergencyAddressCity { get; set; } + + /// State or province of the business + public string EmergencyAddressSubdivision { get; set; } + + /// Postal code of the business + public string EmergencyAddressPostalCode { get; set; } + + /// Country code of the business + public string EmergencyAddressCountryCode { get; set; } + + /// Use the business address as the emergency address + public bool? UseAddressAsEmergencyAddress { get; set; } + + /// The name of the verification document to upload + public string FileName { get; set; } + + /// The verification document to upload + public string File { get; set; } + + + /// Construct a new CreateComplianceRegistrationOptions + /// + /// + public CreateComplianceRegistrationInquiriesOptions(ComplianceRegistrationInquiriesResource.EndUserTypeEnum endUserType, ComplianceRegistrationInquiriesResource.PhoneNumberTypeEnum phoneNumberType) + { + EndUserType = endUserType; + PhoneNumberType = phoneNumberType; + } + + + /// Generate the necessary parameters + public List> GetParams() + { + var p = new List>(); + + if (EndUserType != null) + { + p.Add(new KeyValuePair("EndUserType", EndUserType.ToString())); + } + if (PhoneNumberType != null) + { + p.Add(new KeyValuePair("PhoneNumberType", PhoneNumberType.ToString())); + } + if (BusinessIdentityType != null) + { + p.Add(new KeyValuePair("BusinessIdentityType", BusinessIdentityType.ToString())); + } + if (BusinessRegistrationAuthority != null) + { + p.Add(new KeyValuePair("BusinessRegistrationAuthority", BusinessRegistrationAuthority)); + } + if (BusinessLegalName != null) + { + p.Add(new KeyValuePair("BusinessLegalName", BusinessLegalName)); + } + if (NotificationEmail != null) + { + p.Add(new KeyValuePair("NotificationEmail", NotificationEmail)); + } + if (AcceptedNotificationReceipt != null) + { + p.Add(new KeyValuePair("AcceptedNotificationReceipt", AcceptedNotificationReceipt.Value.ToString().ToLower())); + } + if (BusinessRegistrationNumber != null) + { + p.Add(new KeyValuePair("BusinessRegistrationNumber", BusinessRegistrationNumber)); + } + if (BusinessWebsiteUrl != null) + { + p.Add(new KeyValuePair("BusinessWebsiteUrl", BusinessWebsiteUrl)); + } + if (FriendlyName != null) + { + p.Add(new KeyValuePair("FriendlyName", FriendlyName)); + } + if (AuthorizedRepresentative1FirstName != null) + { + p.Add(new KeyValuePair("AuthorizedRepresentative1FirstName", AuthorizedRepresentative1FirstName)); + } + if (AuthorizedRepresentative1LastName != null) + { + p.Add(new KeyValuePair("AuthorizedRepresentative1LastName", AuthorizedRepresentative1LastName)); + } + if (AuthorizedRepresentative1Phone != null) + { + p.Add(new KeyValuePair("AuthorizedRepresentative1Phone", AuthorizedRepresentative1Phone)); + } + if (AuthorizedRepresentative1Email != null) + { + p.Add(new KeyValuePair("AuthorizedRepresentative1Email", AuthorizedRepresentative1Email)); + } + if (AuthorizedRepresentative1DateOfBirth != null) + { + p.Add(new KeyValuePair("AuthorizedRepresentative1DateOfBirth", AuthorizedRepresentative1DateOfBirth)); + } + if (AddressStreet != null) + { + p.Add(new KeyValuePair("AddressStreet", AddressStreet)); + } + if (AddressStreetSecondary != null) + { + p.Add(new KeyValuePair("AddressStreetSecondary", AddressStreetSecondary)); + } + if (AddressCity != null) + { + p.Add(new KeyValuePair("AddressCity", AddressCity)); + } + if (AddressSubdivision != null) + { + p.Add(new KeyValuePair("AddressSubdivision", AddressSubdivision)); + } + if (AddressPostalCode != null) + { + p.Add(new KeyValuePair("AddressPostalCode", AddressPostalCode)); + } + if (AddressCountryCode != null) + { + p.Add(new KeyValuePair("AddressCountryCode", AddressCountryCode)); + } + if (EmergencyAddressStreet != null) + { + p.Add(new KeyValuePair("EmergencyAddressStreet", EmergencyAddressStreet)); + } + if (EmergencyAddressStreetSecondary != null) + { + p.Add(new KeyValuePair("EmergencyAddressStreetSecondary", EmergencyAddressStreetSecondary)); + } + if (EmergencyAddressCity != null) + { + p.Add(new KeyValuePair("EmergencyAddressCity", EmergencyAddressCity)); + } + if (EmergencyAddressSubdivision != null) + { + p.Add(new KeyValuePair("EmergencyAddressSubdivision", EmergencyAddressSubdivision)); + } + if (EmergencyAddressPostalCode != null) + { + p.Add(new KeyValuePair("EmergencyAddressPostalCode", EmergencyAddressPostalCode)); + } + if (EmergencyAddressCountryCode != null) + { + p.Add(new KeyValuePair("EmergencyAddressCountryCode", EmergencyAddressCountryCode)); + } + if (UseAddressAsEmergencyAddress != null) + { + p.Add(new KeyValuePair("UseAddressAsEmergencyAddress", UseAddressAsEmergencyAddress.Value.ToString().ToLower())); + } + if (FileName != null) + { + p.Add(new KeyValuePair("FileName", FileName)); + } + if (File != null) + { + p.Add(new KeyValuePair("File", File)); + } + return p; + } + + + + } +} + diff --git a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs new file mode 100644 index 000000000..3fba32328 --- /dev/null +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesResource.cs @@ -0,0 +1,315 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * 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.Trusthub.V1 +{ + public class ComplianceRegistrationInquiriesResource : Resource + { + + + + public sealed class PhoneNumberTypeEnum : StringEnum + { + private PhoneNumberTypeEnum(string value) : base(value) {} + public PhoneNumberTypeEnum() {} + public static implicit operator PhoneNumberTypeEnum(string value) + { + return new PhoneNumberTypeEnum(value); + } + public static readonly PhoneNumberTypeEnum Local = new PhoneNumberTypeEnum("local"); + public static readonly PhoneNumberTypeEnum National = new PhoneNumberTypeEnum("national"); + public static readonly PhoneNumberTypeEnum Mobile = new PhoneNumberTypeEnum("mobile"); + public static readonly PhoneNumberTypeEnum TollFree = new PhoneNumberTypeEnum("toll-free"); + + } + public sealed class EndUserTypeEnum : StringEnum + { + private EndUserTypeEnum(string value) : base(value) {} + public EndUserTypeEnum() {} + public static implicit operator EndUserTypeEnum(string value) + { + return new EndUserTypeEnum(value); + } + public static readonly EndUserTypeEnum Individual = new EndUserTypeEnum("Individual"); + public static readonly EndUserTypeEnum Business = new EndUserTypeEnum("Business"); + + } + public sealed class BusinessIdentityTypeEnum : StringEnum + { + private BusinessIdentityTypeEnum(string value) : base(value) {} + public BusinessIdentityTypeEnum() {} + public static implicit operator BusinessIdentityTypeEnum(string value) + { + return new BusinessIdentityTypeEnum(value); + } + public static readonly BusinessIdentityTypeEnum DirectCustomer = new BusinessIdentityTypeEnum("direct_customer"); + public static readonly BusinessIdentityTypeEnum IsvResellerOrPartner = new BusinessIdentityTypeEnum("isv_reseller_or_partner"); + public static readonly BusinessIdentityTypeEnum Unknown = new BusinessIdentityTypeEnum("unknown"); + + } + + + private static Request BuildCreateRequest(CreateComplianceRegistrationInquiriesOptions options, ITwilioRestClient client) + { + + string path = "/v1/ComplianceInquiries/Registration/RegulatoryCompliance/GB/Initialize"; + + + return new Request( + HttpMethod.Post, + Rest.Domain.Trusthub, + path, + postParams: options.GetParams(), + headerParams: null + ); + } + + /// Create a new Compliance Registration Inquiry for the authenticated account. This is necessary to start a new embedded session. + /// Create ComplianceRegistrationInquiries parameters + /// Client to make requests to Twilio + /// A single instance of ComplianceRegistrationInquiries + public static ComplianceRegistrationInquiriesResource Create(CreateComplianceRegistrationInquiriesOptions options, ITwilioRestClient client = null) + { + client = client ?? TwilioClient.GetRestClient(); + var response = client.Request(BuildCreateRequest(options, client)); + return FromJson(response.Content); + } + + #if !NET35 + /// Create a new Compliance Registration Inquiry for the authenticated account. This is necessary to start a new embedded session. + /// Create ComplianceRegistrationInquiries parameters + /// Client to make requests to Twilio + /// Task that resolves to A single instance of ComplianceRegistrationInquiries + public static async System.Threading.Tasks.Task CreateAsync(CreateComplianceRegistrationInquiriesOptions options, + ITwilioRestClient client = null) + { + client = client ?? TwilioClient.GetRestClient(); + var response = await client.RequestAsync(BuildCreateRequest(options, client)); + return FromJson(response.Content); + } + #endif + + /// Create a new Compliance Registration Inquiry for the authenticated account. This is necessary to start a new embedded session. + /// + /// + /// + /// 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. + /// Business registration number of the business + /// The URL of the business website + /// Friendly name for your business information + /// First name of the authorized representative + /// Last name of the authorized representative + /// Phone number of the authorized representative + /// Email address of the authorized representative + /// Birthdate of the authorized representative + /// Street address of the business + /// Street address of the business + /// City of the business + /// State or province of the business + /// Postal code of the business + /// Country code of the business + /// Street address of the business + /// Street address of the business + /// City of the business + /// State or province of the business + /// Postal code of the business + /// Country code of the business + /// Use the business address as the emergency address + /// The name of the verification document to upload + /// The verification document to upload + /// 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, + string businessLegalName = null, + string notificationEmail = null, + bool? acceptedNotificationReceipt = null, + string businessRegistrationNumber = null, + string businessWebsiteUrl = null, + string friendlyName = null, + string authorizedRepresentative1FirstName = null, + string authorizedRepresentative1LastName = null, + string authorizedRepresentative1Phone = null, + string authorizedRepresentative1Email = null, + string authorizedRepresentative1DateOfBirth = null, + string addressStreet = null, + string addressStreetSecondary = null, + string addressCity = null, + string addressSubdivision = null, + string addressPostalCode = null, + string addressCountryCode = null, + string emergencyAddressStreet = null, + string emergencyAddressStreetSecondary = null, + string emergencyAddressCity = null, + string emergencyAddressSubdivision = null, + string emergencyAddressPostalCode = null, + string emergencyAddressCountryCode = null, + bool? useAddressAsEmergencyAddress = null, + string fileName = null, + string file = 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 }; + return Create(options, client); + } + + #if !NET35 + /// Create a new Compliance Registration Inquiry for the authenticated account. This is necessary to start a new embedded session. + /// + /// + /// + /// 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. + /// Business registration number of the business + /// The URL of the business website + /// Friendly name for your business information + /// First name of the authorized representative + /// Last name of the authorized representative + /// Phone number of the authorized representative + /// Email address of the authorized representative + /// Birthdate of the authorized representative + /// Street address of the business + /// Street address of the business + /// City of the business + /// State or province of the business + /// Postal code of the business + /// Country code of the business + /// Street address of the business + /// Street address of the business + /// City of the business + /// State or province of the business + /// Postal code of the business + /// Country code of the business + /// Use the business address as the emergency address + /// The name of the verification document to upload + /// The verification document to upload + /// 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, + string businessLegalName = null, + string notificationEmail = null, + bool? acceptedNotificationReceipt = null, + string businessRegistrationNumber = null, + string businessWebsiteUrl = null, + string friendlyName = null, + string authorizedRepresentative1FirstName = null, + string authorizedRepresentative1LastName = null, + string authorizedRepresentative1Phone = null, + string authorizedRepresentative1Email = null, + string authorizedRepresentative1DateOfBirth = null, + string addressStreet = null, + string addressStreetSecondary = null, + string addressCity = null, + string addressSubdivision = null, + string addressPostalCode = null, + string addressCountryCode = null, + string emergencyAddressStreet = null, + string emergencyAddressStreetSecondary = null, + string emergencyAddressCity = null, + string emergencyAddressSubdivision = null, + string emergencyAddressPostalCode = null, + string emergencyAddressCountryCode = null, + bool? useAddressAsEmergencyAddress = null, + string fileName = null, + string file = 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 }; + return await CreateAsync(options, client); + } + #endif + + /// + /// Converts a JSON string into a ComplianceRegistrationInquiriesResource object + /// + /// Raw JSON string + /// ComplianceRegistrationInquiriesResource object represented by the provided JSON + public static ComplianceRegistrationInquiriesResource 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 used to start an embedded compliance registration session. + [JsonProperty("inquiry_id")] + public string InquiryId { get; private set; } + + /// The session token used to start an embedded compliance registration session. + [JsonProperty("inquiry_session_token")] + public string InquirySessionToken { get; private set; } + + /// The RegistrationId matching the Registration Profile that should be resumed or resubmitted for editing. + [JsonProperty("registration_id")] + public string RegistrationId { get; private set; } + + /// The URL of this resource. + [JsonProperty("url")] + public Uri Url { get; private set; } + + + + private ComplianceRegistrationInquiriesResource() { + + } + } +} + diff --git a/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesOptions.cs b/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesOptions.cs new file mode 100644 index 000000000..55801fe38 --- /dev/null +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesOptions.cs @@ -0,0 +1,203 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * 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.Trusthub.V1 +{ + + /// Create a new Compliance Tollfree Verification Inquiry for the authenticated account. This is necessary to start a new embedded session. + public class CreateComplianceTollfreeInquiriesOptions : IOptions + { + + /// The Tollfree phone number to be verified + public Types.PhoneNumber TollfreePhoneNumber { get; } + + /// 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 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(); + } + + + /// Generate the necessary parameters + public List> GetParams() + { + var p = new List>(); + + if (TollfreePhoneNumber != null) + { + p.Add(new KeyValuePair("TollfreePhoneNumber", TollfreePhoneNumber.ToString())); + } + if (NotificationEmail != null) + { + 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 new file mode 100644 index 000000000..153ad9924 --- /dev/null +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesResource.cs @@ -0,0 +1,255 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Trusthub + * 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.Trusthub.V1 +{ + 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) + { + + string path = "/v1/ComplianceInquiries/Tollfree/Initialize"; + + + return new Request( + HttpMethod.Post, + Rest.Domain.Trusthub, + path, + postParams: options.GetParams(), + headerParams: null + ); + } + + /// Create a new Compliance Tollfree Verification Inquiry for the authenticated account. This is necessary to start a new embedded session. + /// Create ComplianceTollfreeInquiries parameters + /// Client to make requests to Twilio + /// A single instance of ComplianceTollfreeInquiries + public static ComplianceTollfreeInquiriesResource Create(CreateComplianceTollfreeInquiriesOptions options, ITwilioRestClient client = null) + { + client = client ?? TwilioClient.GetRestClient(); + var response = client.Request(BuildCreateRequest(options, client)); + return FromJson(response.Content); + } + + #if !NET35 + /// Create a new Compliance Tollfree Verification Inquiry for the authenticated account. This is necessary to start a new embedded session. + /// Create ComplianceTollfreeInquiries parameters + /// Client to make requests to Twilio + /// Task that resolves to A single instance of ComplianceTollfreeInquiries + public static async System.Threading.Tasks.Task CreateAsync(CreateComplianceTollfreeInquiriesOptions options, + ITwilioRestClient client = null) + { + client = client ?? TwilioClient.GetRestClient(); + var response = await client.RequestAsync(BuildCreateRequest(options, client)); + return FromJson(response.Content); + } + #endif + + /// 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 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){ 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 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){ 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 + + /// + /// Converts a JSON string into a ComplianceTollfreeInquiriesResource object + /// + /// Raw JSON string + /// ComplianceTollfreeInquiriesResource object represented by the provided JSON + public static ComplianceTollfreeInquiriesResource 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 used to start an embedded compliance registration session. + [JsonProperty("inquiry_id")] + public string InquiryId { get; private set; } + + /// The session token used to start an embedded compliance registration session. + [JsonProperty("inquiry_session_token")] + public string InquirySessionToken { get; private set; } + + /// The TolfreeId matching the Tollfree Profile that should be resumed or resubmitted for editing. + [JsonProperty("registration_id")] + public string RegistrationId { get; private set; } + + /// The URL of this resource. + [JsonProperty("url")] + public Uri Url { get; private set; } + + + + private ComplianceTollfreeInquiriesResource() { + + } + } +} + diff --git a/src/Twilio/Rest/Verify/V2/Service/VerificationOptions.cs b/src/Twilio/Rest/Verify/V2/Service/VerificationOptions.cs index e4c9d3eeb..b7dc6f22f 100644 --- a/src/Twilio/Rest/Verify/V2/Service/VerificationOptions.cs +++ b/src/Twilio/Rest/Verify/V2/Service/VerificationOptions.cs @@ -79,6 +79,9 @@ public class CreateVerificationOptions : IOptions public VerificationResource.RiskCheckEnum RiskCheck { get; set; } + /// A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. + public string Tags { get; set; } + /// Construct a new CreateVerificationOptions /// The SID of the verification [Service](https://www.twilio.com/docs/verify/api/service) to create the resource under. @@ -161,6 +164,10 @@ public List> GetParams() { p.Add(new KeyValuePair("RiskCheck", RiskCheck.ToString())); } + if (Tags != null) + { + p.Add(new KeyValuePair("Tags", Tags)); + } return p; } diff --git a/src/Twilio/Rest/Verify/V2/Service/VerificationResource.cs b/src/Twilio/Rest/Verify/V2/Service/VerificationResource.cs index 411ea6900..b18b256ab 100644 --- a/src/Twilio/Rest/Verify/V2/Service/VerificationResource.cs +++ b/src/Twilio/Rest/Verify/V2/Service/VerificationResource.cs @@ -134,6 +134,7 @@ public static async System.Threading.Tasks.Task CreateAsyn /// A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. /// Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. /// + /// A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. /// Client to make requests to Twilio /// A single instance of Verification public static VerificationResource Create( @@ -154,9 +155,10 @@ public static VerificationResource Create( string templateCustomSubstitutions = null, string deviceIp = null, VerificationResource.RiskCheckEnum riskCheck = null, + string tags = null, ITwilioRestClient client = null) { - var options = new CreateVerificationOptions(pathServiceSid, to, channel){ CustomFriendlyName = customFriendlyName, CustomMessage = customMessage, SendDigits = sendDigits, Locale = locale, CustomCode = customCode, Amount = amount, Payee = payee, RateLimits = rateLimits, ChannelConfiguration = channelConfiguration, AppHash = appHash, TemplateSid = templateSid, TemplateCustomSubstitutions = templateCustomSubstitutions, DeviceIp = deviceIp, RiskCheck = riskCheck }; + var options = new CreateVerificationOptions(pathServiceSid, to, channel){ CustomFriendlyName = customFriendlyName, CustomMessage = customMessage, SendDigits = sendDigits, Locale = locale, CustomCode = customCode, Amount = amount, Payee = payee, RateLimits = rateLimits, ChannelConfiguration = channelConfiguration, AppHash = appHash, TemplateSid = templateSid, TemplateCustomSubstitutions = templateCustomSubstitutions, DeviceIp = deviceIp, RiskCheck = riskCheck, Tags = tags }; return Create(options, client); } @@ -179,6 +181,7 @@ public static VerificationResource Create( /// A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. /// Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. /// + /// A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. /// Client to make requests to Twilio /// Task that resolves to A single instance of Verification public static async System.Threading.Tasks.Task CreateAsync( @@ -199,9 +202,10 @@ public static async System.Threading.Tasks.Task CreateAsyn string templateCustomSubstitutions = null, string deviceIp = null, VerificationResource.RiskCheckEnum riskCheck = null, + string tags = null, ITwilioRestClient client = null) { - var options = new CreateVerificationOptions(pathServiceSid, to, channel){ CustomFriendlyName = customFriendlyName, CustomMessage = customMessage, SendDigits = sendDigits, Locale = locale, CustomCode = customCode, Amount = amount, Payee = payee, RateLimits = rateLimits, ChannelConfiguration = channelConfiguration, AppHash = appHash, TemplateSid = templateSid, TemplateCustomSubstitutions = templateCustomSubstitutions, DeviceIp = deviceIp, RiskCheck = riskCheck }; + var options = new CreateVerificationOptions(pathServiceSid, to, channel){ CustomFriendlyName = customFriendlyName, CustomMessage = customMessage, SendDigits = sendDigits, Locale = locale, CustomCode = customCode, Amount = amount, Payee = payee, RateLimits = rateLimits, ChannelConfiguration = channelConfiguration, AppHash = appHash, TemplateSid = templateSid, TemplateCustomSubstitutions = templateCustomSubstitutions, DeviceIp = deviceIp, RiskCheck = riskCheck, Tags = tags }; 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/Verify/V2/VerificationAttemptResource.cs b/src/Twilio/Rest/Verify/V2/VerificationAttemptResource.cs index 5ef2295da..609ef8d70 100644 --- a/src/Twilio/Rest/Verify/V2/VerificationAttemptResource.cs +++ b/src/Twilio/Rest/Verify/V2/VerificationAttemptResource.cs @@ -345,7 +345,7 @@ public static string ToJson(object model) [JsonProperty("channel")] public VerificationAttemptResource.ChannelsEnum Channel { get; private set; } - /// An object containing the charge for this verification attempt related to the channel costs and the currency used. The costs related to the succeeded verifications are not included. May not be immediately available. More information on pricing is available [here](https://www.twilio.com/verify/pricing). + /// An object containing the charge for this verification attempt related to the channel costs and the currency used. The costs related to the succeeded verifications are not included. May not be immediately available. More information on pricing is available [here](https://www.twilio.com/en-us/verify/pricing). [JsonProperty("price")] public object Price { 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/Twilio.csproj b/src/Twilio/Twilio.csproj index 61669d9a7..ffd066168 100644 --- a/src/Twilio/Twilio.csproj +++ b/src/Twilio/Twilio.csproj @@ -7,7 +7,7 @@ Copyright © Twilio Twilio en-US - 6.17.0 + 6.18.0 Twilio