bandwidth-sdk 10.2.0 → 10.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/bandwidth/http/faraday_client.rb +0 -3
- data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb +12 -2
- data/lib/bandwidth/messaging_lib/messaging/models/message_request.rb +13 -2
- data/lib/bandwidth.rb +0 -1
- data/test/integration/test_integration.rb +7 -0
- data/test/test_helper.rb +2 -2
- metadata +3 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6da05ba4b6e401983ac08107e419d06a018640e84f980eb39aea9f9a8c8458fd
|
4
|
+
data.tar.gz: daab0265c2590c6c289b9582d3325f159f3501b66240873c821f269d613e4033
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cc3ffa14b5c4c6574f26524a8caf74e4efdba60e5ab02f7aa74e8ef6ef70d62ffa5d9c6be66ee715d64a3db9e16e0e94a0bcf829aeccc5f4c240af68e4efc9f
|
7
|
+
data.tar.gz: 14d7c3993dd30956d75043799b50db9ac075c505cf3255bd0dd9040ccf3695cc67f51a9ed341acfbbc010dd3326a62eb4cf7244b1e4a52cd49e0c5e635b0852e
|
data/README.md
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
6
|
require 'faraday/follow_redirects'
|
7
|
-
require 'faraday/gzip'
|
8
7
|
require 'faraday/http_cache'
|
9
8
|
require 'faraday/multipart'
|
10
9
|
require 'faraday/retry'
|
@@ -19,10 +18,8 @@ module Bandwidth
|
|
19
18
|
@connection = Faraday.new do |faraday|
|
20
19
|
faraday.use Faraday::HttpCache, serializer: Marshal if cache
|
21
20
|
faraday.use Faraday::FollowRedirects::Middleware
|
22
|
-
faraday.request :gzip
|
23
21
|
faraday.request :multipart
|
24
22
|
faraday.request :url_encoded
|
25
|
-
faraday.ssl[:ca_file] = Certifi.where
|
26
23
|
faraday.ssl[:verify] = verify
|
27
24
|
faraday.request :retry, max: max_retries, interval: retry_interval,
|
28
25
|
backoff_factor: backoff_factor,
|
@@ -61,6 +61,10 @@ module Bandwidth
|
|
61
61
|
# @return [String]
|
62
62
|
attr_accessor :priority
|
63
63
|
|
64
|
+
# A string with the date/time value that the message will automatically expire by.
|
65
|
+
# @return [String]
|
66
|
+
attr_accessor :expiration
|
67
|
+
|
64
68
|
# A mapping from model property names to API property names.
|
65
69
|
def self.names
|
66
70
|
@_hash = {} if @_hash.nil?
|
@@ -76,6 +80,7 @@ module Bandwidth
|
|
76
80
|
@_hash['text'] = 'text'
|
77
81
|
@_hash['tag'] = 'tag'
|
78
82
|
@_hash['priority'] = 'priority'
|
83
|
+
@_hash['expiration'] = 'expiration'
|
79
84
|
@_hash
|
80
85
|
end
|
81
86
|
|
@@ -94,6 +99,7 @@ module Bandwidth
|
|
94
99
|
text
|
95
100
|
tag
|
96
101
|
priority
|
102
|
+
expiration
|
97
103
|
]
|
98
104
|
end
|
99
105
|
|
@@ -113,7 +119,8 @@ module Bandwidth
|
|
113
119
|
media = nil,
|
114
120
|
text = nil,
|
115
121
|
tag = nil,
|
116
|
-
priority = nil
|
122
|
+
priority = nil,
|
123
|
+
expiration = nil)
|
117
124
|
@id = id unless id == SKIP
|
118
125
|
@owner = owner unless owner == SKIP
|
119
126
|
@application_id = application_id unless application_id == SKIP
|
@@ -126,6 +133,7 @@ module Bandwidth
|
|
126
133
|
@text = text unless text == SKIP
|
127
134
|
@tag = tag unless tag == SKIP
|
128
135
|
@priority = priority unless priority == SKIP
|
136
|
+
@expiration = expiration unless expiration == SKIP
|
129
137
|
end
|
130
138
|
|
131
139
|
# Creates an instance of the object from a hash.
|
@@ -145,6 +153,7 @@ module Bandwidth
|
|
145
153
|
text = hash.key?('text') ? hash['text'] : SKIP
|
146
154
|
tag = hash.key?('tag') ? hash['tag'] : SKIP
|
147
155
|
priority = hash.key?('priority') ? hash['priority'] : SKIP
|
156
|
+
expiration = hash.key?('expiration') ? hash['expiration'] : SKIP
|
148
157
|
|
149
158
|
# Create object from extracted values.
|
150
159
|
BandwidthMessage.new(id,
|
@@ -158,7 +167,8 @@ module Bandwidth
|
|
158
167
|
media,
|
159
168
|
text,
|
160
169
|
tag,
|
161
|
-
priority
|
170
|
+
priority,
|
171
|
+
expiration)
|
162
172
|
end
|
163
173
|
end
|
164
174
|
end
|
@@ -41,6 +41,11 @@ module Bandwidth
|
|
41
41
|
# @return [PriorityEnum]
|
42
42
|
attr_accessor :priority
|
43
43
|
|
44
|
+
# A string with the date/time value that the message will automatically expire by.
|
45
|
+
# This must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00.
|
46
|
+
# @return [String]
|
47
|
+
attr_accessor :expiration
|
48
|
+
|
44
49
|
# A mapping from model property names to API property names.
|
45
50
|
def self.names
|
46
51
|
@_hash = {} if @_hash.nil?
|
@@ -51,6 +56,7 @@ module Bandwidth
|
|
51
56
|
@_hash['media'] = 'media'
|
52
57
|
@_hash['tag'] = 'tag'
|
53
58
|
@_hash['priority'] = 'priority'
|
59
|
+
@_hash['expiration'] = 'expiration'
|
54
60
|
@_hash
|
55
61
|
end
|
56
62
|
|
@@ -61,6 +67,7 @@ module Bandwidth
|
|
61
67
|
media
|
62
68
|
tag
|
63
69
|
priority
|
70
|
+
expiration
|
64
71
|
]
|
65
72
|
end
|
66
73
|
|
@@ -75,7 +82,8 @@ module Bandwidth
|
|
75
82
|
text = nil,
|
76
83
|
media = nil,
|
77
84
|
tag = nil,
|
78
|
-
priority = nil
|
85
|
+
priority = nil,
|
86
|
+
expiration = nil)
|
79
87
|
@application_id = application_id unless application_id == SKIP
|
80
88
|
@to = to unless to == SKIP
|
81
89
|
@from = from unless from == SKIP
|
@@ -83,6 +91,7 @@ module Bandwidth
|
|
83
91
|
@media = media unless media == SKIP
|
84
92
|
@tag = tag unless tag == SKIP
|
85
93
|
@priority = priority unless priority == SKIP
|
94
|
+
@expiration = expiration unless expiration == SKIP
|
86
95
|
end
|
87
96
|
|
88
97
|
# Creates an instance of the object from a hash.
|
@@ -97,6 +106,7 @@ module Bandwidth
|
|
97
106
|
media = hash.key?('media') ? hash['media'] : SKIP
|
98
107
|
tag = hash.key?('tag') ? hash['tag'] : SKIP
|
99
108
|
priority = hash.key?('priority') ? hash['priority'] : SKIP
|
109
|
+
expiration = hash.key?('expiration') ? hash['expiration'] : SKIP
|
100
110
|
|
101
111
|
# Create object from extracted values.
|
102
112
|
MessageRequest.new(application_id,
|
@@ -105,7 +115,8 @@ module Bandwidth
|
|
105
115
|
text,
|
106
116
|
media,
|
107
117
|
tag,
|
108
|
-
priority
|
118
|
+
priority,
|
119
|
+
expiration)
|
109
120
|
end
|
110
121
|
end
|
111
122
|
end
|
data/lib/bandwidth.rb
CHANGED
@@ -57,7 +57,14 @@ class IntegrationTest < Test::Unit::TestCase
|
|
57
57
|
body.to = [USER_NUMBER]
|
58
58
|
body.from = BW_NUMBER
|
59
59
|
body.text = "Ruby Integration"
|
60
|
+
body.priority = "high"
|
61
|
+
body.expiration = "2091-02-01T11:29:18-05:00"
|
60
62
|
response = @bandwidth_client.messaging_client.client.create_message(BW_ACCOUNT_ID, body)
|
63
|
+
assert(response.data.to == [USER_NUMBER])
|
64
|
+
assert(response.data.from == BW_NUMBER)
|
65
|
+
assert(response.data.text == "Ruby Integration")
|
66
|
+
assert(response.data.priority == "high")
|
67
|
+
assert(response.data.expiration == "2091-02-01T11:29:18-05:00")
|
61
68
|
assert(response.data.id.length > 0, "id value not set") #validate that _some_ id was returned
|
62
69
|
end
|
63
70
|
|
data/test/test_helper.rb
CHANGED
@@ -87,8 +87,8 @@ class TestHelper
|
|
87
87
|
unless @cache.keys.include? url
|
88
88
|
@cache[url] = Tempfile.new('APIMatic')
|
89
89
|
@cache[url].binmode
|
90
|
-
@cache[url].write(open(url
|
90
|
+
@cache[url].write(open(url).read)
|
91
91
|
end
|
92
92
|
return @cache[url].path
|
93
93
|
end
|
94
|
-
end
|
94
|
+
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: 10.
|
4
|
+
version: 10.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:
|
11
|
+
date: 2023-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|
@@ -58,20 +58,6 @@ dependencies:
|
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0.3'
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: faraday-gzip
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: 0.1.0
|
68
|
-
type: :runtime
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: 0.1.0
|
75
61
|
- !ruby/object:Gem::Dependency
|
76
62
|
name: faraday-multipart
|
77
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,26 +86,6 @@ dependencies:
|
|
100
86
|
- - "~>"
|
101
87
|
- !ruby/object:Gem::Version
|
102
88
|
version: '1.0'
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: certifi
|
105
|
-
requirement: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '2018.1'
|
110
|
-
- - ">="
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
version: 2018.01.18
|
113
|
-
type: :runtime
|
114
|
-
prerelease: false
|
115
|
-
version_requirements: !ruby/object:Gem::Requirement
|
116
|
-
requirements:
|
117
|
-
- - "~>"
|
118
|
-
- !ruby/object:Gem::Version
|
119
|
-
version: '2018.1'
|
120
|
-
- - ">="
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
version: 2018.01.18
|
123
89
|
- !ruby/object:Gem::Dependency
|
124
90
|
name: faraday-http-cache
|
125
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -363,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
363
329
|
- !ruby/object:Gem::Version
|
364
330
|
version: '0'
|
365
331
|
requirements: []
|
366
|
-
rubygems_version: 3.
|
332
|
+
rubygems_version: 3.4.6
|
367
333
|
signing_key:
|
368
334
|
specification_version: 4
|
369
335
|
summary: Bandwidth
|