easypost 4.8.1 → 4.9.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/.gitattributes +5 -0
- data/.github/workflows/ci.yml +8 -0
- data/.gitignore +10 -14
- data/CHANGELOG.md +4 -0
- data/Makefile +10 -2
- data/README.md +5 -1
- data/VERSION +1 -1
- data/docs/EasyPost/Address.html +222 -0
- data/docs/EasyPost/ApiKey.html +99 -0
- data/docs/EasyPost/Batch.html +269 -0
- data/docs/EasyPost/Beta/EndShipper.html +225 -0
- data/docs/EasyPost/Beta/Referral.html +338 -0
- data/docs/EasyPost/Beta.html +91 -0
- data/docs/EasyPost/Billing.html +253 -0
- data/docs/EasyPost/Brand.html +140 -0
- data/docs/EasyPost/CarbonOffset.html +99 -0
- data/docs/EasyPost/CarrierAccount.html +136 -0
- data/docs/EasyPost/CarrierType.html +99 -0
- data/docs/EasyPost/CustomsInfo.html +136 -0
- data/docs/EasyPost/CustomsItem.html +136 -0
- data/docs/EasyPost/EasyPostObject.html +662 -0
- data/docs/EasyPost/EndShipper.html +175 -0
- data/docs/EasyPost/Error.html +258 -0
- data/docs/EasyPost/Event.html +136 -0
- data/docs/EasyPost/Insurance.html +99 -0
- data/docs/EasyPost/Order.html +222 -0
- data/docs/EasyPost/Parcel.html +136 -0
- data/docs/EasyPost/PaymentMethod.html +137 -0
- data/docs/EasyPost/Pickup.html +222 -0
- data/docs/EasyPost/PickupRate.html +99 -0
- data/docs/EasyPost/PostageLabel.html +99 -0
- data/docs/EasyPost/Rate.html +136 -0
- data/docs/EasyPost/Referral.html +334 -0
- data/docs/EasyPost/Refund.html +99 -0
- data/docs/EasyPost/Report.html +167 -0
- data/docs/EasyPost/Resource.html +399 -0
- data/docs/EasyPost/ScanForm.html +137 -0
- data/docs/EasyPost/Shipment.html +456 -0
- data/docs/EasyPost/TaxIdentifier.html +99 -0
- data/docs/EasyPost/Tracker.html +139 -0
- data/docs/EasyPost/User.html +307 -0
- data/docs/EasyPost/Util.html +462 -0
- data/docs/EasyPost/Webhook.html +221 -0
- data/docs/EasyPost.html +440 -0
- data/docs/created.rid +40 -0
- data/docs/css/fonts.css +167 -0
- data/docs/css/rdoc.css +639 -0
- data/docs/fonts/Lato-Light.ttf +0 -0
- data/docs/fonts/Lato-LightItalic.ttf +0 -0
- data/docs/fonts/Lato-Regular.ttf +0 -0
- data/docs/fonts/Lato-RegularItalic.ttf +0 -0
- data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
- data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
- data/docs/images/add.png +0 -0
- data/docs/images/arrow_up.png +0 -0
- data/docs/images/brick.png +0 -0
- data/docs/images/brick_link.png +0 -0
- data/docs/images/bug.png +0 -0
- data/docs/images/bullet_black.png +0 -0
- data/docs/images/bullet_toggle_minus.png +0 -0
- data/docs/images/bullet_toggle_plus.png +0 -0
- data/docs/images/date.png +0 -0
- data/docs/images/delete.png +0 -0
- data/docs/images/find.png +0 -0
- data/docs/images/loadingAnimation.gif +0 -0
- data/docs/images/macFFBgHack.png +0 -0
- data/docs/images/package.png +0 -0
- data/docs/images/page_green.png +0 -0
- data/docs/images/page_white_text.png +0 -0
- data/docs/images/page_white_width.png +0 -0
- data/docs/images/plugin.png +0 -0
- data/docs/images/ruby.png +0 -0
- data/docs/images/tag_blue.png +0 -0
- data/docs/images/tag_green.png +0 -0
- data/docs/images/transparent.png +0 -0
- data/docs/images/wrench.png +0 -0
- data/docs/images/wrench_orange.png +0 -0
- data/docs/images/zoom.png +0 -0
- data/docs/index.html +117 -0
- data/docs/js/darkfish.js +84 -0
- data/docs/js/navigation.js +105 -0
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search.js +110 -0
- data/docs/js/search_index.js +1 -0
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +229 -0
- data/docs/js/searcher.js.gz +0 -0
- data/docs/table_of_contents.html +785 -0
- data/easypost.gemspec +3 -1
- data/lib/easypost/carrier_account.rb +17 -0
- data/lib/easypost/shipment.rb +1 -1
- data/lib/easypost/user.rb +5 -2
- data/lib/easypost/util.rb +2 -0
- metadata +115 -6
data/docs/EasyPost.html
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>module EasyPost - EasyPost Ruby Docs</title>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "./";
|
|
11
|
+
var index_rel_prefix = "./";
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script src="./js/navigation.js" defer></script>
|
|
15
|
+
<script src="./js/search.js" defer></script>
|
|
16
|
+
<script src="./js/search_index.js" defer></script>
|
|
17
|
+
<script src="./js/searcher.js" defer></script>
|
|
18
|
+
<script src="./js/darkfish.js" defer></script>
|
|
19
|
+
|
|
20
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
|
21
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<body id="top" role="document" class="module">
|
|
25
|
+
<nav role="navigation">
|
|
26
|
+
<div id="project-navigation">
|
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
28
|
+
<h2>
|
|
29
|
+
<a href="./index.html" rel="home">Home</a>
|
|
30
|
+
</h2>
|
|
31
|
+
|
|
32
|
+
<div id="table-of-contents-navigation">
|
|
33
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
|
34
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
|
35
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
41
|
+
<div id="search-field-wrapper">
|
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
|
49
|
+
aria-busy="false" aria-expanded="false"
|
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
51
|
+
</form>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
<div id="class-metadata">
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
<!-- Method Quickref -->
|
|
65
|
+
<div id="method-list-section" class="nav-section">
|
|
66
|
+
<h3>Methods</h3>
|
|
67
|
+
|
|
68
|
+
<ul class="link-list" role="directory">
|
|
69
|
+
<li ><a href="#method-c-authorization">::authorization</a>
|
|
70
|
+
<li ><a href="#method-c-default_connection">::default_connection</a>
|
|
71
|
+
<li ><a href="#method-c-default_headers">::default_headers</a>
|
|
72
|
+
<li ><a href="#method-c-default_http_config">::default_http_config</a>
|
|
73
|
+
<li ><a href="#method-c-http_config">::http_config</a>
|
|
74
|
+
<li ><a href="#method-c-http_config-3D">::http_config=</a>
|
|
75
|
+
<li ><a href="#method-c-make_client">::make_client</a>
|
|
76
|
+
<li ><a href="#method-c-make_request">::make_request</a>
|
|
77
|
+
<li ><a href="#method-c-parse_response">::parse_response</a>
|
|
78
|
+
<li ><a href="#method-c-reset_http_config">::reset_http_config</a>
|
|
79
|
+
<li ><a href="#method-c-user_agent">::user_agent</a>
|
|
80
|
+
</ul>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
</div>
|
|
84
|
+
</nav>
|
|
85
|
+
|
|
86
|
+
<main role="main" aria-labelledby="module-EasyPost">
|
|
87
|
+
<h1 id="module-EasyPost" class="module">
|
|
88
|
+
module EasyPost
|
|
89
|
+
</h1>
|
|
90
|
+
|
|
91
|
+
<section class="description">
|
|
92
|
+
|
|
93
|
+
</section>
|
|
94
|
+
|
|
95
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
<section class="constants-list">
|
|
99
|
+
<header>
|
|
100
|
+
<h3>Constants</h3>
|
|
101
|
+
</header>
|
|
102
|
+
<dl>
|
|
103
|
+
<dt id="Connection">Connection
|
|
104
|
+
<dd>
|
|
105
|
+
<dt id="DEFAULT_API_BASE">DEFAULT_API_BASE
|
|
106
|
+
<dd>
|
|
107
|
+
<dt id="VERSION">VERSION
|
|
108
|
+
<dd>
|
|
109
|
+
</dl>
|
|
110
|
+
</section>
|
|
111
|
+
|
|
112
|
+
<section class="attribute-method-details" class="method-section">
|
|
113
|
+
<header>
|
|
114
|
+
<h3>Attributes</h3>
|
|
115
|
+
</header>
|
|
116
|
+
|
|
117
|
+
<div id="attribute-c-api_base" class="method-detail">
|
|
118
|
+
<div class="method-heading attribute-method-heading">
|
|
119
|
+
<span class="method-name">api_base</span><span
|
|
120
|
+
class="attribute-access-type">[RW]</span>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<div class="method-description">
|
|
124
|
+
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
<div id="attribute-c-api_key" class="method-detail">
|
|
128
|
+
<div class="method-heading attribute-method-heading">
|
|
129
|
+
<span class="method-name">api_key</span><span
|
|
130
|
+
class="attribute-access-type">[RW]</span>
|
|
131
|
+
</div>
|
|
132
|
+
|
|
133
|
+
<div class="method-description">
|
|
134
|
+
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
<div id="attribute-c-default_connection" class="method-detail">
|
|
138
|
+
<div class="method-heading attribute-method-heading">
|
|
139
|
+
<span class="method-name">default_connection</span><span
|
|
140
|
+
class="attribute-access-type">[W]</span>
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
<div class="method-description">
|
|
144
|
+
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</section>
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
|
151
|
+
<header>
|
|
152
|
+
<h3>Public Class Methods</h3>
|
|
153
|
+
</header>
|
|
154
|
+
|
|
155
|
+
<div id="method-c-authorization" class="method-detail ">
|
|
156
|
+
<div class="method-heading">
|
|
157
|
+
<span class="method-name">authorization</span><span
|
|
158
|
+
class="method-args">(key)</span>
|
|
159
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<div class="method-description">
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
<div class="method-source-code" id="authorization-source">
|
|
166
|
+
<pre><span class="ruby-comment"># File lib/easypost.rb, line 78</span>
|
|
167
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">authorization</span>(<span class="ruby-identifier">key</span>)
|
|
168
|
+
<span class="ruby-node">"Basic #{Base64.strict_encode64("#{key}:")}"</span>
|
|
169
|
+
<span class="ruby-keyword">end</span></pre>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
<div id="method-c-default_connection" class="method-detail ">
|
|
177
|
+
<div class="method-heading">
|
|
178
|
+
<span class="method-name">default_connection</span><span
|
|
179
|
+
class="method-args">()</span>
|
|
180
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<div class="method-description">
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
<div class="method-source-code" id="default_connection-source">
|
|
187
|
+
<pre><span class="ruby-comment"># File lib/easypost.rb, line 71</span>
|
|
188
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">default_connection</span>
|
|
189
|
+
<span class="ruby-ivar">@default_connection</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">Connection</span>.<span class="ruby-identifier">new</span>(
|
|
190
|
+
<span class="ruby-value">uri:</span> <span class="ruby-constant">URI</span>(<span class="ruby-identifier">api_base</span>),
|
|
191
|
+
<span class="ruby-value">config:</span> <span class="ruby-identifier">http_config</span>,
|
|
192
|
+
)
|
|
193
|
+
<span class="ruby-keyword">end</span></pre>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
<div id="method-c-default_headers" class="method-detail ">
|
|
201
|
+
<div class="method-heading">
|
|
202
|
+
<span class="method-name">default_headers</span><span
|
|
203
|
+
class="method-args">()</span>
|
|
204
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
<div class="method-description">
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
<div class="method-source-code" id="default_headers-source">
|
|
211
|
+
<pre><span class="ruby-comment"># File lib/easypost.rb, line 64</span>
|
|
212
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">default_headers</span>
|
|
213
|
+
<span class="ruby-ivar">@default_headers</span> <span class="ruby-operator">||=</span> {
|
|
214
|
+
<span class="ruby-string">'Content-Type'</span> <span class="ruby-operator">=></span> <span class="ruby-string">'application/json'</span>,
|
|
215
|
+
<span class="ruby-string">'User-Agent'</span> <span class="ruby-operator">=></span> <span class="ruby-identifier">user_agent</span>,
|
|
216
|
+
}
|
|
217
|
+
<span class="ruby-keyword">end</span></pre>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
<div id="method-c-default_http_config" class="method-detail ">
|
|
225
|
+
<div class="method-heading">
|
|
226
|
+
<span class="method-name">default_http_config</span><span
|
|
227
|
+
class="method-args">()</span>
|
|
228
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
<div class="method-description">
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
<div class="method-source-code" id="default_http_config-source">
|
|
235
|
+
<pre><span class="ruby-comment"># File lib/easypost.rb, line 88</span>
|
|
236
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">default_http_config</span>
|
|
237
|
+
<span class="ruby-identifier">http_config</span> = {
|
|
238
|
+
<span class="ruby-value">timeout:</span> <span class="ruby-value">60</span>,
|
|
239
|
+
<span class="ruby-value">open_timeout:</span> <span class="ruby-value">30</span>,
|
|
240
|
+
<span class="ruby-value">verify_ssl:</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">VERIFY_PEER</span>,
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
<span class="ruby-identifier">ruby_version</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Version</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">RUBY_VERSION</span>)
|
|
244
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">ruby_version</span> <span class="ruby-operator">>=</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Version</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">'2.5.0'</span>)
|
|
245
|
+
<span class="ruby-identifier">http_config</span>[<span class="ruby-value">:min_version</span>] = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">TLS1_2_VERSION</span>
|
|
246
|
+
<span class="ruby-keyword">else</span>
|
|
247
|
+
<span class="ruby-identifier">http_config</span>[<span class="ruby-value">:ssl_version</span>] = <span class="ruby-value">:TLSv1_2</span> <span class="ruby-comment"># rubocop:disable Naming/VariableNumber</span>
|
|
248
|
+
<span class="ruby-keyword">end</span>
|
|
249
|
+
|
|
250
|
+
<span class="ruby-identifier">http_config</span>
|
|
251
|
+
<span class="ruby-keyword">end</span></pre>
|
|
252
|
+
</div>
|
|
253
|
+
</div>
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
</div>
|
|
257
|
+
|
|
258
|
+
<div id="method-c-http_config" class="method-detail ">
|
|
259
|
+
<div class="method-heading">
|
|
260
|
+
<span class="method-name">http_config</span><span
|
|
261
|
+
class="method-args">()</span>
|
|
262
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
263
|
+
</div>
|
|
264
|
+
|
|
265
|
+
<div class="method-description">
|
|
266
|
+
<p>Get the HTTP config.</p>
|
|
267
|
+
|
|
268
|
+
<div class="method-source-code" id="http_config-source">
|
|
269
|
+
<pre><span class="ruby-comment"># File lib/easypost.rb, line 106</span>
|
|
270
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">http_config</span>
|
|
271
|
+
<span class="ruby-ivar">@http_config</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">default_http_config</span>
|
|
272
|
+
<span class="ruby-keyword">end</span></pre>
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
</div>
|
|
278
|
+
|
|
279
|
+
<div id="method-c-http_config-3D" class="method-detail ">
|
|
280
|
+
<div class="method-heading">
|
|
281
|
+
<span class="method-name">http_config=</span><span
|
|
282
|
+
class="method-args">(http_config_params)</span>
|
|
283
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
284
|
+
</div>
|
|
285
|
+
|
|
286
|
+
<div class="method-description">
|
|
287
|
+
<p>Set the HTTP config.</p>
|
|
288
|
+
|
|
289
|
+
<div class="method-source-code" id="http_config-3D-source">
|
|
290
|
+
<pre><span class="ruby-comment"># File lib/easypost.rb, line 111</span>
|
|
291
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">http_config=</span>(<span class="ruby-identifier">http_config_params</span>)
|
|
292
|
+
<span class="ruby-identifier">http_config</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">http_config_params</span>)
|
|
293
|
+
|
|
294
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">default_connection</span> = <span class="ruby-keyword">nil</span>
|
|
295
|
+
<span class="ruby-keyword">end</span></pre>
|
|
296
|
+
</div>
|
|
297
|
+
</div>
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
</div>
|
|
301
|
+
|
|
302
|
+
<div id="method-c-make_client" class="method-detail ">
|
|
303
|
+
<div class="method-heading">
|
|
304
|
+
<span class="method-name">make_client</span><span
|
|
305
|
+
class="method-args">(url)</span>
|
|
306
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
<div class="method-description">
|
|
310
|
+
<p>Create an <a href="EasyPost.html"><code>EasyPost</code></a> Client.</p>
|
|
311
|
+
|
|
312
|
+
<p>@deprecated</p>
|
|
313
|
+
|
|
314
|
+
<div class="method-source-code" id="make_client-source">
|
|
315
|
+
<pre><span class="ruby-comment"># File lib/easypost.rb, line 120</span>
|
|
316
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">make_client</span>(<span class="ruby-identifier">url</span>)
|
|
317
|
+
<span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">Connection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">uri:</span> <span class="ruby-constant">URI</span>(<span class="ruby-identifier">url</span>), <span class="ruby-value">config:</span> <span class="ruby-identifier">http_config</span>).<span class="ruby-identifier">create</span>
|
|
318
|
+
<span class="ruby-keyword">end</span></pre>
|
|
319
|
+
</div>
|
|
320
|
+
</div>
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
</div>
|
|
324
|
+
|
|
325
|
+
<div id="method-c-make_request" class="method-detail ">
|
|
326
|
+
<div class="method-heading">
|
|
327
|
+
<span class="method-name">make_request</span><span
|
|
328
|
+
class="method-args">(method, path, api_key = nil, body = nil)</span>
|
|
329
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
330
|
+
</div>
|
|
331
|
+
|
|
332
|
+
<div class="method-description">
|
|
333
|
+
<p>Make an HTTP request against the {default_connection}</p>
|
|
334
|
+
|
|
335
|
+
<p>@param method [Symbol] the HTTP Verb (get, method, put, post, etc.) @param path [String] URI path of the resource @param requested_api_key [String] ({EasyPost.api_key}) key set Authorization header. @param body [Object] (nil) object to be dumped to JSON @raise [EasyPost::Error] if the response has a non-2xx status code @return [Hash] JSON object parsed from the response body</p>
|
|
336
|
+
|
|
337
|
+
<div class="method-source-code" id="make_request-source">
|
|
338
|
+
<pre><span class="ruby-comment"># File lib/easypost.rb, line 132</span>
|
|
339
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">make_request</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">api_key</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">body</span> = <span class="ruby-keyword">nil</span>)
|
|
340
|
+
<span class="ruby-identifier">default_connection</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">api_key</span> <span class="ruby-operator">||</span> <span class="ruby-constant">EasyPost</span>.<span class="ruby-identifier">api_key</span>, <span class="ruby-identifier">body</span>)
|
|
341
|
+
<span class="ruby-keyword">end</span></pre>
|
|
342
|
+
</div>
|
|
343
|
+
</div>
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
</div>
|
|
347
|
+
|
|
348
|
+
<div id="method-c-parse_response" class="method-detail ">
|
|
349
|
+
<div class="method-heading">
|
|
350
|
+
<span class="method-name">parse_response</span><span
|
|
351
|
+
class="method-args">(status:, body:, json:)</span>
|
|
352
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
353
|
+
</div>
|
|
354
|
+
|
|
355
|
+
<div class="method-description">
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
<div class="method-source-code" id="parse_response-source">
|
|
359
|
+
<pre><span class="ruby-comment"># File lib/easypost.rb, line 136</span>
|
|
360
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">parse_response</span>(<span class="ruby-value">status:</span>, <span class="ruby-value">body:</span>, <span class="ruby-value">json:</span>)
|
|
361
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">status</span> <span class="ruby-operator"><</span> <span class="ruby-value">200</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">>=</span> <span class="ruby-value">300</span>
|
|
362
|
+
<span class="ruby-identifier">error</span> = <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">body</span>)[<span class="ruby-string">'error'</span>]
|
|
363
|
+
|
|
364
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>.<span class="ruby-identifier">new</span>(
|
|
365
|
+
<span class="ruby-identifier">error</span>[<span class="ruby-string">'message'</span>],
|
|
366
|
+
<span class="ruby-identifier">status</span>,
|
|
367
|
+
<span class="ruby-identifier">error</span>[<span class="ruby-string">'code'</span>],
|
|
368
|
+
<span class="ruby-identifier">error</span>[<span class="ruby-string">'errors'</span>],
|
|
369
|
+
<span class="ruby-identifier">body</span>,
|
|
370
|
+
)
|
|
371
|
+
<span class="ruby-keyword">end</span>
|
|
372
|
+
|
|
373
|
+
<span class="ruby-identifier">json</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-identifier">body</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">body</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/\A\s+\z/</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">body</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">body</span>
|
|
374
|
+
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">ParserError</span>
|
|
375
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Invalid response object from API, unable to decode.\n#{body}"</span>
|
|
376
|
+
<span class="ruby-keyword">end</span></pre>
|
|
377
|
+
</div>
|
|
378
|
+
</div>
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
</div>
|
|
382
|
+
|
|
383
|
+
<div id="method-c-reset_http_config" class="method-detail ">
|
|
384
|
+
<div class="method-heading">
|
|
385
|
+
<span class="method-name">reset_http_config</span><span
|
|
386
|
+
class="method-args">()</span>
|
|
387
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
388
|
+
</div>
|
|
389
|
+
|
|
390
|
+
<div class="method-description">
|
|
391
|
+
<p>Reset the HTTP config.</p>
|
|
392
|
+
|
|
393
|
+
<div class="method-source-code" id="reset_http_config-source">
|
|
394
|
+
<pre><span class="ruby-comment"># File lib/easypost.rb, line 83</span>
|
|
395
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">reset_http_config</span>
|
|
396
|
+
<span class="ruby-identifier">http_config</span>.<span class="ruby-identifier">clear</span>
|
|
397
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">default_connection</span> = <span class="ruby-keyword">nil</span>
|
|
398
|
+
<span class="ruby-keyword">end</span></pre>
|
|
399
|
+
</div>
|
|
400
|
+
</div>
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
</div>
|
|
404
|
+
|
|
405
|
+
<div id="method-c-user_agent" class="method-detail ">
|
|
406
|
+
<div class="method-heading">
|
|
407
|
+
<span class="method-name">user_agent</span><span
|
|
408
|
+
class="method-args">()</span>
|
|
409
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
410
|
+
</div>
|
|
411
|
+
|
|
412
|
+
<div class="method-description">
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
<div class="method-source-code" id="user_agent-source">
|
|
416
|
+
<pre><span class="ruby-comment"># File lib/easypost.rb, line 57</span>
|
|
417
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">user_agent</span>
|
|
418
|
+
<span class="ruby-ivar">@user_agent</span> <span class="ruby-operator">||=</span>
|
|
419
|
+
<span class="ruby-node">"EasyPost/v2 RubyClient/#{EasyPost::VERSION} Ruby/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} "</span> \
|
|
420
|
+
<span class="ruby-node">"OS/#{EasyPost::Util.os_name} OSVersion/#{EasyPost::Util.os_version} "</span> \
|
|
421
|
+
<span class="ruby-node">"OSArch/#{EasyPost::Util.os_arch}"</span>
|
|
422
|
+
<span class="ruby-keyword">end</span></pre>
|
|
423
|
+
</div>
|
|
424
|
+
</div>
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
</div>
|
|
428
|
+
|
|
429
|
+
</section>
|
|
430
|
+
|
|
431
|
+
</section>
|
|
432
|
+
</main>
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
<footer id="validator-badges" role="contentinfo">
|
|
436
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
|
437
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
|
438
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
439
|
+
</footer>
|
|
440
|
+
|
data/docs/created.rid
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Tue, 01 Nov 2022 15:28:35 -0600
|
|
2
|
+
lib/easypost.rb Wed, 05 Oct 2022 13:35:10 -0600
|
|
3
|
+
lib/easypost/beta/referral.rb Tue, 04 Oct 2022 14:28:06 -0600
|
|
4
|
+
lib/easypost/beta/end_shipper.rb Fri, 30 Sep 2022 20:26:49 -0600
|
|
5
|
+
lib/easypost/pickup.rb Tue, 06 Sep 2022 11:02:09 -0600
|
|
6
|
+
lib/easypost/refund.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
7
|
+
lib/easypost/report.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
8
|
+
lib/easypost/customs_info.rb Tue, 06 Sep 2022 11:02:09 -0600
|
|
9
|
+
lib/easypost/brand.rb Tue, 27 Sep 2022 23:10:22 -0600
|
|
10
|
+
lib/easypost/parcel.rb Tue, 06 Sep 2022 11:02:09 -0600
|
|
11
|
+
lib/easypost/shipment.rb Wed, 21 Sep 2022 13:57:34 -0600
|
|
12
|
+
lib/easypost/referral.rb Tue, 04 Oct 2022 14:28:06 -0600
|
|
13
|
+
lib/easypost/customs_item.rb Tue, 06 Sep 2022 11:02:09 -0600
|
|
14
|
+
lib/easypost/carrier_type.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
15
|
+
lib/easypost/tracker.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
16
|
+
lib/easypost/carbon_offset.rb Mon, 01 Aug 2022 14:19:01 -0600
|
|
17
|
+
lib/easypost/connection.rb Tue, 04 Oct 2022 14:28:06 -0600
|
|
18
|
+
lib/easypost/api_key.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
19
|
+
lib/easypost/resource.rb Tue, 04 Oct 2022 14:28:06 -0600
|
|
20
|
+
lib/easypost/end_shipper.rb Tue, 06 Sep 2022 10:01:23 -0600
|
|
21
|
+
lib/easypost/postage_label.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
22
|
+
lib/easypost/rate.rb Tue, 06 Sep 2022 11:02:09 -0600
|
|
23
|
+
lib/easypost/beta.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
24
|
+
lib/easypost/util.rb Tue, 06 Sep 2022 10:01:23 -0600
|
|
25
|
+
lib/easypost/order.rb Tue, 06 Sep 2022 11:02:09 -0600
|
|
26
|
+
lib/easypost/insurance.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
27
|
+
lib/easypost/batch.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
28
|
+
lib/easypost/version.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
29
|
+
lib/easypost/billing.rb Tue, 04 Oct 2022 14:28:06 -0600
|
|
30
|
+
lib/easypost/error.rb Thu, 20 Oct 2022 16:14:01 -0600
|
|
31
|
+
lib/easypost/payment_method.rb Tue, 06 Sep 2022 11:02:09 -0600
|
|
32
|
+
lib/easypost/carrier_account.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
33
|
+
lib/easypost/object.rb Tue, 06 Sep 2022 10:01:23 -0600
|
|
34
|
+
lib/easypost/webhook.rb Fri, 29 Jul 2022 11:22:05 -0600
|
|
35
|
+
lib/easypost/pickup_rate.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
36
|
+
lib/easypost/address.rb Tue, 04 Oct 2022 14:28:06 -0600
|
|
37
|
+
lib/easypost/tax_identifier.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
38
|
+
lib/easypost/scan_form.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
39
|
+
lib/easypost/event.rb Tue, 05 Jul 2022 14:07:51 -0600
|
|
40
|
+
lib/easypost/user.rb Tue, 05 Jul 2022 14:07:51 -0600
|
data/docs/css/fonts.css
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
|
|
3
|
+
* with Reserved Font Name "Source". All Rights Reserved. Source is a
|
|
4
|
+
* trademark of Adobe Systems Incorporated in the United States and/or other
|
|
5
|
+
* countries.
|
|
6
|
+
*
|
|
7
|
+
* This Font Software is licensed under the SIL Open Font License, Version
|
|
8
|
+
* 1.1.
|
|
9
|
+
*
|
|
10
|
+
* This license is copied below, and is also available with a FAQ at:
|
|
11
|
+
* http://scripts.sil.org/OFL
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
@font-face {
|
|
15
|
+
font-family: "Source Code Pro";
|
|
16
|
+
font-style: normal;
|
|
17
|
+
font-weight: 400;
|
|
18
|
+
src: local("Source Code Pro"),
|
|
19
|
+
local("SourceCodePro-Regular"),
|
|
20
|
+
url("../fonts/SourceCodePro-Regular.ttf") format("truetype");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@font-face {
|
|
24
|
+
font-family: "Source Code Pro";
|
|
25
|
+
font-style: normal;
|
|
26
|
+
font-weight: 700;
|
|
27
|
+
src: local("Source Code Pro Bold"),
|
|
28
|
+
local("SourceCodePro-Bold"),
|
|
29
|
+
url("../fonts/SourceCodePro-Bold.ttf") format("truetype");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/*
|
|
33
|
+
* Copyright (c) 2010, Łukasz Dziedzic (dziedzic@typoland.com),
|
|
34
|
+
* with Reserved Font Name Lato.
|
|
35
|
+
*
|
|
36
|
+
* This Font Software is licensed under the SIL Open Font License, Version
|
|
37
|
+
* 1.1.
|
|
38
|
+
*
|
|
39
|
+
* This license is copied below, and is also available with a FAQ at:
|
|
40
|
+
* http://scripts.sil.org/OFL
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
@font-face {
|
|
44
|
+
font-family: "Lato";
|
|
45
|
+
font-style: normal;
|
|
46
|
+
font-weight: 300;
|
|
47
|
+
src: local("Lato Light"),
|
|
48
|
+
local("Lato-Light"),
|
|
49
|
+
url("../fonts/Lato-Light.ttf") format("truetype");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@font-face {
|
|
53
|
+
font-family: "Lato";
|
|
54
|
+
font-style: italic;
|
|
55
|
+
font-weight: 300;
|
|
56
|
+
src: local("Lato Light Italic"),
|
|
57
|
+
local("Lato-LightItalic"),
|
|
58
|
+
url("../fonts/Lato-LightItalic.ttf") format("truetype");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@font-face {
|
|
62
|
+
font-family: "Lato";
|
|
63
|
+
font-style: normal;
|
|
64
|
+
font-weight: 700;
|
|
65
|
+
src: local("Lato Regular"),
|
|
66
|
+
local("Lato-Regular"),
|
|
67
|
+
url("../fonts/Lato-Regular.ttf") format("truetype");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@font-face {
|
|
71
|
+
font-family: "Lato";
|
|
72
|
+
font-style: italic;
|
|
73
|
+
font-weight: 700;
|
|
74
|
+
src: local("Lato Italic"),
|
|
75
|
+
local("Lato-Italic"),
|
|
76
|
+
url("../fonts/Lato-RegularItalic.ttf") format("truetype");
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/*
|
|
80
|
+
* -----------------------------------------------------------
|
|
81
|
+
* SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
82
|
+
* -----------------------------------------------------------
|
|
83
|
+
*
|
|
84
|
+
* PREAMBLE
|
|
85
|
+
* The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
86
|
+
* development of collaborative font projects, to support the font creation
|
|
87
|
+
* efforts of academic and linguistic communities, and to provide a free and
|
|
88
|
+
* open framework in which fonts may be shared and improved in partnership
|
|
89
|
+
* with others.
|
|
90
|
+
*
|
|
91
|
+
* The OFL allows the licensed fonts to be used, studied, modified and
|
|
92
|
+
* redistributed freely as long as they are not sold by themselves. The
|
|
93
|
+
* fonts, including any derivative works, can be bundled, embedded,
|
|
94
|
+
* redistributed and/or sold with any software provided that any reserved
|
|
95
|
+
* names are not used by derivative works. The fonts and derivatives,
|
|
96
|
+
* however, cannot be released under any other type of license. The
|
|
97
|
+
* requirement for fonts to remain under this license does not apply
|
|
98
|
+
* to any document created using the fonts or their derivatives.
|
|
99
|
+
*
|
|
100
|
+
* DEFINITIONS
|
|
101
|
+
* "Font Software" refers to the set of files released by the Copyright
|
|
102
|
+
* Holder(s) under this license and clearly marked as such. This may
|
|
103
|
+
* include source files, build scripts and documentation.
|
|
104
|
+
*
|
|
105
|
+
* "Reserved Font Name" refers to any names specified as such after the
|
|
106
|
+
* copyright statement(s).
|
|
107
|
+
*
|
|
108
|
+
* "Original Version" refers to the collection of Font Software components as
|
|
109
|
+
* distributed by the Copyright Holder(s).
|
|
110
|
+
*
|
|
111
|
+
* "Modified Version" refers to any derivative made by adding to, deleting,
|
|
112
|
+
* or substituting -- in part or in whole -- any of the components of the
|
|
113
|
+
* Original Version, by changing formats or by porting the Font Software to a
|
|
114
|
+
* new environment.
|
|
115
|
+
*
|
|
116
|
+
* "Author" refers to any designer, engineer, programmer, technical
|
|
117
|
+
* writer or other person who contributed to the Font Software.
|
|
118
|
+
*
|
|
119
|
+
* PERMISSION & CONDITIONS
|
|
120
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
121
|
+
* a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
122
|
+
* redistribute, and sell modified and unmodified copies of the Font
|
|
123
|
+
* Software, subject to the following conditions:
|
|
124
|
+
*
|
|
125
|
+
* 1) Neither the Font Software nor any of its individual components,
|
|
126
|
+
* in Original or Modified Versions, may be sold by itself.
|
|
127
|
+
*
|
|
128
|
+
* 2) Original or Modified Versions of the Font Software may be bundled,
|
|
129
|
+
* redistributed and/or sold with any software, provided that each copy
|
|
130
|
+
* contains the above copyright notice and this license. These can be
|
|
131
|
+
* included either as stand-alone text files, human-readable headers or
|
|
132
|
+
* in the appropriate machine-readable metadata fields within text or
|
|
133
|
+
* binary files as long as those fields can be easily viewed by the user.
|
|
134
|
+
*
|
|
135
|
+
* 3) No Modified Version of the Font Software may use the Reserved Font
|
|
136
|
+
* Name(s) unless explicit written permission is granted by the corresponding
|
|
137
|
+
* Copyright Holder. This restriction only applies to the primary font name as
|
|
138
|
+
* presented to the users.
|
|
139
|
+
*
|
|
140
|
+
* 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
141
|
+
* Software shall not be used to promote, endorse or advertise any
|
|
142
|
+
* Modified Version, except to acknowledge the contribution(s) of the
|
|
143
|
+
* Copyright Holder(s) and the Author(s) or with their explicit written
|
|
144
|
+
* permission.
|
|
145
|
+
*
|
|
146
|
+
* 5) The Font Software, modified or unmodified, in part or in whole,
|
|
147
|
+
* must be distributed entirely under this license, and must not be
|
|
148
|
+
* distributed under any other license. The requirement for fonts to
|
|
149
|
+
* remain under this license does not apply to any document created
|
|
150
|
+
* using the Font Software.
|
|
151
|
+
*
|
|
152
|
+
* TERMINATION
|
|
153
|
+
* This license becomes null and void if any of the above conditions are
|
|
154
|
+
* not met.
|
|
155
|
+
*
|
|
156
|
+
* DISCLAIMER
|
|
157
|
+
* THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
158
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
159
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
160
|
+
* OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
161
|
+
* COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
162
|
+
* INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
163
|
+
* DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
164
|
+
* FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
165
|
+
* OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
166
|
+
*/
|
|
167
|
+
|