diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 53e9a75..3115566 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -49,6 +49,7 @@ docs/CreateMessageRequestError.md docs/CreateMultiChannelMessageResponse.md docs/CreateSyncLookupResponse.md docs/CreateSyncLookupResponseData.md +docs/CustomTooManyRequestsError.md docs/DeactivationEventEnum.md docs/DisconnectCallback.md docs/Diversion.md @@ -251,6 +252,7 @@ lib/bandwidth-sdk/models/create_message_request_error.rb lib/bandwidth-sdk/models/create_multi_channel_message_response.rb lib/bandwidth-sdk/models/create_sync_lookup_response.rb lib/bandwidth-sdk/models/create_sync_lookup_response_data.rb +lib/bandwidth-sdk/models/custom_too_many_requests_error.rb lib/bandwidth-sdk/models/deactivation_event_enum.rb lib/bandwidth-sdk/models/disconnect_callback.rb lib/bandwidth-sdk/models/diversion.rb diff --git a/README.md b/README.md index e981ea0..8ed3f93 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,7 @@ Class | Method | HTTP request | Description - [Bandwidth::CreateMultiChannelMessageResponse](docs/CreateMultiChannelMessageResponse.md) - [Bandwidth::CreateSyncLookupResponse](docs/CreateSyncLookupResponse.md) - [Bandwidth::CreateSyncLookupResponseData](docs/CreateSyncLookupResponseData.md) + - [Bandwidth::CustomTooManyRequestsError](docs/CustomTooManyRequestsError.md) - [Bandwidth::DeactivationEventEnum](docs/DeactivationEventEnum.md) - [Bandwidth::DisconnectCallback](docs/DisconnectCallback.md) - [Bandwidth::Diversion](docs/Diversion.md) diff --git a/bandwidth.yml b/bandwidth.yml index d7c3295..4c32a6b 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -163,7 +163,13 @@ paths: /users/{accountId}/messages: get: summary: List Messages - description: Returns a list of messages based on query parameters. + description: > + Returns a list of messages based on query parameters. + + + **Rate Limit:** This endpoint is rate limited to 3500 requests per 5 + minutes per Source IP address. Exceeding the limit returns HTTP 429 with + a `Retry-After` header. operationId: listMessages tags: - Messages @@ -207,10 +213,12 @@ paths: $ref: '#/components/responses/messagingForbiddenError' '404': $ref: '#/components/responses/messagingNotFoundError' + '405': + $ref: '#/components/responses/messagingMethodNotAllowedError' '415': $ref: '#/components/responses/messagingInvalidMediaTypeError' '429': - $ref: '#/components/responses/messagingTooManyRequestsError' + $ref: '#/components/responses/customTooManyRequestsError' '500': $ref: '#/components/responses/messagingInternalServerError' post: @@ -2257,7 +2265,9 @@ components: type: object properties: media: - $ref: '#/components/schemas/rbmMessageContentFile' + type: array + items: + $ref: '#/components/schemas/rbmMessageContentFile' suggestions: $ref: '#/components/schemas/multiChannelFullActions' required: @@ -2944,6 +2954,21 @@ components: - direction - to - from + customTooManyRequestsError: + title: CustomTooManyRequestsError + type: object + properties: + type: + type: string + example: rate_limit_exceeded + description: + type: string + example: >- + Rate limit exceeded. Wait for Retry-After time before sending + another request. + required: + - type + - description callbackMethodEnum: type: string nullable: true @@ -5875,7 +5900,6 @@ components: type: object internalTicketNumber: type: string - format: uuid description: >- Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number - included in all webhook @@ -5883,7 +5907,6 @@ components: example: acde070d-8c4c-4f0d-9d8a-162843c10333 internalTicketNumberForWebhook: type: string - format: uuid description: >- Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number. @@ -5956,6 +5979,8 @@ components: $ref: '#/components/schemas/helpMessageResponse' ageGatedContent: $ref: '#/components/schemas/ageGatedContent' + cvToken: + $ref: '#/components/schemas/cvToken' verificationUpdateRequest: type: object required: @@ -6005,6 +6030,8 @@ components: $ref: '#/components/schemas/helpMessageResponse' ageGatedContent: $ref: '#/components/schemas/ageGatedContent' + cvToken: + $ref: '#/components/schemas/cvToken' tfvBasicAuthentication: type: object properties: @@ -6456,6 +6483,8 @@ components: $ref: '#/components/schemas/blocked' blockedReason: $ref: '#/components/schemas/blockedReason' + cvToken: + $ref: '#/components/schemas/cvToken' tfvSubmissionInfo: type: object properties: @@ -6520,6 +6549,18 @@ components: nullable: true pattern: ^[ -~]{16,64}$ type: string + cvToken: + type: string + description: >- + The token provided by Campaign Verify to validate your political use + case. Only required for 527 political organizations. If you are not a + 527 political organization, this field should be omitted. If you pass an + empty string, it will be passed along and potentially rejected. + minLength: 0 + maxLength: 500 + nullable: true + example: >- + cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw responses: createMessageResponse: description: Accepted @@ -6734,6 +6775,18 @@ components: - type: internal-server-error description: Internal server error. No further information available source: {} + customTooManyRequestsError: + description: Too Many Requests + headers: + Retry-After: + description: The number of seconds to wait before retrying the request. + schema: + type: integer + example: 300 + content: + application/json: + schema: + $ref: '#/components/schemas/customTooManyRequestsError' createCallResponse: description: Created headers: diff --git a/docs/CustomTooManyRequestsError.md b/docs/CustomTooManyRequestsError.md new file mode 100644 index 0000000..12462ed --- /dev/null +++ b/docs/CustomTooManyRequestsError.md @@ -0,0 +1,20 @@ +# Bandwidth::CustomTooManyRequestsError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | | | +| **description** | **String** | | | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::CustomTooManyRequestsError.new( + type: rate_limit_exceeded, + description: Rate limit exceeded. Wait for Retry-After time before sending another request. +) +``` + diff --git a/docs/LookupResult.md b/docs/LookupResult.md index eab2940..18d4fa4 100644 --- a/docs/LookupResult.md +++ b/docs/LookupResult.md @@ -31,8 +31,8 @@ instance = Bandwidth::LookupResult.new( deactivation_date: 2025-06-20 18:35, deactivation_event: null, latest_message_delivery_status: null, - initial_message_delivery_status_date: Thu Jun 19 20:00:00 EDT 2025, - latest_message_delivery_status_date: Fri Jun 20 20:00:00 EDT 2025 + 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 ) ``` diff --git a/docs/MessagesApi.md b/docs/MessagesApi.md index e4920ef..3ab595e 100644 --- a/docs/MessagesApi.md +++ b/docs/MessagesApi.md @@ -89,7 +89,7 @@ end List Messages -Returns a list of messages based on query parameters. +Returns a list of messages based on query parameters. **Rate Limit:** This endpoint is rate limited to 3500 requests per 5 minutes per Source IP address. Exceeding the limit returns HTTP 429 with a `Retry-After` header. ### Examples diff --git a/docs/RbmActionBase.md b/docs/RbmActionBase.md index 9c9b7d2..22578d6 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@13866865 + postback_data: [B@19d13d04 ) ``` diff --git a/docs/RbmMessageMedia.md b/docs/RbmMessageMedia.md index 0732efb..85bc564 100644 --- a/docs/RbmMessageMedia.md +++ b/docs/RbmMessageMedia.md @@ -4,7 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **media** | [**RbmMessageContentFile**](RbmMessageContentFile.md) | | | +| **media** | [**Array<RbmMessageContentFile>**](RbmMessageContentFile.md) | | | | **suggestions** | [**Array<MultiChannelAction>**](MultiChannelAction.md) | An array of suggested actions for the recipient. | [optional] | ## Example diff --git a/docs/RbmSuggestionResponse.md b/docs/RbmSuggestionResponse.md index e712d72..219cd8c 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@13866865 + postback_data: [B@19d13d04 ) ``` diff --git a/docs/TfvStatus.md b/docs/TfvStatus.md index 81b2f4b..5b87e23 100644 --- a/docs/TfvStatus.md +++ b/docs/TfvStatus.md @@ -14,6 +14,7 @@ | **submission** | [**TfvSubmissionInfo**](TfvSubmissionInfo.md) | | [optional] | | **blocked** | **Boolean** | Whether a Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked. | [optional] | | **blocked_reason** | **String** | The reason why the Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked. | [optional] | +| **cv_token** | **String** | The token provided by Campaign Verify to validate your political use case. Only required for 527 political organizations. If you are not a 527 political organization, this field should be omitted. If you pass an empty string, it will be passed along and potentially rejected. | [optional] | ## Example @@ -30,7 +31,8 @@ instance = Bandwidth::TfvStatus.new( modified_date_time: 2021-06-08T06:45:13Z, submission: null, blocked: true, - blocked_reason: Toll-free number was used to send spam messages + blocked_reason: Toll-free number was used to send spam messages, + cv_token: cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw ) ``` diff --git a/docs/VerificationRequest.md b/docs/VerificationRequest.md index 73e09f3..6624972 100644 --- a/docs/VerificationRequest.md +++ b/docs/VerificationRequest.md @@ -22,6 +22,7 @@ | **business_entity_type** | [**BusinessEntityTypeEnum**](BusinessEntityTypeEnum.md) | | [optional] | | **help_message_response** | **String** | A message that gets sent to users requesting help. | [optional] | | **age_gated_content** | **Boolean** | Indicates whether the content is age-gated. | [optional] | +| **cv_token** | **String** | The token provided by Campaign Verify to validate your political use case. Only required for 527 political organizations. If you are not a 527 political organization, this field should be omitted. If you pass an empty string, it will be passed along and potentially rejected. | [optional] | ## Example @@ -46,7 +47,8 @@ instance = Bandwidth::VerificationRequest.new( business_registration_type: null, business_entity_type: null, help_message_response: Please contact support for assistance., - age_gated_content: false + age_gated_content: false, + cv_token: cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw ) ``` diff --git a/docs/VerificationUpdateRequest.md b/docs/VerificationUpdateRequest.md index f7492d3..9f60d66 100644 --- a/docs/VerificationUpdateRequest.md +++ b/docs/VerificationUpdateRequest.md @@ -21,6 +21,7 @@ | **business_entity_type** | [**BusinessEntityTypeEnum**](BusinessEntityTypeEnum.md) | | [optional] | | **help_message_response** | **String** | A message that gets sent to users requesting help. | [optional] | | **age_gated_content** | **Boolean** | Indicates whether the content is age-gated. | [optional] | +| **cv_token** | **String** | The token provided by Campaign Verify to validate your political use case. Only required for 527 political organizations. If you are not a 527 political organization, this field should be omitted. If you pass an empty string, it will be passed along and potentially rejected. | [optional] | ## Example @@ -44,7 +45,8 @@ instance = Bandwidth::VerificationUpdateRequest.new( business_registration_type: null, business_entity_type: null, help_message_response: Please contact support for assistance., - age_gated_content: false + age_gated_content: false, + cv_token: cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw ) ``` diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb index 718f3ec..f2f5cc6 100644 --- a/lib/bandwidth-sdk.rb +++ b/lib/bandwidth-sdk.rb @@ -61,6 +61,7 @@ require 'bandwidth-sdk/models/create_multi_channel_message_response' require 'bandwidth-sdk/models/create_sync_lookup_response' require 'bandwidth-sdk/models/create_sync_lookup_response_data' +require 'bandwidth-sdk/models/custom_too_many_requests_error' require 'bandwidth-sdk/models/deactivation_event_enum' require 'bandwidth-sdk/models/disconnect_callback' require 'bandwidth-sdk/models/diversion' diff --git a/lib/bandwidth-sdk/api/messages_api.rb b/lib/bandwidth-sdk/api/messages_api.rb index b38beb8..6d18f4c 100644 --- a/lib/bandwidth-sdk/api/messages_api.rb +++ b/lib/bandwidth-sdk/api/messages_api.rb @@ -94,7 +94,7 @@ def create_message_with_http_info(account_id, message_request, opts = {}) end # List Messages - # Returns a list of messages based on query parameters. + # Returns a list of messages based on query parameters. **Rate Limit:** This endpoint is rate limited to 3500 requests per 5 minutes per Source IP address. Exceeding the limit returns HTTP 429 with a `Retry-After` header. # @param account_id [String] Your Bandwidth Account ID. # @param [Hash] opts the optional parameters # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. @@ -131,7 +131,7 @@ def list_messages(account_id, opts = {}) end # List Messages - # Returns a list of messages based on query parameters. + # Returns a list of messages based on query parameters. **Rate Limit:** This endpoint is rate limited to 3500 requests per 5 minutes per Source IP address. Exceeding the limit returns HTTP 429 with a `Retry-After` header. # @param account_id [String] Your Bandwidth Account ID. # @param [Hash] opts the optional parameters # @option opts [String] :message_id The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. diff --git a/lib/bandwidth-sdk/models/custom_too_many_requests_error.rb b/lib/bandwidth-sdk/models/custom_too_many_requests_error.rb new file mode 100644 index 0000000..14782c0 --- /dev/null +++ b/lib/bandwidth-sdk/models/custom_too_many_requests_error.rb @@ -0,0 +1,188 @@ +=begin +#Bandwidth + +#Bandwidth's Communication APIs + +The version of the OpenAPI document: 1.0.0 +Contact: letstalk@bandwidth.com +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class CustomTooManyRequestsError < ApiModelBase + attr_accessor :type + + attr_accessor :description + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'description' => :'description' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'description' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CustomTooManyRequestsError` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CustomTooManyRequestsError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + else + self.description = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @description.nil? + invalid_properties.push('invalid value for "description", description cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @type.nil? + return false if @description.nil? + true + 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 + + # 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 + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + description == o.description + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, description].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + end +end diff --git a/lib/bandwidth-sdk/models/rbm_message_media.rb b/lib/bandwidth-sdk/models/rbm_message_media.rb index 438dba1..bb881fa 100644 --- a/lib/bandwidth-sdk/models/rbm_message_media.rb +++ b/lib/bandwidth-sdk/models/rbm_message_media.rb @@ -41,7 +41,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'media' => :'RbmMessageContentFile', + :'media' => :'Array', :'suggestions' => :'Array' } end @@ -69,7 +69,9 @@ def initialize(attributes = {}) } if attributes.key?(:'media') - self.media = attributes[:'media'] + if (value = attributes[:'media']).is_a?(Array) + self.media = value + end else self.media = nil end diff --git a/lib/bandwidth-sdk/models/tfv_status.rb b/lib/bandwidth-sdk/models/tfv_status.rb index bbb4108..1c02c94 100644 --- a/lib/bandwidth-sdk/models/tfv_status.rb +++ b/lib/bandwidth-sdk/models/tfv_status.rb @@ -43,6 +43,9 @@ class TfvStatus < ApiModelBase # The reason why the Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked. attr_accessor :blocked_reason + # The token provided by Campaign Verify to validate your political use case. Only required for 527 political organizations. If you are not a 527 political organization, this field should be omitted. If you pass an empty string, it will be passed along and potentially rejected. + attr_accessor :cv_token + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -77,7 +80,8 @@ def self.attribute_map :'modified_date_time' => :'modifiedDateTime', :'submission' => :'submission', :'blocked' => :'blocked', - :'blocked_reason' => :'blockedReason' + :'blocked_reason' => :'blockedReason', + :'cv_token' => :'cvToken' } end @@ -103,13 +107,15 @@ def self.openapi_types :'modified_date_time' => :'Time', :'submission' => :'TfvSubmissionInfo', :'blocked' => :'Boolean', - :'blocked_reason' => :'String' + :'blocked_reason' => :'String', + :'cv_token' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'cv_token' ]) end @@ -168,6 +174,10 @@ def initialize(attributes = {}) if attributes.key?(:'blocked_reason') self.blocked_reason = attributes[:'blocked_reason'] end + + if attributes.key?(:'cv_token') + self.cv_token = attributes[:'cv_token'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -188,6 +198,14 @@ def list_invalid_properties invalid_properties.push("invalid value for \"phone_number\", must conform to the pattern #{pattern}.") end + if !@cv_token.nil? && @cv_token.to_s.length > 500 + invalid_properties.push('invalid value for "cv_token", the character length must be smaller than or equal to 500.') + end + + if !@cv_token.nil? && @cv_token.to_s.length < 0 + invalid_properties.push('invalid value for "cv_token", the character length must be greater than or equal to 0.') + end + invalid_properties end @@ -198,6 +216,8 @@ def valid? return false if !@phone_number.nil? && @phone_number.to_s.length > 12 return false if !@phone_number.nil? && @phone_number.to_s.length < 12 return false if !@phone_number.nil? && @phone_number !~ Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/) + return false if !@cv_token.nil? && @cv_token.to_s.length > 500 + return false if !@cv_token.nil? && @cv_token.to_s.length < 0 true end @@ -224,6 +244,20 @@ def phone_number=(phone_number) @phone_number = phone_number end + # Custom attribute writer method with validation + # @param [Object] cv_token Value to be assigned + def cv_token=(cv_token) + if !cv_token.nil? && cv_token.to_s.length > 500 + fail ArgumentError, 'invalid value for "cv_token", the character length must be smaller than or equal to 500.' + end + + if !cv_token.nil? && cv_token.to_s.length < 0 + fail ArgumentError, 'invalid value for "cv_token", the character length must be greater than or equal to 0.' + end + + @cv_token = cv_token + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -238,7 +272,8 @@ def ==(o) modified_date_time == o.modified_date_time && submission == o.submission && blocked == o.blocked && - blocked_reason == o.blocked_reason + blocked_reason == o.blocked_reason && + cv_token == o.cv_token end # @see the `==` method @@ -250,7 +285,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [phone_number, status, internal_ticket_number, decline_reason_description, resubmit_allowed, created_date_time, modified_date_time, submission, blocked, blocked_reason].hash + [phone_number, status, internal_ticket_number, decline_reason_description, resubmit_allowed, created_date_time, modified_date_time, submission, blocked, blocked_reason, cv_token].hash end # Builds the object from hash diff --git a/lib/bandwidth-sdk/models/verification_request.rb b/lib/bandwidth-sdk/models/verification_request.rb index 5d69597..c42d3f2 100644 --- a/lib/bandwidth-sdk/models/verification_request.rb +++ b/lib/bandwidth-sdk/models/verification_request.rb @@ -63,6 +63,9 @@ class VerificationRequest < ApiModelBase # Indicates whether the content is age-gated. attr_accessor :age_gated_content + # The token provided by Campaign Verify to validate your political use case. Only required for 527 political organizations. If you are not a 527 political organization, this field should be omitted. If you pass an empty string, it will be passed along and potentially rejected. + attr_accessor :cv_token + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -105,7 +108,8 @@ def self.attribute_map :'business_registration_type' => :'businessRegistrationType', :'business_entity_type' => :'businessEntityType', :'help_message_response' => :'helpMessageResponse', - :'age_gated_content' => :'ageGatedContent' + :'age_gated_content' => :'ageGatedContent', + :'cv_token' => :'cvToken' } end @@ -139,7 +143,8 @@ def self.openapi_types :'business_registration_type' => :'BusinessRegistrationTypeEnum', :'business_entity_type' => :'BusinessEntityTypeEnum', :'help_message_response' => :'String', - :'age_gated_content' => :'Boolean' + :'age_gated_content' => :'Boolean', + :'cv_token' => :'String' } end @@ -152,6 +157,7 @@ def self.openapi_nullable :'business_registration_type', :'business_entity_type', :'help_message_response', + :'cv_token' ]) end @@ -260,6 +266,10 @@ def initialize(attributes = {}) if attributes.key?(:'age_gated_content') self.age_gated_content = attributes[:'age_gated_content'] end + + if attributes.key?(:'cv_token') + self.cv_token = attributes[:'cv_token'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -363,6 +373,14 @@ def list_invalid_properties invalid_properties.push('invalid value for "help_message_response", the character length must be smaller than or equal to 500.') end + if !@cv_token.nil? && @cv_token.to_s.length > 500 + invalid_properties.push('invalid value for "cv_token", the character length must be smaller than or equal to 500.') + end + + if !@cv_token.nil? && @cv_token.to_s.length < 0 + invalid_properties.push('invalid value for "cv_token", the character length must be greater than or equal to 0.') + end + invalid_properties end @@ -394,6 +412,8 @@ def valid? return false if !@isv_reseller.nil? && @isv_reseller.to_s.length < 0 return false if !@business_registration_number.nil? && @business_registration_number.to_s.length > 500 return false if !@help_message_response.nil? && @help_message_response.to_s.length > 500 + return false if !@cv_token.nil? && @cv_token.to_s.length > 500 + return false if !@cv_token.nil? && @cv_token.to_s.length < 0 true end @@ -565,6 +585,20 @@ def help_message_response=(help_message_response) @help_message_response = help_message_response end + # Custom attribute writer method with validation + # @param [Object] cv_token Value to be assigned + def cv_token=(cv_token) + if !cv_token.nil? && cv_token.to_s.length > 500 + fail ArgumentError, 'invalid value for "cv_token", the character length must be smaller than or equal to 500.' + end + + if !cv_token.nil? && cv_token.to_s.length < 0 + fail ArgumentError, 'invalid value for "cv_token", the character length must be greater than or equal to 0.' + end + + @cv_token = cv_token + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -587,7 +621,8 @@ def ==(o) business_registration_type == o.business_registration_type && business_entity_type == o.business_entity_type && help_message_response == o.help_message_response && - age_gated_content == o.age_gated_content + age_gated_content == o.age_gated_content && + cv_token == o.cv_token end # @see the `==` method @@ -599,7 +634,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [business_address, business_contact, message_volume, phone_numbers, use_case, use_case_summary, production_message_content, opt_in_workflow, additional_information, isv_reseller, privacy_policy_url, terms_and_conditions_url, business_dba, business_registration_number, business_registration_type, business_entity_type, help_message_response, age_gated_content].hash + [business_address, business_contact, message_volume, phone_numbers, use_case, use_case_summary, production_message_content, opt_in_workflow, additional_information, isv_reseller, privacy_policy_url, terms_and_conditions_url, business_dba, business_registration_number, business_registration_type, business_entity_type, help_message_response, age_gated_content, cv_token].hash end # Builds the object from hash diff --git a/lib/bandwidth-sdk/models/verification_update_request.rb b/lib/bandwidth-sdk/models/verification_update_request.rb index ef6de9f..433a81c 100644 --- a/lib/bandwidth-sdk/models/verification_update_request.rb +++ b/lib/bandwidth-sdk/models/verification_update_request.rb @@ -61,6 +61,9 @@ class VerificationUpdateRequest < ApiModelBase # Indicates whether the content is age-gated. attr_accessor :age_gated_content + # The token provided by Campaign Verify to validate your political use case. Only required for 527 political organizations. If you are not a 527 political organization, this field should be omitted. If you pass an empty string, it will be passed along and potentially rejected. + attr_accessor :cv_token + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -102,7 +105,8 @@ def self.attribute_map :'business_registration_type' => :'businessRegistrationType', :'business_entity_type' => :'businessEntityType', :'help_message_response' => :'helpMessageResponse', - :'age_gated_content' => :'ageGatedContent' + :'age_gated_content' => :'ageGatedContent', + :'cv_token' => :'cvToken' } end @@ -135,7 +139,8 @@ def self.openapi_types :'business_registration_type' => :'BusinessRegistrationTypeEnum', :'business_entity_type' => :'BusinessEntityTypeEnum', :'help_message_response' => :'String', - :'age_gated_content' => :'Boolean' + :'age_gated_content' => :'Boolean', + :'cv_token' => :'String' } end @@ -148,6 +153,7 @@ def self.openapi_nullable :'business_registration_type', :'business_entity_type', :'help_message_response', + :'cv_token' ]) end @@ -248,6 +254,10 @@ def initialize(attributes = {}) if attributes.key?(:'age_gated_content') self.age_gated_content = attributes[:'age_gated_content'] end + + if attributes.key?(:'cv_token') + self.cv_token = attributes[:'cv_token'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -339,6 +349,14 @@ def list_invalid_properties invalid_properties.push('invalid value for "help_message_response", the character length must be smaller than or equal to 500.') end + if !@cv_token.nil? && @cv_token.to_s.length > 500 + invalid_properties.push('invalid value for "cv_token", the character length must be smaller than or equal to 500.') + end + + if !@cv_token.nil? && @cv_token.to_s.length < 0 + invalid_properties.push('invalid value for "cv_token", the character length must be greater than or equal to 0.') + end + invalid_properties end @@ -367,6 +385,8 @@ def valid? return false if !@isv_reseller.nil? && @isv_reseller.to_s.length < 0 return false if !@business_registration_number.nil? && @business_registration_number.to_s.length > 500 return false if !@help_message_response.nil? && @help_message_response.to_s.length > 500 + return false if !@cv_token.nil? && @cv_token.to_s.length > 500 + return false if !@cv_token.nil? && @cv_token.to_s.length < 0 true end @@ -520,6 +540,20 @@ def help_message_response=(help_message_response) @help_message_response = help_message_response end + # Custom attribute writer method with validation + # @param [Object] cv_token Value to be assigned + def cv_token=(cv_token) + if !cv_token.nil? && cv_token.to_s.length > 500 + fail ArgumentError, 'invalid value for "cv_token", the character length must be smaller than or equal to 500.' + end + + if !cv_token.nil? && cv_token.to_s.length < 0 + fail ArgumentError, 'invalid value for "cv_token", the character length must be greater than or equal to 0.' + end + + @cv_token = cv_token + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -541,7 +575,8 @@ def ==(o) business_registration_type == o.business_registration_type && business_entity_type == o.business_entity_type && help_message_response == o.help_message_response && - age_gated_content == o.age_gated_content + age_gated_content == o.age_gated_content && + cv_token == o.cv_token end # @see the `==` method @@ -553,7 +588,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [business_address, business_contact, message_volume, use_case, use_case_summary, production_message_content, opt_in_workflow, additional_information, isv_reseller, privacy_policy_url, terms_and_conditions_url, business_dba, business_registration_number, business_registration_type, business_entity_type, help_message_response, age_gated_content].hash + [business_address, business_contact, message_volume, use_case, use_case_summary, production_message_content, opt_in_workflow, additional_information, isv_reseller, privacy_policy_url, terms_and_conditions_url, business_dba, business_registration_number, business_registration_type, business_entity_type, help_message_response, age_gated_content, cv_token].hash end # Builds the object from hash