diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 0b4c5aa..f4109dc 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -8,6 +8,7 @@ docs/AccountStatistics.md docs/AdditionalDenialReason.md docs/Address.md docs/AnswerCallback.md +docs/BlockedWebhook.md docs/BridgeCompleteCallback.md docs/BridgeTargetCompleteCallback.md docs/CallDirectionEnum.md @@ -179,6 +180,7 @@ lib/bandwidth-sdk/models/account_statistics.rb lib/bandwidth-sdk/models/additional_denial_reason.rb lib/bandwidth-sdk/models/address.rb lib/bandwidth-sdk/models/answer_callback.rb +lib/bandwidth-sdk/models/blocked_webhook.rb lib/bandwidth-sdk/models/bridge_complete_callback.rb lib/bandwidth-sdk/models/bridge_target_complete_callback.rb lib/bandwidth-sdk/models/call_direction_enum.rb diff --git a/README.md b/README.md index 201ddf6..8219641 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,7 @@ Class | Method | HTTP request | Description - [Bandwidth::AdditionalDenialReason](docs/AdditionalDenialReason.md) - [Bandwidth::Address](docs/Address.md) - [Bandwidth::AnswerCallback](docs/AnswerCallback.md) + - [Bandwidth::BlockedWebhook](docs/BlockedWebhook.md) - [Bandwidth::BridgeCompleteCallback](docs/BridgeCompleteCallback.md) - [Bandwidth::BridgeTargetCompleteCallback](docs/BridgeTargetCompleteCallback.md) - [Bandwidth::CallDirectionEnum](docs/CallDirectionEnum.md) diff --git a/bandwidth.yml b/bandwidth.yml index e180a94..89d9488 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -5253,17 +5253,17 @@ components: description: >- The Toll-Free Verification request privacy policy URL. (Not Available Until 5/28/2025) - example: http://your-company.com/privacyPolicyUrl.pdf + example: http://your-company.com/privacyPolicy type: string termsAndConditionsUrl: description: >- The Toll-Free Verification request terms and conditions policy URL. (Not Available Until 5/28/2025) - example: http://your-company.com/termsAndConditionsUrl.pdf + example: http://your-company.com/termsAndConditions type: string - businessDBA: + businessDba: description: The company 'Doing Business As'. (Not Available Until 5/28/2025) - example: SecondCompany Name + example: Another Company Name Inc. type: string additionalDenialReason: properties: @@ -5349,8 +5349,8 @@ components: $ref: '#/components/schemas/privacyPolicyUrl' termsAndConditionsUrl: $ref: '#/components/schemas/termsAndConditionsUrl' - businessDBA: - $ref: '#/components/schemas/businessDBA' + businessDba: + $ref: '#/components/schemas/businessDba' verificationUpdateRequest: type: object required: @@ -5388,8 +5388,8 @@ components: $ref: '#/components/schemas/privacyPolicyUrl' termsAndConditionsUrl: $ref: '#/components/schemas/termsAndConditionsUrl' - businessDBA: - $ref: '#/components/schemas/businessDBA' + businessDba: + $ref: '#/components/schemas/businessDba' tfvBasicAuthentication: type: object properties: @@ -5483,6 +5483,21 @@ components: $ref: '#/components/schemas/tfvCallbackStatusEnum' internalTicketNumber: $ref: '#/components/schemas/internalTicketNumberForWebhook' + blockedWebhook: + type: object + properties: + accountId: + $ref: '#/components/schemas/accountId1' + phoneNumber: + $ref: '#/components/schemas/tfPhoneNumber' + status: + $ref: '#/components/schemas/tfvCallbackStatusEnum' + internalTicketNumber: + $ref: '#/components/schemas/internalTicketNumberForWebhook' + blocked: + $ref: '#/components/schemas/blocked' + blockedReason: + $ref: '#/components/schemas/blockedReason' tfvSubmissionWrapper: type: object properties: @@ -5849,8 +5864,8 @@ components: $ref: '#/components/schemas/privacyPolicyUrl' termsAndConditionsUrl: $ref: '#/components/schemas/termsAndConditionsUrl' - businessDBA: - $ref: '#/components/schemas/businessDBA' + businessDba: + $ref: '#/components/schemas/businessDba' tfvStatusEnum: type: string enum: @@ -7468,6 +7483,7 @@ components: - $ref: '#/components/schemas/verificationWebhook' - $ref: '#/components/schemas/verificationDenialWebhook' - $ref: '#/components/schemas/failureWebhook' + - $ref: '#/components/schemas/blockedWebhook' webhookSubscriptionRequest: description: >- Information about a webhook that Bandwidth should send upon the diff --git a/docs/BlockedWebhook.md b/docs/BlockedWebhook.md new file mode 100644 index 0000000..f09b3c0 --- /dev/null +++ b/docs/BlockedWebhook.md @@ -0,0 +1,28 @@ +# Bandwidth::BlockedWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | User's account ID. | [optional] | +| **phone_number** | **String** | Toll-free telephone number in E.164 format. | [optional] | +| **status** | [**TfvCallbackStatusEnum**](TfvCallbackStatusEnum.md) | | [optional] | +| **internal_ticket_number** | **String** | Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number. | [optional] | +| **blocked** | **Boolean** | Whether a Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked. (Not Available Until 5/28/2025) | [optional] | +| **blocked_reason** | **String** | The reason why the Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked. (Not Available Until 5/28/2025) | [optional] | + +## Example + +```ruby +require 'bandwidth-sdk' + +instance = Bandwidth::BlockedWebhook.new( + account_id: 1234567, + phone_number: +18005555555, + status: null, + internal_ticket_number: acde070d-8c4c-4f0d-9d8a-162843c10333, + blocked: true, + blocked_reason: Toll-free number was used to send spam messages +) +``` + diff --git a/docs/RbmActionBase.md b/docs/RbmActionBase.md index eb9e692..9e51afa 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, - post_back_data: [B@204c5ddf + post_back_data: [B@6b103db7 ) ``` diff --git a/docs/TfvSubmissionInfo.md b/docs/TfvSubmissionInfo.md index 2c121a3..9a4e276 100644 --- a/docs/TfvSubmissionInfo.md +++ b/docs/TfvSubmissionInfo.md @@ -32,9 +32,9 @@ instance = Bandwidth::TfvSubmissionInfo.new( opt_in_workflow: null, additional_information: Any additional information, isv_reseller: Test ISV, - privacy_policy_url: http://your-company.com/privacyPolicyUrl.pdf, - terms_and_conditions_url: http://your-company.com/termsAndConditionsUrl.pdf, - business_dba: SecondCompany Name + privacy_policy_url: http://your-company.com/privacyPolicy, + terms_and_conditions_url: http://your-company.com/termsAndConditions, + business_dba: Another Company Name Inc. ) ``` diff --git a/docs/VerificationRequest.md b/docs/VerificationRequest.md index 1b488f3..b0b521a 100644 --- a/docs/VerificationRequest.md +++ b/docs/VerificationRequest.md @@ -34,9 +34,9 @@ instance = Bandwidth::VerificationRequest.new( opt_in_workflow: null, additional_information: Any additional information, isv_reseller: Test ISV, - privacy_policy_url: http://your-company.com/privacyPolicyUrl.pdf, - terms_and_conditions_url: http://your-company.com/termsAndConditionsUrl.pdf, - business_dba: SecondCompany Name + privacy_policy_url: http://your-company.com/privacyPolicy, + terms_and_conditions_url: http://your-company.com/termsAndConditions, + business_dba: Another Company Name Inc. ) ``` diff --git a/docs/VerificationUpdateRequest.md b/docs/VerificationUpdateRequest.md index 5777295..198b3e8 100644 --- a/docs/VerificationUpdateRequest.md +++ b/docs/VerificationUpdateRequest.md @@ -32,9 +32,9 @@ instance = Bandwidth::VerificationUpdateRequest.new( opt_in_workflow: null, additional_information: Any additional information, isv_reseller: Test ISV, - privacy_policy_url: http://your-company.com/privacyPolicyUrl.pdf, - terms_and_conditions_url: http://your-company.com/termsAndConditionsUrl.pdf, - business_dba: SecondCompany Name + privacy_policy_url: http://your-company.com/privacyPolicy, + terms_and_conditions_url: http://your-company.com/termsAndConditions, + business_dba: Another Company Name Inc. ) ``` diff --git a/lib/bandwidth-sdk.rb b/lib/bandwidth-sdk.rb index 1484e1b..74ee0dd 100644 --- a/lib/bandwidth-sdk.rb +++ b/lib/bandwidth-sdk.rb @@ -21,6 +21,7 @@ require 'bandwidth-sdk/models/additional_denial_reason' require 'bandwidth-sdk/models/address' require 'bandwidth-sdk/models/answer_callback' +require 'bandwidth-sdk/models/blocked_webhook' require 'bandwidth-sdk/models/bridge_complete_callback' require 'bandwidth-sdk/models/bridge_target_complete_callback' require 'bandwidth-sdk/models/call_direction_enum' diff --git a/lib/bandwidth-sdk/models/blocked_webhook.rb b/lib/bandwidth-sdk/models/blocked_webhook.rb new file mode 100644 index 0000000..f785299 --- /dev/null +++ b/lib/bandwidth-sdk/models/blocked_webhook.rb @@ -0,0 +1,323 @@ +=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.8.0 + +=end + +require 'date' +require 'time' + +module Bandwidth + class BlockedWebhook + # User's account ID. + attr_accessor :account_id + + # Toll-free telephone number in E.164 format. + attr_accessor :phone_number + + attr_accessor :status + + # Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number. + attr_accessor :internal_ticket_number + + # Whether a Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked. (Not Available Until 5/28/2025) + attr_accessor :blocked + + # The reason why the Toll-Free Verification is blocked. This attribute will only be defined when the number is blocked. (Not Available Until 5/28/2025) + attr_accessor :blocked_reason + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'account_id' => :'accountId', + :'phone_number' => :'phoneNumber', + :'status' => :'status', + :'internal_ticket_number' => :'internalTicketNumber', + :'blocked' => :'blocked', + :'blocked_reason' => :'blockedReason' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'account_id' => :'String', + :'phone_number' => :'String', + :'status' => :'TfvCallbackStatusEnum', + :'internal_ticket_number' => :'String', + :'blocked' => :'Boolean', + :'blocked_reason' => :'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::BlockedWebhook` initialize method' + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::BlockedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'phone_number') + self.phone_number = attributes[:'phone_number'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'internal_ticket_number') + self.internal_ticket_number = attributes[:'internal_ticket_number'] + end + + if attributes.key?(:'blocked') + self.blocked = attributes[:'blocked'] + end + + if attributes.key?(:'blocked_reason') + self.blocked_reason = attributes[:'blocked_reason'] + 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 !@phone_number.nil? && @phone_number.to_s.length > 12 + invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 12.') + end + + if !@phone_number.nil? && @phone_number.to_s.length < 12 + invalid_properties.push('invalid value for "phone_number", the character length must be great than or equal to 12.') + end + + pattern = Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/) + if !@phone_number.nil? && @phone_number !~ pattern + invalid_properties.push("invalid value for \"phone_number\", must conform to the pattern #{pattern}.") + 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 !@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}$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] phone_number Value to be assigned + def phone_number=(phone_number) + if phone_number.nil? + fail ArgumentError, 'phone_number cannot be nil' + end + + if phone_number.to_s.length > 12 + fail ArgumentError, 'invalid value for "phone_number", the character length must be smaller than or equal to 12.' + end + + if phone_number.to_s.length < 12 + fail ArgumentError, 'invalid value for "phone_number", the character length must be great than or equal to 12.' + end + + pattern = Regexp.new(/^\+1(800|833|844|855|866|877|888)[2-9]\d{6}$/) + if phone_number !~ pattern + fail ArgumentError, "invalid value for \"phone_number\", must conform to the pattern #{pattern}." + end + + @phone_number = phone_number + 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 && + account_id == o.account_id && + phone_number == o.phone_number && + status == o.status && + internal_ticket_number == o.internal_ticket_number && + blocked == o.blocked && + blocked_reason == o.blocked_reason + 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 + [account_id, phone_number, status, internal_ticket_number, blocked, blocked_reason].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 + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Bandwidth.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_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 + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/bandwidth-sdk/models/tfv_submission_info.rb b/lib/bandwidth-sdk/models/tfv_submission_info.rb index ebce693..4767715 100644 --- a/lib/bandwidth-sdk/models/tfv_submission_info.rb +++ b/lib/bandwidth-sdk/models/tfv_submission_info.rb @@ -62,7 +62,7 @@ def self.attribute_map :'isv_reseller' => :'isvReseller', :'privacy_policy_url' => :'privacyPolicyUrl', :'terms_and_conditions_url' => :'termsAndConditionsUrl', - :'business_dba' => :'businessDBA' + :'business_dba' => :'businessDba' } end diff --git a/lib/bandwidth-sdk/models/verification_request.rb b/lib/bandwidth-sdk/models/verification_request.rb index b73949e..951eb9c 100644 --- a/lib/bandwidth-sdk/models/verification_request.rb +++ b/lib/bandwidth-sdk/models/verification_request.rb @@ -65,7 +65,7 @@ def self.attribute_map :'isv_reseller' => :'isvReseller', :'privacy_policy_url' => :'privacyPolicyUrl', :'terms_and_conditions_url' => :'termsAndConditionsUrl', - :'business_dba' => :'businessDBA' + :'business_dba' => :'businessDba' } end diff --git a/lib/bandwidth-sdk/models/verification_update_request.rb b/lib/bandwidth-sdk/models/verification_update_request.rb index 847ccbd..963006e 100644 --- a/lib/bandwidth-sdk/models/verification_update_request.rb +++ b/lib/bandwidth-sdk/models/verification_update_request.rb @@ -62,7 +62,7 @@ def self.attribute_map :'isv_reseller' => :'isvReseller', :'privacy_policy_url' => :'privacyPolicyUrl', :'terms_and_conditions_url' => :'termsAndConditionsUrl', - :'business_dba' => :'businessDBA' + :'business_dba' => :'businessDba' } end