diff --git a/CHANGES.md b/CHANGES.md index 98b7c5a28..8b80db49a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,40 @@ twilio-ruby changelog ===================== +[2023-10-19] Version 6.8.0 +-------------------------- +**Library - Chore** +- [PR #682](https://github.com/twilio/twilio-ruby/pull/682): Removing Test Related To Deprecated Endpoint - OAuth. Thanks to [@KobeBrooks](https://github.com/KobeBrooks)! + +**Library - Fix** +- [PR #680](https://github.com/twilio/twilio-ruby/pull/680): update validate ssl method with new endpoint. Thanks to [@AsabuHere](https://github.com/AsabuHere)! + +**Accounts** +- Updated Safelist metadata to correct the docs. +- Add Global SafeList API changes + +**Api** +- Added optional parameter `CallToken` for create participant api + +**Flex** +- Adding `offline_config` to Flex Configuration + +**Intelligence** +- Deleted `redacted` parameter from fetching transcript in v2 **(breaking change)** + +**Lookups** +- Add new `phone_number_quality_score` package to the lookup response +- Remove `disposable_phone_number_risk` package **(breaking change)** + +**Messaging** +- Update US App To Person documentation with current `message_samples` requirements + +**Taskrouter** +- Remove beta_feature check on task_queue_bulk_real_time_statistics endpoint +- Add `virtual_start_time` property to tasks +- Updating `task_queue_data` format from `map` to `array` in the response of bulk get endpoint of TaskQueue Real Time Statistics API **(breaking change)** + + [2023-10-05] Version 6.7.1 -------------------------- **Library - Chore** diff --git a/README.md b/README.md index 7a003279d..472e91b33 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,13 @@ This library supports the following Ruby implementations: To install using [Bundler][bundler] grab the latest stable version: ```ruby -gem 'twilio-ruby', '~> 6.7.1' +gem 'twilio-ruby', '~> 6.8.0' ``` To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install: ```bash -gem install twilio-ruby -v 6.7.1 +gem install twilio-ruby -v 6.8.0 ``` To build and install the development branch yourself from the latest source: diff --git a/lib/twilio-ruby/rest/accounts/v1.rb b/lib/twilio-ruby/rest/accounts/v1.rb index c39d803be..2361e4d14 100644 --- a/lib/twilio-ruby/rest/accounts/v1.rb +++ b/lib/twilio-ruby/rest/accounts/v1.rb @@ -23,6 +23,7 @@ def initialize(domain) @version = 'v1' @auth_token_promotion = nil @credentials = nil + @safelist = nil @secondary_auth_token = nil end @@ -37,6 +38,11 @@ def credentials @credentials ||= CredentialList.new self end ## + # @return [Twilio::REST::Accounts::V1::SafelistList] + def safelist + @safelist ||= SafelistList.new self + end + ## # @return [Twilio::REST::Accounts::V1::secondaryAuthTokenContext] def secondary_auth_token @secondary_auth_token ||= SecondaryAuthTokenContext.new self diff --git a/lib/twilio-ruby/rest/api/v2010/safelist.rb b/lib/twilio-ruby/rest/accounts/v1/safelist.rb similarity index 94% rename from lib/twilio-ruby/rest/api/v2010/safelist.rb rename to lib/twilio-ruby/rest/accounts/v1/safelist.rb index f76d3c715..e55b76c91 100644 --- a/lib/twilio-ruby/rest/api/v2010/safelist.rb +++ b/lib/twilio-ruby/rest/accounts/v1/safelist.rb @@ -4,7 +4,7 @@ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ # -# Twilio - Api +# Twilio - Accounts # This is the public Twilio REST API. # # NOTE: This class is auto generated by OpenAPI Generator. @@ -15,8 +15,8 @@ module Twilio module REST - class Api < ApiBase - class V2010 < Version + class Accounts < AccountsBase + class V1 < Version class SafelistList < ListResource ## # Initialize the SafelistList @@ -26,7 +26,7 @@ def initialize(version) super(version) # Path Solution @solution = { } - @uri = "/SafeList/Numbers.json" + @uri = "/SafeList/Numbers" end ## @@ -85,7 +85,7 @@ def fetch( # Provide a user friendly representation def to_s - '#' + '#' end end @@ -114,7 +114,7 @@ def get_instance(payload) ## # Provide a user friendly representation def to_s - '' + '' end end class SafelistInstance < InstanceResource @@ -153,13 +153,13 @@ def phone_number ## # Provide a user friendly representation def to_s - "" + "" end ## # Provide a detailed, user friendly representation def inspect - "" + "" end end diff --git a/lib/twilio-ruby/rest/api/v2010.rb b/lib/twilio-ruby/rest/api/v2010.rb index d38465f43..b1010597d 100644 --- a/lib/twilio-ruby/rest/api/v2010.rb +++ b/lib/twilio-ruby/rest/api/v2010.rb @@ -22,7 +22,6 @@ def initialize(domain) super @version = '2010-04-01' @accounts = nil - @safelist = nil end ## @@ -123,11 +122,6 @@ def accounts(sid=:unset) end end ## - # @return [Twilio::REST::Api::V2010::SafelistList] - def safelist - @safelist ||= SafelistList.new self - end - ## # Provide a user friendly representation def to_s ''; diff --git a/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb b/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb index 1c5aaba2f..235bd48f0 100644 --- a/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +++ b/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb @@ -81,6 +81,7 @@ def initialize(version, account_sid: nil, conference_sid: nil) # @param [String] amd_status_callback 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. # @param [String] amd_status_callback_method The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. # @param [String] trim 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`. + # @param [String] call_token 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. # @return [ParticipantInstance] Created ParticipantInstance def create( from: nil, @@ -129,7 +130,8 @@ def create( machine_detection_silence_timeout: :unset, amd_status_callback: :unset, amd_status_callback_method: :unset, - trim: :unset + trim: :unset, + call_token: :unset ) data = Twilio::Values.of({ @@ -180,6 +182,7 @@ def create( 'AmdStatusCallback' => amd_status_callback, 'AmdStatusCallbackMethod' => amd_status_callback_method, 'Trim' => trim, + 'CallToken' => call_token, }) payload = @version.create('POST', @uri, data: data) diff --git a/lib/twilio-ruby/rest/flex_api/v1/configuration.rb b/lib/twilio-ruby/rest/flex_api/v1/configuration.rb index fd72110a7..eee84ba8b 100644 --- a/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +++ b/lib/twilio-ruby/rest/flex_api/v1/configuration.rb @@ -177,6 +177,7 @@ def initialize(version, payload ) 'flex_ui_status_report' => payload['flex_ui_status_report'], 'agent_conv_end_methods' => payload['agent_conv_end_methods'], 'citrix_voice_vdi' => payload['citrix_voice_vdi'], + 'offline_config' => payload['offline_config'], } # Context @@ -477,6 +478,12 @@ def citrix_voice_vdi @properties['citrix_voice_vdi'] end + ## + # @return [Hash] Presence and presence ttl configuration + def offline_config + @properties['offline_config'] + end + ## # Fetch the ConfigurationInstance # @param [String] ui_version The Pinned UI version of the Configuration resource to fetch. diff --git a/lib/twilio-ruby/rest/intelligence/v2/transcript.rb b/lib/twilio-ruby/rest/intelligence/v2/transcript.rb index 0a30d460f..296010a95 100644 --- a/lib/twilio-ruby/rest/intelligence/v2/transcript.rb +++ b/lib/twilio-ruby/rest/intelligence/v2/transcript.rb @@ -229,16 +229,10 @@ def delete ## # Fetch the TranscriptInstance - # @param [Boolean] redacted Grant access to PII Redacted/Unredacted Transcript. The default is `true` to access redacted Transcript. # @return [TranscriptInstance] Fetched TranscriptInstance - def fetch( - redacted: :unset - ) + def fetch - params = Twilio::Values.of({ - 'Redacted' => redacted, - }) - payload = @version.fetch('GET', @uri, params: params) + payload = @version.fetch('GET', @uri) TranscriptInstance.new( @version, payload, @@ -478,15 +472,10 @@ def delete ## # Fetch the TranscriptInstance - # @param [Boolean] redacted Grant access to PII Redacted/Unredacted Transcript. The default is `true` to access redacted Transcript. # @return [TranscriptInstance] Fetched TranscriptInstance - def fetch( - redacted: :unset - ) + def fetch - context.fetch( - redacted: redacted, - ) + context.fetch end ## diff --git a/lib/twilio-ruby/rest/intelligence/v2/transcript/media.rb b/lib/twilio-ruby/rest/intelligence/v2/transcript/media.rb index dd0db1469..807dd82de 100644 --- a/lib/twilio-ruby/rest/intelligence/v2/transcript/media.rb +++ b/lib/twilio-ruby/rest/intelligence/v2/transcript/media.rb @@ -60,7 +60,7 @@ def initialize(version, sid) end ## # Fetch the MediaInstance - # @param [Boolean] redacted Grant access to PII Redacted/Unredacted Media. The default is `true` to access redacted media. + # @param [Boolean] redacted Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. # @return [MediaInstance] Fetched MediaInstance def fetch( redacted: :unset @@ -191,7 +191,7 @@ def url ## # Fetch the MediaInstance - # @param [Boolean] redacted Grant access to PII Redacted/Unredacted Media. The default is `true` to access redacted media. + # @param [Boolean] redacted Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. # @return [MediaInstance] Fetched MediaInstance def fetch( redacted: :unset diff --git a/lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb b/lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb index 223323d51..9e20f1d73 100644 --- a/lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb +++ b/lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb @@ -36,7 +36,7 @@ def initialize(version, transcript_sid: nil) # Lists OperatorResultInstance records from the API as a list. # Unlike stream(), this operation is eager and will load `limit` records into # memory before returning. - # @param [Boolean] redacted Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + # @param [Boolean] redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. # @param [Integer] limit Upper limit for the number of records to return. stream() # guarantees to never return more than limit. Default is no limit # @param [Integer] page_size Number of records to fetch per request, when @@ -56,7 +56,7 @@ def list(redacted: :unset, limit: nil, page_size: nil) # Streams Instance records from the API as an Enumerable. # This operation lazily loads records as efficiently as possible until the limit # is reached. - # @param [Boolean] redacted Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + # @param [Boolean] redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. # @param [Integer] limit Upper limit for the number of records to return. stream() # guarantees to never return more than limit. Default is no limit # @param [Integer] page_size Number of records to fetch per request, when @@ -91,7 +91,7 @@ def each ## # Retrieve a single page of OperatorResultInstance records from the API. # Request is executed immediately. - # @param [Boolean] redacted Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + # @param [Boolean] redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. # @param [String] page_token PageToken provided by the API # @param [Integer] page_number Page Number, this value is simply for client state # @param [Integer] page_size Number of records to return, defaults to 50 @@ -151,7 +151,7 @@ def initialize(version, transcript_sid, operator_sid) end ## # Fetch the OperatorResultInstance - # @param [Boolean] redacted Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + # @param [Boolean] redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. # @return [OperatorResultInstance] Fetched OperatorResultInstance def fetch( redacted: :unset @@ -346,7 +346,7 @@ def url ## # Fetch the OperatorResultInstance - # @param [Boolean] redacted Grant access to PII redacted/unredacted Language Understanding operator. The default is True. + # @param [Boolean] redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. # @return [OperatorResultInstance] Fetched OperatorResultInstance def fetch( redacted: :unset diff --git a/lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb b/lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb index 212392e50..242554700 100644 --- a/lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb +++ b/lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb @@ -36,7 +36,7 @@ def initialize(version, transcript_sid: nil) # Lists SentenceInstance records from the API as a list. # Unlike stream(), this operation is eager and will load `limit` records into # memory before returning. - # @param [Boolean] redacted Grant access to PII Redacted/Unredacted Sentences. The default is `true` to access redacted sentences. + # @param [Boolean] redacted Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. # @param [Integer] limit Upper limit for the number of records to return. stream() # guarantees to never return more than limit. Default is no limit # @param [Integer] page_size Number of records to fetch per request, when @@ -56,7 +56,7 @@ def list(redacted: :unset, limit: nil, page_size: nil) # Streams Instance records from the API as an Enumerable. # This operation lazily loads records as efficiently as possible until the limit # is reached. - # @param [Boolean] redacted Grant access to PII Redacted/Unredacted Sentences. The default is `true` to access redacted sentences. + # @param [Boolean] redacted Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. # @param [Integer] limit Upper limit for the number of records to return. stream() # guarantees to never return more than limit. Default is no limit # @param [Integer] page_size Number of records to fetch per request, when @@ -91,7 +91,7 @@ def each ## # Retrieve a single page of SentenceInstance records from the API. # Request is executed immediately. - # @param [Boolean] redacted Grant access to PII Redacted/Unredacted Sentences. The default is `true` to access redacted sentences. + # @param [Boolean] redacted Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. # @param [String] page_token PageToken provided by the API # @param [Integer] page_number Page Number, this value is simply for client state # @param [Integer] page_size Number of records to return, defaults to 50 diff --git a/lib/twilio-ruby/rest/lookups/v2/phone_number.rb b/lib/twilio-ruby/rest/lookups/v2/phone_number.rb index 1b36f8508..719fc20bd 100644 --- a/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +++ b/lib/twilio-ruby/rest/lookups/v2/phone_number.rb @@ -184,7 +184,7 @@ def initialize(version, payload , phone_number: nil) 'identity_match' => payload['identity_match'], 'reassigned_number' => payload['reassigned_number'], 'sms_pumping_risk' => payload['sms_pumping_risk'], - 'disposable_phone_number_risk' => payload['disposable_phone_number_risk'], + 'phone_number_quality_score' => payload['phone_number_quality_score'], 'url' => payload['url'], } @@ -289,9 +289,9 @@ def sms_pumping_risk end ## - # @return [Hash] An object that contains information on if a mobile phone number could be a disposable or burner number. - def disposable_phone_number_risk - @properties['disposable_phone_number_risk'] + # @return [Hash] An object that contains information of a mobile phone number quality score. Quality score will return a risk score about the phone number. + def phone_number_quality_score + @properties['phone_number_quality_score'] end ## diff --git a/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb b/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb index 9d6af5010..4fee1abe4 100644 --- a/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +++ b/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb @@ -36,7 +36,7 @@ def initialize(version, messaging_service_sid: nil) # @param [String] brand_registration_sid A2P Brand Registration SID # @param [String] description A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. # @param [String] message_flow 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. - # @param [Array[String]] message_samples Message samples, at least 1 and up to 5 sample messages (at least 2 for sole proprietor), >=20 chars, <=1024 chars each. + # @param [Array[String]] message_samples 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. # @param [String] us_app_to_person_usecase A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING..] # @param [Boolean] has_embedded_links Indicates that this SMS campaign will send messages that contain links. # @param [Boolean] has_embedded_phone Indicates that this SMS campaign will send messages that contain phone numbers. @@ -354,7 +354,7 @@ def description end ## - # @return [Array] Message samples, at least 1 and up to 5 sample messages (at least 2 for starter/sole proprietor), >=20 chars, <=1024 chars each. + # @return [Array] 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. def message_samples @properties['message_samples'] end diff --git a/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb b/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb index a809ff965..4b7aa50e2 100644 --- a/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +++ b/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb @@ -38,13 +38,15 @@ def initialize(version, workspace_sid: nil) # @param [String] task_channel When MultiTasking is enabled, specify the TaskChannel by passing either its `unique_name` or `sid`. Default value is `default`. # @param [String] workflow_sid The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. # @param [String] attributes A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. + # @param [Time] virtual_start_time The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future. # @return [TaskInstance] Created TaskInstance def create( timeout: :unset, priority: :unset, task_channel: :unset, workflow_sid: :unset, - attributes: :unset + attributes: :unset, + virtual_start_time: :unset ) data = Twilio::Values.of({ @@ -53,6 +55,7 @@ def create( 'TaskChannel' => task_channel, 'WorkflowSid' => workflow_sid, 'Attributes' => attributes, + 'VirtualStartTime' => Twilio.serialize_iso8601_datetime(virtual_start_time), }) payload = @version.create('POST', @uri, data: data) @@ -75,7 +78,7 @@ def create( # @param [String] task_queue_sid The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. # @param [String] task_queue_name The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. # @param [String] evaluate_task_attributes The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. - # @param [String] ordering How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `Priority` or `DateCreated` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Multiple 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. + # @param [String] ordering 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. # @param [Boolean] has_addons Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. # @param [Integer] limit Upper limit for the number of records to return. stream() # guarantees to never return more than limit. Default is no limit @@ -111,7 +114,7 @@ def list(priority: :unset, assignment_status: :unset, workflow_sid: :unset, work # @param [String] task_queue_sid The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. # @param [String] task_queue_name The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. # @param [String] evaluate_task_attributes The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. - # @param [String] ordering How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `Priority` or `DateCreated` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Multiple 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. + # @param [String] ordering 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. # @param [Boolean] has_addons Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. # @param [Integer] limit Upper limit for the number of records to return. stream() # guarantees to never return more than limit. Default is no limit @@ -162,7 +165,7 @@ def each # @param [String] task_queue_sid The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. # @param [String] task_queue_name The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. # @param [String] evaluate_task_attributes The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. - # @param [String] ordering How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `Priority` or `DateCreated` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Multiple 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. + # @param [String] ordering 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. # @param [Boolean] has_addons Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. # @param [String] page_token PageToken provided by the API # @param [Integer] page_number Page Number, this value is simply for client state @@ -262,6 +265,7 @@ def fetch # @param [String] reason The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. # @param [String] priority The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). # @param [String] task_channel When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + # @param [Time] virtual_start_time The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. # @param [String] if_match If provided, applies this mutation if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). # @return [TaskInstance] Updated TaskInstance def update( @@ -270,6 +274,7 @@ def update( reason: :unset, priority: :unset, task_channel: :unset, + virtual_start_time: :unset, if_match: :unset ) @@ -279,6 +284,7 @@ def update( 'Reason' => reason, 'Priority' => priority, 'TaskChannel' => task_channel, + 'VirtualStartTime' => Twilio.serialize_iso8601_datetime(virtual_start_time), }) headers = Twilio::Values.of({ 'If-Match' => if_match, }) @@ -390,6 +396,7 @@ def initialize(version, payload , workspace_sid: nil, sid: nil) 'workspace_sid' => payload['workspace_sid'], 'url' => payload['url'], 'links' => payload['links'], + 'virtual_start_time' => Twilio.deserialize_iso8601_datetime(payload['virtual_start_time']), } # Context @@ -534,6 +541,12 @@ def links @properties['links'] end + ## + # @return [Time] The date and time in GMT indicating the ordering for routing of the Task specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + def virtual_start_time + @properties['virtual_start_time'] + end + ## # Delete the TaskInstance # @param [String] if_match If provided, deletes this Task if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). @@ -562,6 +575,7 @@ def fetch # @param [String] reason The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. # @param [String] priority The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). # @param [String] task_channel When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + # @param [Time] virtual_start_time The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. # @param [String] if_match If provided, applies this mutation if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). # @return [TaskInstance] Updated TaskInstance def update( @@ -570,6 +584,7 @@ def update( reason: :unset, priority: :unset, task_channel: :unset, + virtual_start_time: :unset, if_match: :unset ) @@ -579,6 +594,7 @@ def update( reason: reason, priority: priority, task_channel: task_channel, + virtual_start_time: virtual_start_time, if_match: if_match, ) end diff --git a/lib/twilio-ruby/version.rb b/lib/twilio-ruby/version.rb index 9611a3043..51974e488 100644 --- a/lib/twilio-ruby/version.rb +++ b/lib/twilio-ruby/version.rb @@ -1,3 +1,3 @@ module Twilio - VERSION = '6.7.1' + VERSION = '6.8.0' end