diff --git a/bandwidth.yml b/bandwidth.yml index bfa971f6..d3f8539c 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -5552,6 +5552,10 @@ components: example: GET lookupErrorSchema: type: object + required: + - code + - type + - description properties: code: type: string @@ -5699,6 +5703,39 @@ components: type: array items: $ref: '#/components/schemas/lookupErrorSchema' + rcsErrorEnum: + type: string + description: >- + [RCS-Only](#section/RCS-Only). Error encountered during RCS capability + lookup. Appears as the `code` field in the top-level `errors` array. + + + **RCS service pass-through codes:** + + - `REQUEST_FAILED`: The RCS service returned this error code. + + - `UNKNOWN_CODE`: The RCS service returned this error code. + + - `INVALID_DESTINATION_ADDRESS`: The RCS service returned this error + code. + + - `UNKNOWN_STATUS: `: The RCS service returned an unrecognized + status code, where `` is the raw value. + + + **Service-level errors:** + + - `MISSING_FROM_RESPONSE`: The phone number was absent from the RCS + service response. + + - `RCS_SERVICE_UNAVAILABLE`: An exception was thrown during the async + RCS service call. + + - `RCS_SERVICE_DISABLED`: RCS lookup is disabled in configuration. + + - `EMPTY_RESPONSE`: The RCS service returned a null or empty response + body. + example: RCS_SERVICE_UNAVAILABLE lookupResult: type: object description: Carrier information results for the specified telephone number. @@ -5757,13 +5794,21 @@ components: format: date description: >- [DNI-Only](#section/DNI-Only). The date bandwidth last received - delivery status information for this phone number. + delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. example: '2025-06-21' + rcsEnabled: + type: boolean + description: > + [RCS-Only](#section/RCS-Only). Indicates whether the phone number is + capable of receiving RCS messages. Value will be null if account has + RCS, but no value was returned. Absent when account does not have + RCS. + example: true accountId1: type: string description: User's account ID. @@ -7149,6 +7194,10 @@ components: $ref: '#/components/examples/lookupCompleteWithDniExample' lookupCompleteExample: $ref: '#/components/examples/lookupCompleteExample' + lookupCompleteWithRcsExample: + $ref: '#/components/examples/lookupCompleteWithRcsExample' + lookupCompleteWithRcsErrorExample: + $ref: '#/components/examples/lookupCompleteWithRcsErrorExample' lookupPartialExample: $ref: '#/components/examples/lookupPartialExample' lookupFailedExample: @@ -7160,8 +7209,8 @@ components: schema: $ref: '#/components/schemas/createAsyncBulkLookupResponse' examples: - lookupInProgressExample: - $ref: '#/components/examples/lookupInProgressExample' + lookupAcceptedExample: + $ref: '#/components/examples/lookupAcceptedExample' getAsyncBulkLookupResponse: description: OK content: @@ -8049,25 +8098,32 @@ components: phoneNumbers: - '+19196104423' - '+19196104424' - lookupInProgressExample: - summary: Numbers Lookup In Progress + lookupAcceptedExample: + summary: Numbers Lookup Accepted value: links: - - href: href - rel: rel + - href: >- + /accounts/9912345/phoneNumberLookup/bulk/004223a0-8b17-41b1-bf81-20732adf5590 + rel: createdRequest method: GET data: requestId: 004223a0-8b17-41b1-bf81-20732adf5590 status: IN_PROGRESS results: [] errors: [] + lookupInProgressExample: + summary: Numbers Lookup In Progress + value: + links: [] + data: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: IN_PROGRESS + results: [] + errors: [] lookupFailedExample: summary: Numbers Lookup Failed value: - links: - - href: href - rel: rel - method: GET + links: [] data: requestId: 004223a0-8b17-41b1-bf81-20732adf5590 status: FAILED @@ -8084,10 +8140,7 @@ components: lookupPartialExample: summary: Numbers Lookup Partial Complete value: - links: - - href: href - rel: rel - method: GET + links: [] data: requestId: 004223a0-8b17-41b1-bf81-20732adf5590 status: PARTIAL_COMPLETE @@ -8114,10 +8167,7 @@ components: lookupCompleteExample: summary: Numbers Lookup Complete (without DNI) value: - links: - - href: href - rel: rel - method: GET + links: [] data: requestId: 004223a0-8b17-41b1-bf81-20732adf5590 status: COMPLETE @@ -8136,10 +8186,7 @@ components: lookupCompleteWithDniExample: summary: Numbers Lookup Complete (with DNI) value: - links: - - href: href - rel: rel - method: GET + links: [] data: requestId: 20732adf-bf81-8b17-41b1-004223a05590 status: COMPLETE @@ -8177,6 +8224,58 @@ components: deactivationEvent: DEACTIVATED latestMessageDeliveryStatus: NOT_ENABLED errors: [] + lookupCompleteWithRcsExample: + summary: Numbers Lookup Complete (with RCS) + value: + links: [] + data: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: COMPLETE + results: + - phoneNumber: '+10072904497' + lineType: MOBILE + messagingProvider: Verizon Wireless + voiceProvider: Verizon Wireless + countryCodeA3: USA + rcsEnabled: true + - phoneNumber: '+10072904498' + lineType: MOBILE + messagingProvider: T-Mobile USA + voiceProvider: T-Mobile USA + countryCodeA3: USA + rcsEnabled: false + errors: [] + lookupCompleteWithRcsErrorExample: + summary: Numbers Lookup Complete (with RCS error) + value: + links: [] + data: + requestId: 004223a0-8b17-41b1-bf81-20732adf5590 + status: COMPLETE + results: + - phoneNumber: '+10072904497' + lineType: MOBILE + messagingProvider: Verizon Wireless + voiceProvider: Verizon Wireless + countryCodeA3: USA + - phoneNumber: '+10072904498' + lineType: MOBILE + messagingProvider: T-Mobile USA + voiceProvider: T-Mobile USA + countryCodeA3: USA + errors: + - code: RCS_SERVICE_UNAVAILABLE + type: rcs-error + description: An exception was thrown during the async RCS service call. + meta: + phoneNumbers: + - '+10072904497' + - code: MISSING_FROM_RESPONSE + type: rcs-error + description: The phone number was absent from the RCS service response. + meta: + phoneNumbers: + - '+10072904498' badRequestExample: summary: Example Bad Request Error value: diff --git a/docs/LookupErrorSchema.md b/docs/LookupErrorSchema.md index d37c5ecc..53b9a1d4 100644 --- a/docs/LookupErrorSchema.md +++ b/docs/LookupErrorSchema.md @@ -4,9 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **code** | **String** | Validation error code | [optional] | -| **description** | **String** | Description of validation error | [optional] | -| **type** | **String** | Type of validation error | [optional] | +| **code** | **String** | Validation error code | | +| **description** | **String** | Description of validation error | | +| **type** | **String** | Type of validation error | | | **meta** | [**LookupErrorSchemaMeta**](LookupErrorSchemaMeta.md) | | [optional] | ## Example diff --git a/docs/LookupResult.md b/docs/LookupResult.md index 18d4fa4b..d6c0079c 100644 --- a/docs/LookupResult.md +++ b/docs/LookupResult.md @@ -14,7 +14,8 @@ | **deactivation_event** | [**DeactivationEventEnum**](DeactivationEventEnum.md) | | [optional] | | **latest_message_delivery_status** | [**LatestMessageDeliveryStatusEnum**](LatestMessageDeliveryStatusEnum.md) | | [optional] | | **initial_message_delivery_status_date** | **Date** | [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] | -| **latest_message_delivery_status_date** | **Date** | [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] | +| **latest_message_delivery_status_date** | **Date** | [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. | [optional] | +| **rcs_enabled** | **Boolean** | [RCS-Only](#section/RCS-Only). Indicates whether the phone number is capable of receiving RCS messages. Value will be null if account has RCS, but no value was returned. Absent when account does not have RCS. | [optional] | ## Example @@ -32,7 +33,8 @@ instance = Bandwidth::LookupResult.new( deactivation_event: null, latest_message_delivery_status: null, initial_message_delivery_status_date: Fri Jun 20 00:00:00 UTC 2025, - latest_message_delivery_status_date: Sat Jun 21 00:00:00 UTC 2025 + latest_message_delivery_status_date: Sat Jun 21 00:00:00 UTC 2025, + rcs_enabled: true ) ``` diff --git a/docs/RbmActionBase.md b/docs/RbmActionBase.md index ed19b38f..5c3804ef 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@764a3867 + postback_data: [B@4693d24f ) ``` diff --git a/docs/RbmSuggestionResponse.md b/docs/RbmSuggestionResponse.md index 28abe61b..513519c0 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@764a3867 + postback_data: [B@4693d24f ) ``` diff --git a/lib/bandwidth-sdk/models/lookup_error_schema.rb b/lib/bandwidth-sdk/models/lookup_error_schema.rb index c4ae5de3..217ff67d 100644 --- a/lib/bandwidth-sdk/models/lookup_error_schema.rb +++ b/lib/bandwidth-sdk/models/lookup_error_schema.rb @@ -80,14 +80,20 @@ def initialize(attributes = {}) if attributes.key?(:'code') self.code = attributes[:'code'] + else + self.code = nil end if attributes.key?(:'description') self.description = attributes[:'description'] + else + self.description = nil end if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'meta') @@ -100,6 +106,18 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @code.nil? + invalid_properties.push('invalid value for "code", code cannot be nil.') + end + + if @description.nil? + invalid_properties.push('invalid value for "description", description cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + invalid_properties end @@ -107,9 +125,42 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @code.nil? + return false if @description.nil? + return false if @type.nil? true end + # Custom attribute writer method with validation + # @param [Object] code Value to be assigned + def code=(code) + if code.nil? + fail ArgumentError, 'code cannot be nil' + end + + @code = code + end + + # Custom attribute writer method with validation + # @param [Object] description Value to be assigned + def description=(description) + if description.nil? + fail ArgumentError, 'description cannot be nil' + end + + @description = description + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) diff --git a/lib/bandwidth-sdk/models/lookup_result.rb b/lib/bandwidth-sdk/models/lookup_result.rb index b7def89e..40e48872 100644 --- a/lib/bandwidth-sdk/models/lookup_result.rb +++ b/lib/bandwidth-sdk/models/lookup_result.rb @@ -43,9 +43,12 @@ class LookupResult < ApiModelBase # [DNI-Only](#section/DNI-Only). The date the phone number entered the status described in `latestMessageDeliveryStatus`. Think of this as the \"start time\" for that status. Value resets every time the `latestMessageDeliveryStatus` changes. attr_accessor :initial_message_delivery_status_date - # [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. + # [DNI-Only](#section/DNI-Only). The date bandwidth last received delivery status information for this phone number. Use this field to understand how up-to-date the `latestMessageDeliveryStatus` is. Value resets every time the `latestMessageDeliveryStatus` changes. attr_accessor :latest_message_delivery_status_date + # [RCS-Only](#section/RCS-Only). Indicates whether the phone number is capable of receiving RCS messages. Value will be null if account has RCS, but no value was returned. Absent when account does not have RCS. + attr_accessor :rcs_enabled + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -81,7 +84,8 @@ def self.attribute_map :'deactivation_event' => :'deactivationEvent', :'latest_message_delivery_status' => :'latestMessageDeliveryStatus', :'initial_message_delivery_status_date' => :'initialMessageDeliveryStatusDate', - :'latest_message_delivery_status_date' => :'latestMessageDeliveryStatusDate' + :'latest_message_delivery_status_date' => :'latestMessageDeliveryStatusDate', + :'rcs_enabled' => :'rcsEnabled' } end @@ -108,7 +112,8 @@ def self.openapi_types :'deactivation_event' => :'DeactivationEventEnum', :'latest_message_delivery_status' => :'LatestMessageDeliveryStatusEnum', :'initial_message_delivery_status_date' => :'Date', - :'latest_message_delivery_status_date' => :'Date' + :'latest_message_delivery_status_date' => :'Date', + :'rcs_enabled' => :'Boolean' } end @@ -177,6 +182,10 @@ def initialize(attributes = {}) if attributes.key?(:'latest_message_delivery_status_date') self.latest_message_delivery_status_date = attributes[:'latest_message_delivery_status_date'] end + + if attributes.key?(:'rcs_enabled') + self.rcs_enabled = attributes[:'rcs_enabled'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -209,7 +218,8 @@ def ==(o) deactivation_event == o.deactivation_event && latest_message_delivery_status == o.latest_message_delivery_status && initial_message_delivery_status_date == o.initial_message_delivery_status_date && - latest_message_delivery_status_date == o.latest_message_delivery_status_date + latest_message_delivery_status_date == o.latest_message_delivery_status_date && + rcs_enabled == o.rcs_enabled end # @see the `==` method @@ -221,7 +231,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [phone_number, line_type, messaging_provider, voice_provider, country_code_a3, deactivation_reporter, deactivation_date, deactivation_event, latest_message_delivery_status, initial_message_delivery_status_date, latest_message_delivery_status_date].hash + [phone_number, line_type, messaging_provider, voice_provider, country_code_a3, deactivation_reporter, deactivation_date, deactivation_event, latest_message_delivery_status, initial_message_delivery_status_date, latest_message_delivery_status_date, rcs_enabled].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 43e58d50..fd875e16 100644 --- a/spec/unit/api/phone_number_lookup_api_spec.rb +++ b/spec/unit/api/phone_number_lookup_api_spec.rb @@ -52,10 +52,6 @@ expect(status_code).to equal_to(200) expect(data).to be_instance_of(Bandwidth::CreateSyncLookupResponse) - expect(data.links[0]).to be_instance_of(Bandwidth::LinkSchema) - expect(data.links[0].rel).to be_instance_of(String) - expect(data.links[0].href).to be_instance_of(String) - expect(data.links[0].method).to be_instance_of(String) expect(data.data.request_id).to be_instance_of(String) expect(data.data.status).to eq(Bandwidth::CompletedLookupStatusEnum::COMPLETE) expect(data.data.results).to be_instance_of(Array) @@ -79,10 +75,6 @@ expect(status_code).to equal_to(200) expect(data).to be_instance_of(Bandwidth::GetAsyncBulkLookupResponse) - expect(data.links[0]).to be_instance_of(Bandwidth::LinkSchema) - expect(data.links[0].rel).to be_instance_of(String) - expect(data.links[0].href).to be_instance_of(String) - expect(data.links[0].method).to be_instance_of(String) expect(data.data.request_id).to be_instance_of(String) expect(data.data.status).to eq(Bandwidth::InProgressLookupStatusEnum::COMPLETE) expect(data.data.results).to be_instance_of(Array)