diff --git a/CHANGES.md b/CHANGES.md index 1db211e00..1da1ad46c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,30 @@ twilio-ruby changelog ===================== +[2023-12-14] Version 6.9.0 +-------------------------- +**Api** +- Updated service base url for connect apps and authorized connect apps APIs **(breaking change)** + +**Events** +- Marked as GA + +**Insights** +- decommission voice-qualitystats-endpoint role + +**Numbers** +- Add Get Port In request api + +**Taskrouter** +- Add `jitter_buffer_size` param in update reservation + +**Trusthub** +- Add additional optional fields in compliance_tollfree_inquiry.json + +**Verify** +- Remove `Tags` from Public Docs **(breaking change)** + + [2023-12-01] Version 6.8.3 -------------------------- **Verify** diff --git a/README.md b/README.md index 8955803ab..66d50bc49 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.8.3' +gem 'twilio-ruby', '~> 6.9.0' ``` To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install: ```bash -gem install twilio-ruby -v 6.8.3 +gem install twilio-ruby -v 6.9.0 ``` To build and install the development branch yourself from the latest source: diff --git a/lib/twilio-ruby/http/http_client.rb b/lib/twilio-ruby/http/http_client.rb index 99f3c7cc8..0a0607012 100644 --- a/lib/twilio-ruby/http/http_client.rb +++ b/lib/twilio-ruby/http/http_client.rb @@ -6,7 +6,7 @@ module Twilio module HTTP class Client attr_accessor :adapter - attr_reader :timeout, :last_response, :last_request + attr_reader :timeout, :last_response, :last_request, :connection def initialize(proxy_prot = nil, proxy_addr = nil, proxy_port = nil, proxy_user = nil, proxy_pass = nil, ssl_ca_file = nil, timeout: nil) @@ -39,6 +39,7 @@ def _request(request) # rubocop:disable Metrics/MethodLength f.proxy = "#{@proxy_prot}://#{@proxy_auth}#{@proxy_path}" if @proxy_prot && @proxy_path f.options.open_timeout = request.timeout || @timeout f.options.timeout = request.timeout || @timeout + f.params = request.params.nil? ? {} : request.params @configure_connection_blocks.each { |block| block.call(f) } f.adapter @adapter @@ -65,7 +66,7 @@ def _request(request) # rubocop:disable Metrics/MethodLength def send(request) @connection.send(request.method.downcase.to_sym, request.url, - request.method == 'GET' ? request.params : request.data) + request.data) rescue Faraday::Error => e raise Twilio::REST::TwilioError, e end diff --git a/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb b/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb index eec0c72b3..8f9d1910b 100644 --- a/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +++ b/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb @@ -220,8 +220,6 @@ def initialize(version, payload , account_sid: nil, connect_app_sid: nil) 'connect_app_friendly_name' => payload['connect_app_friendly_name'], 'connect_app_homepage_url' => payload['connect_app_homepage_url'], 'connect_app_sid' => payload['connect_app_sid'], - 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), - 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'permissions' => payload['permissions'], 'uri' => payload['uri'], } @@ -278,18 +276,6 @@ def connect_app_sid @properties['connect_app_sid'] end - ## - # @return [Time] The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_created - @properties['date_created'] - end - - ## - # @return [Time] The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_updated - @properties['date_updated'] - end - ## # @return [Array] The set of permissions that you authorized for the Connect App. Can be: `get-all` or `post-all`. def permissions diff --git a/lib/twilio-ruby/rest/events/v1/event_type.rb b/lib/twilio-ruby/rest/events/v1/event_type.rb index 0653e102f..c08d2077d 100644 --- a/lib/twilio-ruby/rest/events/v1/event_type.rb +++ b/lib/twilio-ruby/rest/events/v1/event_type.rb @@ -129,8 +129,6 @@ def to_s end - ## - #PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class EventTypeContext < InstanceContext ## # Initialize the EventTypeContext diff --git a/lib/twilio-ruby/rest/events/v1/schema.rb b/lib/twilio-ruby/rest/events/v1/schema.rb index 39f28b719..42b3a4e24 100644 --- a/lib/twilio-ruby/rest/events/v1/schema.rb +++ b/lib/twilio-ruby/rest/events/v1/schema.rb @@ -39,8 +39,6 @@ def to_s end - ## - #PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class SchemaContext < InstanceContext ## # Initialize the SchemaContext diff --git a/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb b/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb index bf1963541..e3cb3862d 100644 --- a/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb +++ b/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb @@ -125,8 +125,6 @@ def to_s end - ## - #PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class SchemaVersionContext < InstanceContext ## # Initialize the SchemaVersionContext diff --git a/lib/twilio-ruby/rest/events/v1/sink.rb b/lib/twilio-ruby/rest/events/v1/sink.rb index bb74cf7f7..b7dff68ac 100644 --- a/lib/twilio-ruby/rest/events/v1/sink.rb +++ b/lib/twilio-ruby/rest/events/v1/sink.rb @@ -160,8 +160,6 @@ def to_s end - ## - #PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class SinkContext < InstanceContext ## # Initialize the SinkContext diff --git a/lib/twilio-ruby/rest/events/v1/subscription.rb b/lib/twilio-ruby/rest/events/v1/subscription.rb index a1446851f..1ff1ecb0b 100644 --- a/lib/twilio-ruby/rest/events/v1/subscription.rb +++ b/lib/twilio-ruby/rest/events/v1/subscription.rb @@ -154,8 +154,6 @@ def to_s end - ## - #PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class SubscriptionContext < InstanceContext ## # Initialize the SubscriptionContext diff --git a/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb b/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb index fc5144d62..02ad51744 100644 --- a/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +++ b/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb @@ -34,7 +34,7 @@ def initialize(version, subscription_sid: nil) ## # Create the SubscribedEventInstance # @param [String] type Type of event being subscribed to. - # @param [String] schema_version The schema version that the subscription should use. + # @param [String] schema_version The schema version that the Subscription should use. # @return [SubscribedEventInstance] Created SubscribedEventInstance def create( type: nil, @@ -148,8 +148,6 @@ def to_s end - ## - #PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. class SubscribedEventContext < InstanceContext ## # Initialize the SubscribedEventContext @@ -190,7 +188,7 @@ def fetch ## # Update the SubscribedEventInstance - # @param [String] schema_version The schema version that the subscription should use. + # @param [String] schema_version The schema version that the Subscription should use. # @return [SubscribedEventInstance] Updated SubscribedEventInstance def update( schema_version: :unset @@ -304,7 +302,7 @@ def type end ## - # @return [String] The schema version that the subscription should use. + # @return [String] The schema version that the Subscription should use. def schema_version @properties['schema_version'] end @@ -339,7 +337,7 @@ def fetch ## # Update the SubscribedEventInstance - # @param [String] schema_version The schema version that the subscription should use. + # @param [String] schema_version The schema version that the Subscription should use. # @return [SubscribedEventInstance] Updated SubscribedEventInstance def update( schema_version: :unset diff --git a/lib/twilio-ruby/rest/numbers/v1.rb b/lib/twilio-ruby/rest/numbers/v1.rb index 74ca90ac4..03e605ba3 100644 --- a/lib/twilio-ruby/rest/numbers/v1.rb +++ b/lib/twilio-ruby/rest/numbers/v1.rb @@ -23,6 +23,7 @@ def initialize(domain) @version = 'v1' @bulk_eligibilities = nil @porting_bulk_portabilities = nil + @porting_port_ins = nil @porting_portabilities = nil end @@ -55,6 +56,20 @@ def porting_bulk_portabilities(sid=:unset) end end ## + # @param [String] port_in_request_sid The SID of the Port In request. This is a unique identifier of the port in request. + # @return [Twilio::REST::Numbers::V1::PortingPortInFetchContext] if portInRequestSid was passed. + # @return [Twilio::REST::Numbers::V1::PortingPortInFetchList] + def porting_port_ins(port_in_request_sid=:unset) + if port_in_request_sid.nil? + raise ArgumentError, 'port_in_request_sid cannot be nil' + end + if port_in_request_sid == :unset + @porting_port_ins ||= PortingPortInFetchList.new self + else + PortingPortInFetchContext.new(self, port_in_request_sid) + end + end + ## # @param [String] phone_number The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212). # @return [Twilio::REST::Numbers::V1::PortingPortabilityContext] if phoneNumber was passed. # @return [Twilio::REST::Numbers::V1::PortingPortabilityList] diff --git a/lib/twilio-ruby/rest/numbers/v1/porting_port_in_fetch.rb b/lib/twilio-ruby/rest/numbers/v1/porting_port_in_fetch.rb new file mode 100644 index 000000000..48df9ac4f --- /dev/null +++ b/lib/twilio-ruby/rest/numbers/v1/porting_port_in_fetch.rb @@ -0,0 +1,245 @@ +## +# 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. +# + + +module Twilio + module REST + class Numbers < NumbersBase + class V1 < Version + class PortingPortInFetchList < ListResource + ## + # Initialize the PortingPortInFetchList + # @param [Version] version Version that contains the resource + # @return [PortingPortInFetchList] PortingPortInFetchList + def initialize(version) + super(version) + # Path Solution + @solution = { } + + + end + + + + # Provide a user friendly representation + def to_s + '#' + end + end + + + ## + #PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + class PortingPortInFetchContext < InstanceContext + ## + # Initialize the PortingPortInFetchContext + # @param [Version] version Version that contains the resource + # @param [String] port_in_request_sid The SID of the Port In request. This is a unique identifier of the port in request. + # @return [PortingPortInFetchContext] PortingPortInFetchContext + def initialize(version, port_in_request_sid) + super(version) + + # Path Solution + @solution = { port_in_request_sid: port_in_request_sid, } + @uri = "/Porting/PortIn/#{@solution[:port_in_request_sid]}" + + + end + ## + # Fetch the PortingPortInFetchInstance + # @return [PortingPortInFetchInstance] Fetched PortingPortInFetchInstance + def fetch + + payload = @version.fetch('GET', @uri) + PortingPortInFetchInstance.new( + @version, + payload, + port_in_request_sid: @solution[:port_in_request_sid], + ) + end + + + ## + # Provide a user friendly representation + def to_s + context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') + "#" + end + + ## + # Provide a detailed, user friendly representation + def inspect + context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') + "#" + end + end + + class PortingPortInFetchPage < Page + ## + # Initialize the PortingPortInFetchPage + # @param [Version] version Version that contains the resource + # @param [Response] response Response from the API + # @param [Hash] solution Path solution for the resource + # @return [PortingPortInFetchPage] PortingPortInFetchPage + def initialize(version, response, solution) + super(version, response) + + # Path Solution + @solution = solution + end + + ## + # Build an instance of PortingPortInFetchInstance + # @param [Hash] payload Payload response from the API + # @return [PortingPortInFetchInstance] PortingPortInFetchInstance + def get_instance(payload) + PortingPortInFetchInstance.new(@version, payload) + end + + ## + # Provide a user friendly representation + def to_s + '' + end + end + class PortingPortInFetchInstance < InstanceResource + ## + # Initialize the PortingPortInFetchInstance + # @param [Version] version Version that contains the resource + # @param [Hash] payload payload that contains response from Twilio + # @param [String] account_sid The SID of the + # {Account}[https://www.twilio.com/docs/iam/api/account] that created this PortingPortInFetch + # resource. + # @param [String] sid The SID of the Call resource to fetch. + # @return [PortingPortInFetchInstance] PortingPortInFetchInstance + def initialize(version, payload , port_in_request_sid: nil) + super(version) + + # Marshaled Properties + @properties = { + 'port_in_request_sid' => payload['port_in_request_sid'], + 'url' => payload['url'], + 'account_sid' => payload['account_sid'], + 'notification_emails' => payload['notification_emails'], + 'target_port_in_date' => Twilio.deserialize_iso8601_date(payload['target_port_in_date']), + 'target_port_in_time_range_start' => payload['target_port_in_time_range_start'], + 'target_port_in_time_range_end' => payload['target_port_in_time_range_end'], + 'losing_carrier_information' => payload['losing_carrier_information'], + 'phone_numbers' => payload['phone_numbers'], + 'documents' => payload['documents'], + } + + # Context + @instance_context = nil + @params = { 'port_in_request_sid' => port_in_request_sid || @properties['port_in_request_sid'] , } + end + + ## + # Generate an instance context for the instance, the context is capable of + # performing various actions. All instance actions are proxied to the context + # @return [PortingPortInFetchContext] CallContext for this CallInstance + def context + unless @instance_context + @instance_context = PortingPortInFetchContext.new(@version , @params['port_in_request_sid']) + end + @instance_context + end + + ## + # @return [String] The SID of the Port In request. This is a unique identifier of the port in request. + def port_in_request_sid + @properties['port_in_request_sid'] + end + + ## + # @return [String] The URL of this Port In request + def url + @properties['url'] + end + + ## + # @return [String] The Account SID that the numbers will be added to after they are ported into Twilio. + def account_sid + @properties['account_sid'] + end + + ## + # @return [Array] List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails. + def notification_emails + @properties['notification_emails'] + end + + ## + # @return [Date] Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation. + def target_port_in_date + @properties['target_port_in_date'] + end + + ## + # @return [String] Minimum hour in the future needs to be established with the Ops team for validation. + def target_port_in_time_range_start + @properties['target_port_in_time_range_start'] + end + + ## + # @return [String] Maximum hour in the future needs to be established with the Ops team for validation. + def target_port_in_time_range_end + @properties['target_port_in_time_range_end'] + end + + ## + # @return [Hash] The information for the losing carrier. + def losing_carrier_information + @properties['losing_carrier_information'] + end + + ## + # @return [Array] The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212). + def phone_numbers + @properties['phone_numbers'] + end + + ## + # @return [Array] The list of documents SID referencing a utility bills + def documents + @properties['documents'] + end + + ## + # Fetch the PortingPortInFetchInstance + # @return [PortingPortInFetchInstance] Fetched PortingPortInFetchInstance + def fetch + + context.fetch + end + + ## + # Provide a user friendly representation + def to_s + values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") + "" + end + + ## + # Provide a detailed, user friendly representation + def inspect + values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") + "" + end + end + + end + end + end +end diff --git a/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb b/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb index 68dfcd3af..0a9bf5525 100644 --- a/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +++ b/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb @@ -225,6 +225,7 @@ def fetch # @param [String] supervisor The Supervisor SID/URI when executing the Supervise instruction. # @param [Boolean] end_conference_on_customer_exit Whether to end the conference when the customer leaves. # @param [Boolean] beep_on_customer_entrance Whether to play a notification beep when the customer joins. + # @param [String] jitter_buffer_size The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. # @param [String] if_match The If-Match HTTP request header # @return [ReservationInstance] Updated ReservationInstance def update( @@ -281,6 +282,7 @@ def update( supervisor: :unset, end_conference_on_customer_exit: :unset, beep_on_customer_entrance: :unset, + jitter_buffer_size: :unset, if_match: :unset ) @@ -338,6 +340,7 @@ def update( 'Supervisor' => supervisor, 'EndConferenceOnCustomerExit' => end_conference_on_customer_exit, 'BeepOnCustomerEntrance' => beep_on_customer_entrance, + 'JitterBufferSize' => jitter_buffer_size, }) headers = Twilio::Values.of({ 'If-Match' => if_match, }) @@ -568,6 +571,7 @@ def fetch # @param [String] supervisor The Supervisor SID/URI when executing the Supervise instruction. # @param [Boolean] end_conference_on_customer_exit Whether to end the conference when the customer leaves. # @param [Boolean] beep_on_customer_entrance Whether to play a notification beep when the customer joins. + # @param [String] jitter_buffer_size The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. # @param [String] if_match The If-Match HTTP request header # @return [ReservationInstance] Updated ReservationInstance def update( @@ -624,6 +628,7 @@ def update( supervisor: :unset, end_conference_on_customer_exit: :unset, beep_on_customer_entrance: :unset, + jitter_buffer_size: :unset, if_match: :unset ) @@ -681,6 +686,7 @@ def update( supervisor: supervisor, end_conference_on_customer_exit: end_conference_on_customer_exit, beep_on_customer_entrance: beep_on_customer_entrance, + jitter_buffer_size: jitter_buffer_size, if_match: if_match, ) end diff --git a/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb b/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb index 977483559..a07a5f816 100644 --- a/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +++ b/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb @@ -217,6 +217,7 @@ def fetch # @param [String] post_work_activity_sid The new worker activity SID after executing a Conference instruction. # @param [Boolean] end_conference_on_customer_exit Whether to end the conference when the customer leaves. # @param [Boolean] beep_on_customer_entrance Whether to play a notification beep when the customer joins. + # @param [String] jitter_buffer_size The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. # @param [String] if_match The If-Match HTTP request header # @return [ReservationInstance] Updated ReservationInstance def update( @@ -271,6 +272,7 @@ def update( post_work_activity_sid: :unset, end_conference_on_customer_exit: :unset, beep_on_customer_entrance: :unset, + jitter_buffer_size: :unset, if_match: :unset ) @@ -326,6 +328,7 @@ def update( 'PostWorkActivitySid' => post_work_activity_sid, 'EndConferenceOnCustomerExit' => end_conference_on_customer_exit, 'BeepOnCustomerEntrance' => beep_on_customer_entrance, + 'JitterBufferSize' => jitter_buffer_size, }) headers = Twilio::Values.of({ 'If-Match' => if_match, }) @@ -554,6 +557,7 @@ def fetch # @param [String] post_work_activity_sid The new worker activity SID after executing a Conference instruction. # @param [Boolean] end_conference_on_customer_exit Whether to end the conference when the customer leaves. # @param [Boolean] beep_on_customer_entrance Whether to play a notification beep when the customer joins. + # @param [String] jitter_buffer_size The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. # @param [String] if_match The If-Match HTTP request header # @return [ReservationInstance] Updated ReservationInstance def update( @@ -608,6 +612,7 @@ def update( post_work_activity_sid: :unset, end_conference_on_customer_exit: :unset, beep_on_customer_entrance: :unset, + jitter_buffer_size: :unset, if_match: :unset ) @@ -663,6 +668,7 @@ def update( post_work_activity_sid: post_work_activity_sid, end_conference_on_customer_exit: end_conference_on_customer_exit, beep_on_customer_entrance: beep_on_customer_entrance, + jitter_buffer_size: jitter_buffer_size, if_match: if_match, ) end diff --git a/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb b/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb index d05dd2a3b..3edc0d5e6 100644 --- a/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb +++ b/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb @@ -32,16 +32,73 @@ def initialize(version) ## # Create the ComplianceTollfreeInquiriesInstance # @param [String] tollfree_phone_number The Tollfree phone number to be verified - # @param [String] notification_email The notification email to be triggered when verification status is changed + # @param [String] notification_email The email address to receive the notification about the verification result. + # @param [String] business_name The name of the business or organization using the Tollfree number. + # @param [String] business_website The website of the business or organization using the Tollfree number. + # @param [Array[String]] use_case_categories The category of the use case for the Tollfree Number. List as many are applicable.. + # @param [String] use_case_summary Use this to further explain how messaging is used by the business or organization. + # @param [String] production_message_sample An example of message content, i.e. a sample message. + # @param [Array[String]] opt_in_image_urls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + # @param [OptInType] opt_in_type + # @param [String] message_volume Estimate monthly volume of messages from the Tollfree Number. + # @param [String] business_street_address The address of the business or organization using the Tollfree number. + # @param [String] business_street_address2 The address of the business or organization using the Tollfree number. + # @param [String] business_city The city of the business or organization using the Tollfree number. + # @param [String] business_state_province_region The state/province/region of the business or organization using the Tollfree number. + # @param [String] business_postal_code The postal code of the business or organization using the Tollfree number. + # @param [String] business_country The country of the business or organization using the Tollfree number. + # @param [String] additional_information Additional information to be provided for verification. + # @param [String] business_contact_first_name The first name of the contact for the business or organization using the Tollfree number. + # @param [String] business_contact_last_name The last name of the contact for the business or organization using the Tollfree number. + # @param [String] business_contact_email The email address of the contact for the business or organization using the Tollfree number. + # @param [String] business_contact_phone The phone number of the contact for the business or organization using the Tollfree number. # @return [ComplianceTollfreeInquiriesInstance] Created ComplianceTollfreeInquiriesInstance def create( tollfree_phone_number: nil, - notification_email: nil + notification_email: nil, + business_name: :unset, + business_website: :unset, + use_case_categories: :unset, + use_case_summary: :unset, + production_message_sample: :unset, + opt_in_image_urls: :unset, + opt_in_type: :unset, + message_volume: :unset, + business_street_address: :unset, + business_street_address2: :unset, + business_city: :unset, + business_state_province_region: :unset, + business_postal_code: :unset, + business_country: :unset, + additional_information: :unset, + business_contact_first_name: :unset, + business_contact_last_name: :unset, + business_contact_email: :unset, + business_contact_phone: :unset ) data = Twilio::Values.of({ 'TollfreePhoneNumber' => tollfree_phone_number, 'NotificationEmail' => notification_email, + 'BusinessName' => business_name, + 'BusinessWebsite' => business_website, + 'UseCaseCategories' => Twilio.serialize_list(use_case_categories) { |e| e }, + 'UseCaseSummary' => use_case_summary, + 'ProductionMessageSample' => production_message_sample, + 'OptInImageUrls' => Twilio.serialize_list(opt_in_image_urls) { |e| e }, + 'OptInType' => opt_in_type, + 'MessageVolume' => message_volume, + 'BusinessStreetAddress' => business_street_address, + 'BusinessStreetAddress2' => business_street_address2, + 'BusinessCity' => business_city, + 'BusinessStateProvinceRegion' => business_state_province_region, + 'BusinessPostalCode' => business_postal_code, + 'BusinessCountry' => business_country, + 'AdditionalInformation' => additional_information, + 'BusinessContactFirstName' => business_contact_first_name, + 'BusinessContactLastName' => business_contact_last_name, + 'BusinessContactEmail' => business_contact_email, + 'BusinessContactPhone' => business_contact_phone, }) payload = @version.create('POST', @uri, data: data) diff --git a/lib/twilio-ruby/version.rb b/lib/twilio-ruby/version.rb index 637384dca..ba7fe1ecf 100644 --- a/lib/twilio-ruby/version.rb +++ b/lib/twilio-ruby/version.rb @@ -1,3 +1,3 @@ module Twilio - VERSION = '6.8.3' + VERSION = '6.9.0' end diff --git a/spec/http/http_client_spec.rb b/spec/http/http_client_spec.rb index 27d290bec..422b62cd5 100644 --- a/spec/http/http_client_spec.rb +++ b/spec/http/http_client_spec.rb @@ -133,6 +133,13 @@ expect(@client.last_request.timeout).to be_nil end + it 'should contain params in Connection object' do + allow_any_instance_of(Faraday::Connection).to receive(:send).and_return(double('response', status: 301, body: {}, headers: { something: '1' })) + params = Twilio::Values.of({ 'abc' => 'xyz' }) + @client.request('host', 'port', 'DELETE', 'url', params, nil, {}, ['a', 'b']) + expect(@client.connection.params).to eq({ 'abc' => 'xyz' }) + end + describe 'last_response' do let(:last_response) { Twilio::Response.new(200, 'body') } end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 62fbbaa88..8b295d076 100755 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -19,6 +19,7 @@ require 'twilio-ruby' require 'rspec/matchers' require 'equivalent-xml' +require 'rspec/core' RSpec.configure do |config| config.expect_with :rspec do |c|