diff --git a/bandwidth.yml b/bandwidth.yml index 5b874ee..84e00b3 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -5759,6 +5759,19 @@ components: items: type: string pattern: ^\+[1-9]\d{1,14}$ + rcsAgent: + type: string + description: >- + Override the default RCS sender/agent ID used when checking RCS + capabilities. + + When provided, this value is used as the `sender` in the RCS + capability-check request instead of the account default. + + Must be 1–40 characters and contain only letters, digits, + underscores, or hyphens. + pattern: ^[A-Za-z0-9_-]{1,40}$ + example: MyCustomRcsAgent required: - phoneNumbers asyncLookupRequest: @@ -8758,6 +8771,13 @@ components: phoneNumbers: - '+19196104423' - '+19196104424' + rcsAgentRequestExample: + summary: Number Lookup Request with Custom RCS Agent + value: + phoneNumbers: + - '+19196104423' + - '+19196104424' + rcsAgent: MyCustomRcsAgent lookupAcceptedExample: summary: Numbers Lookup Accepted value: @@ -9518,6 +9538,8 @@ components: $ref: '#/components/examples/singleNumberRequestExample' multipleNumberRequestExample: $ref: '#/components/examples/multipleNumberRequestExample' + rcsAgentRequestExample: + $ref: '#/components/examples/rcsAgentRequestExample' createAsyncBulkLookupRequest: description: Asynchronous bulk phone number lookup request. required: true diff --git a/docs/RbmActionBase.md b/docs/RbmActionBase.md index e0b1278..a3e18df 100644 --- a/docs/RbmActionBase.md +++ b/docs/RbmActionBase.md @@ -16,7 +16,7 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmActionBase.new( type: null, text: Hello world, - postback_data: [B@73c6ae15 + postback_data: [B@1a99692 ) ``` diff --git a/docs/RbmSuggestionResponse.md b/docs/RbmSuggestionResponse.md index 61a2c41..4730a01 100644 --- a/docs/RbmSuggestionResponse.md +++ b/docs/RbmSuggestionResponse.md @@ -14,7 +14,7 @@ require 'bandwidth-sdk' instance = Bandwidth::RbmSuggestionResponse.new( text: Yes, I would like to proceed, - postback_data: [B@73c6ae15 + postback_data: [B@1a99692 ) ``` diff --git a/docs/SyncLookupRequest.md b/docs/SyncLookupRequest.md index c8f8043..11f4883 100644 --- a/docs/SyncLookupRequest.md +++ b/docs/SyncLookupRequest.md @@ -5,6 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **phone_numbers** | **Array<String>** | Telephone numbers in E.164 format. | | +| **rcs_agent** | **String** | Override the default RCS sender/agent ID used when checking RCS capabilities. When provided, this value is used as the `sender` in the RCS capability-check request instead of the account default. Must be 1–40 characters and contain only letters, digits, underscores, or hyphens. | [optional] | ## Example @@ -12,7 +13,8 @@ require 'bandwidth-sdk' instance = Bandwidth::SyncLookupRequest.new( - phone_numbers: null + phone_numbers: null, + rcs_agent: MyCustomRcsAgent ) ``` diff --git a/lib/bandwidth-sdk/models/sync_lookup_request.rb b/lib/bandwidth-sdk/models/sync_lookup_request.rb index b83095b..60b771d 100644 --- a/lib/bandwidth-sdk/models/sync_lookup_request.rb +++ b/lib/bandwidth-sdk/models/sync_lookup_request.rb @@ -18,10 +18,14 @@ class SyncLookupRequest < ApiModelBase # Telephone numbers in E.164 format. attr_accessor :phone_numbers + # Override the default RCS sender/agent ID used when checking RCS capabilities. When provided, this value is used as the `sender` in the RCS capability-check request instead of the account default. Must be 1–40 characters and contain only letters, digits, underscores, or hyphens. + attr_accessor :rcs_agent + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'phone_numbers' => :'phoneNumbers' + :'phone_numbers' => :'phoneNumbers', + :'rcs_agent' => :'rcsAgent' } end @@ -38,7 +42,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'phone_numbers' => :'Array' + :'phone_numbers' => :'Array', + :'rcs_agent' => :'String' } end @@ -71,6 +76,10 @@ def initialize(attributes = {}) else self.phone_numbers = nil end + + if attributes.key?(:'rcs_agent') + self.rcs_agent = attributes[:'rcs_agent'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -82,6 +91,11 @@ def list_invalid_properties invalid_properties.push('invalid value for "phone_numbers", phone_numbers cannot be nil.') end + pattern = Regexp.new(/^[A-Za-z0-9_-]{1,40}$/) + if !@rcs_agent.nil? && @rcs_agent !~ pattern + invalid_properties.push("invalid value for \"rcs_agent\", must conform to the pattern #{pattern}.") + end + invalid_properties end @@ -90,6 +104,7 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @phone_numbers.nil? + return false if !@rcs_agent.nil? && @rcs_agent !~ Regexp.new(/^[A-Za-z0-9_-]{1,40}$/) true end @@ -103,12 +118,28 @@ def phone_numbers=(phone_numbers) @phone_numbers = phone_numbers end + # Custom attribute writer method with validation + # @param [Object] rcs_agent Value to be assigned + def rcs_agent=(rcs_agent) + if rcs_agent.nil? + fail ArgumentError, 'rcs_agent cannot be nil' + end + + pattern = Regexp.new(/^[A-Za-z0-9_-]{1,40}$/) + if rcs_agent !~ pattern + fail ArgumentError, "invalid value for \"rcs_agent\", must conform to the pattern #{pattern}." + end + + @rcs_agent = rcs_agent + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && - phone_numbers == o.phone_numbers + phone_numbers == o.phone_numbers && + rcs_agent == o.rcs_agent end # @see the `==` method @@ -120,7 +151,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [phone_numbers].hash + [phone_numbers, rcs_agent].hash end # Builds the object from hash diff --git a/spec/unit/api/phone_number_lookup_api_spec.rb b/spec/unit/api/phone_number_lookup_api_spec.rb index fd875e1..2c0d1ad 100644 --- a/spec/unit/api/phone_number_lookup_api_spec.rb +++ b/spec/unit/api/phone_number_lookup_api_spec.rb @@ -2,6 +2,7 @@ describe 'PhoneNumberLookupApi' do let(:phone_numbers) { [BW_NUMBER, USER_NUMBER] } let(:request_id) { '123e4567-e89b-12d3-a456-426614174000' } + let(:rcs_agent) { 'TestAgent' } before(:all) do Bandwidth.configure do |config| @@ -46,6 +47,7 @@ it 'should work' do request = Bandwidth::SyncLookupRequest.new( phone_numbers: phone_numbers, + rcs_agent: rcs_agent, ) data, status_code = @api_instance.create_sync_lookup_with_http_info(BW_ACCOUNT_ID, request)