bandwidth-sdk 17.3.2 → 18.1.0

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.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +6 -6
  3. data/README.md +28 -2
  4. data/bandwidth.yml +979 -60
  5. data/coverage/.last_run.json +1 -1
  6. data/coverage/.resultset.json +783 -152
  7. data/coverage/index.html +21642 -14804
  8. data/docs/BrtcError.md +26 -0
  9. data/docs/BrtcErrorResponse.md +22 -0
  10. data/docs/BrtcErrorSource.md +24 -0
  11. data/docs/BrtcLink.md +22 -0
  12. data/docs/CreateCall.md +2 -2
  13. data/docs/CreateEndpointRequestBase.md +26 -0
  14. data/docs/CreateEndpointResponse.md +22 -0
  15. data/docs/CreateEndpointResponseData.md +32 -0
  16. data/docs/CreateWebRtcConnectionRequest.md +28 -0
  17. data/docs/Device.md +24 -0
  18. data/docs/{BusinessRegistrationIssuingCountryEnum.md → DeviceStatusEnum.md} +2 -2
  19. data/docs/Endpoint.md +30 -0
  20. data/docs/EndpointDirectionEnum.md +15 -0
  21. data/docs/EndpointEvent.md +34 -0
  22. data/docs/EndpointEventTypeEnum.md +15 -0
  23. data/docs/EndpointResponse.md +22 -0
  24. data/docs/EndpointStatusEnum.md +15 -0
  25. data/docs/EndpointTypeEnum.md +15 -0
  26. data/docs/Endpoints.md +28 -0
  27. data/docs/EndpointsApi.md +395 -0
  28. data/docs/InboundCallback.md +2 -2
  29. data/docs/ListEndpointsResponse.md +24 -0
  30. data/docs/LookupResult.md +1 -1
  31. data/docs/MachineDetectionConfiguration.md +1 -1
  32. data/docs/MediaApi.md +1 -1
  33. data/docs/MessageRequest.md +1 -1
  34. data/docs/MmsMessageContentFile.md +1 -1
  35. data/docs/Page.md +24 -0
  36. data/docs/RbmActionBase.md +1 -1
  37. data/docs/RbmSuggestionResponse.md +1 -1
  38. data/docs/SipConnectionMetadata.md +24 -0
  39. data/docs/SipCredentials.md +20 -0
  40. data/docs/StatusCallback.md +1 -1
  41. data/docs/SyncLookupRequest.md +3 -1
  42. data/docs/TfvSubmissionInfo.md +3 -3
  43. data/docs/UpdateCall.md +1 -1
  44. data/docs/VerificationRequest.md +3 -3
  45. data/docs/VerificationUpdateRequest.md +3 -3
  46. data/docs/WebhookSubscriptionError.md +22 -0
  47. data/docs/WebhookSubscriptionsListBody.md +1 -1
  48. data/lib/bandwidth-sdk/api/endpoints_api.rb +397 -0
  49. data/lib/bandwidth-sdk/api/media_api.rb +2 -2
  50. data/lib/bandwidth-sdk/configuration.rb +30 -0
  51. data/lib/bandwidth-sdk/models/brtc_error.rb +219 -0
  52. data/lib/bandwidth-sdk/models/brtc_error_response.rb +204 -0
  53. data/lib/bandwidth-sdk/models/brtc_error_source.rb +176 -0
  54. data/lib/bandwidth-sdk/models/brtc_link.rb +166 -0
  55. data/lib/bandwidth-sdk/models/create_call.rb +7 -7
  56. data/lib/bandwidth-sdk/models/create_endpoint_request_base.rb +250 -0
  57. data/lib/bandwidth-sdk/models/create_endpoint_response.rb +218 -0
  58. data/lib/bandwidth-sdk/models/create_endpoint_response_data.rb +356 -0
  59. data/lib/bandwidth-sdk/models/create_web_rtc_connection_request.rb +266 -0
  60. data/lib/bandwidth-sdk/models/device.rb +258 -0
  61. data/lib/bandwidth-sdk/models/device_status_enum.rb +40 -0
  62. data/lib/bandwidth-sdk/models/endpoint.rb +329 -0
  63. data/lib/bandwidth-sdk/models/endpoint_direction_enum.rb +41 -0
  64. data/lib/bandwidth-sdk/models/endpoint_event.rb +381 -0
  65. data/lib/bandwidth-sdk/models/endpoint_event_type_enum.rb +40 -0
  66. data/lib/bandwidth-sdk/models/endpoint_response.rb +218 -0
  67. data/lib/bandwidth-sdk/models/endpoint_status_enum.rb +40 -0
  68. data/lib/bandwidth-sdk/models/endpoint_type_enum.rb +39 -0
  69. data/lib/bandwidth-sdk/models/endpoints.rb +311 -0
  70. data/lib/bandwidth-sdk/models/inbound_callback.rb +2 -2
  71. data/lib/bandwidth-sdk/models/list_endpoints_response.rb +229 -0
  72. data/lib/bandwidth-sdk/models/lookup_result.rb +1 -1
  73. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +1 -1
  74. data/lib/bandwidth-sdk/models/message_request.rb +1 -1
  75. data/lib/bandwidth-sdk/models/mms_message_content_file.rb +1 -1
  76. data/lib/bandwidth-sdk/models/page.rb +259 -0
  77. data/lib/bandwidth-sdk/models/sip_connection_metadata.rb +175 -0
  78. data/lib/bandwidth-sdk/models/sip_credentials.rb +156 -0
  79. data/lib/bandwidth-sdk/models/status_callback.rb +1 -1
  80. data/lib/bandwidth-sdk/models/sync_lookup_request.rb +35 -4
  81. data/lib/bandwidth-sdk/models/tfv_submission_info.rb +4 -2
  82. data/lib/bandwidth-sdk/models/update_call.rb +6 -6
  83. data/lib/bandwidth-sdk/models/verification_request.rb +4 -2
  84. data/lib/bandwidth-sdk/models/verification_update_request.rb +4 -2
  85. data/lib/bandwidth-sdk/models/webhook_subscription_error.rb +165 -0
  86. data/lib/bandwidth-sdk/models/webhook_subscriptions_list_body.rb +1 -1
  87. data/lib/bandwidth-sdk/version.rb +1 -1
  88. data/lib/bandwidth-sdk.rb +24 -2
  89. data/spec/smoke/endpoints_api_spec.rb +148 -0
  90. data/spec/smoke/phone_number_lookup_api_spec.rb +1 -9
  91. data/spec/unit/api/endpoints_api_spec.rb +172 -0
  92. data/spec/unit/api/phone_number_lookup_api_spec.rb +2 -0
  93. data/spec/unit/api/toll_free_verification_api_spec.rb +1 -1
  94. metadata +104 -54
  95. data/lib/bandwidth-sdk/models/business_registration_issuing_country_enum.rb +0 -55
@@ -48,11 +48,12 @@ module Bandwidth
48
48
  # The company 'Doing Business As'.
49
49
  attr_accessor :business_dba
50
50
 
51
- # Government-issued business identifying number. **Note:** If this field is provided, it is strongly recommended to also provide `businessRegistrationType` and `businessRegistrationIssuingCountry`. Submissions missing these fields have a high likelihood of rejection.
51
+ # Government-issued business identifying number. **Note: As of October 19th, 2026 this field will be required when `businessEntityType` is _not_ `SOLE_PROPRIETOR`. If this field is provided, `businessRegistrationType` and `businessRegistrationIssuingCountry` are also required.**
52
52
  attr_accessor :business_registration_number
53
53
 
54
54
  attr_accessor :business_registration_type
55
55
 
56
+ # The country issuing the business registration in ISO-3166-1 alpha-3 format. Alpha-2 format is accepted by the API, but alpha-3 is highly encouraged. **Note: As of October 19th, 2026 this field will be required when `businessRegistrationNumber` is provided.** | Registration Type | Supported Countries | |----------------------|------------------------------------| | EIN | USA | | CBN | CAN | | NEQ | CAN | | PROVINCIAL_NUMBER | CAN | | CRN | GBR, HKG | | VAT | GBR, IRL, BRA, NLD | | ACN | AUS | | ABN | AUS | | BRN | HKG | | SIREN | FRA | | SIRET | FRA | | NZBN | NZL | | UST_IDNR | DEU | | CIF | ESP | | NIF | ESP | | CNPJ | BRA | | UID | CHE | | OTHER | Must Provide Country Code |
56
57
  attr_accessor :business_registration_issuing_country
57
58
 
58
59
  attr_accessor :business_entity_type
@@ -128,7 +129,7 @@ module Bandwidth
128
129
  :'business_dba' => :'String',
129
130
  :'business_registration_number' => :'String',
130
131
  :'business_registration_type' => :'BusinessRegistrationTypeEnum',
131
- :'business_registration_issuing_country' => :'BusinessRegistrationIssuingCountryEnum',
132
+ :'business_registration_issuing_country' => :'String',
132
133
  :'business_entity_type' => :'BusinessEntityTypeEnum'
133
134
  }
134
135
  end
@@ -140,6 +141,7 @@ module Bandwidth
140
141
  :'isv_reseller',
141
142
  :'business_registration_number',
142
143
  :'business_registration_type',
144
+ :'business_registration_issuing_country',
143
145
  ])
144
146
  end
145
147
 
@@ -39,7 +39,7 @@ module Bandwidth
39
39
  # Basic auth password.
40
40
  attr_accessor :fallback_password
41
41
 
42
- # A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 256 characters. Not allowed if `state` is `completed`.
42
+ # A custom string that will be sent with this and all future callbacks unless overwritten by a future `tag` attribute or [`<Tag>`](/docs/voice/bxml/tag) verb, or cleared. May be cleared by setting `tag=\"\"`. Max length 4096 characters. Not allowed if `state` is `completed`.
43
43
  attr_accessor :tag
44
44
 
45
45
  class EnumAttributeValidator
@@ -206,8 +206,8 @@ module Bandwidth
206
206
  invalid_properties.push('invalid value for "fallback_password", the character length must be smaller than or equal to 1024.')
207
207
  end
208
208
 
209
- if !@tag.nil? && @tag.to_s.length > 256
210
- invalid_properties.push('invalid value for "tag", the character length must be smaller than or equal to 256.')
209
+ if !@tag.nil? && @tag.to_s.length > 4096
210
+ invalid_properties.push('invalid value for "tag", the character length must be smaller than or equal to 4096.')
211
211
  end
212
212
 
213
213
  invalid_properties
@@ -221,7 +221,7 @@ module Bandwidth
221
221
  return false if !@password.nil? && @password.to_s.length > 1024
222
222
  return false if !@fallback_username.nil? && @fallback_username.to_s.length > 1024
223
223
  return false if !@fallback_password.nil? && @fallback_password.to_s.length > 1024
224
- return false if !@tag.nil? && @tag.to_s.length > 256
224
+ return false if !@tag.nil? && @tag.to_s.length > 4096
225
225
  true
226
226
  end
227
227
 
@@ -268,8 +268,8 @@ module Bandwidth
268
268
  # Custom attribute writer method with validation
269
269
  # @param [Object] tag Value to be assigned
270
270
  def tag=(tag)
271
- if !tag.nil? && tag.to_s.length > 256
272
- fail ArgumentError, 'invalid value for "tag", the character length must be smaller than or equal to 256.'
271
+ if !tag.nil? && tag.to_s.length > 4096
272
+ fail ArgumentError, 'invalid value for "tag", the character length must be smaller than or equal to 4096.'
273
273
  end
274
274
 
275
275
  @tag = tag
@@ -50,11 +50,12 @@ module Bandwidth
50
50
  # The company 'Doing Business As'.
51
51
  attr_accessor :business_dba
52
52
 
53
- # Government-issued business identifying number. **Note:** If this field is provided, it is strongly recommended to also provide `businessRegistrationType` and `businessRegistrationIssuingCountry`. Submissions missing these fields have a high likelihood of rejection.
53
+ # Government-issued business identifying number. **Note: As of October 19th, 2026 this field will be required when `businessEntityType` is _not_ `SOLE_PROPRIETOR`. If this field is provided, `businessRegistrationType` and `businessRegistrationIssuingCountry` are also required.**
54
54
  attr_accessor :business_registration_number
55
55
 
56
56
  attr_accessor :business_registration_type
57
57
 
58
+ # The country issuing the business registration in ISO-3166-1 alpha-3 format. Alpha-2 format is accepted by the API, but alpha-3 is highly encouraged. **Note: As of October 19th, 2026 this field will be required when `businessRegistrationNumber` is provided.** | Registration Type | Supported Countries | |----------------------|------------------------------------| | EIN | USA | | CBN | CAN | | NEQ | CAN | | PROVINCIAL_NUMBER | CAN | | CRN | GBR, HKG | | VAT | GBR, IRL, BRA, NLD | | ACN | AUS | | ABN | AUS | | BRN | HKG | | SIREN | FRA | | SIRET | FRA | | NZBN | NZL | | UST_IDNR | DEU | | CIF | ESP | | NIF | ESP | | CNPJ | BRA | | UID | CHE | | OTHER | Must Provide Country Code |
58
59
  attr_accessor :business_registration_issuing_country
59
60
 
60
61
  attr_accessor :business_entity_type
@@ -144,7 +145,7 @@ module Bandwidth
144
145
  :'business_dba' => :'String',
145
146
  :'business_registration_number' => :'String',
146
147
  :'business_registration_type' => :'BusinessRegistrationTypeEnum',
147
- :'business_registration_issuing_country' => :'BusinessRegistrationIssuingCountryEnum',
148
+ :'business_registration_issuing_country' => :'String',
148
149
  :'business_entity_type' => :'BusinessEntityTypeEnum',
149
150
  :'help_message_response' => :'String',
150
151
  :'age_gated_content' => :'Boolean',
@@ -159,6 +160,7 @@ module Bandwidth
159
160
  :'isv_reseller',
160
161
  :'business_registration_number',
161
162
  :'business_registration_type',
163
+ :'business_registration_issuing_country',
162
164
  :'help_message_response',
163
165
  :'cv_token'
164
166
  ])
@@ -48,13 +48,14 @@ module Bandwidth
48
48
  # The company 'Doing Business As'.
49
49
  attr_accessor :business_dba
50
50
 
51
- # Government-issued business identifying number. **Note:** If this field is provided, it is strongly recommended to also provide `businessRegistrationType` and `businessRegistrationIssuingCountry`. Submissions missing these fields have a high likelihood of rejection.
51
+ # Government-issued business identifying number. **Note: As of October 19th, 2026 this field will be required when `businessEntityType` is _not_ `SOLE_PROPRIETOR`. If this field is provided, `businessRegistrationType` and `businessRegistrationIssuingCountry` are also required.**
52
52
  attr_accessor :business_registration_number
53
53
 
54
54
  attr_accessor :business_registration_type
55
55
 
56
56
  attr_accessor :business_entity_type
57
57
 
58
+ # The country issuing the business registration in ISO-3166-1 alpha-3 format. Alpha-2 format is accepted by the API, but alpha-3 is highly encouraged. **Note: As of October 19th, 2026 this field will be required when `businessRegistrationNumber` is provided.** | Registration Type | Supported Countries | |----------------------|------------------------------------| | EIN | USA | | CBN | CAN | | NEQ | CAN | | PROVINCIAL_NUMBER | CAN | | CRN | GBR, HKG | | VAT | GBR, IRL, BRA, NLD | | ACN | AUS | | ABN | AUS | | BRN | HKG | | SIREN | FRA | | SIRET | FRA | | NZBN | NZL | | UST_IDNR | DEU | | CIF | ESP | | NIF | ESP | | CNPJ | BRA | | UID | CHE | | OTHER | Must Provide Country Code |
58
59
  attr_accessor :business_registration_issuing_country
59
60
 
60
61
  # A message that gets sent to users requesting help.
@@ -141,7 +142,7 @@ module Bandwidth
141
142
  :'business_registration_number' => :'String',
142
143
  :'business_registration_type' => :'BusinessRegistrationTypeEnum',
143
144
  :'business_entity_type' => :'BusinessEntityTypeEnum',
144
- :'business_registration_issuing_country' => :'BusinessRegistrationIssuingCountryEnum',
145
+ :'business_registration_issuing_country' => :'String',
145
146
  :'help_message_response' => :'String',
146
147
  :'age_gated_content' => :'Boolean',
147
148
  :'cv_token' => :'String'
@@ -155,6 +156,7 @@ module Bandwidth
155
156
  :'isv_reseller',
156
157
  :'business_registration_number',
157
158
  :'business_registration_type',
159
+ :'business_registration_issuing_country',
158
160
  :'help_message_response',
159
161
  :'cv_token'
160
162
  ])
@@ -0,0 +1,165 @@
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.17.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Bandwidth
17
+ class WebhookSubscriptionError < ApiModelBase
18
+ attr_accessor :code
19
+
20
+ attr_accessor :description
21
+
22
+ attr_accessor :telephone_numbers
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'code' => :'code',
28
+ :'description' => :'description',
29
+ :'telephone_numbers' => :'telephoneNumbers'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'code' => :'Integer',
47
+ :'description' => :'String',
48
+ :'telephone_numbers' => :'Array<TelephoneNumber>'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::WebhookSubscriptionError` initialize method'
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::WebhookSubscriptionError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'code')
75
+ self.code = attributes[:'code']
76
+ end
77
+
78
+ if attributes.key?(:'description')
79
+ self.description = attributes[:'description']
80
+ end
81
+
82
+ if attributes.key?(:'telephone_numbers')
83
+ if (value = attributes[:'telephone_numbers']).is_a?(Array)
84
+ self.telephone_numbers = value
85
+ end
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ code == o.code &&
110
+ description == o.description &&
111
+ telephone_numbers == o.telephone_numbers
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [code, description, telephone_numbers].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ transformed_hash = {}
133
+ openapi_types.each_pair do |key, type|
134
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = nil
136
+ elsif type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[attribute_map[key]].is_a?(Array)
140
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
141
+ end
142
+ elsif !attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
144
+ end
145
+ end
146
+ new(transformed_hash)
147
+ end
148
+
149
+ # Returns the object in the form of hash
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_hash
152
+ hash = {}
153
+ self.class.attribute_map.each_pair do |attr, param|
154
+ value = self.send(attr)
155
+ if value.nil?
156
+ is_nullable = self.class.openapi_nullable.include?(attr)
157
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
158
+ end
159
+
160
+ hash[param] = _to_hash(value)
161
+ end
162
+ hash
163
+ end
164
+ end
165
+ end
@@ -45,7 +45,7 @@ module Bandwidth
45
45
  def self.openapi_types
46
46
  {
47
47
  :'links' => :'LinksObject',
48
- :'errors' => :'Array<Error>',
48
+ :'errors' => :'Array<WebhookSubscriptionError>',
49
49
  :'data' => :'Array<WebhookSubscription>'
50
50
  }
51
51
  end
@@ -11,5 +11,5 @@ Generator version: 7.17.0
11
11
  =end
12
12
 
13
13
  module Bandwidth
14
- VERSION = '17.3.2'
14
+ VERSION = '18.1.0'
15
15
  end
data/lib/bandwidth-sdk.rb CHANGED
@@ -26,8 +26,11 @@ require 'bandwidth-sdk/models/async_lookup_request'
26
26
  require 'bandwidth-sdk/models/blocked_webhook'
27
27
  require 'bandwidth-sdk/models/bridge_complete_callback'
28
28
  require 'bandwidth-sdk/models/bridge_target_complete_callback'
29
+ require 'bandwidth-sdk/models/brtc_error'
30
+ require 'bandwidth-sdk/models/brtc_error_response'
31
+ require 'bandwidth-sdk/models/brtc_error_source'
32
+ require 'bandwidth-sdk/models/brtc_link'
29
33
  require 'bandwidth-sdk/models/business_entity_type_enum'
30
- require 'bandwidth-sdk/models/business_registration_issuing_country_enum'
31
34
  require 'bandwidth-sdk/models/business_registration_type_enum'
32
35
  require 'bandwidth-sdk/models/call_direction_enum'
33
36
  require 'bandwidth-sdk/models/call_recording_metadata'
@@ -58,15 +61,28 @@ require 'bandwidth-sdk/models/create_async_bulk_lookup_response'
58
61
  require 'bandwidth-sdk/models/create_async_bulk_lookup_response_data'
59
62
  require 'bandwidth-sdk/models/create_call'
60
63
  require 'bandwidth-sdk/models/create_call_response'
64
+ require 'bandwidth-sdk/models/create_endpoint_request_base'
65
+ require 'bandwidth-sdk/models/create_endpoint_response'
66
+ require 'bandwidth-sdk/models/create_endpoint_response_data'
61
67
  require 'bandwidth-sdk/models/create_message_request_error'
62
68
  require 'bandwidth-sdk/models/create_multi_channel_message_response'
63
69
  require 'bandwidth-sdk/models/create_sync_lookup_response'
64
70
  require 'bandwidth-sdk/models/create_sync_lookup_response_data'
71
+ require 'bandwidth-sdk/models/create_web_rtc_connection_request'
65
72
  require 'bandwidth-sdk/models/deactivation_event_enum'
73
+ require 'bandwidth-sdk/models/device'
74
+ require 'bandwidth-sdk/models/device_status_enum'
66
75
  require 'bandwidth-sdk/models/disconnect_callback'
67
76
  require 'bandwidth-sdk/models/diversion'
68
77
  require 'bandwidth-sdk/models/dtmf_callback'
69
- require 'bandwidth-sdk/models/error'
78
+ require 'bandwidth-sdk/models/endpoint'
79
+ require 'bandwidth-sdk/models/endpoint_direction_enum'
80
+ require 'bandwidth-sdk/models/endpoint_event'
81
+ require 'bandwidth-sdk/models/endpoint_event_type_enum'
82
+ require 'bandwidth-sdk/models/endpoint_response'
83
+ require 'bandwidth-sdk/models/endpoint_status_enum'
84
+ require 'bandwidth-sdk/models/endpoint_type_enum'
85
+ require 'bandwidth-sdk/models/endpoints'
70
86
  require 'bandwidth-sdk/models/error_object'
71
87
  require 'bandwidth-sdk/models/error_source'
72
88
  require 'bandwidth-sdk/models/failure_webhook'
@@ -85,6 +101,7 @@ require 'bandwidth-sdk/models/line_type_enum'
85
101
  require 'bandwidth-sdk/models/link'
86
102
  require 'bandwidth-sdk/models/link_schema'
87
103
  require 'bandwidth-sdk/models/links_object'
104
+ require 'bandwidth-sdk/models/list_endpoints_response'
88
105
  require 'bandwidth-sdk/models/list_message_direction_enum'
89
106
  require 'bandwidth-sdk/models/list_message_item'
90
107
  require 'bandwidth-sdk/models/lookup_error_response'
@@ -128,6 +145,7 @@ require 'bandwidth-sdk/models/multi_channel_message_content'
128
145
  require 'bandwidth-sdk/models/multi_channel_message_request'
129
146
  require 'bandwidth-sdk/models/multi_channel_message_response_data'
130
147
  require 'bandwidth-sdk/models/opt_in_workflow'
148
+ require 'bandwidth-sdk/models/page'
131
149
  require 'bandwidth-sdk/models/page_info'
132
150
  require 'bandwidth-sdk/models/priority_enum'
133
151
  require 'bandwidth-sdk/models/product_type_enum'
@@ -156,6 +174,8 @@ require 'bandwidth-sdk/models/recording_transcription_metadata'
156
174
  require 'bandwidth-sdk/models/recording_transcriptions'
157
175
  require 'bandwidth-sdk/models/redirect_callback'
158
176
  require 'bandwidth-sdk/models/redirect_method_enum'
177
+ require 'bandwidth-sdk/models/sip_connection_metadata'
178
+ require 'bandwidth-sdk/models/sip_credentials'
159
179
  require 'bandwidth-sdk/models/sms_message_content'
160
180
  require 'bandwidth-sdk/models/standalone_card_orientation_enum'
161
181
  require 'bandwidth-sdk/models/status_callback'
@@ -192,6 +212,7 @@ require 'bandwidth-sdk/models/voice_api_error'
192
212
  require 'bandwidth-sdk/models/voice_code_response'
193
213
  require 'bandwidth-sdk/models/webhook_subscription'
194
214
  require 'bandwidth-sdk/models/webhook_subscription_basic_authentication'
215
+ require 'bandwidth-sdk/models/webhook_subscription_error'
195
216
  require 'bandwidth-sdk/models/webhook_subscription_request_schema'
196
217
  require 'bandwidth-sdk/models/webhook_subscription_type_enum'
197
218
  require 'bandwidth-sdk/models/webhook_subscriptions_list_body'
@@ -234,6 +255,7 @@ require 'bandwidth-sdk/models/bxml/verbs/transfer'
234
255
  # APIs
235
256
  require 'bandwidth-sdk/api/calls_api'
236
257
  require 'bandwidth-sdk/api/conferences_api'
258
+ require 'bandwidth-sdk/api/endpoints_api'
237
259
  require 'bandwidth-sdk/api/mfa_api'
238
260
  require 'bandwidth-sdk/api/media_api'
239
261
  require 'bandwidth-sdk/api/messages_api'
@@ -0,0 +1,148 @@
1
+ # Integration Tests for Bandwidth::EndpointsApi
2
+ describe 'EndpointsApi Integration Tests' do
3
+ before(:all) do
4
+ config = Bandwidth::Configuration.new
5
+ config.configure do |config|
6
+ config.client_id = BW_CLIENT_ID
7
+ config.client_secret = BW_CLIENT_SECRET
8
+ end
9
+ client = Bandwidth::ApiClient.new(config)
10
+ @endpoints_api_instance = Bandwidth::EndpointsApi.new(client)
11
+
12
+ unauthorized_config = Bandwidth::Configuration.new
13
+ unauthorized_config.configure do |config|
14
+ config.username = UNAUTHORIZED_USERNAME
15
+ config.password = UNAUTHORIZED_PASSWORD
16
+ end
17
+ unauthorized_client = Bandwidth::ApiClient.new(unauthorized_config)
18
+ @unauthorized_api_instance = Bandwidth::EndpointsApi.new(unauthorized_client)
19
+
20
+ $endpoint_id = ''
21
+ end
22
+
23
+ # Create Endpoint
24
+ describe 'create_endpoint' do
25
+ it 'creates a WebRTC endpoint' do
26
+ create_endpoint_body = Bandwidth::CreateWebRtcConnectionRequest.new(
27
+ type: Bandwidth::EndpointTypeEnum::WEBRTC,
28
+ direction: Bandwidth::EndpointDirectionEnum::BIDIRECTIONAL,
29
+ event_callback_url: BASE_CALLBACK_URL + '/endpoint/callback',
30
+ event_fallback_url: BASE_CALLBACK_URL + '/endpoint/fallback',
31
+ tag: 'ruby-sdk-test-endpoint'
32
+ )
33
+
34
+ data, status_code = @endpoints_api_instance.create_endpoint_with_http_info(BW_ACCOUNT_ID, create_endpoint_body)
35
+
36
+ expect(status_code).to eq(201)
37
+ expect(data).to be_instance_of(Bandwidth::CreateEndpointResponse)
38
+ expect(data.links).to be_instance_of(Array)
39
+ expect(data.errors).to be_instance_of(Array)
40
+ expect(data.data).to be_instance_of(Bandwidth::CreateEndpointResponseData)
41
+ expect(data.data.endpoint_id).to be_instance_of(String)
42
+ expect(data.data.type).to eq(Bandwidth::EndpointTypeEnum::WEBRTC)
43
+ expect(data.data.status).to be_one_of(Bandwidth::EndpointStatusEnum.all_vars)
44
+ expect(data.data.token).to be_instance_of(String)
45
+ expect(data.data.creation_timestamp).to be_instance_of(Time)
46
+ expect(data.data.expiration_timestamp).to be_instance_of(Time)
47
+ expect(data.data.tag).to eq('ruby-sdk-test-endpoint')
48
+ expect(data.data.devices).to be_instance_of(Array)
49
+
50
+ $endpoint_id = data.data.endpoint_id
51
+ end
52
+ end
53
+
54
+ # List Endpoints
55
+ describe 'list_endpoints' do
56
+ it 'gets a list of endpoints' do
57
+ data, status_code = @endpoints_api_instance.list_endpoints_with_http_info(
58
+ BW_ACCOUNT_ID,
59
+ type: Bandwidth::EndpointTypeEnum::WEBRTC,
60
+ limit: 10
61
+ )
62
+
63
+ expect(status_code).to eq(200)
64
+ expect(data).to be_instance_of(Bandwidth::ListEndpointsResponse)
65
+ expect(data.links).to be_instance_of(Array)
66
+ expect(data.errors).to be_instance_of(Array)
67
+ expect(data.data).to be_instance_of(Array)
68
+ expect(data.data.length).to be > 0
69
+
70
+ tagged_endpoint = data.data.find { |ep| ep.endpoint_id == $endpoint_id }
71
+ expect(tagged_endpoint).not_to be_nil
72
+ expect(tagged_endpoint.tag).to eq('ruby-sdk-test-endpoint')
73
+ end
74
+ end
75
+
76
+ # Get Endpoint
77
+ describe 'get_endpoint' do
78
+ it 'gets a specific endpoint' do
79
+ data, status_code = @endpoints_api_instance.get_endpoint_with_http_info(BW_ACCOUNT_ID, $endpoint_id)
80
+
81
+ expect(status_code).to eq(200)
82
+ expect(data).to be_instance_of(Bandwidth::EndpointResponse)
83
+ expect(data.links).to be_instance_of(Array)
84
+ expect(data.errors).to be_instance_of(Array)
85
+ expect(data.data).to be_instance_of(Bandwidth::Endpoint)
86
+ expect(data.data.endpoint_id).to eq($endpoint_id)
87
+ expect(data.data.type).to eq(Bandwidth::EndpointTypeEnum::WEBRTC)
88
+ expect(data.data.status).to be_one_of(Bandwidth::EndpointStatusEnum.all_vars)
89
+ expect(data.data.creation_timestamp).to be_instance_of(Time)
90
+ expect(data.data.expiration_timestamp).to be_instance_of(Time)
91
+ expect(data.data.tag).to eq('ruby-sdk-test-endpoint')
92
+ expect(data.data.devices).to be_instance_of(Array)
93
+ end
94
+ end
95
+
96
+ # Delete Endpoint
97
+ describe 'delete_endpoint' do
98
+ it 'deletes an endpoint' do
99
+ _data, status_code = @endpoints_api_instance.delete_endpoint_with_http_info(BW_ACCOUNT_ID, $endpoint_id)
100
+
101
+ expect(status_code).to eq(204)
102
+ end
103
+ end
104
+
105
+ # HTTP 4XX Errors
106
+ describe 'http error' do
107
+ it 'causes a 401 error on create' do
108
+ create_endpoint_body = Bandwidth::CreateWebRtcConnectionRequest.new(
109
+ type: Bandwidth::EndpointTypeEnum::WEBRTC,
110
+ direction: Bandwidth::EndpointDirectionEnum::BIDIRECTIONAL
111
+ )
112
+
113
+ expect {
114
+ @unauthorized_api_instance.create_endpoint_with_http_info(BW_ACCOUNT_ID, create_endpoint_body)
115
+ }.to raise_error { |e|
116
+ expect(e).to be_instance_of(Bandwidth::ApiError)
117
+ expect(e.code).to eq(401)
118
+ }
119
+ end
120
+
121
+ it 'causes a 401 error on list' do
122
+ expect {
123
+ @unauthorized_api_instance.list_endpoints_with_http_info(BW_ACCOUNT_ID)
124
+ }.to raise_error { |e|
125
+ expect(e).to be_instance_of(Bandwidth::ApiError)
126
+ expect(e.code).to eq(401)
127
+ }
128
+ end
129
+
130
+ it 'causes a 404 error on get' do
131
+ expect {
132
+ @endpoints_api_instance.get_endpoint_with_http_info(BW_ACCOUNT_ID, 'does-not-exist')
133
+ }.to raise_error { |e|
134
+ expect(e).to be_instance_of(Bandwidth::ApiError)
135
+ expect(e.code).to eq(404)
136
+ }
137
+ end
138
+
139
+ it 'causes a 404 error on delete' do
140
+ expect {
141
+ @endpoints_api_instance.delete_endpoint_with_http_info(BW_ACCOUNT_ID, 'does-not-exist')
142
+ }.to raise_error { |e|
143
+ expect(e).to be_instance_of(Bandwidth::ApiError)
144
+ expect(e.code).to eq(404)
145
+ }
146
+ end
147
+ end
148
+ end
@@ -38,15 +38,11 @@ describe 'PhoneNumberLookupApi' do
38
38
  expect(create_data.errors).to be_instance_of(Array)
39
39
 
40
40
  request_id = create_data.data.request_id
41
- sleep(30)
41
+ sleep(60)
42
42
 
43
43
  get_data, get_status_code = @api_instance.get_async_bulk_lookup_with_http_info(BW_ACCOUNT_ID, request_id)
44
44
  expect(get_status_code).to equal_to(200)
45
45
  expect(get_data).to be_instance_of(Bandwidth::GetAsyncBulkLookupResponse)
46
- expect(get_data.links[0]).to be_instance_of(Bandwidth::LinkSchema)
47
- expect(get_data.links[0].rel).to be_instance_of(String)
48
- expect(get_data.links[0].href).to be_instance_of(String)
49
- expect(get_data.links[0].method).to be_instance_of(String)
50
46
  expect(get_data.data.request_id).to eq(request_id)
51
47
  expect(get_data.data.status).to eq(Bandwidth::InProgressLookupStatusEnum::COMPLETE)
52
48
  expect(get_data.data.results).to be_instance_of(Array)
@@ -69,10 +65,6 @@ describe 'PhoneNumberLookupApi' do
69
65
 
70
66
  expect(status_code).to equal_to(200)
71
67
  expect(data).to be_instance_of(Bandwidth::CreateSyncLookupResponse)
72
- expect(data.links[0]).to be_instance_of(Bandwidth::LinkSchema)
73
- expect(data.links[0].rel).to be_instance_of(String)
74
- expect(data.links[0].href).to be_instance_of(String)
75
- expect(data.links[0].method).to be_instance_of(String)
76
68
  expect(data.data.request_id).to be_instance_of(String)
77
69
  expect(data.data.status).to eq(Bandwidth::CompletedLookupStatusEnum::COMPLETE)
78
70
  expect(data.data.results).to be_instance_of(Array)