lob 6.0.9 → 6.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1633a287f82a1ac9a15e1523e5e8f73c881a876a4dcfb2f923dc8bbcb75936d8
4
- data.tar.gz: 0fcaaee5d324e9276213a22e5692c66f56762c18d006b96b39667c8a71db6d61
3
+ metadata.gz: c8a2782361e622be1fdb99962ea871b260f8f4faa6e25b8069c5e5abbd07aa80
4
+ data.tar.gz: 110486ee622f1a9e27635b919e7c77cc86851725bce99c84e318c6c00de14573
5
5
  SHA512:
6
- metadata.gz: d05a6dae92dacf769f6520317618a57f94ede049c6aab8f9b3d3f3e5dc96e6df528602b4ccd4e36648a85fe7a211d99dba6948a18ef19085be6924bdde47d73b
7
- data.tar.gz: 55030c5056ebf2de9594fc758fc3bb596547d2dd52f0b402b42b2ed708ad87ba57fd7d558c002ba2a4726a3495bc8bd9c04b01f1c9be362435ac40a3eacb4907
6
+ metadata.gz: fcce2c74ecc247887cc6b07ef93519dba565ea6e80adea544e0a2f243f13069d522e5ee72d811f9a3815242643b786116b1b68ecb13e08a0c6a3bce0f93a9940
7
+ data.tar.gz: e85687aedf6787973d7a8813184d0b400f938631e18b44d75e22cc7970559866c46ab46783fe40a95077f9ad2e9e0a154d859b2c88516a3f0e10dede209662ec
data/Gemfile.lock CHANGED
@@ -1,23 +1,26 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lob (6.0.9)
4
+ lob (6.1.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- ast (2.4.2)
10
+ ast (2.4.3)
11
11
  byebug (11.1.3)
12
12
  coderay (1.1.3)
13
- diff-lcs (1.5.1)
14
- ethon (0.16.0)
13
+ date (3.5.1)
14
+ diff-lcs (1.6.2)
15
+ ethon (0.18.0)
15
16
  ffi (>= 1.15.0)
16
- ffi (1.16.3)
17
+ logger
18
+ ffi (1.17.4)
17
19
  jaro_winkler (1.5.6)
20
+ logger (1.7.0)
18
21
  method_source (1.1.0)
19
- parallel (1.24.0)
20
- parser (3.3.0.5)
22
+ parallel (1.28.0)
23
+ parser (3.3.11.1)
21
24
  ast (~> 2.4.1)
22
25
  racc
23
26
  pry (0.14.2)
@@ -26,24 +29,25 @@ GEM
26
29
  pry-byebug (3.10.1)
27
30
  byebug (~> 11.0)
28
31
  pry (>= 0.13, < 0.15)
29
- psych (5.1.2)
32
+ psych (5.4.0)
33
+ date
30
34
  stringio
31
- racc (1.7.3)
35
+ racc (1.8.1)
32
36
  rainbow (3.1.1)
33
37
  rake (13.0.6)
34
- rspec (3.13.0)
38
+ rspec (3.13.2)
35
39
  rspec-core (~> 3.13.0)
36
40
  rspec-expectations (~> 3.13.0)
37
41
  rspec-mocks (~> 3.13.0)
38
- rspec-core (3.13.0)
42
+ rspec-core (3.13.6)
39
43
  rspec-support (~> 3.13.0)
40
- rspec-expectations (3.13.0)
44
+ rspec-expectations (3.13.5)
41
45
  diff-lcs (>= 1.2.0, < 2.0)
42
46
  rspec-support (~> 3.13.0)
43
- rspec-mocks (3.13.0)
47
+ rspec-mocks (3.13.8)
44
48
  diff-lcs (>= 1.2.0, < 2.0)
45
49
  rspec-support (~> 3.13.0)
46
- rspec-support (3.13.1)
50
+ rspec-support (3.13.7)
47
51
  rubocop (0.66.0)
48
52
  jaro_winkler (~> 1.5.1)
49
53
  parallel (~> 1.10)
@@ -53,9 +57,9 @@ GEM
53
57
  ruby-progressbar (~> 1.7)
54
58
  unicode-display_width (>= 1.4.0, < 1.6)
55
59
  ruby-progressbar (1.13.0)
56
- stringio (3.1.0)
57
- typhoeus (1.4.1)
58
- ethon (>= 0.9.0)
60
+ stringio (3.2.0)
61
+ typhoeus (1.6.0)
62
+ ethon (>= 0.18.0)
59
63
  unicode-display_width (1.5.0)
60
64
 
61
65
  PLATFORMS
@@ -35,7 +35,7 @@ RSpec.describe "AddressesApi" do
35
35
  addressApiMock = double("ApiClient")
36
36
  addressApi = AddressesApi.new(addressApiMock)
37
37
  addressEditable = AddressEditable.new
38
- fakeAddress = Address.new
38
+ fakeAddress = UsAddress.new
39
39
 
40
40
  fakeAddress.id = "adr_fakeid"
41
41
  allow(addressApi).to receive(:create) { fakeAddress }
@@ -62,7 +62,7 @@ RSpec.describe "AddressesApi" do
62
62
  it "retrieves an address" do
63
63
  addressApiMock = double("ApiClient")
64
64
  addressApi = AddressesApi.new(addressApiMock)
65
- fakeAddress = Address.new
65
+ fakeAddress = UsAddress.new
66
66
 
67
67
  fakeAddress.id = "adr_fakeid"
68
68
  allow(addressApi).to receive(:get) { fakeAddress }
@@ -91,7 +91,7 @@ RSpec.describe "AddressesApi" do
91
91
  addressApiMock = double("ApiClient")
92
92
  addressApi = AddressesApi.new(addressApiMock)
93
93
  addressEditable = AddressEditable.new
94
- fakeAddresses = Array.new(2) { Address.new }
94
+ fakeAddresses = Array.new(2) { UsAddress.new }
95
95
 
96
96
  fakeAddresses[0].id = "adr_fakeid"
97
97
  allow(addressApi).to receive(:list) { fakeAddresses }
@@ -106,7 +106,7 @@ RSpec.describe "AddressesApi" do
106
106
  addressApiMock = double("ApiClient")
107
107
  addressApi = AddressesApi.new(addressApiMock)
108
108
  addressEditable = AddressEditable.new
109
- fakeAddresses = Array.new(2) { Address.new }
109
+ fakeAddresses = Array.new(2) { UsAddress.new }
110
110
 
111
111
  fakeAddresses[0].id = "adr_fakeid"
112
112
  allow(addressApi).to receive(:list) { fakeAddresses }
@@ -121,7 +121,7 @@ RSpec.describe "AddressesApi" do
121
121
  addressApiMock = double("ApiClient")
122
122
  addressApi = AddressesApi.new(addressApiMock)
123
123
  addressEditable = AddressEditable.new
124
- fakeAddresses = Array.new(2) { Address.new }
124
+ fakeAddresses = Array.new(2) { UsAddress.new }
125
125
 
126
126
  fakeAddresses[0].id = "adr_fakeid"
127
127
  allow(addressApi).to receive(:list) { fakeAddresses }
@@ -136,7 +136,7 @@ RSpec.describe "AddressesApi" do
136
136
  addressApiMock = double("ApiClient")
137
137
  addressApi = AddressesApi.new(addressApiMock)
138
138
  addressEditable = AddressEditable.new
139
- fakeAddresses = Array.new(2) { Address.new }
139
+ fakeAddresses = Array.new(2) { UsAddress.new }
140
140
 
141
141
  fakeAddresses[0].id = "adr_fakeid"
142
142
  allow(addressApi).to receive(:list) { fakeAddresses }
@@ -151,7 +151,7 @@ RSpec.describe "AddressesApi" do
151
151
  addressApiMock = double("ApiClient")
152
152
  addressApi = AddressesApi.new(addressApiMock)
153
153
  addressEditable = AddressEditable.new
154
- fakeAddresses = Array.new(2) { Address.new }
154
+ fakeAddresses = Array.new(2) { UsAddress.new }
155
155
 
156
156
  dateFilter = { gt: "2020-01-01", lt: "2020-01-31T12" };
157
157
  fakeAddresses[0].id = "adr_fakeid"
@@ -167,7 +167,7 @@ RSpec.describe "AddressesApi" do
167
167
  addressApiMock = double("ApiClient")
168
168
  addressApi = AddressesApi.new(addressApiMock)
169
169
  addressEditable = AddressEditable.new
170
- fakeAddresses = Array.new(2) { Address.new }
170
+ fakeAddresses = Array.new(2) { UsAddress.new }
171
171
 
172
172
  metadata = { fakeMetadata: "fakemetadata" }
173
173
  fakeAddresses[0].id = "adr_fakeid"
@@ -215,7 +215,7 @@ RSpec.describe "BankAccountsApi" do
215
215
  it "handles errors returned by the api" do
216
216
  bankAccountApiMock = double("ApiClient")
217
217
  bankAccountApi = BankAccountsApi.new(bankAccountApiMock)
218
- bankAccountVerify = BankAccountVerify.new
218
+ bankAccountVerify = BankAccountVerify.new(amounts: [11, 35])
219
219
 
220
220
  allow(bankAccountApi).to receive(:verify).and_raise("exception thrown in verification test")
221
221
  begin
@@ -228,7 +228,7 @@ RSpec.describe "BankAccountsApi" do
228
228
  it "verifies a bank account" do
229
229
  bankAccountApiMock = double("ApiClient")
230
230
  bankAccountApi = BankAccountsApi.new(bankAccountApiMock)
231
- bankAccountVerify = BankAccountVerify.new
231
+ bankAccountVerify = BankAccountVerify.new(amounts: [11, 35])
232
232
  fakeBankAccount = BankAccount.new
233
233
  fakeBankAccount.verified = true
234
234
  fakeBankAccount.id = "bank_fakeId"
@@ -147,13 +147,13 @@ RSpec.describe "AddressesApi" do
147
147
  end
148
148
 
149
149
  it "lists addresses with after param" do
150
- response = @addressApi.list()
150
+ response = @addressApi.list(limit: 2)
151
151
  responseAfter = @addressApi.list(after: response.getNextPageToken())
152
152
  expect(responseAfter.data.length()).to be > 0
153
153
  end
154
154
 
155
155
  it "lists addresses with before param" do
156
- response = @addressApi.list()
156
+ response = @addressApi.list(limit: 2)
157
157
  responseAfter = @addressApi.list(before: response.getNextPageToken())
158
158
  expect(responseAfter.data.length()).to be > 0
159
159
  end
@@ -197,4 +197,4 @@ RSpec.describe "AddressesApi" do
197
197
  expect(response.deleted).to eq(true)
198
198
  end
199
199
  end
200
- end
200
+ end
@@ -236,7 +236,7 @@ RSpec.describe "ChecksApi" do
236
236
 
237
237
  expect(response.data[0].id).not_to eq(first_chk_id)
238
238
 
239
- uri = URI.parse(response.next_url)
239
+ uri = URI.parse(response.previous_url)
240
240
  params = CGI.parse(uri.query)
241
241
 
242
242
  response = @checkApi.list({ :"limit" => 2, :"before" => params["before"][0] })
@@ -178,7 +178,7 @@ RSpec.describe "LettersApi" do
178
178
 
179
179
  expect(response.data[0].id).not_to eq(first_ltr_id)
180
180
 
181
- uri = URI.parse(response.next_url)
181
+ uri = URI.parse(response.previous_url)
182
182
  params = CGI.parse(uri.query)
183
183
 
184
184
  response = @letterApi.list({ :"limit" => 2, :"before" => params["before"][0] })
@@ -126,6 +126,38 @@ RSpec.describe "Postcards Api" do
126
126
  before(:all) do
127
127
  api = TestFixtures.api_client_with_test_key()
128
128
  @postcardApi = PostcardsApi.new(api)
129
+
130
+ addressEditable1 = AddressEditable.new({
131
+ name: "Thing T. Thing",
132
+ address_line1: "1313 CEMETERY LN",
133
+ address_city: "WESTFIELD",
134
+ address_state: "NJ",
135
+ address_zip: "07000",
136
+ })
137
+
138
+ addressEditable2 = AddressEditable.new({
139
+ name: "FESTER",
140
+ address_line1: "001 CEMETERY LN",
141
+ address_line2: "SUITE 666",
142
+ address_city: "WESTFIELD",
143
+ address_state: "NJ",
144
+ address_zip: "07000",
145
+ })
146
+
147
+ dummyPostcard = PostcardEditable.new({
148
+ to: addressEditable1,
149
+ from: addressEditable2,
150
+ front: TestFixtures.FILE_LOCATION_4x6,
151
+ back: TestFixtures.FILE_LOCATION_4x6,
152
+ use_type: 'marketing'
153
+ })
154
+
155
+ response1 = @postcardApi.create(dummyPostcard)
156
+ response2 = @postcardApi.create(dummyPostcard)
157
+ response3 = @postcardApi.create(dummyPostcard)
158
+ response4 = @postcardApi.create(dummyPostcard)
159
+ response5 = @postcardApi.create(dummyPostcard)
160
+ @postcardIds = [response1.id, response2.id, response3.id, response4.id, response5.id]
129
161
  end
130
162
 
131
163
  it "lists postcards with limit, before, and after params" do
@@ -168,6 +200,10 @@ RSpec.describe "Postcards Api" do
168
200
  end
169
201
  end
170
202
  end
203
+
204
+ after(:all) do
205
+ @postcardIds.each { |id| @postcardApi.cancel(id) }
206
+ end
171
207
  end
172
208
 
173
209
  describe "cancel" do
@@ -138,13 +138,31 @@ RSpec.describe "SelfMailersApi" do
138
138
  use_type: SfmUseType::MARKETING
139
139
  })
140
140
 
141
+ selfMailerEditable4 = SelfMailerEditable.new({
142
+ to: addr,
143
+ inside: TestFixtures.FILE_LOCATION_6X18,
144
+ outside: TestFixtures.FILE_LOCATION_6X18,
145
+ use_type: SfmUseType::MARKETING
146
+ })
147
+
148
+ selfMailerEditable5 = SelfMailerEditable.new({
149
+ to: addr,
150
+ inside: TestFixtures.FILE_LOCATION_6X18,
151
+ outside: TestFixtures.FILE_LOCATION_6X18,
152
+ use_type: SfmUseType::MARKETING
153
+ })
154
+
141
155
  response1 = @selfMailerApi.create(selfMailerEditable1)
142
156
  response2 = @selfMailerApi.create(selfMailerEditable2)
143
157
  response3 = @selfMailerApi.create(selfMailerEditable3)
158
+ response4 = @selfMailerApi.create(selfMailerEditable4)
159
+ response5 = @selfMailerApi.create(selfMailerEditable5)
144
160
 
145
161
  @selfMailer1Id = response1.id
146
162
  @selfMailer2Id = response2.id
147
163
  @selfMailer3Id = response3.id
164
+ @selfMailer4Id = response4.id
165
+ @selfMailer5Id = response5.id
148
166
  end
149
167
 
150
168
  it "lists self mailers with limit, before, and after params" do
@@ -232,6 +250,8 @@ RSpec.describe "SelfMailersApi" do
232
250
  @selfMailerApi.delete(@selfMailer1Id)
233
251
  @selfMailerApi.delete(@selfMailer2Id)
234
252
  @selfMailerApi.delete(@selfMailer3Id)
253
+ @selfMailerApi.delete(@selfMailer4Id)
254
+ @selfMailerApi.delete(@selfMailer5Id)
235
255
  end
236
256
  end
237
257
 
@@ -98,7 +98,8 @@ RSpec.describe "TemplatesApi" do
98
98
 
99
99
  templateWritable3 = TemplateWritable.new({
100
100
  description: "Ruby Integration Test",
101
- html: "<html>Updated HTML for Ruby Integration Test</html>"
101
+ html: "<html>Updated HTML for Ruby Integration Test</html>",
102
+ metadata: { name: "Harry" }
102
103
  })
103
104
 
104
105
  response1 = @templateApi.create(templateWritable1)
@@ -123,7 +124,7 @@ RSpec.describe "TemplatesApi" do
123
124
 
124
125
  expect(response.data[0].id).not_to eq(first_tmpl_id)
125
126
 
126
- uri = URI.parse(response.next_url)
127
+ uri = URI.parse(response.previous_url)
127
128
  params = CGI.parse(uri.query)
128
129
 
129
130
  response = @templateApi.list({ :"limit" => 2, :"before" => params["before"][0] })
@@ -24,7 +24,6 @@ RSpec.describe "UsAutocompletionsApi" do
24
24
 
25
25
  it "Autocompletes US address (with test key)" do
26
26
  autocompletedAddr = @usAutocompletionApi.autocomplete(@validAddress)
27
- puts autocompletedAddr.suggestions[0].primary_line
28
27
  expect(autocompletedAddr.suggestions[0].primary_line).to eq("1 TELEGRAPH HILL BLVD")
29
28
  end
30
29
 
data/docs/Address.md CHANGED
@@ -14,8 +14,8 @@
14
14
  | **address_line1** | **String** | | [optional] |
15
15
  | **address_line2** | **String** | | [optional] |
16
16
  | **address_city** | **String** | | [optional] |
17
- | **address_state** | **String** | 2 letter state short-name code | [optional] |
18
- | **address_zip** | **String** | Must follow the ZIP format of &#x60;12345&#x60; or ZIP+4 format of &#x60;12345-1234&#x60;. | [optional] |
17
+ | **address_state** | **String** | 2 letter state short-name code for US address or must be no longer than 200 characters for non-US address. | [optional] |
18
+ | **address_zip** | **String** | Must follow the ZIP format of &#x60;12345&#x60; or ZIP+4 format of &#x60;12345-1234&#x60; for US address or must be no longer than 40 characters for non-US address. | [optional] |
19
19
  | **address_country** | [**CountryExtendedExpanded**](CountryExtendedExpanded.md) | | [optional] |
20
20
  | **object** | **String** | | [optional][default to &#39;address&#39;] |
21
21
  | **date_created** | **Time** | A timestamp in ISO 8601 format of the date the resource was created. | [optional] |
@@ -28,7 +28,7 @@
28
28
  ```ruby
29
29
  require 'lob'
30
30
 
31
- instance = Lob::Address.new(
31
+ instance = Lob::Address.build(
32
32
  id: null,
33
33
  description: null,
34
34
  name: null,
data/docs/IntlAddress.md CHANGED
@@ -14,8 +14,8 @@
14
14
  | **address_line1** | **String** | | [optional] |
15
15
  | **address_line2** | **String** | | [optional] |
16
16
  | **address_city** | **String** | | [optional] |
17
- | **address_state** | **String** | 2 letter state short-name code | [optional] |
18
- | **address_zip** | **String** | Must have a maximum of 12 characters | [optional] |
17
+ | **address_state** | **String** | Must be no longer than 200 characters. | [optional] |
18
+ | **address_zip** | **String** | Must be no longer than 40 characters. | [optional] |
19
19
  | **address_country** | [**CountryExtendedExpandedNoUs**](CountryExtendedExpandedNoUs.md) | | [optional] |
20
20
  | **object** | **String** | | [optional][default to &#39;address&#39;] |
21
21
  | **date_created** | **Time** | A timestamp in ISO 8601 format of the date the resource was created. | [optional] |