bandwidth-sdk 0.1.0 → 1.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE +27 -27
  3. data/README.md +115 -1
  4. data/lib/bandwidth.rb +39 -37
  5. data/lib/bandwidth/api_helper.rb +280 -280
  6. data/lib/bandwidth/client.rb +41 -32
  7. data/lib/bandwidth/configuration.rb +130 -111
  8. data/lib/bandwidth/exceptions/api_exception.rb +20 -20
  9. data/lib/bandwidth/http/api_response.rb +36 -36
  10. data/lib/bandwidth/http/auth/messaging_basic_auth.rb +22 -0
  11. data/lib/bandwidth/http/auth/voice_basic_auth.rb +22 -22
  12. data/lib/bandwidth/http/faraday_client.rb +64 -64
  13. data/lib/bandwidth/http/http_call_back.rb +24 -24
  14. data/lib/bandwidth/http/http_client.rb +104 -104
  15. data/lib/bandwidth/http/http_method_enum.rb +13 -13
  16. data/lib/bandwidth/http/http_request.rb +50 -50
  17. data/lib/bandwidth/http/http_response.rb +29 -29
  18. data/lib/bandwidth/messaging_lib/messaging.rb +23 -0
  19. data/lib/bandwidth/messaging_lib/messaging/client.rb +40 -0
  20. data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +406 -0
  21. data/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +49 -0
  22. data/lib/bandwidth/messaging_lib/messaging/exceptions/generic_client_exception.rb +46 -0
  23. data/lib/bandwidth/messaging_lib/messaging/exceptions/path_client_exception.rb +49 -0
  24. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb +80 -0
  25. data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb +125 -0
  26. data/lib/bandwidth/messaging_lib/messaging/models/deferred_result.rb +44 -0
  27. data/lib/bandwidth/messaging_lib/messaging/models/field_error.rb +44 -0
  28. data/lib/bandwidth/messaging_lib/messaging/models/media.rb +123 -0
  29. data/lib/bandwidth/messaging_lib/messaging/models/message_request.rb +80 -0
  30. data/lib/bandwidth/messaging_lib/messaging/models/tag.rb +44 -0
  31. data/lib/bandwidth/models/base_model.rb +36 -36
  32. data/lib/bandwidth/voice_lib/bxml/bxml.rb +40 -0
  33. data/lib/bandwidth/voice_lib/bxml/verbs/forward.rb +19 -0
  34. data/lib/bandwidth/voice_lib/bxml/verbs/gather.rb +38 -0
  35. data/lib/bandwidth/voice_lib/bxml/verbs/hangup.rb +15 -0
  36. data/lib/bandwidth/voice_lib/bxml/verbs/pause.rb +16 -0
  37. data/lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb +19 -0
  38. data/lib/bandwidth/voice_lib/bxml/verbs/play_audio.rb +18 -0
  39. data/lib/bandwidth/voice_lib/bxml/verbs/redirect.rb +21 -0
  40. data/lib/bandwidth/voice_lib/bxml/verbs/send_dtmf.rb +14 -0
  41. data/lib/bandwidth/voice_lib/bxml/verbs/speak_sentence.rb +19 -0
  42. data/lib/bandwidth/voice_lib/bxml/verbs/transfer.rb +38 -0
  43. data/lib/bandwidth/voice_lib/bxml/verbs/xml_verb.rb +27 -0
  44. data/lib/bandwidth/voice_lib/voice.rb +27 -23
  45. data/lib/bandwidth/voice_lib/voice/client.rb +40 -36
  46. data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +184 -0
  47. data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +49 -49
  48. data/lib/bandwidth/voice_lib/voice/exceptions/bandwidth_exception.rb +51 -0
  49. data/lib/bandwidth/voice_lib/voice/exceptions/bandwidth_not_found_exception.rb +49 -0
  50. data/lib/bandwidth/voice_lib/voice/exceptions/bandwidth_rate_limit_error_exception.rb +56 -0
  51. data/lib/bandwidth/voice_lib/voice/models/answer_method_enum.rb +35 -35
  52. data/lib/bandwidth/voice_lib/voice/models/api_call_response.rb +116 -116
  53. data/lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb +125 -125
  54. data/lib/bandwidth/voice_lib/voice/models/api_modify_call_request.rb +80 -80
  55. data/lib/bandwidth/voice_lib/voice/models/bandwidth_callback_message_voice.rb +98 -98
  56. data/lib/bandwidth/voice_lib/voice/models/disconnect_method_enum.rb +35 -35
  57. data/lib/bandwidth/voice_lib/voice/models/field_error.rb +44 -0
  58. data/lib/bandwidth/voice_lib/voice/models/redirect_method_enum.rb +35 -35
  59. data/lib/bandwidth/voice_lib/voice/models/state_enum.rb +17 -17
  60. metadata +36 -47
  61. data/lib/bandwidth/voice_lib/voice/bxml/bxml.rb +0 -36
  62. data/lib/bandwidth/voice_lib/voice/bxml/verbs/forward.rb +0 -19
  63. data/lib/bandwidth/voice_lib/voice/bxml/verbs/gather.rb +0 -37
  64. data/lib/bandwidth/voice_lib/voice/bxml/verbs/hangup.rb +0 -14
  65. data/lib/bandwidth/voice_lib/voice/bxml/verbs/pause.rb +0 -15
  66. data/lib/bandwidth/voice_lib/voice/bxml/verbs/phone_number.rb +0 -18
  67. data/lib/bandwidth/voice_lib/voice/bxml/verbs/play_audio.rb +0 -17
  68. data/lib/bandwidth/voice_lib/voice/bxml/verbs/redirect.rb +0 -20
  69. data/lib/bandwidth/voice_lib/voice/bxml/verbs/send_dtmf.rb +0 -12
  70. data/lib/bandwidth/voice_lib/voice/bxml/verbs/speak_sentence.rb +0 -18
  71. data/lib/bandwidth/voice_lib/voice/bxml/verbs/transfer.rb +0 -37
  72. data/lib/bandwidth/voice_lib/voice/bxml/verbs/xml_verb.rb +0 -26
  73. data/lib/bandwidth/voice_lib/voice/controllers/calls_controller.rb +0 -88
@@ -1,35 +1,35 @@
1
- # bandwidth
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module Bandwidth
7
- # RedirectMethod.
8
- class RedirectMethodEnum
9
- REDIRECT_METHOD_ENUM = [
10
- # TODO: Write general description for GET
11
- GET = 'GET'.freeze,
12
-
13
- # TODO: Write general description for HEAD
14
- HEAD = 'HEAD'.freeze,
15
-
16
- # TODO: Write general description for POST
17
- POST = 'POST'.freeze,
18
-
19
- # TODO: Write general description for PUT
20
- PUT = 'PUT'.freeze,
21
-
22
- # TODO: Write general description for PATCH
23
- PATCH = 'PATCH'.freeze,
24
-
25
- # TODO: Write general description for DELETE
26
- DELETE = 'DELETE'.freeze,
27
-
28
- # TODO: Write general description for OPTIONS
29
- OPTIONS = 'OPTIONS'.freeze,
30
-
31
- # TODO: Write general description for TRACE
32
- TRACE = 'TRACE'.freeze
33
- ].freeze
34
- end
35
- end
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # RedirectMethod.
8
+ class RedirectMethodEnum
9
+ REDIRECT_METHOD_ENUM = [
10
+ # TODO: Write general description for GET
11
+ GET = 'GET'.freeze,
12
+
13
+ # TODO: Write general description for HEAD
14
+ HEAD = 'HEAD'.freeze,
15
+
16
+ # TODO: Write general description for POST
17
+ POST = 'POST'.freeze,
18
+
19
+ # TODO: Write general description for PUT
20
+ PUT = 'PUT'.freeze,
21
+
22
+ # TODO: Write general description for PATCH
23
+ PATCH = 'PATCH'.freeze,
24
+
25
+ # TODO: Write general description for DELETE
26
+ DELETE = 'DELETE'.freeze,
27
+
28
+ # TODO: Write general description for OPTIONS
29
+ OPTIONS = 'OPTIONS'.freeze,
30
+
31
+ # TODO: Write general description for TRACE
32
+ TRACE = 'TRACE'.freeze
33
+ ].freeze
34
+ end
35
+ end
@@ -1,17 +1,17 @@
1
- # bandwidth
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module Bandwidth
7
- # State.
8
- class StateEnum
9
- STATE_ENUM = [
10
- # TODO: Write general description for ACTIVE
11
- ACTIVE = 'ACTIVE'.freeze,
12
-
13
- # TODO: Write general description for COMPLETED
14
- COMPLETED = 'COMPLETED'.freeze
15
- ].freeze
16
- end
17
- end
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # State.
8
+ class StateEnum
9
+ STATE_ENUM = [
10
+ # TODO: Write general description for ACTIVE
11
+ ACTIVE = 'ACTIVE'.freeze,
12
+
13
+ # TODO: Write general description for COMPLETED
14
+ COMPLETED = 'COMPLETED'.freeze
15
+ ].freeze
16
+ end
17
+ end
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: 0.1.0
4
+ version: 1.0.0.pre
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: 2019-07-31 00:00:00.000000000 Z
11
+ date: 2019-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging
@@ -80,34 +80,6 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 2.0.0
83
- - !ruby/object:Gem::Dependency
84
- name: nokogiri
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: builder
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
83
  description: Bandwidth's set of APIs
112
84
  email: support@apimatic.io
113
85
  executables: []
@@ -122,6 +94,7 @@ files:
122
94
  - lib/bandwidth/configuration.rb
123
95
  - lib/bandwidth/exceptions/api_exception.rb
124
96
  - lib/bandwidth/http/api_response.rb
97
+ - lib/bandwidth/http/auth/messaging_basic_auth.rb
125
98
  - lib/bandwidth/http/auth/voice_basic_auth.rb
126
99
  - lib/bandwidth/http/faraday_client.rb
127
100
  - lib/bandwidth/http/http_call_back.rb
@@ -129,29 +102,46 @@ files:
129
102
  - lib/bandwidth/http/http_method_enum.rb
130
103
  - lib/bandwidth/http/http_request.rb
131
104
  - lib/bandwidth/http/http_response.rb
105
+ - lib/bandwidth/messaging_lib/messaging.rb
106
+ - lib/bandwidth/messaging_lib/messaging/client.rb
107
+ - lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb
108
+ - 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
111
+ - lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb
112
+ - lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb
113
+ - lib/bandwidth/messaging_lib/messaging/models/deferred_result.rb
114
+ - lib/bandwidth/messaging_lib/messaging/models/field_error.rb
115
+ - lib/bandwidth/messaging_lib/messaging/models/media.rb
116
+ - lib/bandwidth/messaging_lib/messaging/models/message_request.rb
117
+ - lib/bandwidth/messaging_lib/messaging/models/tag.rb
132
118
  - lib/bandwidth/models/base_model.rb
119
+ - lib/bandwidth/voice_lib/bxml/bxml.rb
120
+ - lib/bandwidth/voice_lib/bxml/verbs/forward.rb
121
+ - lib/bandwidth/voice_lib/bxml/verbs/gather.rb
122
+ - lib/bandwidth/voice_lib/bxml/verbs/hangup.rb
123
+ - lib/bandwidth/voice_lib/bxml/verbs/pause.rb
124
+ - lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb
125
+ - lib/bandwidth/voice_lib/bxml/verbs/play_audio.rb
126
+ - lib/bandwidth/voice_lib/bxml/verbs/redirect.rb
127
+ - lib/bandwidth/voice_lib/bxml/verbs/send_dtmf.rb
128
+ - lib/bandwidth/voice_lib/bxml/verbs/speak_sentence.rb
129
+ - lib/bandwidth/voice_lib/bxml/verbs/transfer.rb
130
+ - lib/bandwidth/voice_lib/bxml/verbs/xml_verb.rb
133
131
  - lib/bandwidth/voice_lib/voice.rb
134
- - lib/bandwidth/voice_lib/voice/bxml/bxml.rb
135
- - lib/bandwidth/voice_lib/voice/bxml/verbs/forward.rb
136
- - lib/bandwidth/voice_lib/voice/bxml/verbs/gather.rb
137
- - lib/bandwidth/voice_lib/voice/bxml/verbs/hangup.rb
138
- - lib/bandwidth/voice_lib/voice/bxml/verbs/pause.rb
139
- - lib/bandwidth/voice_lib/voice/bxml/verbs/phone_number.rb
140
- - lib/bandwidth/voice_lib/voice/bxml/verbs/play_audio.rb
141
- - lib/bandwidth/voice_lib/voice/bxml/verbs/redirect.rb
142
- - lib/bandwidth/voice_lib/voice/bxml/verbs/send_dtmf.rb
143
- - lib/bandwidth/voice_lib/voice/bxml/verbs/speak_sentence.rb
144
- - lib/bandwidth/voice_lib/voice/bxml/verbs/transfer.rb
145
- - lib/bandwidth/voice_lib/voice/bxml/verbs/xml_verb.rb
146
132
  - lib/bandwidth/voice_lib/voice/client.rb
133
+ - lib/bandwidth/voice_lib/voice/controllers/api_controller.rb
147
134
  - lib/bandwidth/voice_lib/voice/controllers/base_controller.rb
148
- - lib/bandwidth/voice_lib/voice/controllers/calls_controller.rb
135
+ - lib/bandwidth/voice_lib/voice/exceptions/bandwidth_exception.rb
136
+ - lib/bandwidth/voice_lib/voice/exceptions/bandwidth_not_found_exception.rb
137
+ - lib/bandwidth/voice_lib/voice/exceptions/bandwidth_rate_limit_error_exception.rb
149
138
  - lib/bandwidth/voice_lib/voice/models/answer_method_enum.rb
150
139
  - lib/bandwidth/voice_lib/voice/models/api_call_response.rb
151
140
  - lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb
152
141
  - lib/bandwidth/voice_lib/voice/models/api_modify_call_request.rb
153
142
  - lib/bandwidth/voice_lib/voice/models/bandwidth_callback_message_voice.rb
154
143
  - lib/bandwidth/voice_lib/voice/models/disconnect_method_enum.rb
144
+ - lib/bandwidth/voice_lib/voice/models/field_error.rb
155
145
  - lib/bandwidth/voice_lib/voice/models/redirect_method_enum.rb
156
146
  - lib/bandwidth/voice_lib/voice/models/state_enum.rb
157
147
  homepage: https://apimatic.io
@@ -169,12 +159,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
169
159
  version: '2.0'
170
160
  required_rubygems_version: !ruby/object:Gem::Requirement
171
161
  requirements:
172
- - - ">="
162
+ - - ">"
173
163
  - !ruby/object:Gem::Version
174
- version: '0'
164
+ version: 1.3.1
175
165
  requirements: []
176
- rubyforge_project:
177
- rubygems_version: 2.5.2.3
166
+ rubygems_version: 3.0.6
178
167
  signing_key:
179
168
  specification_version: 4
180
169
  summary: bandwidth
@@ -1,36 +0,0 @@
1
- require 'builder'
2
- Dir[File.dirname(__FILE__) + '/verbs/*'].each {|file|
3
- require_relative file
4
- }
5
-
6
- module Bandwidth
7
- module Voice
8
- class Response
9
- # Initializer
10
- # @param verbs [Array] optional list of verbs to include into response
11
- def initialize(verbs = nil)
12
- @verbs = verbs || []
13
- end
14
-
15
- # Return XML presentaion of this response
16
- def to_xml()
17
- xml = Builder::XmlMarkup.new()
18
- xml.instruct!(:xml, :version=>'1.0', :encoding=>'UTF-8')
19
- xml.Response do
20
- @verbs.each {|verb| verb.to_xml(xml)}
21
- end
22
- xml.target!()
23
- end
24
-
25
- # Add one or more verbs to this response
26
- def push(*verbs)
27
- @verbs.push(*verbs)
28
- end
29
-
30
- # Add a verb to this response
31
- def <<(verb)
32
- @verbs << verb
33
- end
34
- end
35
- end
36
- end
@@ -1,19 +0,0 @@
1
- require_relative 'xml_verb'
2
-
3
- module Bandwidth
4
- module Voice
5
- class Forward
6
- include XmlVerb
7
-
8
- def to_xml(xml)
9
- xml.Forward(compact_hash({
10
- 'to' => to,
11
- 'from' => from,
12
- 'callTimeout' => call_timeout,
13
- 'diversionTreatment' => diversion_treatment,
14
- 'diversionReason' => diversion_reason
15
- }))
16
- end
17
- end
18
- end
19
- end
@@ -1,37 +0,0 @@
1
- require_relative 'xml_verb'
2
-
3
- module Bandwidth
4
- module Voice
5
- # The Gather verb is used to collect digits for some period of time
6
- class Gather
7
- include XmlVerb
8
-
9
- def to_xml(xml)
10
- xml.Gather(compact_hash({
11
- 'gatherUrl' => gather_url,
12
- 'gatherMethod' => gather_method,
13
- 'terminatingDigits' => terminating_digits,
14
- 'tag' => tag,
15
- 'maxDigits' => max_digits,
16
- 'interDigitTimeout' => inter_digit_timeout,
17
- 'username' => username,
18
- 'password' => password,
19
- 'firstDigitTimeout' => first_digit_timeout,
20
- 'repeatCount' => repeat_count
21
- })) do
22
- def embedded_xml(xml, property, type)
23
- if property
24
- s = if property.is_a?(type)
25
- then property
26
- else type.new(property)
27
- end
28
- s.to_xml(xml)
29
- end
30
- end
31
- embedded_xml(xml, speak_sentence, SpeakSentence)
32
- embedded_xml(xml, play_audio, PlayAudio)
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,14 +0,0 @@
1
- require_relative 'xml_verb'
2
-
3
- module Bandwidth
4
- module Voice
5
- # The Hangup verb is used to hangup current call
6
- class Hangup
7
- include XmlVerb
8
-
9
- def to_xml(xml)
10
- xml.Hangup()
11
- end
12
- end
13
- end
14
- end
@@ -1,15 +0,0 @@
1
- require_relative 'xml_verb'
2
-
3
- module Bandwidth
4
- module Voice
5
- class Pause
6
- include XmlVerb
7
-
8
- def to_xml(xml)
9
- xml.Pause(compact_hash({
10
- 'duration' => duration
11
- }))
12
- end
13
- end
14
- end
15
- end
@@ -1,18 +0,0 @@
1
- require_relative 'xml_verb'
2
-
3
- module Bandwidth
4
- module Voice
5
- class PhoneNumber
6
- include XmlVerb
7
- def to_xml(xml)
8
- xml.PhoneNumber(number, compact_hash({
9
- 'transferAnswerUrl' => transfer_answer_url,
10
- 'transferAnswerMethod' => transfer_answer_method,
11
- 'username' => username,
12
- 'password' => password,
13
- 'tag' => tag
14
- }))
15
- end
16
- end
17
- end
18
- end
@@ -1,17 +0,0 @@
1
- require_relative 'xml_verb'
2
-
3
- module Bandwidth
4
- module Voice
5
- # The PlayAudio verb is used to play an audio file in the call
6
- class PlayAudio
7
- include XmlVerb
8
-
9
- def to_xml(xml)
10
- xml.PlayAudio(url, compact_hash({
11
- 'username' => username,
12
- 'password' => password
13
- }))
14
- end
15
- end
16
- end
17
- end
@@ -1,20 +0,0 @@
1
- require_relative 'xml_verb'
2
-
3
- module Bandwidth
4
- module Voice
5
- # The Redirect verb is used to redirect the current XML execution to another URL
6
- class Redirect
7
- include XmlVerb
8
-
9
- def to_xml(xml)
10
- xml.Redirect(compact_hash({
11
- 'redirectUrl' => redirect_url,
12
- 'redirectMethod' => redirect_method,
13
- 'tag' => tag,
14
- 'username' => username,
15
- 'password' => password
16
- }))
17
- end
18
- end
19
- end
20
- end
@@ -1,12 +0,0 @@
1
- require_relative 'xml_verb'
2
- module Bandwidth
3
- module Voice
4
- class SendDtmf
5
- include XmlVerb
6
-
7
- def to_xml(xml)
8
- xml.SendDtmf(dtmf)
9
- end
10
- end
11
- end
12
- end