Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/RbmActionBase.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require 'bandwidth-sdk'
instance = Bandwidth::RbmActionBase.new(
type: null,
text: Hello world,
postback_data: [B@73c6ae15
postback_data: [B@1a99692
)
```

2 changes: 1 addition & 1 deletion docs/RbmSuggestionResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
```

4 changes: 3 additions & 1 deletion docs/SyncLookupRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
| 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

```ruby
require 'bandwidth-sdk'

instance = Bandwidth::SyncLookupRequest.new(
phone_numbers: null
phone_numbers: null,
rcs_agent: MyCustomRcsAgent
)
```

39 changes: 35 additions & 4 deletions lib/bandwidth-sdk/models/sync_lookup_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -38,7 +42,8 @@ def self.acceptable_attributes
# Attribute type mapping.
def self.openapi_types
{
:'phone_numbers' => :'Array<String>'
:'phone_numbers' => :'Array<String>',
:'rcs_agent' => :'String'
}
end

Expand Down Expand Up @@ -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?
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/api/phone_number_lookup_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down Expand Up @@ -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)
Expand Down
Loading