bandwidth-sdk 2.2.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +85 -70
  3. data/lib/bandwidth.rb +5 -1
  4. data/lib/bandwidth/client.rb +9 -0
  5. data/lib/bandwidth/configuration.rb +22 -4
  6. data/lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb +22 -0
  7. data/lib/bandwidth/http/faraday_client.rb +2 -6
  8. data/lib/bandwidth/messaging_lib/messaging.rb +1 -3
  9. data/lib/bandwidth/messaging_lib/messaging/client.rb +4 -0
  10. data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +45 -88
  11. data/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +1 -1
  12. data/lib/bandwidth/messaging_lib/messaging/exceptions/{generic_client_exception.rb → messaging_exception.rb} +2 -14
  13. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth.rb +19 -0
  14. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/client.rb +44 -0
  15. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/api_controller.rb +129 -0
  16. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/base_controller.rb +49 -0
  17. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_code_request_schema.rb +62 -0
  18. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_messaging_response.rb +35 -0
  19. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_code_response.rb +35 -0
  20. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb +71 -0
  21. data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_voice_response.rb +35 -0
  22. data/lib/bandwidth/utilities/file_wrapper.rb +17 -0
  23. data/lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb +2 -0
  24. data/lib/bandwidth/voice_lib/bxml/verbs/record.rb +2 -1
  25. data/lib/bandwidth/voice_lib/bxml/verbs/send_dtmf.rb +4 -1
  26. data/lib/bandwidth/voice_lib/voice/client.rb +4 -0
  27. data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +1 -1
  28. metadata +30 -7
  29. data/lib/bandwidth/messaging_lib/messaging/exceptions/path_client_exception.rb +0 -49
  30. data/lib/bandwidth/messaging_lib/messaging/models/field_error.rb +0 -44
@@ -0,0 +1,35 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # TwoFactorVoiceResponse Model.
8
+ class TwoFactorVoiceResponse < BaseModel
9
+ # TODO: Write general description for this method
10
+ # @return [String]
11
+ attr_accessor :call_id
12
+
13
+ # A mapping from model property names to API property names.
14
+ def self.names
15
+ @_hash = {} if @_hash.nil?
16
+ @_hash['call_id'] = 'callId'
17
+ @_hash
18
+ end
19
+
20
+ def initialize(call_id = nil)
21
+ @call_id = call_id
22
+ end
23
+
24
+ # Creates an instance of the object from a hash.
25
+ def self.from_hash(hash)
26
+ return nil unless hash
27
+
28
+ # Extract variables from the hash.
29
+ call_id = hash['callId']
30
+
31
+ # Create object from extracted values.
32
+ TwoFactorVoiceResponse.new(call_id)
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,17 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # A utility to allow users to set the content-type for files
8
+ class FileWrapper
9
+ attr_reader :content_type
10
+ attr_reader :file
11
+
12
+ def initialize(file, content_type: 'application/octet-stream')
13
+ @file = file
14
+ @content_type = content_type
15
+ end
16
+ end
17
+ end
@@ -8,6 +8,8 @@ module Bandwidth
8
8
  xml.PhoneNumber(number, compact_hash({
9
9
  'transferAnswerUrl' => transfer_answer_url,
10
10
  'transferAnswerMethod' => transfer_answer_method,
11
+ 'transferDisconnectUrl' => transfer_disconnect_url,
12
+ 'transferDisconnectMethod' => transfer_disconnect_method,
11
13
  'username' => username,
12
14
  'password' => password,
13
15
  'tag' => tag
@@ -20,7 +20,8 @@ module Bandwidth
20
20
  'fileFormat' => file_format,
21
21
  'transcribe' => transcribe,
22
22
  'transcriptionAvailableUrl' => transcription_available_url,
23
- 'transcriptionAvailableMethod' => transcription_available_method
23
+ 'transcriptionAvailableMethod' => transcription_available_method,
24
+ 'silenceTimeout' => silence_timeout
24
25
  }))
25
26
  end
26
27
  end
@@ -6,7 +6,10 @@ module Bandwidth
6
6
  include XmlVerb
7
7
 
8
8
  def to_bxml(xml)
9
- xml.SendDtmf(dtmf)
9
+ xml.SendDtmf(dtmf, compact_hash({
10
+ 'toneDuration' => tone_duration,
11
+ 'toneInterval' => tone_interval
12
+ }))
10
13
  end
11
14
  end
12
15
  end
@@ -19,6 +19,8 @@ module Bandwidth
19
19
  backoff_factor: 1, environment: Environment::PRODUCTION,
20
20
  messaging_basic_auth_user_name: 'TODO: Replace',
21
21
  messaging_basic_auth_password: 'TODO: Replace',
22
+ two_factor_auth_basic_auth_user_name: 'TODO: Replace',
23
+ two_factor_auth_basic_auth_password: 'TODO: Replace',
22
24
  voice_basic_auth_user_name: 'TODO: Replace',
23
25
  voice_basic_auth_password: 'TODO: Replace', config: nil)
24
26
  @config = if config.nil?
@@ -29,6 +31,8 @@ module Bandwidth
29
31
  environment: environment,
30
32
  messaging_basic_auth_user_name: messaging_basic_auth_user_name,
31
33
  messaging_basic_auth_password: messaging_basic_auth_password,
34
+ two_factor_auth_basic_auth_user_name: two_factor_auth_basic_auth_user_name,
35
+ two_factor_auth_basic_auth_password: two_factor_auth_basic_auth_password,
32
36
  voice_basic_auth_user_name: voice_basic_auth_user_name,
33
37
  voice_basic_auth_password: voice_basic_auth_password)
34
38
  else
@@ -13,7 +13,7 @@ module Bandwidth
13
13
  @http_call_back = http_call_back
14
14
 
15
15
  @global_headers = {
16
- 'user-agent' => 'APIMATIC 2.0'
16
+ 'user-agent' => 'ruby-sdk-refs/tags/ruby3.2.0'
17
17
  }
18
18
  end
19
19
 
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: 2.2.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - APIMatic SDK Generator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-11 00:00:00.000000000 Z
11
+ date: 2020-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging
@@ -72,14 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 2.0.0
75
+ version: '2.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 2.0.0
82
+ version: '2.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: builder
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 3.2.4
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 3.2.4
83
97
  description: Bandwidth's set of APIs
84
98
  email: support@apimatic.io
85
99
  executables: []
@@ -95,6 +109,7 @@ files:
95
109
  - lib/bandwidth/exceptions/api_exception.rb
96
110
  - lib/bandwidth/http/api_response.rb
97
111
  - lib/bandwidth/http/auth/messaging_basic_auth.rb
112
+ - lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb
98
113
  - lib/bandwidth/http/auth/voice_basic_auth.rb
99
114
  - lib/bandwidth/http/faraday_client.rb
100
115
  - lib/bandwidth/http/http_call_back.rb
@@ -106,16 +121,24 @@ files:
106
121
  - lib/bandwidth/messaging_lib/messaging/client.rb
107
122
  - lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb
108
123
  - lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb
109
- - lib/bandwidth/messaging_lib/messaging/exceptions/generic_client_exception.rb
110
- - lib/bandwidth/messaging_lib/messaging/exceptions/path_client_exception.rb
124
+ - lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb
111
125
  - lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb
112
126
  - lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb
113
127
  - lib/bandwidth/messaging_lib/messaging/models/deferred_result.rb
114
- - lib/bandwidth/messaging_lib/messaging/models/field_error.rb
115
128
  - lib/bandwidth/messaging_lib/messaging/models/media.rb
116
129
  - lib/bandwidth/messaging_lib/messaging/models/message_request.rb
117
130
  - lib/bandwidth/messaging_lib/messaging/models/tag.rb
118
131
  - lib/bandwidth/models/base_model.rb
132
+ - lib/bandwidth/two_factor_auth_lib/two_factor_auth.rb
133
+ - lib/bandwidth/two_factor_auth_lib/two_factor_auth/client.rb
134
+ - lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/api_controller.rb
135
+ - lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/base_controller.rb
136
+ - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_code_request_schema.rb
137
+ - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_messaging_response.rb
138
+ - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_code_response.rb
139
+ - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb
140
+ - lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_voice_response.rb
141
+ - lib/bandwidth/utilities/file_wrapper.rb
119
142
  - lib/bandwidth/voice_lib/bxml/bxml.rb
120
143
  - lib/bandwidth/voice_lib/bxml/verbs/forward.rb
121
144
  - lib/bandwidth/voice_lib/bxml/verbs/gather.rb
@@ -1,49 +0,0 @@
1
- # bandwidth
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module Bandwidth
7
- # PathClientException class.
8
- class PathClientException < APIException
9
- # TODO: Write general description for this method
10
- # @return [String]
11
- attr_accessor :timestamp
12
-
13
- # TODO: Write general description for this method
14
- # @return [Integer]
15
- attr_accessor :status
16
-
17
- # TODO: Write general description for this method
18
- # @return [String]
19
- attr_accessor :error
20
-
21
- # TODO: Write general description for this method
22
- # @return [String]
23
- attr_accessor :message
24
-
25
- # TODO: Write general description for this method
26
- # @return [String]
27
- attr_accessor :path
28
-
29
- # The constructor.
30
- # @param [String] The reason for raising an exception.
31
- # @param [HttpResponse] The HttpReponse of the API call.
32
- def initialize(reason, response)
33
- super(reason, response)
34
- hash = APIHelper.json_deserialize(@response.raw_body)
35
- unbox(hash)
36
- end
37
-
38
- # Populates this object by extracting properties from a hash.
39
- # @param [Hash] The deserialized response sent by the server in the
40
- # response body.
41
- def unbox(hash)
42
- @timestamp = hash['timestamp']
43
- @status = hash['status']
44
- @error = hash['error']
45
- @message = hash['message']
46
- @path = hash['path']
47
- end
48
- end
49
- end
@@ -1,44 +0,0 @@
1
- # bandwidth
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module Bandwidth
7
- # FieldError Model.
8
- class FieldError < BaseModel
9
- # TODO: Write general description for this method
10
- # @return [String]
11
- attr_accessor :field_name
12
-
13
- # TODO: Write general description for this method
14
- # @return [String]
15
- attr_accessor :description
16
-
17
- # A mapping from model property names to API property names.
18
- def self.names
19
- @_hash = {} if @_hash.nil?
20
- @_hash['field_name'] = 'fieldName'
21
- @_hash['description'] = 'description'
22
- @_hash
23
- end
24
-
25
- def initialize(field_name = nil,
26
- description = nil)
27
- @field_name = field_name
28
- @description = description
29
- end
30
-
31
- # Creates an instance of the object from a hash.
32
- def self.from_hash(hash)
33
- return nil unless hash
34
-
35
- # Extract variables from the hash.
36
- field_name = hash['fieldName']
37
- description = hash['description']
38
-
39
- # Create object from extracted values.
40
- FieldError.new(field_name,
41
- description)
42
- end
43
- end
44
- end