bandwidth-sdk 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +27 -27
  3. data/README.md +18 -59
  4. data/lib/bandwidth/api_helper.rb +4 -0
  5. data/lib/bandwidth/client.rb +1 -1
  6. data/lib/bandwidth/configuration.rb +2 -2
  7. data/lib/bandwidth/messaging_lib/messaging/client.rb +1 -1
  8. data/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +1 -1
  9. data/lib/bandwidth/voice_lib/bxml/verbs/record.rb +26 -0
  10. data/lib/bandwidth/voice_lib/voice.rb +6 -5
  11. data/lib/bandwidth/voice_lib/voice/client.rb +1 -1
  12. data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +178 -98
  13. data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +1 -1
  14. data/lib/bandwidth/voice_lib/voice/models/api_call_response.rb +67 -40
  15. data/lib/bandwidth/voice_lib/voice/models/direction_enum.rb +17 -0
  16. data/lib/bandwidth/voice_lib/voice/models/duration.rb +78 -0
  17. data/lib/bandwidth/voice_lib/voice/models/file_format_enum.rb +17 -0
  18. data/lib/bandwidth/voice_lib/voice/models/recording_metadata_response.rb +152 -0
  19. data/lib/bandwidth/voice_lib/voice/models/state_enum.rb +2 -2
  20. data/lib/bandwidth/voice_lib/voice/models/temporal_unit.rb +62 -0
  21. data/lib/bandwidth/voice_lib/voice/models/transcription_status_enum.rb +20 -0
  22. metadata +15 -13
  23. data/lib/bandwidth/voice_lib/voice/exceptions/bandwidth_exception.rb +0 -51
  24. data/lib/bandwidth/voice_lib/voice/exceptions/bandwidth_not_found_exception.rb +0 -49
  25. data/lib/bandwidth/voice_lib/voice/exceptions/bandwidth_rate_limit_error_exception.rb +0 -56
  26. data/lib/bandwidth/voice_lib/voice/models/bandwidth_callback_message_voice.rb +0 -98
  27. data/lib/bandwidth/voice_lib/voice/models/field_error.rb +0 -44
@@ -8,10 +8,10 @@ module Bandwidth
8
8
  class StateEnum
9
9
  STATE_ENUM = [
10
10
  # TODO: Write general description for ACTIVE
11
- ACTIVE = 'ACTIVE'.freeze,
11
+ ACTIVE = 'active'.freeze,
12
12
 
13
13
  # TODO: Write general description for COMPLETED
14
- COMPLETED = 'COMPLETED'.freeze
14
+ COMPLETED = 'completed'.freeze
15
15
  ].freeze
16
16
  end
17
17
  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
+ # TemporalUnit Model.
8
+ class TemporalUnit < BaseModel
9
+ # TODO: Write general description for this method
10
+ # @return [Duration]
11
+ attr_accessor :duration
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [Boolean]
15
+ attr_accessor :duration_estimated
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [Boolean]
19
+ attr_accessor :date_based
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [Boolean]
23
+ attr_accessor :time_based
24
+
25
+ # A mapping from model property names to API property names.
26
+ def self.names
27
+ @_hash = {} if @_hash.nil?
28
+ @_hash['duration'] = 'duration'
29
+ @_hash['duration_estimated'] = 'durationEstimated'
30
+ @_hash['date_based'] = 'dateBased'
31
+ @_hash['time_based'] = 'timeBased'
32
+ @_hash
33
+ end
34
+
35
+ def initialize(duration = nil,
36
+ duration_estimated = nil,
37
+ date_based = nil,
38
+ time_based = nil)
39
+ @duration = duration
40
+ @duration_estimated = duration_estimated
41
+ @date_based = date_based
42
+ @time_based = time_based
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
+ duration = Duration.from_hash(hash['duration']) if hash['duration']
51
+ duration_estimated = hash['durationEstimated']
52
+ date_based = hash['dateBased']
53
+ time_based = hash['timeBased']
54
+
55
+ # Create object from extracted values.
56
+ TemporalUnit.new(duration,
57
+ duration_estimated,
58
+ date_based,
59
+ time_based)
60
+ end
61
+ end
62
+ 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
+ # TranscriptionStatus.
8
+ class TranscriptionStatusEnum
9
+ TRANSCRIPTION_STATUS_ENUM = [
10
+ # TODO: Write general description for NONE
11
+ NONE = 'none'.freeze,
12
+
13
+ # TODO: Write general description for REQUESTED
14
+ REQUESTED = 'requested'.freeze,
15
+
16
+ # TODO: Write general description for AVAILABLE
17
+ AVAILABLE = 'available'.freeze
18
+ ].freeze
19
+ end
20
+ 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: 1.0.1
4
+ version: 1.0.2
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-10-18 00:00:00.000000000 Z
11
+ date: 2019-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.2.2
19
+ version: '2.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.2.2
26
+ version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.15.4
33
+ version: '0.15'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.15.4
40
+ version: '0.15'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: faraday_middleware
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.13.1
47
+ version: '0.13'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.13.1
54
+ version: '0.13'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: certifi
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -123,6 +123,7 @@ files:
123
123
  - lib/bandwidth/voice_lib/bxml/verbs/pause.rb
124
124
  - lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb
125
125
  - lib/bandwidth/voice_lib/bxml/verbs/play_audio.rb
126
+ - lib/bandwidth/voice_lib/bxml/verbs/record.rb
126
127
  - lib/bandwidth/voice_lib/bxml/verbs/redirect.rb
127
128
  - lib/bandwidth/voice_lib/bxml/verbs/send_dtmf.rb
128
129
  - lib/bandwidth/voice_lib/bxml/verbs/speak_sentence.rb
@@ -132,18 +133,19 @@ files:
132
133
  - lib/bandwidth/voice_lib/voice/client.rb
133
134
  - lib/bandwidth/voice_lib/voice/controllers/api_controller.rb
134
135
  - lib/bandwidth/voice_lib/voice/controllers/base_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
138
136
  - lib/bandwidth/voice_lib/voice/models/answer_method_enum.rb
139
137
  - lib/bandwidth/voice_lib/voice/models/api_call_response.rb
140
138
  - lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb
141
139
  - lib/bandwidth/voice_lib/voice/models/api_modify_call_request.rb
142
- - lib/bandwidth/voice_lib/voice/models/bandwidth_callback_message_voice.rb
140
+ - lib/bandwidth/voice_lib/voice/models/direction_enum.rb
143
141
  - lib/bandwidth/voice_lib/voice/models/disconnect_method_enum.rb
144
- - lib/bandwidth/voice_lib/voice/models/field_error.rb
142
+ - lib/bandwidth/voice_lib/voice/models/duration.rb
143
+ - lib/bandwidth/voice_lib/voice/models/file_format_enum.rb
144
+ - lib/bandwidth/voice_lib/voice/models/recording_metadata_response.rb
145
145
  - lib/bandwidth/voice_lib/voice/models/redirect_method_enum.rb
146
146
  - lib/bandwidth/voice_lib/voice/models/state_enum.rb
147
+ - lib/bandwidth/voice_lib/voice/models/temporal_unit.rb
148
+ - lib/bandwidth/voice_lib/voice/models/transcription_status_enum.rb
147
149
  homepage: https://apimatic.io
148
150
  licenses:
149
151
  - MIT
@@ -1,51 +0,0 @@
1
- # bandwidth
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module Bandwidth
7
- # BandwidthException class.
8
- class BandwidthException < APIException
9
- # TODO: Write general description for this method
10
- # @return [String]
11
- attr_accessor :type
12
-
13
- # TODO: Write general description for this method
14
- # @return [String]
15
- attr_accessor :description
16
-
17
- # TODO: Write general description for this method
18
- # @return [String]
19
- attr_accessor :id
20
-
21
- # TODO: Write general description for this method
22
- # @return [List of FieldError]
23
- attr_accessor :field_errors
24
-
25
- # The constructor.
26
- # @param [String] The reason for raising an exception.
27
- # @param [HttpResponse] The HttpReponse of the API call.
28
- def initialize(reason, response)
29
- super(reason, response)
30
- hash = APIHelper.json_deserialize(@response.raw_body)
31
- unbox(hash)
32
- end
33
-
34
- # Populates this object by extracting properties from a hash.
35
- # @param [Hash] The deserialized response sent by the server in the
36
- # response body.
37
- def unbox(hash)
38
- @type = hash['type']
39
- @description = hash['description']
40
- @id = hash['id']
41
- # Parameter is an array, so we need to iterate through it
42
- @field_errors = nil
43
- unless hash['fieldErrors'].nil?
44
- @field_errors = []
45
- hash['fieldErrors'].each do |structure|
46
- @field_errors << (FieldError.from_hash(structure) if structure)
47
- end
48
- end
49
- end
50
- end
51
- end
@@ -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
- # 404 Not Found
8
- class BandwidthNotFoundException < 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 [String]
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,56 +0,0 @@
1
- # bandwidth
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module Bandwidth
7
- # BandwidthRateLimitError class.
8
- class BandwidthRateLimitErrorException < APIException
9
- # TODO: Write general description for this method
10
- # @return [String]
11
- attr_accessor :type
12
-
13
- # TODO: Write general description for this method
14
- # @return [String]
15
- attr_accessor :description
16
-
17
- # TODO: Write general description for this method
18
- # @return [String]
19
- attr_accessor :id
20
-
21
- # TODO: Write general description for this method
22
- # @return [String]
23
- attr_accessor :status
24
-
25
- # TODO: Write general description for this method
26
- # @return [List of FieldError]
27
- attr_accessor :field_errors
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
- @type = hash['type']
43
- @description = hash['description']
44
- @id = hash['id']
45
- @status = hash['status']
46
- # Parameter is an array, so we need to iterate through it
47
- @field_errors = nil
48
- unless hash['fieldErrors'].nil?
49
- @field_errors = []
50
- hash['fieldErrors'].each do |structure|
51
- @field_errors << (FieldError.from_hash(structure) if structure)
52
- end
53
- end
54
- end
55
- end
56
- end
@@ -1,98 +0,0 @@
1
- # bandwidth
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module Bandwidth
7
- # BandwidthCallbackMessageVoice Model.
8
- class BandwidthCallbackMessageVoice < BaseModel
9
- # TODO: Write general description for this method
10
- # @return [String]
11
- attr_accessor :call_id
12
-
13
- # TODO: Write general description for this method
14
- # @return [String]
15
- attr_accessor :start_time
16
-
17
- # TODO: Write general description for this method
18
- # @return [String]
19
- attr_accessor :direction
20
-
21
- # TODO: Write general description for this method
22
- # @return [String]
23
- attr_accessor :from
24
-
25
- # TODO: Write general description for this method
26
- # @return [String]
27
- attr_accessor :to
28
-
29
- # TODO: Write general description for this method
30
- # @return [String]
31
- attr_accessor :digits
32
-
33
- # TODO: Write general description for this method
34
- # @return [String]
35
- attr_accessor :event_type
36
-
37
- # TODO: Write general description for this method
38
- # @return [String]
39
- attr_accessor :call_url
40
-
41
- # A mapping from model property names to API property names.
42
- def self.names
43
- @_hash = {} if @_hash.nil?
44
- @_hash['call_id'] = 'callId'
45
- @_hash['start_time'] = 'startTime'
46
- @_hash['direction'] = 'direction'
47
- @_hash['from'] = 'from'
48
- @_hash['to'] = 'to'
49
- @_hash['digits'] = 'digits'
50
- @_hash['event_type'] = 'eventType'
51
- @_hash['call_url'] = 'callUrl'
52
- @_hash
53
- end
54
-
55
- def initialize(call_id = nil,
56
- start_time = nil,
57
- direction = nil,
58
- from = nil,
59
- to = nil,
60
- digits = nil,
61
- event_type = nil,
62
- call_url = nil)
63
- @call_id = call_id
64
- @start_time = start_time
65
- @direction = direction
66
- @from = from
67
- @to = to
68
- @digits = digits
69
- @event_type = event_type
70
- @call_url = call_url
71
- end
72
-
73
- # Creates an instance of the object from a hash.
74
- def self.from_hash(hash)
75
- return nil unless hash
76
-
77
- # Extract variables from the hash.
78
- call_id = hash['callId']
79
- start_time = hash['startTime']
80
- direction = hash['direction']
81
- from = hash['from']
82
- to = hash['to']
83
- digits = hash['digits']
84
- event_type = hash['eventType']
85
- call_url = hash['callUrl']
86
-
87
- # Create object from extracted values.
88
- BandwidthCallbackMessageVoice.new(call_id,
89
- start_time,
90
- direction,
91
- from,
92
- to,
93
- digits,
94
- event_type,
95
- call_url)
96
- end
97
- end
98
- end