bandwidth-sdk 11.0.0.pre.beta.2.0 → 11.0.0.pre.beta.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/bandwidth-sdk.gemspec +1 -1
  4. data/coverage/.last_run.json +1 -1
  5. data/coverage/.resultset.json +262 -295
  6. data/coverage/index.html +2527 -2890
  7. data/lib/bandwidth-sdk/api/calls_api.rb +1 -1
  8. data/lib/bandwidth-sdk/api/conferences_api.rb +1 -1
  9. data/lib/bandwidth-sdk/api/media_api.rb +1 -1
  10. data/lib/bandwidth-sdk/api/messages_api.rb +1 -1
  11. data/lib/bandwidth-sdk/api/mfa_api.rb +1 -1
  12. data/lib/bandwidth-sdk/api/phone_number_lookup_api.rb +1 -1
  13. data/lib/bandwidth-sdk/api/recordings_api.rb +1 -1
  14. data/lib/bandwidth-sdk/api/statistics_api.rb +1 -1
  15. data/lib/bandwidth-sdk/api_client.rb +1 -1
  16. data/lib/bandwidth-sdk/api_error.rb +1 -1
  17. data/lib/bandwidth-sdk/configuration.rb +10 -8
  18. data/lib/bandwidth-sdk/models/account_statistics.rb +13 -18
  19. data/lib/bandwidth-sdk/models/answer_callback.rb +13 -18
  20. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +13 -18
  21. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +13 -18
  22. data/lib/bandwidth-sdk/models/call_direction_enum.rb +1 -1
  23. data/lib/bandwidth-sdk/models/call_recording_metadata.rb +13 -18
  24. data/lib/bandwidth-sdk/models/call_state.rb +13 -18
  25. data/lib/bandwidth-sdk/models/call_state_enum.rb +1 -1
  26. data/lib/bandwidth-sdk/models/callback_method_enum.rb +1 -1
  27. data/lib/bandwidth-sdk/models/code_request.rb +28 -19
  28. data/lib/bandwidth-sdk/models/conference.rb +13 -18
  29. data/lib/bandwidth-sdk/models/conference_completed_callback.rb +13 -18
  30. data/lib/bandwidth-sdk/models/conference_created_callback.rb +13 -18
  31. data/lib/bandwidth-sdk/models/conference_member.rb +13 -18
  32. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +13 -18
  33. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +13 -18
  34. data/lib/bandwidth-sdk/models/conference_recording_available_callback.rb +13 -18
  35. data/lib/bandwidth-sdk/models/conference_recording_metadata.rb +13 -18
  36. data/lib/bandwidth-sdk/models/conference_redirect_callback.rb +13 -18
  37. data/lib/bandwidth-sdk/models/conference_state_enum.rb +1 -1
  38. data/lib/bandwidth-sdk/models/create_call.rb +21 -18
  39. data/lib/bandwidth-sdk/models/create_call_response.rb +27 -18
  40. data/lib/bandwidth-sdk/models/create_lookup_response.rb +13 -18
  41. data/lib/bandwidth-sdk/models/create_message_request_error.rb +17 -18
  42. data/lib/bandwidth-sdk/models/deferred_result.rb +13 -18
  43. data/lib/bandwidth-sdk/models/disconnect_callback.rb +13 -18
  44. data/lib/bandwidth-sdk/models/diversion.rb +13 -18
  45. data/lib/bandwidth-sdk/models/dtmf_callback.rb +13 -18
  46. data/lib/bandwidth-sdk/models/field_error.rb +13 -18
  47. data/lib/bandwidth-sdk/models/file_format_enum.rb +1 -1
  48. data/lib/bandwidth-sdk/models/gather_callback.rb +13 -18
  49. data/lib/bandwidth-sdk/models/inbound_message_callback.rb +23 -18
  50. data/lib/bandwidth-sdk/models/inbound_message_callback_message.rb +31 -18
  51. data/lib/bandwidth-sdk/models/initiate_callback.rb +13 -18
  52. data/lib/bandwidth-sdk/models/list_message_direction_enum.rb +1 -1
  53. data/lib/bandwidth-sdk/models/list_message_item.rb +13 -18
  54. data/lib/bandwidth-sdk/models/lookup_request.rb +15 -18
  55. data/lib/bandwidth-sdk/models/lookup_result.rb +13 -18
  56. data/lib/bandwidth-sdk/models/lookup_status.rb +13 -18
  57. data/lib/bandwidth-sdk/models/lookup_status_enum.rb +1 -1
  58. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +13 -18
  59. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +13 -18
  60. data/lib/bandwidth-sdk/models/machine_detection_mode_enum.rb +1 -1
  61. data/lib/bandwidth-sdk/models/machine_detection_result.rb +13 -18
  62. data/lib/bandwidth-sdk/models/media.rb +13 -18
  63. data/lib/bandwidth-sdk/models/message.rb +21 -18
  64. data/lib/bandwidth-sdk/models/message_delivered_callback.rb +23 -18
  65. data/lib/bandwidth-sdk/models/message_delivered_callback_message.rb +33 -18
  66. data/lib/bandwidth-sdk/models/message_direction_enum.rb +1 -1
  67. data/lib/bandwidth-sdk/models/message_failed_callback.rb +25 -18
  68. data/lib/bandwidth-sdk/models/message_failed_callback_message.rb +35 -18
  69. data/lib/bandwidth-sdk/models/message_request.rb +24 -19
  70. data/lib/bandwidth-sdk/models/message_sending_callback.rb +23 -18
  71. data/lib/bandwidth-sdk/models/message_sending_callback_message.rb +35 -18
  72. data/lib/bandwidth-sdk/models/message_status_enum.rb +1 -1
  73. data/lib/bandwidth-sdk/models/message_type_enum.rb +1 -1
  74. data/lib/bandwidth-sdk/models/messages_list.rb +13 -18
  75. data/lib/bandwidth-sdk/models/messaging_code_response.rb +13 -18
  76. data/lib/bandwidth-sdk/models/messaging_request_error.rb +17 -18
  77. data/lib/bandwidth-sdk/models/mfa_forbidden_request_error.rb +13 -18
  78. data/lib/bandwidth-sdk/models/mfa_request_error.rb +13 -18
  79. data/lib/bandwidth-sdk/models/mfa_unauthorized_request_error.rb +13 -18
  80. data/lib/bandwidth-sdk/models/page_info.rb +13 -18
  81. data/lib/bandwidth-sdk/models/priority_enum.rb +1 -1
  82. data/lib/bandwidth-sdk/models/recording_available_callback.rb +13 -18
  83. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +13 -18
  84. data/lib/bandwidth-sdk/models/recording_state_enum.rb +1 -1
  85. data/lib/bandwidth-sdk/models/redirect_callback.rb +13 -18
  86. data/lib/bandwidth-sdk/models/redirect_method_enum.rb +1 -1
  87. data/lib/bandwidth-sdk/models/stir_shaken.rb +13 -18
  88. data/lib/bandwidth-sdk/models/tag.rb +13 -18
  89. data/lib/bandwidth-sdk/models/tn_lookup_request_error.rb +13 -18
  90. data/lib/bandwidth-sdk/models/transcribe_recording.rb +13 -18
  91. data/lib/bandwidth-sdk/models/transcription.rb +13 -18
  92. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +13 -18
  93. data/lib/bandwidth-sdk/models/transcription_list.rb +13 -18
  94. data/lib/bandwidth-sdk/models/transcription_metadata.rb +13 -18
  95. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +13 -18
  96. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +13 -18
  97. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +13 -18
  98. data/lib/bandwidth-sdk/models/update_call.rb +13 -18
  99. data/lib/bandwidth-sdk/models/update_call_recording.rb +15 -18
  100. data/lib/bandwidth-sdk/models/update_conference.rb +13 -18
  101. data/lib/bandwidth-sdk/models/update_conference_member.rb +13 -18
  102. data/lib/bandwidth-sdk/models/verify_code_request.rb +19 -18
  103. data/lib/bandwidth-sdk/models/verify_code_response.rb +13 -18
  104. data/lib/bandwidth-sdk/models/voice_api_error.rb +13 -18
  105. data/lib/bandwidth-sdk/models/voice_code_response.rb +13 -18
  106. data/lib/bandwidth-sdk/version.rb +1 -1
  107. data/lib/bandwidth-sdk.rb +1 -1
  108. data/spec/api_client_spec.rb +1 -1
  109. data/spec/configuration_spec.rb +19 -7
  110. data/spec/models/call_state_spec.rb +0 -13
  111. data/spec/models/deferred_result_spec.rb +1 -14
  112. data/spec/models/message_spec.rb +10 -17
  113. data/spec/models/verify_code_request_spec.rb +7 -15
  114. metadata +2 -2
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -66,6 +66,7 @@ module Bandwidth
66
66
  # Show invalid properties with the reasons. Usually used together with valid?
67
67
  # @return Array for valid properties with the reasons
68
68
  def list_invalid_properties
69
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
69
70
  invalid_properties = Array.new
70
71
  invalid_properties
71
72
  end
@@ -73,6 +74,7 @@ module Bandwidth
73
74
  # Check to see if the all the properties in the model are valid
74
75
  # @return true if the model is valid
75
76
  def valid?
77
+ warn '[DEPRECATED] the `valid?` method is obsolete'
76
78
  true
77
79
  end
78
80
 
@@ -100,37 +102,30 @@ module Bandwidth
100
102
  # @param [Hash] attributes Model attributes in the form of hash
101
103
  # @return [Object] Returns the model itself
102
104
  def self.build_from_hash(attributes)
103
- new.build_from_hash(attributes)
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def build_from_hash(attributes)
110
105
  return nil unless attributes.is_a?(Hash)
111
106
  attributes = attributes.transform_keys(&:to_sym)
112
- self.class.openapi_types.each_pair do |key, type|
113
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
- self.send("#{key}=", nil)
107
+ transformed_hash = {}
108
+ openapi_types.each_pair do |key, type|
109
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
110
+ transformed_hash["#{key}"] = nil
115
111
  elsif type =~ /\AArray<(.*)>/i
116
112
  # check to ensure the input is an array given that the attribute
117
113
  # is documented as an array but the input is not
118
- if attributes[self.class.attribute_map[key]].is_a?(Array)
119
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
114
+ if attributes[attribute_map[key]].is_a?(Array)
115
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
120
116
  end
121
- elsif !attributes[self.class.attribute_map[key]].nil?
122
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ elsif !attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
123
119
  end
124
120
  end
125
-
126
- self
121
+ new(transformed_hash)
127
122
  end
128
123
 
129
124
  # Deserializes the data based on type
130
125
  # @param string type Data type
131
126
  # @param string value Value to be deserialized
132
127
  # @return [Object] Deserialized data
133
- def _deserialize(type, value)
128
+ def self._deserialize(type, value)
134
129
  case type.to_sym
135
130
  when :Time
136
131
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
data/lib/bandwidth-sdk.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: letstalk@bandwidth.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
9
+ OpenAPI Generator version: 7.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -288,7 +288,7 @@ describe Bandwidth::ApiClient do
288
288
 
289
289
  describe '#build_request_url' do
290
290
  it 'adds leading and trailing slashes to path' do
291
- expect(api_client_default.build_request_url('test/path')).to eq('/test/path')
291
+ expect(api_client_default.build_request_url('test/path')).to eq('http://localhost/test/path')
292
292
  end
293
293
  end
294
294
 
@@ -53,19 +53,31 @@ describe Bandwidth::Configuration do
53
53
  end
54
54
 
55
55
  describe '#base_url' do
56
- it 'Returns default base URL when server_index is nil' do
57
- config.server_index = nil
58
- expect(config.base_url).to eq('http://localhost')
59
- end
60
-
61
- it 'returns empty string when invalid operation is passed' do
62
- expect(config.base_url('invalid_operation')).to eq('')
56
+ it 'returns default value when invalid operation is passed' do
57
+ expect(config.base_url('invalid_operation')).to eq('http://localhost')
63
58
  end
64
59
 
65
60
  it 'returns proper base URL when server index is set' do
66
61
  operation, server = config.operation_server_settings.first
67
62
  expect(config.base_url(operation)).to eq(server[0][:url])
68
63
  end
64
+
65
+ it 'should have the default value' do
66
+ expect(config.base_url).to eq('http://localhost')
67
+ end
68
+
69
+ it 'returns default value when invalid operation is passed' do
70
+ expect(config.base_url('invalid_operation')).to eq('http://localhost')
71
+ end
72
+
73
+ it 'throws argument error when attempting to use a server index that is out of bounds' do
74
+ config.server_operation_index = {
75
+ :'MediaApi.upload_media' => 10
76
+ }
77
+ expect {
78
+ config.base_url(:'MediaApi.upload_media')
79
+ }.to raise_error(ArgumentError, 'Invalid index 10 when selecting the server. Must not be nil and must be less than 1')
80
+ end
69
81
  end
70
82
 
71
83
  describe '#api_key_with_prefix' do
@@ -118,12 +118,6 @@ describe Bandwidth::CallState do
118
118
  end
119
119
  end
120
120
 
121
- describe '#list_invalid_properties' do
122
- it 'returns list of invalid properties' do
123
- expect(call_state_default.list_invalid_properties).to eq([])
124
- end
125
- end
126
-
127
121
  describe '#hash' do
128
122
  it 'returns a hash code according to attributes' do
129
123
  expect(call_state_default.hash).to be_instance_of(Integer)
@@ -136,13 +130,6 @@ describe Bandwidth::CallState do
136
130
  end
137
131
  end
138
132
 
139
- describe '#valid?' do
140
- it 'validates instances with and without attributes set' do
141
- expect(call_state_default).to be_valid
142
- expect(call_state_values).to be_valid
143
- end
144
- end
145
-
146
133
  describe '#eq? #==' do
147
134
  it 'returns true/false when comparing objects' do
148
135
  expect(call_state_default.eql?(Bandwidth::CallState.new)).to be true
@@ -43,13 +43,7 @@ describe Bandwidth::DeferredResult do
43
43
  expect(deferred_result_from_hash.set_or_expired).to be true
44
44
  end
45
45
  end
46
-
47
- describe '#list_invalid_properties' do
48
- it 'returns list of invalid properties' do
49
- expect(deferred_result_default.list_invalid_properties).to eq([])
50
- end
51
- end
52
-
46
+
53
47
  describe '#hash' do
54
48
  it 'returns a hash code according to attributes' do
55
49
  expect(deferred_result_default.hash).to be_instance_of(Integer)
@@ -62,13 +56,6 @@ describe Bandwidth::DeferredResult do
62
56
  end
63
57
  end
64
58
 
65
- describe '#valid?' do
66
- it 'validates instances with and without attributes set' do
67
- expect(deferred_result_default).to be_valid
68
- expect(deferred_result_values).to be_valid
69
- end
70
- end
71
-
72
59
  describe '#eq? #==' do
73
60
  it 'returns true/false when comparing objects' do
74
61
  expect(deferred_result_default.eql?(Bandwidth::DeferredResult.new)).to be true
@@ -7,7 +7,7 @@ describe Bandwidth::Message do
7
7
  application_id: '93de2206-9669-4e07-948d-329f4b722ee2',
8
8
  time: '2022-06-16T13:15:07.160Z',
9
9
  segment_count: 2,
10
- direction: 'in',
10
+ direction: Bandwidth::MessageDirectionEnum::IN,
11
11
  to: ['+19195551234'],
12
12
  from: '+19195554321',
13
13
  media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'],
@@ -37,6 +37,12 @@ describe Bandwidth::Message do
37
37
  end
38
38
  end
39
39
 
40
+ describe 'enum validation' do
41
+ it 'works' do
42
+
43
+ end
44
+ end
45
+
40
46
  describe 'EnumAttributeValidator' do
41
47
  it 'validates string enum' do
42
48
  validator = Bandwidth::Message::EnumAttributeValidator.new(String, ['valid'])
@@ -65,7 +71,7 @@ describe Bandwidth::Message do
65
71
  applicationId: '93de2206-9669-4e07-948d-329f4b722ee2',
66
72
  time: '2022-06-16T13:15:07.160Z',
67
73
  segmentCount: 2,
68
- direction: 'in',
74
+ direction: Bandwidth::MessageDirectionEnum::IN,
69
75
  to: ['+19195551234'],
70
76
  from: '+19195554321',
71
77
  media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'],
@@ -80,7 +86,7 @@ describe Bandwidth::Message do
80
86
  expect(message_from_hash.application_id).to eq('93de2206-9669-4e07-948d-329f4b722ee2')
81
87
  expect(message_from_hash.time).to eq(Time.parse('2022-06-16T13:15:07.160Z'))
82
88
  expect(message_from_hash.segment_count).to eq(2)
83
- expect(message_from_hash.direction).to eq('in')
89
+ expect(message_from_hash.direction).to eq(Bandwidth::MessageDirectionEnum::IN)
84
90
  expect(message_from_hash.to).to eq(['+19195551234'])
85
91
  expect(message_from_hash.from).to eq('+19195554321')
86
92
  expect(message_from_hash.media).to eq(['https://dev.bandwidth.com/images/bandwidth-logo.png'])
@@ -91,12 +97,6 @@ describe Bandwidth::Message do
91
97
  end
92
98
  end
93
99
 
94
- describe '#list_invalid_properties' do
95
- it 'returns list of invalid properties' do
96
- expect(message_default.list_invalid_properties).to eq([])
97
- end
98
- end
99
-
100
100
  describe '#hash' do
101
101
  it 'returns a hash code according to attributes' do
102
102
  expect(message_default.hash).to be_instance_of(Integer)
@@ -109,13 +109,6 @@ describe Bandwidth::Message do
109
109
  end
110
110
  end
111
111
 
112
- describe '#valid?' do
113
- it 'validates instances with and without attributes set' do
114
- expect(message_default).to be_valid
115
- expect(message_values).to be_valid
116
- end
117
- end
118
-
119
112
  describe '#eq? #==' do
120
113
  it 'returns true/false when comparing objects' do
121
114
  expect(message_default.eql?(Bandwidth::Message.new)).to be true
@@ -131,7 +124,7 @@ describe Bandwidth::Message do
131
124
  applicationId: '93de2206-9669-4e07-948d-329f4b722ee2',
132
125
  time: '2022-06-16T13:15:07.160Z',
133
126
  segmentCount: 2,
134
- direction: 'in',
127
+ direction: Bandwidth::MessageDirectionEnum::IN,
135
128
  to: ['+19195551234'],
136
129
  from: '+19195554321',
137
130
  media: ['https://dev.bandwidth.com/images/bandwidth-logo.png'],
@@ -1,6 +1,5 @@
1
1
  # Unit tests for Bandwidth::VerifyCodeRequest
2
2
  describe Bandwidth::VerifyCodeRequest do
3
- let(:verify_code_request_default) { Bandwidth::VerifyCodeRequest.new }
4
3
  let(:verify_code_request_values) { Bandwidth::VerifyCodeRequest.new({
5
4
  to: '+19195551234',
6
5
  scope: '2FA',
@@ -50,12 +49,6 @@ describe Bandwidth::VerifyCodeRequest do
50
49
  end
51
50
  end
52
51
 
53
- describe '#list_invalid_properties' do
54
- it 'returns list of invalid properties' do
55
- expect(verify_code_request_values.list_invalid_properties).to eq([])
56
- end
57
- end
58
-
59
52
  describe '#hash' do
60
53
  it 'returns a hash code according to attributes' do
61
54
  expect(verify_code_request_values.hash).to be_instance_of(Integer)
@@ -68,16 +61,15 @@ describe Bandwidth::VerifyCodeRequest do
68
61
  end
69
62
  end
70
63
 
71
- describe '#valid?' do
72
- it 'validates instances with and without attributes set' do
73
- expect(verify_code_request_values).to be_valid
74
- end
75
- end
76
-
77
64
  describe '#eq? #==' do
78
65
  it 'returns true/false when comparing objects' do
79
- expect(verify_code_request_default.eql?(Bandwidth::VerifyCodeRequest.new)).to be true
80
- expect(verify_code_request_default.eql?(verify_code_request_values)).to be false
66
+ verify_code_request_equal = Bandwidth::VerifyCodeRequest.new({
67
+ to: '+19195551234',
68
+ scope: '2FA',
69
+ expiration_time_in_minutes: 1.0,
70
+ code: '123456'
71
+ })
72
+ expect(verify_code_request_equal.eql?(verify_code_request_values)).to be true
81
73
  end
82
74
  end
83
75
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bandwidth-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.0.0.pre.beta.2.0
4
+ version: 11.0.0.pre.beta.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bandwidth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-19 00:00:00.000000000 Z
11
+ date: 2023-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday