easypost 3.4.0 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/easypost/brand.rb +9 -0
- data/lib/easypost/tax_identifier.rb +2 -0
- data/lib/easypost/user.rb +20 -8
- data/lib/easypost/util.rb +1 -0
- data/lib/easypost.rb +2 -0
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61c0e0c8eb25bf4d96db43cd812a71df8648e2b1a77f2eef5d651bb4c1275cbf
|
4
|
+
data.tar.gz: ac36be5df27407e988d4fcc50c93a312fe8e1465cba96e85c8120d36acdfcf65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd011f19406e4f5187f6daac73c490621052605610160992ce4ec42db0b9a4e1b3f64f90123f2b8a7399f32f3b54c7d6515e03c882e01acbc913d611dce9f0a2
|
7
|
+
data.tar.gz: 3bb63bfce116fa8e1504cde77b38019c68bd4269770246e78aad8916b3e04e29877926550ddaf17fe5fa8489e071069a5e2b0e1432a0fdb52bc0f55e4a981af5
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.5.0
|
data/lib/easypost/user.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class EasyPost::User < EasyPost::Resource
|
2
|
-
def self.create(params={}, api_key=nil)
|
3
|
-
response = EasyPost.make_request(:post,
|
4
|
-
|
2
|
+
def self.create(params = {}, api_key = nil)
|
3
|
+
response = EasyPost.make_request(:post, url, api_key, {class_name.to_sym => params})
|
4
|
+
EasyPost::Util.convert_to_easypost_object(response, api_key)
|
5
5
|
end
|
6
6
|
|
7
7
|
def save
|
@@ -14,11 +14,11 @@ class EasyPost::User < EasyPost::Resource
|
|
14
14
|
response = EasyPost.make_request(:put, url, @api_key, wrapped_params)
|
15
15
|
refresh_from(response, api_key)
|
16
16
|
end
|
17
|
-
|
17
|
+
self
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.retrieve_me
|
21
|
-
|
21
|
+
all
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.all_api_keys
|
@@ -28,11 +28,11 @@ class EasyPost::User < EasyPost::Resource
|
|
28
28
|
def api_keys
|
29
29
|
api_keys = EasyPost::User.all_api_keys
|
30
30
|
|
31
|
-
if api_keys.id ==
|
31
|
+
if api_keys.id == id
|
32
32
|
my_api_keys = api_keys.keys
|
33
33
|
else
|
34
|
-
|
35
|
-
if child.id ==
|
34
|
+
api_keys.children.each do |child|
|
35
|
+
if child.id == id
|
36
36
|
my_api_keys = child.keys
|
37
37
|
break
|
38
38
|
end
|
@@ -41,4 +41,16 @@ class EasyPost::User < EasyPost::Resource
|
|
41
41
|
|
42
42
|
my_api_keys
|
43
43
|
end
|
44
|
+
|
45
|
+
def update_brand(**attrs)
|
46
|
+
brand = EasyPost::Brand.new
|
47
|
+
data = {object: "Brand", user_id: id, **attrs}
|
48
|
+
# Add accessors manually because there's no API to retrieve a brand
|
49
|
+
brand.add_accessors(data.keys)
|
50
|
+
# Assigning values with accessors defined above
|
51
|
+
data.each do |key, val|
|
52
|
+
brand.send("#{key}=", val)
|
53
|
+
end
|
54
|
+
brand.save
|
55
|
+
end
|
44
56
|
end
|
data/lib/easypost/util.rb
CHANGED
@@ -42,6 +42,7 @@ module EasyPost::Util
|
|
42
42
|
'Report' => EasyPost::Report,
|
43
43
|
'ScanForm' => EasyPost::ScanForm,
|
44
44
|
'Shipment' => EasyPost::Shipment,
|
45
|
+
'TaxIdentifier' => EasyPost::TaxIdentifier,
|
45
46
|
'ShipmentInvoiceReport' => EasyPost::Report,
|
46
47
|
'ShipmentReport' => EasyPost::Report,
|
47
48
|
'Tracker' => EasyPost::Tracker,
|
data/lib/easypost.rb
CHANGED
@@ -12,6 +12,7 @@ require "easypost/error"
|
|
12
12
|
require "easypost/address"
|
13
13
|
require "easypost/api_key"
|
14
14
|
require "easypost/batch"
|
15
|
+
require "easypost/brand"
|
15
16
|
require "easypost/carrier_account"
|
16
17
|
require "easypost/carrier_type"
|
17
18
|
require "easypost/customs_info"
|
@@ -30,6 +31,7 @@ require "easypost/refund"
|
|
30
31
|
require "easypost/report"
|
31
32
|
require "easypost/scan_form"
|
32
33
|
require "easypost/shipment"
|
34
|
+
require "easypost/tax_identifier"
|
33
35
|
require "easypost/tracker"
|
34
36
|
require "easypost/user"
|
35
37
|
require "easypost/webhook"
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easypost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Epstein
|
8
8
|
- Andrew Tribone
|
9
9
|
- James Brown
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-12-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: pry
|
@@ -103,6 +103,7 @@ files:
|
|
103
103
|
- lib/easypost/address.rb
|
104
104
|
- lib/easypost/api_key.rb
|
105
105
|
- lib/easypost/batch.rb
|
106
|
+
- lib/easypost/brand.rb
|
106
107
|
- lib/easypost/carrier_account.rb
|
107
108
|
- lib/easypost/carrier_type.rb
|
108
109
|
- lib/easypost/customs_info.rb
|
@@ -124,6 +125,7 @@ files:
|
|
124
125
|
- lib/easypost/resource.rb
|
125
126
|
- lib/easypost/scan_form.rb
|
126
127
|
- lib/easypost/shipment.rb
|
128
|
+
- lib/easypost/tax_identifier.rb
|
127
129
|
- lib/easypost/tracker.rb
|
128
130
|
- lib/easypost/user.rb
|
129
131
|
- lib/easypost/util.rb
|
@@ -133,7 +135,7 @@ homepage: https://www.easypost.com/docs
|
|
133
135
|
licenses:
|
134
136
|
- MIT
|
135
137
|
metadata: {}
|
136
|
-
post_install_message:
|
138
|
+
post_install_message:
|
137
139
|
rdoc_options: []
|
138
140
|
require_paths:
|
139
141
|
- lib
|
@@ -148,8 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
150
|
- !ruby/object:Gem::Version
|
149
151
|
version: '0'
|
150
152
|
requirements: []
|
151
|
-
rubygems_version: 3.0.3
|
152
|
-
signing_key:
|
153
|
+
rubygems_version: 3.0.3.1
|
154
|
+
signing_key:
|
153
155
|
specification_version: 4
|
154
156
|
summary: EasyPost Ruby Client Library
|
155
157
|
test_files: []
|