diff --git a/CHANGES.md b/CHANGES.md index a36c30a55..e45f5ad93 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,18 @@ twilio-ruby changelog ===================== +[2021-07-28] Version 5.57.1 +--------------------------- +**Conversations** +- Expose ParticipantConversations resource + +**Taskrouter** +- Adding `links` to the activity resource + +**Verify** +- Added a `Version` to Verify Factors `Webhooks` to add new fields without breaking old Webhooks. + + [2021-07-14] Version 5.57.0 --------------------------- **Conversations** diff --git a/lib/twilio-ruby/rest/conversations.rb b/lib/twilio-ruby/rest/conversations.rb index 18c9ed8c1..34156075d 100644 --- a/lib/twilio-ruby/rest/conversations.rb +++ b/lib/twilio-ruby/rest/conversations.rb @@ -52,6 +52,12 @@ def credentials(sid=:unset) self.v1.credentials(sid) end + ## + # @return [Twilio::REST::Conversations::V1::ParticipantConversationInstance] + def participant_conversations + self.v1.participant_conversations() + end + ## # @param [String] sid The unique string that we created to identify the Role # resource. diff --git a/lib/twilio-ruby/rest/conversations/v1.rb b/lib/twilio-ruby/rest/conversations/v1.rb index 368b5953e..7af750233 100644 --- a/lib/twilio-ruby/rest/conversations/v1.rb +++ b/lib/twilio-ruby/rest/conversations/v1.rb @@ -18,6 +18,7 @@ def initialize(domain) @configuration = nil @conversations = nil @credentials = nil + @participant_conversations = nil @roles = nil @services = nil @users = nil @@ -61,6 +62,12 @@ def credentials(sid=:unset) end end + ## + # @return [Twilio::REST::Conversations::V1::ParticipantConversationContext] + def participant_conversations + @participant_conversations ||= ParticipantConversationList.new self + end + ## # @param [String] sid The SID of the Role resource to fetch. # @return [Twilio::REST::Conversations::V1::RoleContext] if sid was passed. diff --git a/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb b/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb new file mode 100644 index 000000000..cd98aef43 --- /dev/null +++ b/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb @@ -0,0 +1,312 @@ +## +# This code was generated by +# \ / _ _ _| _ _ +# | (_)\/(_)(_|\/| |(/_ v1.0.0 +# / / +# +# frozen_string_literal: true + +module Twilio + module REST + class Conversations < Domain + class V1 < Version + class ParticipantConversationList < ListResource + ## + # Initialize the ParticipantConversationList + # @param [Version] version Version that contains the resource + # @return [ParticipantConversationList] ParticipantConversationList + def initialize(version) + super(version) + + # Path Solution + @solution = {} + @uri = "/ParticipantConversations" + end + + ## + # Lists ParticipantConversationInstance records from the API as a list. + # Unlike stream(), this operation is eager and will load `limit` records into + # memory before returning. + # @param [String] identity A unique string identifier for the conversation + # participant as {Conversation + # User}[https://www.twilio.com/docs/conversations/api/user-resource]. This + # parameter is non-null if (and only if) the participant is using the + # Conversations SDK to communicate. Limited to 256 characters. + # @param [String] address A unique string identifier for the conversation + # participant who's not a Conversation User. This parameter could be found in + # messaging_binding.address field of Participant resource. It should be + # url-encoded. + # @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 + # not set will use the default value of 50 records. If no page_size is defined + # but a limit is defined, stream() will attempt to read the limit with the most + # efficient page size, i.e. min(limit, 1000) + # @return [Array] Array of up to limit results + def list(identity: :unset, address: :unset, limit: nil, page_size: nil) + self.stream(identity: identity, address: address, limit: limit, page_size: page_size).entries + end + + ## + # Streams ParticipantConversationInstance records from the API as an Enumerable. + # This operation lazily loads records as efficiently as possible until the limit + # is reached. + # @param [String] identity A unique string identifier for the conversation + # participant as {Conversation + # User}[https://www.twilio.com/docs/conversations/api/user-resource]. This + # parameter is non-null if (and only if) the participant is using the + # Conversations SDK to communicate. Limited to 256 characters. + # @param [String] address A unique string identifier for the conversation + # participant who's not a Conversation User. This parameter could be found in + # messaging_binding.address field of Participant resource. It should be + # url-encoded. + # @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 + # not set will use the default value of 50 records. If no page_size is defined + # but a limit is defined, stream() will attempt to read the limit with the most + # efficient page size, i.e. min(limit, 1000) + # @return [Enumerable] Enumerable that will yield up to limit results + def stream(identity: :unset, address: :unset, limit: nil, page_size: nil) + limits = @version.read_limits(limit, page_size) + + page = self.page(identity: identity, address: address, page_size: limits[:page_size], ) + + @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) + end + + ## + # When passed a block, yields ParticipantConversationInstance records from the API. + # This operation lazily loads records as efficiently as possible until the limit + # is reached. + def each + limits = @version.read_limits + + page = self.page(page_size: limits[:page_size], ) + + @version.stream(page, + limit: limits[:limit], + page_limit: limits[:page_limit]).each {|x| yield x} + end + + ## + # Retrieve a single page of ParticipantConversationInstance records from the API. + # Request is executed immediately. + # @param [String] identity A unique string identifier for the conversation + # participant as {Conversation + # User}[https://www.twilio.com/docs/conversations/api/user-resource]. This + # parameter is non-null if (and only if) the participant is using the + # Conversations SDK to communicate. Limited to 256 characters. + # @param [String] address A unique string identifier for the conversation + # participant who's not a Conversation User. This parameter could be found in + # messaging_binding.address field of Participant resource. It should be + # url-encoded. + # @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 + # @return [Page] Page of ParticipantConversationInstance + def page(identity: :unset, address: :unset, page_token: :unset, page_number: :unset, page_size: :unset) + params = Twilio::Values.of({ + 'Identity' => identity, + 'Address' => address, + 'PageToken' => page_token, + 'Page' => page_number, + 'PageSize' => page_size, + }) + + response = @version.page('GET', @uri, params: params) + + ParticipantConversationPage.new(@version, response, @solution) + end + + ## + # Retrieve a single page of ParticipantConversationInstance records from the API. + # Request is executed immediately. + # @param [String] target_url API-generated URL for the requested results page + # @return [Page] Page of ParticipantConversationInstance + def get_page(target_url) + response = @version.domain.request( + 'GET', + target_url + ) + ParticipantConversationPage.new(@version, response, @solution) + end + + ## + # Provide a user friendly representation + def to_s + '#' + end + end + + class ParticipantConversationPage < Page + ## + # Initialize the ParticipantConversationPage + # @param [Version] version Version that contains the resource + # @param [Response] response Response from the API + # @param [Hash] solution Path solution for the resource + # @return [ParticipantConversationPage] ParticipantConversationPage + def initialize(version, response, solution) + super(version, response) + + # Path Solution + @solution = solution + end + + ## + # Build an instance of ParticipantConversationInstance + # @param [Hash] payload Payload response from the API + # @return [ParticipantConversationInstance] ParticipantConversationInstance + def get_instance(payload) + ParticipantConversationInstance.new(@version, payload, ) + end + + ## + # Provide a user friendly representation + def to_s + '' + end + end + + class ParticipantConversationInstance < InstanceResource + ## + # Initialize the ParticipantConversationInstance + # @param [Version] version Version that contains the resource + # @param [Hash] payload payload that contains response from Twilio + # @return [ParticipantConversationInstance] ParticipantConversationInstance + def initialize(version, payload) + super(version) + + # Marshaled Properties + @properties = { + 'account_sid' => payload['account_sid'], + 'chat_service_sid' => payload['chat_service_sid'], + 'participant_sid' => payload['participant_sid'], + 'participant_user_sid' => payload['participant_user_sid'], + 'participant_identity' => payload['participant_identity'], + 'participant_messaging_binding' => payload['participant_messaging_binding'], + 'conversation_sid' => payload['conversation_sid'], + 'conversation_unique_name' => payload['conversation_unique_name'], + 'conversation_friendly_name' => payload['conversation_friendly_name'], + 'conversation_attributes' => payload['conversation_attributes'], + 'conversation_date_created' => Twilio.deserialize_iso8601_datetime(payload['conversation_date_created']), + 'conversation_date_updated' => Twilio.deserialize_iso8601_datetime(payload['conversation_date_updated']), + 'conversation_created_by' => payload['conversation_created_by'], + 'conversation_state' => payload['conversation_state'], + 'conversation_timers' => payload['conversation_timers'], + 'links' => payload['links'], + } + end + + ## + # @return [String] The unique ID of the Account responsible for this conversation. + def account_sid + @properties['account_sid'] + end + + ## + # @return [String] The unique ID of the Conversation Service this conversation belongs to. + def chat_service_sid + @properties['chat_service_sid'] + end + + ## + # @return [String] The unique ID of the Participant. + def participant_sid + @properties['participant_sid'] + end + + ## + # @return [String] The unique ID for the conversation participant as Conversation User. + def participant_user_sid + @properties['participant_user_sid'] + end + + ## + # @return [String] A unique string identifier for the conversation participant as Conversation User. + def participant_identity + @properties['participant_identity'] + end + + ## + # @return [Hash] Information about how this participant exchanges messages with the conversation. + def participant_messaging_binding + @properties['participant_messaging_binding'] + end + + ## + # @return [String] The unique ID of the Conversation this Participant belongs to. + def conversation_sid + @properties['conversation_sid'] + end + + ## + # @return [String] An application-defined string that uniquely identifies the Conversation resource + def conversation_unique_name + @properties['conversation_unique_name'] + end + + ## + # @return [String] The human-readable name of this conversation. + def conversation_friendly_name + @properties['conversation_friendly_name'] + end + + ## + # @return [String] An optional string metadata field you can use to store any data you wish. + def conversation_attributes + @properties['conversation_attributes'] + end + + ## + # @return [Time] The date that this conversation was created. + def conversation_date_created + @properties['conversation_date_created'] + end + + ## + # @return [Time] The date that this conversation was last updated. + def conversation_date_updated + @properties['conversation_date_updated'] + end + + ## + # @return [String] Creator of this conversation. + def conversation_created_by + @properties['conversation_created_by'] + end + + ## + # @return [participant_conversation.State] The current state of this User Conversation + def conversation_state + @properties['conversation_state'] + end + + ## + # @return [Hash] Timer date values for this conversation. + def conversation_timers + @properties['conversation_timers'] + end + + ## + # @return [String] Absolute URLs to access the participant and conversation of this Participant Conversation. + def links + @properties['links'] + end + + ## + # Provide a user friendly representation + def to_s + "" + end + + ## + # Provide a detailed, user friendly representation + def inspect + "" + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/twilio-ruby/rest/conversations/v1/service.rb b/lib/twilio-ruby/rest/conversations/v1/service.rb index 6bd725381..6c8c59dc9 100644 --- a/lib/twilio-ruby/rest/conversations/v1/service.rb +++ b/lib/twilio-ruby/rest/conversations/v1/service.rb @@ -172,6 +172,7 @@ def initialize(version, sid) @users = nil @roles = nil @configuration = nil + @participant_conversations = nil end ## @@ -270,6 +271,21 @@ def configuration ConfigurationContext.new(@version, @solution[:sid], ) end + ## + # Access the participant_conversations + # @return [ParticipantConversationList] + # @return [ParticipantConversationContext] + def participant_conversations + unless @participant_conversations + @participant_conversations = ParticipantConversationList.new( + @version, + chat_service_sid: @solution[:sid], + ) + end + + @participant_conversations + end + ## # Provide a user friendly representation def to_s @@ -414,6 +430,13 @@ def configuration context.configuration end + ## + # Access the participant_conversations + # @return [participant_conversations] participant_conversations + def participant_conversations + context.participant_conversations + end + ## # Provide a user friendly representation def to_s diff --git a/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb b/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb new file mode 100644 index 000000000..a05e03e3b --- /dev/null +++ b/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb @@ -0,0 +1,324 @@ +## +# This code was generated by +# \ / _ _ _| _ _ +# | (_)\/(_)(_|\/| |(/_ v1.0.0 +# / / +# +# frozen_string_literal: true + +module Twilio + module REST + class Conversations < Domain + class V1 < Version + class ServiceContext < InstanceContext + class ParticipantConversationList < ListResource + ## + # Initialize the ParticipantConversationList + # @param [Version] version Version that contains the resource + # @param [String] chat_service_sid The unique ID of the {Conversation + # Service}[https://www.twilio.com/docs/conversations/api/service-resource] this + # conversation belongs to. + # @return [ParticipantConversationList] ParticipantConversationList + def initialize(version, chat_service_sid: nil) + super(version) + + # Path Solution + @solution = {chat_service_sid: chat_service_sid} + @uri = "/Services/#{@solution[:chat_service_sid]}/ParticipantConversations" + end + + ## + # Lists ParticipantConversationInstance records from the API as a list. + # Unlike stream(), this operation is eager and will load `limit` records into + # memory before returning. + # @param [String] identity A unique string identifier for the conversation + # participant as {Conversation + # User}[https://www.twilio.com/docs/conversations/api/user-resource]. This + # parameter is non-null if (and only if) the participant is using the + # Conversations SDK to communicate. Limited to 256 characters. + # @param [String] address A unique string identifier for the conversation + # participant who's not a Conversation User. This parameter could be found in + # messaging_binding.address field of Participant resource. It should be + # url-encoded. + # @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 + # not set will use the default value of 50 records. If no page_size is defined + # but a limit is defined, stream() will attempt to read the limit with the most + # efficient page size, i.e. min(limit, 1000) + # @return [Array] Array of up to limit results + def list(identity: :unset, address: :unset, limit: nil, page_size: nil) + self.stream(identity: identity, address: address, limit: limit, page_size: page_size).entries + end + + ## + # Streams ParticipantConversationInstance records from the API as an Enumerable. + # This operation lazily loads records as efficiently as possible until the limit + # is reached. + # @param [String] identity A unique string identifier for the conversation + # participant as {Conversation + # User}[https://www.twilio.com/docs/conversations/api/user-resource]. This + # parameter is non-null if (and only if) the participant is using the + # Conversations SDK to communicate. Limited to 256 characters. + # @param [String] address A unique string identifier for the conversation + # participant who's not a Conversation User. This parameter could be found in + # messaging_binding.address field of Participant resource. It should be + # url-encoded. + # @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 + # not set will use the default value of 50 records. If no page_size is defined + # but a limit is defined, stream() will attempt to read the limit with the most + # efficient page size, i.e. min(limit, 1000) + # @return [Enumerable] Enumerable that will yield up to limit results + def stream(identity: :unset, address: :unset, limit: nil, page_size: nil) + limits = @version.read_limits(limit, page_size) + + page = self.page(identity: identity, address: address, page_size: limits[:page_size], ) + + @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) + end + + ## + # When passed a block, yields ParticipantConversationInstance records from the API. + # This operation lazily loads records as efficiently as possible until the limit + # is reached. + def each + limits = @version.read_limits + + page = self.page(page_size: limits[:page_size], ) + + @version.stream(page, + limit: limits[:limit], + page_limit: limits[:page_limit]).each {|x| yield x} + end + + ## + # Retrieve a single page of ParticipantConversationInstance records from the API. + # Request is executed immediately. + # @param [String] identity A unique string identifier for the conversation + # participant as {Conversation + # User}[https://www.twilio.com/docs/conversations/api/user-resource]. This + # parameter is non-null if (and only if) the participant is using the + # Conversations SDK to communicate. Limited to 256 characters. + # @param [String] address A unique string identifier for the conversation + # participant who's not a Conversation User. This parameter could be found in + # messaging_binding.address field of Participant resource. It should be + # url-encoded. + # @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 + # @return [Page] Page of ParticipantConversationInstance + def page(identity: :unset, address: :unset, page_token: :unset, page_number: :unset, page_size: :unset) + params = Twilio::Values.of({ + 'Identity' => identity, + 'Address' => address, + 'PageToken' => page_token, + 'Page' => page_number, + 'PageSize' => page_size, + }) + + response = @version.page('GET', @uri, params: params) + + ParticipantConversationPage.new(@version, response, @solution) + end + + ## + # Retrieve a single page of ParticipantConversationInstance records from the API. + # Request is executed immediately. + # @param [String] target_url API-generated URL for the requested results page + # @return [Page] Page of ParticipantConversationInstance + def get_page(target_url) + response = @version.domain.request( + 'GET', + target_url + ) + ParticipantConversationPage.new(@version, response, @solution) + end + + ## + # Provide a user friendly representation + def to_s + '#' + end + end + + class ParticipantConversationPage < Page + ## + # Initialize the ParticipantConversationPage + # @param [Version] version Version that contains the resource + # @param [Response] response Response from the API + # @param [Hash] solution Path solution for the resource + # @return [ParticipantConversationPage] ParticipantConversationPage + def initialize(version, response, solution) + super(version, response) + + # Path Solution + @solution = solution + end + + ## + # Build an instance of ParticipantConversationInstance + # @param [Hash] payload Payload response from the API + # @return [ParticipantConversationInstance] ParticipantConversationInstance + def get_instance(payload) + ParticipantConversationInstance.new( + @version, + payload, + chat_service_sid: @solution[:chat_service_sid], + ) + end + + ## + # Provide a user friendly representation + def to_s + '' + end + end + + class ParticipantConversationInstance < InstanceResource + ## + # Initialize the ParticipantConversationInstance + # @param [Version] version Version that contains the resource + # @param [Hash] payload payload that contains response from Twilio + # @param [String] chat_service_sid The unique ID of the {Conversation + # Service}[https://www.twilio.com/docs/conversations/api/service-resource] this + # conversation belongs to. + # @return [ParticipantConversationInstance] ParticipantConversationInstance + def initialize(version, payload, chat_service_sid: nil) + super(version) + + # Marshaled Properties + @properties = { + 'account_sid' => payload['account_sid'], + 'chat_service_sid' => payload['chat_service_sid'], + 'participant_sid' => payload['participant_sid'], + 'participant_user_sid' => payload['participant_user_sid'], + 'participant_identity' => payload['participant_identity'], + 'participant_messaging_binding' => payload['participant_messaging_binding'], + 'conversation_sid' => payload['conversation_sid'], + 'conversation_unique_name' => payload['conversation_unique_name'], + 'conversation_friendly_name' => payload['conversation_friendly_name'], + 'conversation_attributes' => payload['conversation_attributes'], + 'conversation_date_created' => Twilio.deserialize_iso8601_datetime(payload['conversation_date_created']), + 'conversation_date_updated' => Twilio.deserialize_iso8601_datetime(payload['conversation_date_updated']), + 'conversation_created_by' => payload['conversation_created_by'], + 'conversation_state' => payload['conversation_state'], + 'conversation_timers' => payload['conversation_timers'], + 'links' => payload['links'], + } + end + + ## + # @return [String] The unique ID of the Account responsible for this conversation. + def account_sid + @properties['account_sid'] + end + + ## + # @return [String] The unique ID of the Conversation Service this conversation belongs to. + def chat_service_sid + @properties['chat_service_sid'] + end + + ## + # @return [String] The unique ID of the Participant. + def participant_sid + @properties['participant_sid'] + end + + ## + # @return [String] The unique ID for the conversation participant as Conversation User. + def participant_user_sid + @properties['participant_user_sid'] + end + + ## + # @return [String] A unique string identifier for the conversation participant as Conversation User. + def participant_identity + @properties['participant_identity'] + end + + ## + # @return [Hash] Information about how this participant exchanges messages with the conversation. + def participant_messaging_binding + @properties['participant_messaging_binding'] + end + + ## + # @return [String] The unique ID of the Conversation this Participant belongs to. + def conversation_sid + @properties['conversation_sid'] + end + + ## + # @return [String] An application-defined string that uniquely identifies the Conversation resource. + def conversation_unique_name + @properties['conversation_unique_name'] + end + + ## + # @return [String] The human-readable name of this conversation. + def conversation_friendly_name + @properties['conversation_friendly_name'] + end + + ## + # @return [String] An optional string metadata field you can use to store any data you wish. + def conversation_attributes + @properties['conversation_attributes'] + end + + ## + # @return [Time] The date that this conversation was created. + def conversation_date_created + @properties['conversation_date_created'] + end + + ## + # @return [Time] The date that this conversation was last updated. + def conversation_date_updated + @properties['conversation_date_updated'] + end + + ## + # @return [String] Creator of this conversation. + def conversation_created_by + @properties['conversation_created_by'] + end + + ## + # @return [participant_conversation.State] The current state of this User Conversation + def conversation_state + @properties['conversation_state'] + end + + ## + # @return [Hash] Timer date values for this conversation. + def conversation_timers + @properties['conversation_timers'] + end + + ## + # @return [String] Absolute URLs to access the participant and conversation of this Participant Conversation. + def links + @properties['links'] + end + + ## + # Provide a user friendly representation + def to_s + "" + end + + ## + # Provide a detailed, user friendly representation + def inspect + "" + end + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb b/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb index 3c3b36d67..05f2f783e 100644 --- a/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb +++ b/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb @@ -318,7 +318,7 @@ def chat_service_sid end ## - # @return [String] The unique ID of the Conversation for this message. + # @return [String] The unique ID of the Conversation for this User Conversation. def conversation_sid @properties['conversation_sid'] end @@ -396,7 +396,7 @@ def notification_level end ## - # @return [String] An application-defined string that uniquely identifies the resource + # @return [String] An application-defined string that uniquely identifies the Conversation resource. def unique_name @properties['unique_name'] end diff --git a/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb b/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb index 5fa495823..4b31df704 100644 --- a/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb +++ b/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb @@ -295,7 +295,7 @@ def chat_service_sid end ## - # @return [String] The unique ID of the Conversation for this message. + # @return [String] The unique ID of the Conversation for this User Conversation. def conversation_sid @properties['conversation_sid'] end @@ -373,7 +373,7 @@ def notification_level end ## - # @return [String] An application-defined string that uniquely identifies the resource + # @return [String] An application-defined string that uniquely identifies the Conversation resource. def unique_name @properties['unique_name'] end diff --git a/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb b/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb index 2a1030e27..cf65deed1 100644 --- a/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +++ b/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb @@ -282,6 +282,7 @@ def initialize(version, payload, workspace_sid: nil, sid: nil) 'sid' => payload['sid'], 'workspace_sid' => payload['workspace_sid'], 'url' => payload['url'], + 'links' => payload['links'], } # Context @@ -348,6 +349,12 @@ def url @properties['url'] end + ## + # @return [String] The links + def links + @properties['links'] + end + ## # Fetch the ActivityInstance # @return [ActivityInstance] Fetched ActivityInstance diff --git a/lib/twilio-ruby/rest/verify/v2/service/webhook.rb b/lib/twilio-ruby/rest/verify/v2/service/webhook.rb index f20267ebf..ad3ba3df3 100644 --- a/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +++ b/lib/twilio-ruby/rest/verify/v2/service/webhook.rb @@ -37,13 +37,17 @@ def initialize(version, service_sid: nil) # @param [String] webhook_url The URL associated with this Webhook. # @param [webhook.Status] status The webhook status. Default value is `enabled`. # One of: `enabled` or `disabled` + # @param [webhook.Version] version The webhook version. Default value is `v2` + # which includes all the latest fields. Version `v1` is legacy and may be removed + # in the future. # @return [WebhookInstance] Created WebhookInstance - def create(friendly_name: nil, event_types: nil, webhook_url: nil, status: :unset) + def create(friendly_name: nil, event_types: nil, webhook_url: nil, status: :unset, version: :unset) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'EventTypes' => Twilio.serialize_list(event_types) { |e| e }, 'WebhookUrl' => webhook_url, 'Status' => status, + 'Version' => version, }) payload = @version.create('POST', @uri, data: data) @@ -197,13 +201,17 @@ def initialize(version, service_sid, sid) # @param [String] webhook_url The URL associated with this Webhook. # @param [webhook.Status] status The webhook status. Default value is `enabled`. # One of: `enabled` or `disabled` + # @param [webhook.Version] version The webhook version. Default value is `v2` + # which includes all the latest fields. Version `v1` is legacy and may be removed + # in the future. # @return [WebhookInstance] Updated WebhookInstance - def update(friendly_name: :unset, event_types: :unset, webhook_url: :unset, status: :unset) + def update(friendly_name: :unset, event_types: :unset, webhook_url: :unset, status: :unset, version: :unset) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'EventTypes' => Twilio.serialize_list(event_types) { |e| e }, 'WebhookUrl' => webhook_url, 'Status' => status, + 'Version' => version, }) payload = @version.update('POST', @uri, data: data) @@ -264,6 +272,7 @@ def initialize(version, payload, service_sid: nil, sid: nil) 'friendly_name' => payload['friendly_name'], 'event_types' => payload['event_types'], 'status' => payload['status'], + 'version' => payload['version'], 'webhook_url' => payload['webhook_url'], 'webhook_method' => payload['webhook_method'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), @@ -323,6 +332,12 @@ def status @properties['status'] end + ## + # @return [webhook.Version] The webhook version + def version + @properties['version'] + end + ## # @return [String] The URL associated with this Webhook. def webhook_url @@ -336,13 +351,13 @@ def webhook_method end ## - # @return [Time] The RFC 2822 date and time in GMT when the resource was created + # @return [Time] The ISO 8601 date and time in GMT when the resource was created def date_created @properties['date_created'] end ## - # @return [Time] The RFC 2822 date and time in GMT when the resource was last updated + # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated def date_updated @properties['date_updated'] end @@ -363,13 +378,17 @@ def url # @param [String] webhook_url The URL associated with this Webhook. # @param [webhook.Status] status The webhook status. Default value is `enabled`. # One of: `enabled` or `disabled` + # @param [webhook.Version] version The webhook version. Default value is `v2` + # which includes all the latest fields. Version `v1` is legacy and may be removed + # in the future. # @return [WebhookInstance] Updated WebhookInstance - def update(friendly_name: :unset, event_types: :unset, webhook_url: :unset, status: :unset) + def update(friendly_name: :unset, event_types: :unset, webhook_url: :unset, status: :unset, version: :unset) context.update( friendly_name: friendly_name, event_types: event_types, webhook_url: webhook_url, status: status, + version: version, ) end diff --git a/spec/integration/conversations/v1/participant_conversation_spec.rb b/spec/integration/conversations/v1/participant_conversation_spec.rb new file mode 100644 index 000000000..5a466ca70 --- /dev/null +++ b/spec/integration/conversations/v1/participant_conversation_spec.rb @@ -0,0 +1,154 @@ +## +# This code was generated by +# \ / _ _ _| _ _ +# | (_)\/(_)(_|\/| |(/_ v1.0.0 +# / / +# +# frozen_string_literal: true + +require 'spec_helper.rb' + +describe 'ParticipantConversation' do + it "can read" do + @holodeck.mock(Twilio::Response.new(500, '')) + + expect { + @client.conversations.v1.participant_conversations.list() + }.to raise_exception(Twilio::REST::TwilioError) + + expect( + @holodeck.has_request?(Holodeck::Request.new( + method: 'get', + url: 'https://conversations.twilio.com/v1/ParticipantConversations', + ))).to eq(true) + end + + it "receives read_empty responses" do + @holodeck.mock(Twilio::Response.new( + 200, + %q[ + { + "conversations": [], + "meta": { + "page": 0, + "page_size": 50, + "first_page_url": "https://conversations.twilio.com/v1/ParticipantConversations?Identity=identity&PageSize=50&Page=0", + "previous_page_url": null, + "url": "https://conversations.twilio.com/v1/ParticipantConversations?Identity=identity&PageSize=50&Page=0", + "next_page_url": null, + "key": "conversations" + } + } + ] + )) + + actual = @client.conversations.v1.participant_conversations.list() + + expect(actual).to_not eq(nil) + end + + it "receives read_full_by_identity responses" do + @holodeck.mock(Twilio::Response.new( + 200, + %q[ + { + "conversations": [ + { + "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "conversation_friendly_name": "friendly_name", + "conversation_state": "inactive", + "conversation_timers": { + "date_inactive": "2015-12-16T22:19:38Z", + "date_closed": "2015-12-16T22:28:38Z" + }, + "conversation_attributes": "{}", + "conversation_date_created": "2015-07-30T20:00:00Z", + "conversation_date_updated": "2015-07-30T20:00:00Z", + "conversation_created_by": "created_by", + "conversation_unique_name": "unique_name", + "participant_user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "participant_identity": "identity", + "participant_messaging_binding": null, + "links": { + "participant": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "conversation": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + } + ], + "meta": { + "page": 0, + "page_size": 50, + "first_page_url": "https://conversations.twilio.com/v1/ParticipantConversations?Identity=identity&PageSize=50&Page=0", + "previous_page_url": null, + "url": "https://conversations.twilio.com/v1/ParticipantConversations?Identity=identity&PageSize=50&Page=0", + "next_page_url": null, + "key": "conversations" + } + } + ] + )) + + actual = @client.conversations.v1.participant_conversations.list() + + expect(actual).to_not eq(nil) + end + + it "receives read_full_by_address responses" do + @holodeck.mock(Twilio::Response.new( + 200, + %q[ + { + "conversations": [ + { + "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "conversation_friendly_name": "friendly_name", + "conversation_state": "inactive", + "conversation_timers": { + "date_inactive": "2015-12-16T22:19:38Z", + "date_closed": "2015-12-16T22:28:38Z" + }, + "conversation_attributes": "{}", + "conversation_date_created": "2015-07-30T20:00:00Z", + "conversation_date_updated": "2015-07-30T20:00:00Z", + "conversation_created_by": "created_by", + "conversation_unique_name": "unique_name", + "participant_user_sid": null, + "participant_identity": null, + "participant_messaging_binding": { + "address": "+375255555555", + "proxy_address": "+12345678910", + "type": "sms", + "level": null, + "name": null, + "projected_address": null + }, + "links": { + "participant": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "conversation": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + } + ], + "meta": { + "page": 0, + "page_size": 50, + "first_page_url": "https://conversations.twilio.com/v1/ParticipantConversations?Address=%2B375255555555&PageSize=50&Page=0", + "previous_page_url": null, + "url": "https://conversations.twilio.com/v1/ParticipantConversations?Address=%2B375255555555&PageSize=50&Page=0", + "next_page_url": null, + "key": "conversations" + } + } + ] + )) + + actual = @client.conversations.v1.participant_conversations.list() + + expect(actual).to_not eq(nil) + end +end \ No newline at end of file diff --git a/spec/integration/conversations/v1/service/participant_conversation_spec.rb b/spec/integration/conversations/v1/service/participant_conversation_spec.rb new file mode 100644 index 000000000..7d561f2d2 --- /dev/null +++ b/spec/integration/conversations/v1/service/participant_conversation_spec.rb @@ -0,0 +1,158 @@ +## +# This code was generated by +# \ / _ _ _| _ _ +# | (_)\/(_)(_|\/| |(/_ v1.0.0 +# / / +# +# frozen_string_literal: true + +require 'spec_helper.rb' + +describe 'ParticipantConversation' do + it "can read" do + @holodeck.mock(Twilio::Response.new(500, '')) + + expect { + @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \ + .participant_conversations.list() + }.to raise_exception(Twilio::REST::TwilioError) + + expect( + @holodeck.has_request?(Holodeck::Request.new( + method: 'get', + url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ParticipantConversations', + ))).to eq(true) + end + + it "receives read_empty responses" do + @holodeck.mock(Twilio::Response.new( + 200, + %q[ + { + "conversations": [], + "meta": { + "page": 0, + "page_size": 50, + "first_page_url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ParticipantConversations?Identity=identity&PageSize=50&Page=0", + "previous_page_url": null, + "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ParticipantConversations?Identity=identity&PageSize=50&Page=0", + "next_page_url": null, + "key": "conversations" + } + } + ] + )) + + actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \ + .participant_conversations.list() + + expect(actual).to_not eq(nil) + end + + it "receives read_full_by_identity responses" do + @holodeck.mock(Twilio::Response.new( + 200, + %q[ + { + "conversations": [ + { + "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "conversation_friendly_name": "friendly_name", + "conversation_state": "inactive", + "conversation_timers": { + "date_inactive": "2015-12-16T22:19:38Z", + "date_closed": "2015-12-16T22:28:38Z" + }, + "conversation_attributes": "{}", + "conversation_date_created": "2015-07-30T20:00:00Z", + "conversation_date_updated": "2015-07-30T20:00:00Z", + "conversation_created_by": "created_by", + "conversation_unique_name": "unique_name", + "participant_user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "participant_identity": "identity", + "participant_messaging_binding": null, + "links": { + "participant": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "conversation": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + } + ], + "meta": { + "page": 0, + "page_size": 50, + "first_page_url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ParticipantConversations?Identity=identity&PageSize=50&Page=0", + "previous_page_url": null, + "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ParticipantConversations?Identity=identity&PageSize=50&Page=0", + "next_page_url": null, + "key": "conversations" + } + } + ] + )) + + actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \ + .participant_conversations.list() + + expect(actual).to_not eq(nil) + end + + it "receives read_full_by_address responses" do + @holodeck.mock(Twilio::Response.new( + 200, + %q[ + { + "conversations": [ + { + "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "conversation_friendly_name": "friendly_name", + "conversation_state": "inactive", + "conversation_timers": { + "date_inactive": "2015-12-16T22:19:38Z", + "date_closed": "2015-12-16T22:28:38Z" + }, + "conversation_attributes": "{}", + "conversation_date_created": "2015-07-30T20:00:00Z", + "conversation_date_updated": "2015-07-30T20:00:00Z", + "conversation_created_by": "created_by", + "conversation_unique_name": "unique_name", + "participant_user_sid": null, + "participant_identity": null, + "participant_messaging_binding": { + "address": "+375255555555", + "proxy_address": "+12345678910", + "type": "sms", + "level": null, + "name": null, + "projected_address": null + }, + "links": { + "participant": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "conversation": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + } + ], + "meta": { + "page": 0, + "page_size": 50, + "first_page_url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ParticipantConversations?Address=%2B375255555555&PageSize=50&Page=0", + "previous_page_url": null, + "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ParticipantConversations?Address=%2B375255555555&PageSize=50&Page=0", + "next_page_url": null, + "key": "conversations" + } + } + ] + )) + + actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \ + .participant_conversations.list() + + expect(actual).to_not eq(nil) + end +end \ No newline at end of file diff --git a/spec/integration/conversations/v1/service_spec.rb b/spec/integration/conversations/v1/service_spec.rb index 51e31e061..023e898fe 100644 --- a/spec/integration/conversations/v1/service_spec.rb +++ b/spec/integration/conversations/v1/service_spec.rb @@ -41,7 +41,8 @@ "users": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users", "roles": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles", "bindings": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings", - "configuration": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration" + "configuration": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration", + "participant_conversations": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ParticipantConversations" } } ] @@ -107,7 +108,8 @@ "users": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users", "roles": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles", "bindings": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings", - "configuration": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration" + "configuration": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration", + "participant_conversations": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ParticipantConversations" } } ] @@ -150,7 +152,8 @@ "users": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users", "roles": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles", "bindings": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings", - "configuration": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration" + "configuration": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration", + "participant_conversations": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ParticipantConversations" } } ], diff --git a/spec/integration/taskrouter/v1/workspace/activity_spec.rb b/spec/integration/taskrouter/v1/workspace/activity_spec.rb index dfd7e68b4..cd56a2fd4 100644 --- a/spec/integration/taskrouter/v1/workspace/activity_spec.rb +++ b/spec/integration/taskrouter/v1/workspace/activity_spec.rb @@ -36,7 +36,10 @@ "friendly_name": "New Activity", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "links": { + "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } } ] )) @@ -74,7 +77,10 @@ "friendly_name": "New Activity", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "links": { + "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } } ] )) @@ -141,18 +147,20 @@ "friendly_name": "New Activity", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "links": { + "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } } ], "meta": { - "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0", + "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?Available=true&FriendlyName=friendly_name&PageSize=50&Page=0", "key": "activities", - "last_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, - "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0" + "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?Available=true&FriendlyName=friendly_name&PageSize=50&Page=0" } } ] @@ -171,14 +179,13 @@ { "activities": [], "meta": { - "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0", + "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?Available=true&FriendlyName=friendly_name&PageSize=50&Page=0", "key": "activities", - "last_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, - "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0" + "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?Available=true&FriendlyName=friendly_name&PageSize=50&Page=0" } } ] @@ -219,7 +226,10 @@ "friendly_name": "New Activity", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "links": { + "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } } ] )) diff --git a/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb b/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb index 99531f1a4..d7d9fc807 100644 --- a/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +++ b/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb @@ -35,9 +35,9 @@ "key": "channels", "next_page_url": null, "page": 0, - "page_size": 1, + "page_size": 50, "previous_page_url": null, - "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels" + "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0" }, "channels": [ { @@ -46,12 +46,12 @@ "available": true, "available_capacity_percentage": 100, "configured_capacity": 1, - "date_created": "2014-05-14T10:50:02Z", - "date_updated": "2014-05-15T16:03:42Z", + "date_created": "2016-04-14T17:35:54Z", + "date_updated": "2016-04-14T17:35:54Z", "sid": "WCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_unique_name": "default", - "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/WCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } @@ -77,9 +77,9 @@ "key": "channels", "next_page_url": null, "page": 0, - "page_size": 1, + "page_size": 50, "previous_page_url": null, - "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels" + "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0" }, "channels": [] } @@ -109,7 +109,7 @@ ))).to eq(true) end - it "receives fetch responses" do + it "receives fetch_sid responses" do @holodeck.mock(Twilio::Response.new( 200, %q[ @@ -119,12 +119,12 @@ "available": true, "available_capacity_percentage": 100, "configured_capacity": 1, - "date_created": "2014-05-14T10:50:02Z", - "date_updated": "2014-05-15T16:03:42Z", + "date_created": "2016-04-14T17:35:54Z", + "date_updated": "2016-04-14T17:35:54Z", "sid": "WCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_unique_name": "default", - "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/WCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } @@ -164,8 +164,8 @@ "available": true, "available_capacity_percentage": 100, "configured_capacity": 3, - "date_created": "2014-05-14T10:50:02Z", - "date_updated": "2014-05-15T16:03:42Z", + "date_created": "2016-04-14T17:35:54Z", + "date_updated": "2016-04-14T17:35:54Z", "sid": "WCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_unique_name": "default", diff --git a/spec/integration/verify/v2/service/webhook_spec.rb b/spec/integration/verify/v2/service/webhook_spec.rb index cd6e214b0..94a5ee2f8 100644 --- a/spec/integration/verify/v2/service/webhook_spec.rb +++ b/spec/integration/verify/v2/service/webhook_spec.rb @@ -47,6 +47,7 @@ "webhook_method": "POST", "webhook_url": "https://owlbank.twilio.com", "status": "enabled", + "version": "v2", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z" } @@ -91,6 +92,7 @@ "webhook_method": "POST", "webhook_url": "https://owlbank.twilio.com", "status": "disabled", + "version": "v2", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z" } @@ -162,6 +164,7 @@ "webhook_method": "POST", "webhook_url": "https://owlbank.twilio.com", "status": "enabled", + "version": "v2", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z" } @@ -233,6 +236,7 @@ "webhook_method": "POST", "webhook_url": "https://owlbank.twilio.com", "status": "enabled", + "version": "v2", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z" }