bandwidth-sdk 2.1.1 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +85 -70
  3. data/lib/bandwidth.rb +3 -1
  4. data/lib/bandwidth/configuration.rb +4 -4
  5. data/lib/bandwidth/http/faraday_client.rb +2 -6
  6. data/lib/bandwidth/messaging_lib/messaging.rb +1 -3
  7. data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +45 -88
  8. data/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +1 -1
  9. data/lib/bandwidth/messaging_lib/messaging/exceptions/{generic_client_exception.rb → messaging_exception.rb} +2 -14
  10. data/lib/bandwidth/utilities/file_wrapper.rb +17 -0
  11. data/lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb +2 -0
  12. data/lib/bandwidth/voice_lib/bxml/verbs/record.rb +5 -1
  13. data/lib/bandwidth/voice_lib/bxml/verbs/send_dtmf.rb +4 -1
  14. data/lib/bandwidth/voice_lib/bxml/verbs/start_recording.rb +4 -1
  15. data/lib/bandwidth/voice_lib/voice.rb +11 -4
  16. data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +540 -90
  17. data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +1 -1
  18. data/lib/bandwidth/voice_lib/voice/exceptions/{error_response_exception.rb → api_error_response_exception.rb} +3 -3
  19. data/lib/bandwidth/voice_lib/voice/models/api_call_response.rb +11 -2
  20. data/lib/bandwidth/voice_lib/voice/models/api_call_state_response.rb +164 -0
  21. data/lib/bandwidth/voice_lib/voice/models/api_modify_call_request.rb +1 -1
  22. data/lib/bandwidth/voice_lib/voice/models/api_transcribe_recording_request.rb +71 -0
  23. data/lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb +35 -0
  24. data/lib/bandwidth/voice_lib/voice/models/disconnect_cause_enum.rb +44 -0
  25. data/lib/bandwidth/voice_lib/voice/models/modify_call_recording_state.rb +1 -1
  26. data/lib/bandwidth/voice_lib/voice/models/recording_metadata_response.rb +35 -25
  27. data/lib/bandwidth/voice_lib/voice/models/state1_enum.rb +4 -7
  28. data/lib/bandwidth/voice_lib/voice/models/state2_enum.rb +20 -0
  29. data/lib/bandwidth/voice_lib/voice/models/state_enum.rb +7 -4
  30. data/lib/bandwidth/voice_lib/voice/models/status1_enum.rb +32 -0
  31. data/lib/bandwidth/voice_lib/voice/models/status_enum.rb +26 -0
  32. data/lib/bandwidth/{messaging_lib/messaging/models/field_error.rb → voice_lib/voice/models/transcript.rb} +15 -15
  33. data/lib/bandwidth/voice_lib/voice/models/transcription.rb +62 -0
  34. data/lib/bandwidth/voice_lib/voice/models/transcription_response.rb +42 -0
  35. metadata +31 -11
  36. data/lib/bandwidth/messaging_lib/messaging/exceptions/path_client_exception.rb +0 -49
  37. data/lib/bandwidth/voice_lib/voice/models/api_get_account_recordings_metadata_request.rb +0 -65
  38. data/lib/bandwidth/voice_lib/voice/models/transcription_status_enum.rb +0 -20
  39. data/lib/bandwidth/voice_lib/voice/models/type_enum.rb +0 -32
@@ -7,14 +7,11 @@ module Bandwidth
7
7
  # State1.
8
8
  class State1Enum
9
9
  STATE1_ENUM = [
10
- # TODO: Write general description for NOT_RECORDING
11
- NOT_RECORDING = 'NOT_RECORDING'.freeze,
10
+ # TODO: Write general description for ACTIVE
11
+ ACTIVE = 'active'.freeze,
12
12
 
13
- # TODO: Write general description for PAUSED
14
- PAUSED = 'PAUSED'.freeze,
15
-
16
- # TODO: Write general description for RECORDING
17
- RECORDING = 'RECORDING'.freeze
13
+ # TODO: Write general description for COMPLETED
14
+ COMPLETED = 'completed'.freeze
18
15
  ].freeze
19
16
  end
20
17
  end
@@ -0,0 +1,20 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # State2.
8
+ class State2Enum
9
+ STATE2_ENUM = [
10
+ # TODO: Write general description for NOT_RECORDING
11
+ NOT_RECORDING = 'NOT_RECORDING'.freeze,
12
+
13
+ # TODO: Write general description for PAUSED
14
+ PAUSED = 'PAUSED'.freeze,
15
+
16
+ # TODO: Write general description for RECORDING
17
+ RECORDING = 'RECORDING'.freeze
18
+ ].freeze
19
+ end
20
+ end
@@ -7,11 +7,14 @@ module Bandwidth
7
7
  # State.
8
8
  class StateEnum
9
9
  STATE_ENUM = [
10
- # TODO: Write general description for ACTIVE
11
- ACTIVE = 'active'.freeze,
10
+ # TODO: Write general description for DISCONNECTED
11
+ DISCONNECTED = 'DISCONNECTED'.freeze,
12
12
 
13
- # TODO: Write general description for COMPLETED
14
- COMPLETED = 'completed'.freeze
13
+ # TODO: Write general description for ANSWERED
14
+ ANSWERED = 'ANSWERED'.freeze,
15
+
16
+ # TODO: Write general description for INITIATED
17
+ INITIATED = 'INITIATED'.freeze
15
18
  ].freeze
16
19
  end
17
20
  end
@@ -0,0 +1,32 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # Status1.
8
+ class Status1Enum
9
+ STATUS1_ENUM = [
10
+ # TODO: Write general description for REQUESTED
11
+ REQUESTED = 'requested'.freeze,
12
+
13
+ # TODO: Write general description for NONE
14
+ NONE = 'none'.freeze,
15
+
16
+ # TODO: Write general description for PROCESSING
17
+ PROCESSING = 'processing'.freeze,
18
+
19
+ # TODO: Write general description for AVAILABLE
20
+ AVAILABLE = 'available'.freeze,
21
+
22
+ # TODO: Write general description for ERROR
23
+ ERROR = 'error'.freeze,
24
+
25
+ # TODO: Write general description for TIMEOUT
26
+ TIMEOUT = 'timeout'.freeze,
27
+
28
+ # TODO: Write general description for FILESIZETOOBIG
29
+ FILESIZETOOBIG = 'file-size-too-big'.freeze
30
+ ].freeze
31
+ end
32
+ end
@@ -0,0 +1,26 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # Status.
8
+ class StatusEnum
9
+ STATUS_ENUM = [
10
+ # TODO: Write general description for PROCESSING
11
+ PROCESSING = 'processing'.freeze,
12
+
13
+ # TODO: Write general description for PARTIAL
14
+ PARTIAL = 'partial'.freeze,
15
+
16
+ # TODO: Write general description for COMPLETE
17
+ COMPLETE = 'complete'.freeze,
18
+
19
+ # TODO: Write general description for DELETED
20
+ DELETED = 'deleted'.freeze,
21
+
22
+ # TODO: Write general description for ERROR
23
+ ERROR = 'error'.freeze
24
+ ].freeze
25
+ end
26
+ end
@@ -4,28 +4,28 @@
4
4
  # ( https://apimatic.io ).
5
5
 
6
6
  module Bandwidth
7
- # FieldError Model.
8
- class FieldError < BaseModel
7
+ # Transcript Model.
8
+ class Transcript < BaseModel
9
9
  # TODO: Write general description for this method
10
10
  # @return [String]
11
- attr_accessor :field_name
11
+ attr_accessor :text
12
12
 
13
13
  # TODO: Write general description for this method
14
- # @return [String]
15
- attr_accessor :description
14
+ # @return [Float]
15
+ attr_accessor :confidence
16
16
 
17
17
  # A mapping from model property names to API property names.
18
18
  def self.names
19
19
  @_hash = {} if @_hash.nil?
20
- @_hash['field_name'] = 'fieldName'
21
- @_hash['description'] = 'description'
20
+ @_hash['text'] = 'text'
21
+ @_hash['confidence'] = 'confidence'
22
22
  @_hash
23
23
  end
24
24
 
25
- def initialize(field_name = nil,
26
- description = nil)
27
- @field_name = field_name
28
- @description = description
25
+ def initialize(text = nil,
26
+ confidence = nil)
27
+ @text = text
28
+ @confidence = confidence
29
29
  end
30
30
 
31
31
  # Creates an instance of the object from a hash.
@@ -33,12 +33,12 @@ module Bandwidth
33
33
  return nil unless hash
34
34
 
35
35
  # Extract variables from the hash.
36
- field_name = hash['fieldName']
37
- description = hash['description']
36
+ text = hash['text']
37
+ confidence = hash['confidence']
38
38
 
39
39
  # Create object from extracted values.
40
- FieldError.new(field_name,
41
- description)
40
+ Transcript.new(text,
41
+ confidence)
42
42
  end
43
43
  end
44
44
  end
@@ -0,0 +1,62 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # Transcription Model.
8
+ class Transcription < BaseModel
9
+ # TODO: Write general description for this method
10
+ # @return [String]
11
+ attr_accessor :id
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [Status1Enum]
15
+ attr_accessor :status
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [String]
19
+ attr_accessor :completed_time
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [String]
23
+ attr_accessor :url
24
+
25
+ # A mapping from model property names to API property names.
26
+ def self.names
27
+ @_hash = {} if @_hash.nil?
28
+ @_hash['id'] = 'id'
29
+ @_hash['status'] = 'status'
30
+ @_hash['completed_time'] = 'completedTime'
31
+ @_hash['url'] = 'url'
32
+ @_hash
33
+ end
34
+
35
+ def initialize(id = nil,
36
+ status = nil,
37
+ completed_time = nil,
38
+ url = nil)
39
+ @id = id
40
+ @status = status
41
+ @completed_time = completed_time
42
+ @url = url
43
+ end
44
+
45
+ # Creates an instance of the object from a hash.
46
+ def self.from_hash(hash)
47
+ return nil unless hash
48
+
49
+ # Extract variables from the hash.
50
+ id = hash['id']
51
+ status = hash['status']
52
+ completed_time = hash['completedTime']
53
+ url = hash['url']
54
+
55
+ # Create object from extracted values.
56
+ Transcription.new(id,
57
+ status,
58
+ completed_time,
59
+ url)
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,42 @@
1
+ # bandwidth
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module Bandwidth
7
+ # TranscriptionResponse Model.
8
+ class TranscriptionResponse < BaseModel
9
+ # TODO: Write general description for this method
10
+ # @return [List of Transcript]
11
+ attr_accessor :transcripts
12
+
13
+ # A mapping from model property names to API property names.
14
+ def self.names
15
+ @_hash = {} if @_hash.nil?
16
+ @_hash['transcripts'] = 'transcripts'
17
+ @_hash
18
+ end
19
+
20
+ def initialize(transcripts = nil)
21
+ @transcripts = transcripts
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
+ # Parameter is an array, so we need to iterate through it
30
+ transcripts = nil
31
+ unless hash['transcripts'].nil?
32
+ transcripts = []
33
+ hash['transcripts'].each do |structure|
34
+ transcripts << (Transcript.from_hash(structure) if structure)
35
+ end
36
+ end
37
+
38
+ # Create object from extracted values.
39
+ TranscriptionResponse.new(transcripts)
40
+ end
41
+ end
42
+ 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: 2.1.1
4
+ version: 3.1.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-01-28 00:00:00.000000000 Z
11
+ date: 2020-05-07 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: []
@@ -106,16 +120,15 @@ files:
106
120
  - lib/bandwidth/messaging_lib/messaging/client.rb
107
121
  - lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb
108
122
  - 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
123
+ - lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb
111
124
  - lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb
112
125
  - lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb
113
126
  - lib/bandwidth/messaging_lib/messaging/models/deferred_result.rb
114
- - lib/bandwidth/messaging_lib/messaging/models/field_error.rb
115
127
  - lib/bandwidth/messaging_lib/messaging/models/media.rb
116
128
  - lib/bandwidth/messaging_lib/messaging/models/message_request.rb
117
129
  - lib/bandwidth/messaging_lib/messaging/models/tag.rb
118
130
  - lib/bandwidth/models/base_model.rb
131
+ - lib/bandwidth/utilities/file_wrapper.rb
119
132
  - lib/bandwidth/voice_lib/bxml/bxml.rb
120
133
  - lib/bandwidth/voice_lib/bxml/verbs/forward.rb
121
134
  - lib/bandwidth/voice_lib/bxml/verbs/gather.rb
@@ -137,22 +150,29 @@ files:
137
150
  - lib/bandwidth/voice_lib/voice/client.rb
138
151
  - lib/bandwidth/voice_lib/voice/controllers/api_controller.rb
139
152
  - lib/bandwidth/voice_lib/voice/controllers/base_controller.rb
140
- - lib/bandwidth/voice_lib/voice/exceptions/error_response_exception.rb
153
+ - lib/bandwidth/voice_lib/voice/exceptions/api_error_response_exception.rb
141
154
  - lib/bandwidth/voice_lib/voice/models/answer_method_enum.rb
142
155
  - lib/bandwidth/voice_lib/voice/models/api_call_response.rb
156
+ - lib/bandwidth/voice_lib/voice/models/api_call_state_response.rb
143
157
  - lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb
144
- - lib/bandwidth/voice_lib/voice/models/api_get_account_recordings_metadata_request.rb
145
158
  - lib/bandwidth/voice_lib/voice/models/api_modify_call_request.rb
159
+ - lib/bandwidth/voice_lib/voice/models/api_transcribe_recording_request.rb
160
+ - lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb
146
161
  - lib/bandwidth/voice_lib/voice/models/direction_enum.rb
162
+ - lib/bandwidth/voice_lib/voice/models/disconnect_cause_enum.rb
147
163
  - lib/bandwidth/voice_lib/voice/models/disconnect_method_enum.rb
148
164
  - lib/bandwidth/voice_lib/voice/models/file_format_enum.rb
149
165
  - lib/bandwidth/voice_lib/voice/models/modify_call_recording_state.rb
150
166
  - lib/bandwidth/voice_lib/voice/models/recording_metadata_response.rb
151
167
  - lib/bandwidth/voice_lib/voice/models/redirect_method_enum.rb
152
168
  - lib/bandwidth/voice_lib/voice/models/state1_enum.rb
169
+ - lib/bandwidth/voice_lib/voice/models/state2_enum.rb
153
170
  - lib/bandwidth/voice_lib/voice/models/state_enum.rb
154
- - lib/bandwidth/voice_lib/voice/models/transcription_status_enum.rb
155
- - lib/bandwidth/voice_lib/voice/models/type_enum.rb
171
+ - lib/bandwidth/voice_lib/voice/models/status1_enum.rb
172
+ - lib/bandwidth/voice_lib/voice/models/status_enum.rb
173
+ - lib/bandwidth/voice_lib/voice/models/transcript.rb
174
+ - lib/bandwidth/voice_lib/voice/models/transcription.rb
175
+ - lib/bandwidth/voice_lib/voice/models/transcription_response.rb
156
176
  homepage: https://apimatic.io
157
177
  licenses:
158
178
  - MIT
@@ -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,65 +0,0 @@
1
- # bandwidth
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- require 'date'
7
- module Bandwidth
8
- # ApiGetAccountRecordingsMetadataRequest Model.
9
- class ApiGetAccountRecordingsMetadataRequest < BaseModel
10
- # Format is E164
11
- # @return [String]
12
- attr_accessor :from
13
-
14
- # Format is E164
15
- # @return [String]
16
- attr_accessor :to
17
-
18
- # ISO8601 format
19
- # @return [DateTime]
20
- attr_accessor :min_start_time
21
-
22
- # ISO8601 format
23
- # @return [DateTime]
24
- attr_accessor :max_start_time
25
-
26
- # A mapping from model property names to API property names.
27
- def self.names
28
- @_hash = {} if @_hash.nil?
29
- @_hash['from'] = 'from'
30
- @_hash['to'] = 'to'
31
- @_hash['min_start_time'] = 'minStartTime'
32
- @_hash['max_start_time'] = 'maxStartTime'
33
- @_hash
34
- end
35
-
36
- def initialize(from = nil,
37
- to = nil,
38
- min_start_time = nil,
39
- max_start_time = nil)
40
- @from = from
41
- @to = to
42
- @min_start_time = min_start_time
43
- @max_start_time = max_start_time
44
- end
45
-
46
- # Creates an instance of the object from a hash.
47
- def self.from_hash(hash)
48
- return nil unless hash
49
-
50
- # Extract variables from the hash.
51
- from = hash['from']
52
- to = hash['to']
53
- min_start_time = APIHelper.rfc3339(hash['minStartTime']) if
54
- hash['minStartTime']
55
- max_start_time = APIHelper.rfc3339(hash['maxStartTime']) if
56
- hash['maxStartTime']
57
-
58
- # Create object from extracted values.
59
- ApiGetAccountRecordingsMetadataRequest.new(from,
60
- to,
61
- min_start_time,
62
- max_start_time)
63
- end
64
- end
65
- end