bandwidth-sdk 14.0.0 → 14.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/Gemfile.lock +10 -10
 - data/README.md +42 -10
 - data/bandwidth.yml +1113 -0
 - data/coverage/.last_run.json +1 -1
 - data/coverage/.resultset.json +1204 -231
 - data/coverage/index.html +20499 -10053
 - data/custom_templates/README.mustache +6 -6
 - data/docs/AdditionalDenialReason.md +22 -0
 - data/docs/Address.md +30 -0
 - data/docs/Contact.md +24 -0
 - data/docs/Error.md +22 -0
 - data/docs/FailureWebhook.md +28 -0
 - data/docs/InitiateCallback.md +3 -1
 - data/docs/LinksObject.md +24 -0
 - data/docs/OptInWorkflow.md +20 -0
 - data/docs/TelephoneNumber.md +18 -0
 - data/docs/TfvBasicAuthentication.md +20 -0
 - data/docs/{PublishPermissionsEnum.md → TfvCallbackStatusEnum.md} +2 -2
 - data/docs/TfvError.md +22 -0
 - data/docs/TfvStatus.md +32 -0
 - data/docs/{DeviceApiVersionEnum.md → TfvStatusEnum.md} +2 -2
 - data/docs/TfvSubmissionInfo.md +34 -0
 - data/docs/TfvSubmissionWrapper.md +18 -0
 - data/docs/TollFreeVerificationApi.md +585 -0
 - data/docs/VerificationDenialWebhook.md +32 -0
 - data/docs/VerificationRequest.md +36 -0
 - data/docs/VerificationUpdateRequest.md +34 -0
 - data/docs/VerificationWebhook.md +24 -0
 - data/docs/WebhookSubscription.md +30 -0
 - data/docs/WebhookSubscriptionBasicAuthentication.md +20 -0
 - data/docs/WebhookSubscriptionRequestSchema.md +22 -0
 - data/docs/WebhookSubscriptionTypeEnum.md +15 -0
 - data/docs/WebhookSubscriptionsListBody.md +22 -0
 - data/lib/bandwidth-sdk/api/toll_free_verification_api.rb +614 -0
 - data/lib/bandwidth-sdk/configuration.rb +48 -0
 - data/lib/bandwidth-sdk/models/additional_denial_reason.rb +254 -0
 - data/lib/bandwidth-sdk/models/address.rb +501 -0
 - data/lib/bandwidth-sdk/models/contact.rb +393 -0
 - data/lib/bandwidth-sdk/models/error.rb +232 -0
 - data/lib/bandwidth-sdk/models/failure_webhook.rb +304 -0
 - data/lib/bandwidth-sdk/models/initiate_callback.rb +33 -4
 - data/lib/bandwidth-sdk/models/links_object.rb +243 -0
 - data/lib/bandwidth-sdk/models/opt_in_workflow.rb +265 -0
 - data/lib/bandwidth-sdk/models/telephone_number.rb +213 -0
 - data/lib/bandwidth-sdk/models/tfv_basic_authentication.rb +273 -0
 - data/lib/bandwidth-sdk/models/tfv_callback_status_enum.rb +40 -0
 - data/lib/bandwidth-sdk/models/tfv_error.rb +232 -0
 - data/lib/bandwidth-sdk/models/tfv_status.rb +342 -0
 - data/lib/bandwidth-sdk/models/tfv_status_enum.rb +43 -0
 - data/lib/bandwidth-sdk/models/tfv_submission_info.rb +452 -0
 - data/lib/bandwidth-sdk/models/tfv_submission_wrapper.rb +212 -0
 - data/lib/bandwidth-sdk/models/verification_denial_webhook.rb +325 -0
 - data/lib/bandwidth-sdk/models/verification_request.rb +547 -0
 - data/lib/bandwidth-sdk/models/verification_update_request.rb +501 -0
 - data/lib/bandwidth-sdk/models/verification_webhook.rb +303 -0
 - data/lib/bandwidth-sdk/models/webhook_subscription.rb +328 -0
 - data/lib/bandwidth-sdk/models/webhook_subscription_basic_authentication.rb +274 -0
 - data/lib/bandwidth-sdk/models/webhook_subscription_request_schema.rb +306 -0
 - data/lib/bandwidth-sdk/models/webhook_subscription_type_enum.rb +40 -0
 - data/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb +242 -0
 - data/lib/bandwidth-sdk/version.rb +1 -1
 - data/lib/bandwidth-sdk.rb +25 -0
 - data/openapi-config.yml +1 -1
 - data/spec/call_utils.rb +2 -2
 - data/spec/smoke/toll_free_verification_api_spec.rb +69 -0
 - data/spec/spec_helper.rb +1 -1
 - data/spec/unit/api/mfa_api_spec.rb +1 -1
 - data/spec/unit/api/toll_free_verification_api_spec.rb +278 -0
 - data/spec/unit/client/api_client_spec.rb +1 -1
 - metadata +91 -61
 - data/docs/CreateParticipantRequest.md +0 -24
 - data/docs/CreateParticipantResponse.md +0 -20
 - data/docs/DisconenctCallback.md +0 -50
 - data/docs/ForbiddenRequest.md +0 -18
 - data/docs/InboundMessageCallback.md +0 -26
 - data/docs/InboundMessageCallbackMessage.md +0 -40
 - data/docs/MessageDeliveredCallback.md +0 -26
 - data/docs/MessageDeliveredCallbackMessage.md +0 -40
 - data/docs/MessageFailedCallback.md +0 -28
 - data/docs/MessageFailedCallbackMessage.md +0 -40
 - data/docs/MessageSendingCallback.md +0 -26
 - data/docs/MessageSendingCallbackMessage.md +0 -40
 - data/docs/Participant.md +0 -30
 - data/docs/ParticipantSubscription.md +0 -20
 - data/docs/ParticipantsApi.md +0 -227
 - data/docs/RequestError.md +0 -20
 - data/docs/Session.md +0 -20
 - data/docs/SessionsApi.md +0 -605
 - data/docs/Subscriptions.md +0 -20
 - data/docs/TranscriptionList.md +0 -18
 - data/docs/TranscriptionMetadata.md +0 -24
 - data/docs/UnauthorizedRequest.md +0 -18
 
| 
         @@ -0,0 +1,242 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            =begin
         
     | 
| 
      
 2 
     | 
    
         
            +
            #Bandwidth
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            #Bandwidth's Communication APIs
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            The version of the OpenAPI document: 1.0.0
         
     | 
| 
      
 7 
     | 
    
         
            +
            Contact: letstalk@bandwidth.com
         
     | 
| 
      
 8 
     | 
    
         
            +
            Generated by: https://openapi-generator.tech
         
     | 
| 
      
 9 
     | 
    
         
            +
            Generator version: 7.8.0
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            =end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            require 'date'
         
     | 
| 
      
 14 
     | 
    
         
            +
            require 'time'
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            module Bandwidth
         
     | 
| 
      
 17 
     | 
    
         
            +
              # A list of all webhook subscriptions registered for this account ID for this particular feature (unpaginated).
         
     | 
| 
      
 18 
     | 
    
         
            +
              class WebhookSubscriptionsListBody
         
     | 
| 
      
 19 
     | 
    
         
            +
                attr_accessor :links
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                attr_accessor :errors
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                attr_accessor :data
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
                # Attribute mapping from ruby-style variable name to JSON key.
         
     | 
| 
      
 26 
     | 
    
         
            +
                def self.attribute_map
         
     | 
| 
      
 27 
     | 
    
         
            +
                  {
         
     | 
| 
      
 28 
     | 
    
         
            +
                    :'links' => :'links',
         
     | 
| 
      
 29 
     | 
    
         
            +
                    :'errors' => :'errors',
         
     | 
| 
      
 30 
     | 
    
         
            +
                    :'data' => :'data'
         
     | 
| 
      
 31 
     | 
    
         
            +
                  }
         
     | 
| 
      
 32 
     | 
    
         
            +
                end
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                # Returns all the JSON keys this model knows about
         
     | 
| 
      
 35 
     | 
    
         
            +
                def self.acceptable_attributes
         
     | 
| 
      
 36 
     | 
    
         
            +
                  attribute_map.values
         
     | 
| 
      
 37 
     | 
    
         
            +
                end
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
                # Attribute type mapping.
         
     | 
| 
      
 40 
     | 
    
         
            +
                def self.openapi_types
         
     | 
| 
      
 41 
     | 
    
         
            +
                  {
         
     | 
| 
      
 42 
     | 
    
         
            +
                    :'links' => :'LinksObject',
         
     | 
| 
      
 43 
     | 
    
         
            +
                    :'errors' => :'Array<Error>',
         
     | 
| 
      
 44 
     | 
    
         
            +
                    :'data' => :'Array<WebhookSubscription>'
         
     | 
| 
      
 45 
     | 
    
         
            +
                  }
         
     | 
| 
      
 46 
     | 
    
         
            +
                end
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                # List of attributes with nullable: true
         
     | 
| 
      
 49 
     | 
    
         
            +
                def self.openapi_nullable
         
     | 
| 
      
 50 
     | 
    
         
            +
                  Set.new([
         
     | 
| 
      
 51 
     | 
    
         
            +
                  ])
         
     | 
| 
      
 52 
     | 
    
         
            +
                end
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
                # Initializes the object
         
     | 
| 
      
 55 
     | 
    
         
            +
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
      
 56 
     | 
    
         
            +
                def initialize(attributes = {})
         
     | 
| 
      
 57 
     | 
    
         
            +
                  if (!attributes.is_a?(Hash))
         
     | 
| 
      
 58 
     | 
    
         
            +
                    fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::WebhookSubscriptionsListBody` initialize method'
         
     | 
| 
      
 59 
     | 
    
         
            +
                  end
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
                  # check to see if the attribute exists and convert string to symbol for hash key
         
     | 
| 
      
 62 
     | 
    
         
            +
                  attributes = attributes.each_with_object({}) { |(k, v), h|
         
     | 
| 
      
 63 
     | 
    
         
            +
                    if (!self.class.attribute_map.key?(k.to_sym))
         
     | 
| 
      
 64 
     | 
    
         
            +
                      fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::WebhookSubscriptionsListBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
         
     | 
| 
      
 65 
     | 
    
         
            +
                    end
         
     | 
| 
      
 66 
     | 
    
         
            +
                    h[k.to_sym] = v
         
     | 
| 
      
 67 
     | 
    
         
            +
                  }
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
                  if attributes.key?(:'links')
         
     | 
| 
      
 70 
     | 
    
         
            +
                    self.links = attributes[:'links']
         
     | 
| 
      
 71 
     | 
    
         
            +
                  end
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
      
 73 
     | 
    
         
            +
                  if attributes.key?(:'errors')
         
     | 
| 
      
 74 
     | 
    
         
            +
                    if (value = attributes[:'errors']).is_a?(Array)
         
     | 
| 
      
 75 
     | 
    
         
            +
                      self.errors = value
         
     | 
| 
      
 76 
     | 
    
         
            +
                    end
         
     | 
| 
      
 77 
     | 
    
         
            +
                  end
         
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
      
 79 
     | 
    
         
            +
                  if attributes.key?(:'data')
         
     | 
| 
      
 80 
     | 
    
         
            +
                    if (value = attributes[:'data']).is_a?(Array)
         
     | 
| 
      
 81 
     | 
    
         
            +
                      self.data = value
         
     | 
| 
      
 82 
     | 
    
         
            +
                    end
         
     | 
| 
      
 83 
     | 
    
         
            +
                  else
         
     | 
| 
      
 84 
     | 
    
         
            +
                    self.data = nil
         
     | 
| 
      
 85 
     | 
    
         
            +
                  end
         
     | 
| 
      
 86 
     | 
    
         
            +
                end
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
                # Show invalid properties with the reasons. Usually used together with valid?
         
     | 
| 
      
 89 
     | 
    
         
            +
                # @return Array for valid properties with the reasons
         
     | 
| 
      
 90 
     | 
    
         
            +
                def list_invalid_properties
         
     | 
| 
      
 91 
     | 
    
         
            +
                  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
         
     | 
| 
      
 92 
     | 
    
         
            +
                  invalid_properties = Array.new
         
     | 
| 
      
 93 
     | 
    
         
            +
                  if @data.nil?
         
     | 
| 
      
 94 
     | 
    
         
            +
                    invalid_properties.push('invalid value for "data", data cannot be nil.')
         
     | 
| 
      
 95 
     | 
    
         
            +
                  end
         
     | 
| 
      
 96 
     | 
    
         
            +
             
     | 
| 
      
 97 
     | 
    
         
            +
                  invalid_properties
         
     | 
| 
      
 98 
     | 
    
         
            +
                end
         
     | 
| 
      
 99 
     | 
    
         
            +
             
     | 
| 
      
 100 
     | 
    
         
            +
                # Check to see if the all the properties in the model are valid
         
     | 
| 
      
 101 
     | 
    
         
            +
                # @return true if the model is valid
         
     | 
| 
      
 102 
     | 
    
         
            +
                def valid?
         
     | 
| 
      
 103 
     | 
    
         
            +
                  warn '[DEPRECATED] the `valid?` method is obsolete'
         
     | 
| 
      
 104 
     | 
    
         
            +
                  return false if @data.nil?
         
     | 
| 
      
 105 
     | 
    
         
            +
                  true
         
     | 
| 
      
 106 
     | 
    
         
            +
                end
         
     | 
| 
      
 107 
     | 
    
         
            +
             
     | 
| 
      
 108 
     | 
    
         
            +
                # Checks equality by comparing each attribute.
         
     | 
| 
      
 109 
     | 
    
         
            +
                # @param [Object] Object to be compared
         
     | 
| 
      
 110 
     | 
    
         
            +
                def ==(o)
         
     | 
| 
      
 111 
     | 
    
         
            +
                  return true if self.equal?(o)
         
     | 
| 
      
 112 
     | 
    
         
            +
                  self.class == o.class &&
         
     | 
| 
      
 113 
     | 
    
         
            +
                      links == o.links &&
         
     | 
| 
      
 114 
     | 
    
         
            +
                      errors == o.errors &&
         
     | 
| 
      
 115 
     | 
    
         
            +
                      data == o.data
         
     | 
| 
      
 116 
     | 
    
         
            +
                end
         
     | 
| 
      
 117 
     | 
    
         
            +
             
     | 
| 
      
 118 
     | 
    
         
            +
                # @see the `==` method
         
     | 
| 
      
 119 
     | 
    
         
            +
                # @param [Object] Object to be compared
         
     | 
| 
      
 120 
     | 
    
         
            +
                def eql?(o)
         
     | 
| 
      
 121 
     | 
    
         
            +
                  self == o
         
     | 
| 
      
 122 
     | 
    
         
            +
                end
         
     | 
| 
      
 123 
     | 
    
         
            +
             
     | 
| 
      
 124 
     | 
    
         
            +
                # Calculates hash code according to all attributes.
         
     | 
| 
      
 125 
     | 
    
         
            +
                # @return [Integer] Hash code
         
     | 
| 
      
 126 
     | 
    
         
            +
                def hash
         
     | 
| 
      
 127 
     | 
    
         
            +
                  [links, errors, data].hash
         
     | 
| 
      
 128 
     | 
    
         
            +
                end
         
     | 
| 
      
 129 
     | 
    
         
            +
             
     | 
| 
      
 130 
     | 
    
         
            +
                # Builds the object from hash
         
     | 
| 
      
 131 
     | 
    
         
            +
                # @param [Hash] attributes Model attributes in the form of hash
         
     | 
| 
      
 132 
     | 
    
         
            +
                # @return [Object] Returns the model itself
         
     | 
| 
      
 133 
     | 
    
         
            +
                def self.build_from_hash(attributes)
         
     | 
| 
      
 134 
     | 
    
         
            +
                  return nil unless attributes.is_a?(Hash)
         
     | 
| 
      
 135 
     | 
    
         
            +
                  attributes = attributes.transform_keys(&:to_sym)
         
     | 
| 
      
 136 
     | 
    
         
            +
                  transformed_hash = {}
         
     | 
| 
      
 137 
     | 
    
         
            +
                  openapi_types.each_pair do |key, type|
         
     | 
| 
      
 138 
     | 
    
         
            +
                    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
         
     | 
| 
      
 139 
     | 
    
         
            +
                      transformed_hash["#{key}"] = nil
         
     | 
| 
      
 140 
     | 
    
         
            +
                    elsif type =~ /\AArray<(.*)>/i
         
     | 
| 
      
 141 
     | 
    
         
            +
                      # check to ensure the input is an array given that the attribute
         
     | 
| 
      
 142 
     | 
    
         
            +
                      # is documented as an array but the input is not
         
     | 
| 
      
 143 
     | 
    
         
            +
                      if attributes[attribute_map[key]].is_a?(Array)
         
     | 
| 
      
 144 
     | 
    
         
            +
                        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
         
     | 
| 
      
 145 
     | 
    
         
            +
                      end
         
     | 
| 
      
 146 
     | 
    
         
            +
                    elsif !attributes[attribute_map[key]].nil?
         
     | 
| 
      
 147 
     | 
    
         
            +
                      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
         
     | 
| 
      
 148 
     | 
    
         
            +
                    end
         
     | 
| 
      
 149 
     | 
    
         
            +
                  end
         
     | 
| 
      
 150 
     | 
    
         
            +
                  new(transformed_hash)
         
     | 
| 
      
 151 
     | 
    
         
            +
                end
         
     | 
| 
      
 152 
     | 
    
         
            +
             
     | 
| 
      
 153 
     | 
    
         
            +
                # Deserializes the data based on type
         
     | 
| 
      
 154 
     | 
    
         
            +
                # @param string type Data type
         
     | 
| 
      
 155 
     | 
    
         
            +
                # @param string value Value to be deserialized
         
     | 
| 
      
 156 
     | 
    
         
            +
                # @return [Object] Deserialized data
         
     | 
| 
      
 157 
     | 
    
         
            +
                def self._deserialize(type, value)
         
     | 
| 
      
 158 
     | 
    
         
            +
                  case type.to_sym
         
     | 
| 
      
 159 
     | 
    
         
            +
                  when :Time
         
     | 
| 
      
 160 
     | 
    
         
            +
                    Time.parse(value)
         
     | 
| 
      
 161 
     | 
    
         
            +
                  when :Date
         
     | 
| 
      
 162 
     | 
    
         
            +
                    Date.parse(value)
         
     | 
| 
      
 163 
     | 
    
         
            +
                  when :String
         
     | 
| 
      
 164 
     | 
    
         
            +
                    value.to_s
         
     | 
| 
      
 165 
     | 
    
         
            +
                  when :Integer
         
     | 
| 
      
 166 
     | 
    
         
            +
                    value.to_i
         
     | 
| 
      
 167 
     | 
    
         
            +
                  when :Float
         
     | 
| 
      
 168 
     | 
    
         
            +
                    value.to_f
         
     | 
| 
      
 169 
     | 
    
         
            +
                  when :Boolean
         
     | 
| 
      
 170 
     | 
    
         
            +
                    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
         
     | 
| 
      
 171 
     | 
    
         
            +
                      true
         
     | 
| 
      
 172 
     | 
    
         
            +
                    else
         
     | 
| 
      
 173 
     | 
    
         
            +
                      false
         
     | 
| 
      
 174 
     | 
    
         
            +
                    end
         
     | 
| 
      
 175 
     | 
    
         
            +
                  when :Object
         
     | 
| 
      
 176 
     | 
    
         
            +
                    # generic object (usually a Hash), return directly
         
     | 
| 
      
 177 
     | 
    
         
            +
                    value
         
     | 
| 
      
 178 
     | 
    
         
            +
                  when /\AArray<(?<inner_type>.+)>\z/
         
     | 
| 
      
 179 
     | 
    
         
            +
                    inner_type = Regexp.last_match[:inner_type]
         
     | 
| 
      
 180 
     | 
    
         
            +
                    value.map { |v| _deserialize(inner_type, v) }
         
     | 
| 
      
 181 
     | 
    
         
            +
                  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
         
     | 
| 
      
 182 
     | 
    
         
            +
                    k_type = Regexp.last_match[:k_type]
         
     | 
| 
      
 183 
     | 
    
         
            +
                    v_type = Regexp.last_match[:v_type]
         
     | 
| 
      
 184 
     | 
    
         
            +
                    {}.tap do |hash|
         
     | 
| 
      
 185 
     | 
    
         
            +
                      value.each do |k, v|
         
     | 
| 
      
 186 
     | 
    
         
            +
                        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
         
     | 
| 
      
 187 
     | 
    
         
            +
                      end
         
     | 
| 
      
 188 
     | 
    
         
            +
                    end
         
     | 
| 
      
 189 
     | 
    
         
            +
                  else # model
         
     | 
| 
      
 190 
     | 
    
         
            +
                    # models (e.g. Pet) or oneOf
         
     | 
| 
      
 191 
     | 
    
         
            +
                    klass = Bandwidth.const_get(type)
         
     | 
| 
      
 192 
     | 
    
         
            +
                    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
         
     | 
| 
      
 193 
     | 
    
         
            +
                  end
         
     | 
| 
      
 194 
     | 
    
         
            +
                end
         
     | 
| 
      
 195 
     | 
    
         
            +
             
     | 
| 
      
 196 
     | 
    
         
            +
                # Returns the string representation of the object
         
     | 
| 
      
 197 
     | 
    
         
            +
                # @return [String] String presentation of the object
         
     | 
| 
      
 198 
     | 
    
         
            +
                def to_s
         
     | 
| 
      
 199 
     | 
    
         
            +
                  to_hash.to_s
         
     | 
| 
      
 200 
     | 
    
         
            +
                end
         
     | 
| 
      
 201 
     | 
    
         
            +
             
     | 
| 
      
 202 
     | 
    
         
            +
                # to_body is an alias to to_hash (backward compatibility)
         
     | 
| 
      
 203 
     | 
    
         
            +
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
      
 204 
     | 
    
         
            +
                def to_body
         
     | 
| 
      
 205 
     | 
    
         
            +
                  to_hash
         
     | 
| 
      
 206 
     | 
    
         
            +
                end
         
     | 
| 
      
 207 
     | 
    
         
            +
             
     | 
| 
      
 208 
     | 
    
         
            +
                # Returns the object in the form of hash
         
     | 
| 
      
 209 
     | 
    
         
            +
                # @return [Hash] Returns the object in the form of hash
         
     | 
| 
      
 210 
     | 
    
         
            +
                def to_hash
         
     | 
| 
      
 211 
     | 
    
         
            +
                  hash = {}
         
     | 
| 
      
 212 
     | 
    
         
            +
                  self.class.attribute_map.each_pair do |attr, param|
         
     | 
| 
      
 213 
     | 
    
         
            +
                    value = self.send(attr)
         
     | 
| 
      
 214 
     | 
    
         
            +
                    if value.nil?
         
     | 
| 
      
 215 
     | 
    
         
            +
                      is_nullable = self.class.openapi_nullable.include?(attr)
         
     | 
| 
      
 216 
     | 
    
         
            +
                      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
         
     | 
| 
      
 217 
     | 
    
         
            +
                    end
         
     | 
| 
      
 218 
     | 
    
         
            +
             
     | 
| 
      
 219 
     | 
    
         
            +
                    hash[param] = _to_hash(value)
         
     | 
| 
      
 220 
     | 
    
         
            +
                  end
         
     | 
| 
      
 221 
     | 
    
         
            +
                  hash
         
     | 
| 
      
 222 
     | 
    
         
            +
                end
         
     | 
| 
      
 223 
     | 
    
         
            +
             
     | 
| 
      
 224 
     | 
    
         
            +
                # Outputs non-array value in the form of hash
         
     | 
| 
      
 225 
     | 
    
         
            +
                # For object, use to_hash. Otherwise, just return the value
         
     | 
| 
      
 226 
     | 
    
         
            +
                # @param [Object] value Any valid value
         
     | 
| 
      
 227 
     | 
    
         
            +
                # @return [Hash] Returns the value in the form of hash
         
     | 
| 
      
 228 
     | 
    
         
            +
                def _to_hash(value)
         
     | 
| 
      
 229 
     | 
    
         
            +
                  if value.is_a?(Array)
         
     | 
| 
      
 230 
     | 
    
         
            +
                    value.compact.map { |v| _to_hash(v) }
         
     | 
| 
      
 231 
     | 
    
         
            +
                  elsif value.is_a?(Hash)
         
     | 
| 
      
 232 
     | 
    
         
            +
                    {}.tap do |hash|
         
     | 
| 
      
 233 
     | 
    
         
            +
                      value.each { |k, v| hash[k] = _to_hash(v) }
         
     | 
| 
      
 234 
     | 
    
         
            +
                    end
         
     | 
| 
      
 235 
     | 
    
         
            +
                  elsif value.respond_to? :to_hash
         
     | 
| 
      
 236 
     | 
    
         
            +
                    value.to_hash
         
     | 
| 
      
 237 
     | 
    
         
            +
                  else
         
     | 
| 
      
 238 
     | 
    
         
            +
                    value
         
     | 
| 
      
 239 
     | 
    
         
            +
                  end
         
     | 
| 
      
 240 
     | 
    
         
            +
                end
         
     | 
| 
      
 241 
     | 
    
         
            +
              end
         
     | 
| 
      
 242 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/bandwidth-sdk.rb
    CHANGED
    
    | 
         @@ -18,6 +18,8 @@ require 'bandwidth-sdk/configuration' 
     | 
|
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
            # Models
         
     | 
| 
       20 
20 
     | 
    
         
             
            require 'bandwidth-sdk/models/account_statistics'
         
     | 
| 
      
 21 
     | 
    
         
            +
            require 'bandwidth-sdk/models/additional_denial_reason'
         
     | 
| 
      
 22 
     | 
    
         
            +
            require 'bandwidth-sdk/models/address'
         
     | 
| 
       21 
23 
     | 
    
         
             
            require 'bandwidth-sdk/models/answer_callback'
         
     | 
| 
       22 
24 
     | 
    
         
             
            require 'bandwidth-sdk/models/bridge_complete_callback'
         
     | 
| 
       23 
25 
     | 
    
         
             
            require 'bandwidth-sdk/models/bridge_target_complete_callback'
         
     | 
| 
         @@ -43,6 +45,7 @@ require 'bandwidth-sdk/models/conference_recording_available_callback' 
     | 
|
| 
       43 
45 
     | 
    
         
             
            require 'bandwidth-sdk/models/conference_recording_metadata'
         
     | 
| 
       44 
46 
     | 
    
         
             
            require 'bandwidth-sdk/models/conference_redirect_callback'
         
     | 
| 
       45 
47 
     | 
    
         
             
            require 'bandwidth-sdk/models/conference_state_enum'
         
     | 
| 
      
 48 
     | 
    
         
            +
            require 'bandwidth-sdk/models/contact'
         
     | 
| 
       46 
49 
     | 
    
         
             
            require 'bandwidth-sdk/models/create_call'
         
     | 
| 
       47 
50 
     | 
    
         
             
            require 'bandwidth-sdk/models/create_call_response'
         
     | 
| 
       48 
51 
     | 
    
         
             
            require 'bandwidth-sdk/models/create_lookup_response'
         
     | 
| 
         @@ -51,10 +54,13 @@ require 'bandwidth-sdk/models/deferred_result' 
     | 
|
| 
       51 
54 
     | 
    
         
             
            require 'bandwidth-sdk/models/disconnect_callback'
         
     | 
| 
       52 
55 
     | 
    
         
             
            require 'bandwidth-sdk/models/diversion'
         
     | 
| 
       53 
56 
     | 
    
         
             
            require 'bandwidth-sdk/models/dtmf_callback'
         
     | 
| 
      
 57 
     | 
    
         
            +
            require 'bandwidth-sdk/models/error'
         
     | 
| 
      
 58 
     | 
    
         
            +
            require 'bandwidth-sdk/models/failure_webhook'
         
     | 
| 
       54 
59 
     | 
    
         
             
            require 'bandwidth-sdk/models/field_error'
         
     | 
| 
       55 
60 
     | 
    
         
             
            require 'bandwidth-sdk/models/file_format_enum'
         
     | 
| 
       56 
61 
     | 
    
         
             
            require 'bandwidth-sdk/models/gather_callback'
         
     | 
| 
       57 
62 
     | 
    
         
             
            require 'bandwidth-sdk/models/initiate_callback'
         
     | 
| 
      
 63 
     | 
    
         
            +
            require 'bandwidth-sdk/models/links_object'
         
     | 
| 
       58 
64 
     | 
    
         
             
            require 'bandwidth-sdk/models/list_message_direction_enum'
         
     | 
| 
       59 
65 
     | 
    
         
             
            require 'bandwidth-sdk/models/list_message_item'
         
     | 
| 
       60 
66 
     | 
    
         
             
            require 'bandwidth-sdk/models/lookup_request'
         
     | 
| 
         @@ -79,6 +85,7 @@ require 'bandwidth-sdk/models/messaging_request_error' 
     | 
|
| 
       79 
85 
     | 
    
         
             
            require 'bandwidth-sdk/models/mfa_forbidden_request_error'
         
     | 
| 
       80 
86 
     | 
    
         
             
            require 'bandwidth-sdk/models/mfa_request_error'
         
     | 
| 
       81 
87 
     | 
    
         
             
            require 'bandwidth-sdk/models/mfa_unauthorized_request_error'
         
     | 
| 
      
 88 
     | 
    
         
            +
            require 'bandwidth-sdk/models/opt_in_workflow'
         
     | 
| 
       82 
89 
     | 
    
         
             
            require 'bandwidth-sdk/models/page_info'
         
     | 
| 
       83 
90 
     | 
    
         
             
            require 'bandwidth-sdk/models/priority_enum'
         
     | 
| 
       84 
91 
     | 
    
         
             
            require 'bandwidth-sdk/models/recording_available_callback'
         
     | 
| 
         @@ -90,6 +97,14 @@ require 'bandwidth-sdk/models/redirect_callback' 
     | 
|
| 
       90 
97 
     | 
    
         
             
            require 'bandwidth-sdk/models/redirect_method_enum'
         
     | 
| 
       91 
98 
     | 
    
         
             
            require 'bandwidth-sdk/models/stir_shaken'
         
     | 
| 
       92 
99 
     | 
    
         
             
            require 'bandwidth-sdk/models/tag'
         
     | 
| 
      
 100 
     | 
    
         
            +
            require 'bandwidth-sdk/models/telephone_number'
         
     | 
| 
      
 101 
     | 
    
         
            +
            require 'bandwidth-sdk/models/tfv_basic_authentication'
         
     | 
| 
      
 102 
     | 
    
         
            +
            require 'bandwidth-sdk/models/tfv_callback_status_enum'
         
     | 
| 
      
 103 
     | 
    
         
            +
            require 'bandwidth-sdk/models/tfv_error'
         
     | 
| 
      
 104 
     | 
    
         
            +
            require 'bandwidth-sdk/models/tfv_status'
         
     | 
| 
      
 105 
     | 
    
         
            +
            require 'bandwidth-sdk/models/tfv_status_enum'
         
     | 
| 
      
 106 
     | 
    
         
            +
            require 'bandwidth-sdk/models/tfv_submission_info'
         
     | 
| 
      
 107 
     | 
    
         
            +
            require 'bandwidth-sdk/models/tfv_submission_wrapper'
         
     | 
| 
       93 
108 
     | 
    
         
             
            require 'bandwidth-sdk/models/tn_lookup_request_error'
         
     | 
| 
       94 
109 
     | 
    
         
             
            require 'bandwidth-sdk/models/transcribe_recording'
         
     | 
| 
       95 
110 
     | 
    
         
             
            require 'bandwidth-sdk/models/transcription'
         
     | 
| 
         @@ -101,10 +116,19 @@ require 'bandwidth-sdk/models/update_call' 
     | 
|
| 
       101 
116 
     | 
    
         
             
            require 'bandwidth-sdk/models/update_call_recording'
         
     | 
| 
       102 
117 
     | 
    
         
             
            require 'bandwidth-sdk/models/update_conference'
         
     | 
| 
       103 
118 
     | 
    
         
             
            require 'bandwidth-sdk/models/update_conference_member'
         
     | 
| 
      
 119 
     | 
    
         
            +
            require 'bandwidth-sdk/models/verification_denial_webhook'
         
     | 
| 
      
 120 
     | 
    
         
            +
            require 'bandwidth-sdk/models/verification_request'
         
     | 
| 
      
 121 
     | 
    
         
            +
            require 'bandwidth-sdk/models/verification_update_request'
         
     | 
| 
      
 122 
     | 
    
         
            +
            require 'bandwidth-sdk/models/verification_webhook'
         
     | 
| 
       104 
123 
     | 
    
         
             
            require 'bandwidth-sdk/models/verify_code_request'
         
     | 
| 
       105 
124 
     | 
    
         
             
            require 'bandwidth-sdk/models/verify_code_response'
         
     | 
| 
       106 
125 
     | 
    
         
             
            require 'bandwidth-sdk/models/voice_api_error'
         
     | 
| 
       107 
126 
     | 
    
         
             
            require 'bandwidth-sdk/models/voice_code_response'
         
     | 
| 
      
 127 
     | 
    
         
            +
            require 'bandwidth-sdk/models/webhook_subscription'
         
     | 
| 
      
 128 
     | 
    
         
            +
            require 'bandwidth-sdk/models/webhook_subscription_basic_authentication'
         
     | 
| 
      
 129 
     | 
    
         
            +
            require 'bandwidth-sdk/models/webhook_subscription_request_schema'
         
     | 
| 
      
 130 
     | 
    
         
            +
            require 'bandwidth-sdk/models/webhook_subscription_type_enum'
         
     | 
| 
      
 131 
     | 
    
         
            +
            require 'bandwidth-sdk/models/webhook_subscriptions_list_body'
         
     | 
| 
       108 
132 
     | 
    
         | 
| 
       109 
133 
     | 
    
         
             
            # BXML
         
     | 
| 
       110 
134 
     | 
    
         
             
            require 'bandwidth-sdk/models/bxml/root'
         
     | 
| 
         @@ -150,6 +174,7 @@ require 'bandwidth-sdk/api/messages_api' 
     | 
|
| 
       150 
174 
     | 
    
         
             
            require 'bandwidth-sdk/api/phone_number_lookup_api'
         
     | 
| 
       151 
175 
     | 
    
         
             
            require 'bandwidth-sdk/api/recordings_api'
         
     | 
| 
       152 
176 
     | 
    
         
             
            require 'bandwidth-sdk/api/statistics_api'
         
     | 
| 
      
 177 
     | 
    
         
            +
            require 'bandwidth-sdk/api/toll_free_verification_api'
         
     | 
| 
       153 
178 
     | 
    
         
             
            require 'bandwidth-sdk/api/transcriptions_api'
         
     | 
| 
       154 
179 
     | 
    
         | 
| 
       155 
180 
     | 
    
         
             
            module Bandwidth
         
     | 
    
        data/openapi-config.yml
    CHANGED
    
    
    
        data/spec/call_utils.rb
    CHANGED
    
    | 
         @@ -41,13 +41,13 @@ end 
     | 
|
| 
       41 
41 
     | 
    
         
             
            def cleanup_calls(calls, calls_api)
         
     | 
| 
       42 
42 
     | 
    
         
             
              attempts = 0
         
     | 
| 
       43 
43 
     | 
    
         | 
| 
       44 
     | 
    
         
            -
              while (calls 
     | 
| 
      
 44 
     | 
    
         
            +
              while (calls&.length > 0 && attempts < 10)
         
     | 
| 
       45 
45 
     | 
    
         
             
                calls.delete_if { |call_id| call_ended(call_id, calls_api) }
         
     | 
| 
       46 
46 
     | 
    
         
             
                sleep(SLEEP_TIME_S)
         
     | 
| 
       47 
47 
     | 
    
         
             
                attempts += 1
         
     | 
| 
       48 
48 
     | 
    
         
             
              end
         
     | 
| 
       49 
49 
     | 
    
         | 
| 
       50 
     | 
    
         
            -
              if (calls 
     | 
| 
      
 50 
     | 
    
         
            +
              if (calls&.length > 0)
         
     | 
| 
       51 
51 
     | 
    
         
             
                error_message = 'Failed to terminate all calls' + calls.to_s
         
     | 
| 
       52 
52 
     | 
    
         
             
                raise StandardError.new error_message
         
     | 
| 
       53 
53 
     | 
    
         
             
              end
         
     | 
| 
         @@ -0,0 +1,69 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # Integration tests for Bandwidth::TollFreeVerificationApi
         
     | 
| 
      
 2 
     | 
    
         
            +
            describe 'TollFreeVerificationApi' do
         
     | 
| 
      
 3 
     | 
    
         
            +
              before(:all) do
         
     | 
| 
      
 4 
     | 
    
         
            +
                Bandwidth.configure do |config|
         
     | 
| 
      
 5 
     | 
    
         
            +
                  config.username = BW_USERNAME
         
     | 
| 
      
 6 
     | 
    
         
            +
                  config.password = BW_PASSWORD
         
     | 
| 
      
 7 
     | 
    
         
            +
                end
         
     | 
| 
      
 8 
     | 
    
         
            +
                @tfv_api_instance = Bandwidth::TollFreeVerificationApi.new
         
     | 
| 
      
 9 
     | 
    
         
            +
              end
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
              # Create Webhook Subscription
         
     | 
| 
      
 12 
     | 
    
         
            +
              describe 'create_webhook_subscription test' do
         
     | 
| 
      
 13 
     | 
    
         
            +
                it 'creates webhook subscription' do
         
     | 
| 
      
 14 
     | 
    
         
            +
                  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
         
     | 
| 
      
 15 
     | 
    
         
            +
                end
         
     | 
| 
      
 16 
     | 
    
         
            +
              end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
              # Delete Webhook Subscription
         
     | 
| 
      
 19 
     | 
    
         
            +
              describe 'delete_webhook_subscription test' do
         
     | 
| 
      
 20 
     | 
    
         
            +
                it 'deletes webhook subscription' do
         
     | 
| 
      
 21 
     | 
    
         
            +
                  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
              end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
              # Get Toll-Free Verification Status
         
     | 
| 
      
 26 
     | 
    
         
            +
              describe 'get_toll_free_verification_status test' do
         
     | 
| 
      
 27 
     | 
    
         
            +
                it 'gets toll free verification status' do
         
     | 
| 
      
 28 
     | 
    
         
            +
                  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
         
     | 
| 
      
 29 
     | 
    
         
            +
                end
         
     | 
| 
      
 30 
     | 
    
         
            +
              end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
              # List Toll-Free Use Cases
         
     | 
| 
      
 33 
     | 
    
         
            +
              describe 'list_toll_free_use_cases test' do
         
     | 
| 
      
 34 
     | 
    
         
            +
                it 'lists toll free use cases' do
         
     | 
| 
      
 35 
     | 
    
         
            +
                  data, status_code = @tfv_api_instance.list_toll_free_use_cases_with_http_info
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                  expect(status_code).to eq(200)
         
     | 
| 
      
 38 
     | 
    
         
            +
                  expect(data).to be_instance_of(Array)
         
     | 
| 
      
 39 
     | 
    
         
            +
                end
         
     | 
| 
      
 40 
     | 
    
         
            +
              end
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
              # List Webhook Subscriptions
         
     | 
| 
      
 43 
     | 
    
         
            +
              describe 'list_webhook_subscriptions test' do
         
     | 
| 
      
 44 
     | 
    
         
            +
                it 'lists webhook subscriptions' do
         
     | 
| 
      
 45 
     | 
    
         
            +
                  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
         
     | 
| 
      
 46 
     | 
    
         
            +
                end
         
     | 
| 
      
 47 
     | 
    
         
            +
              end
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
              # Request Toll-Free Verification
         
     | 
| 
      
 50 
     | 
    
         
            +
              describe 'request_toll_free_verification test' do
         
     | 
| 
      
 51 
     | 
    
         
            +
                it 'requests toll free verification' do
         
     | 
| 
      
 52 
     | 
    
         
            +
                  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
         
     | 
| 
      
 53 
     | 
    
         
            +
                end
         
     | 
| 
      
 54 
     | 
    
         
            +
              end
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
              # Update Toll-Free Verification Request
         
     | 
| 
      
 57 
     | 
    
         
            +
              describe 'update_toll_free_verification_request test' do
         
     | 
| 
      
 58 
     | 
    
         
            +
                it 'updates toll free verification request' do
         
     | 
| 
      
 59 
     | 
    
         
            +
                  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
         
     | 
| 
      
 60 
     | 
    
         
            +
                end
         
     | 
| 
      
 61 
     | 
    
         
            +
              end
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
              # Update Webhook Subscription
         
     | 
| 
      
 64 
     | 
    
         
            +
              describe 'update_webhook_subscription test' do
         
     | 
| 
      
 65 
     | 
    
         
            +
                it 'updates webhook subscription' do
         
     | 
| 
      
 66 
     | 
    
         
            +
                  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
         
     | 
| 
      
 67 
     | 
    
         
            +
                end
         
     | 
| 
      
 68 
     | 
    
         
            +
              end
         
     | 
| 
      
 69 
     | 
    
         
            +
            end
         
     | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    | 
         @@ -17,7 +17,7 @@ SimpleCov.start do 
     | 
|
| 
       17 
17 
     | 
    
         
             
              end
         
     | 
| 
       18 
18 
     | 
    
         
             
              add_group 'Models', 'lib/bandwidth-sdk/models/'
         
     | 
| 
       19 
19 
     | 
    
         
             
              add_group 'APIs', 'lib/bandwidth-sdk/api/'
         
     | 
| 
       20 
     | 
    
         
            -
              add_group 'Client', ['api_client.rb', 'api_error.rb', 'configuration.rb', 'bandwidth-sdk.rb']
         
     | 
| 
      
 20 
     | 
    
         
            +
              add_group 'Client', ['api_client.rb', 'api_error.rb', 'configuration.rb', 'version.rb', 'bandwidth-sdk.rb']
         
     | 
| 
       21 
21 
     | 
    
         
             
              add_group 'Tests', 'spec'
         
     | 
| 
       22 
22 
     | 
    
         
             
            end
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
         @@ -105,7 +105,7 @@ describe 'MFAApi' do 
     | 
|
| 
       105 
105 
     | 
    
         
             
                  }.to raise_error(ArgumentError)
         
     | 
| 
       106 
106 
     | 
    
         
             
                end
         
     | 
| 
       107 
107 
     | 
    
         | 
| 
       108 
     | 
    
         
            -
                it 'causes an ArgumentError for a missing  
     | 
| 
      
 108 
     | 
    
         
            +
                it 'causes an ArgumentError for a missing verify_code_request' do
         
     | 
| 
       109 
109 
     | 
    
         
             
                  expect {
         
     | 
| 
       110 
110 
     | 
    
         
             
                    @mfa_api_instance.verify_code(BW_ACCOUNT_ID, nil)
         
     | 
| 
       111 
111 
     | 
    
         
             
                  }.to raise_error(ArgumentError)
         
     |