approveapi_swagger 1.0.1 → 1.0.2
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/Gemfile.lock +1 -1
- data/README.md +4 -4
- data/doc/ApproveAPISwagger/AnswerMetadata.html +789 -0
- data/doc/ApproveAPISwagger/ApiClient.html +1032 -0
- data/doc/ApproveAPISwagger/ApiError.html +224 -0
- data/doc/ApproveAPISwagger/ApproveApi.html +501 -0
- data/doc/ApproveAPISwagger/Configuration.html +941 -0
- data/doc/ApproveAPISwagger/CreatePromptRequest.html +879 -0
- data/doc/ApproveAPISwagger/Error.html +754 -0
- data/doc/ApproveAPISwagger/Prompt.html +819 -0
- data/doc/ApproveAPISwagger/PromptAnswer.html +799 -0
- data/doc/ApproveAPISwagger/PromptMetadata.html +829 -0
- data/doc/ApproveAPISwagger/PromptStatus.html +754 -0
- data/doc/ApproveAPISwagger.html +185 -0
- data/doc/Gemfile.html +120 -0
- data/doc/Gemfile_lock.html +194 -0
- data/doc/README_md.html +225 -0
- data/doc/Rakefile.html +125 -0
- data/doc/approveapi_swagger_gemspec.html +161 -0
- data/doc/created.rid +39 -0
- data/doc/css/fonts.css +167 -0
- data/doc/css/rdoc.css +590 -0
- data/doc/docs/AnswerMetadata_md.html +123 -0
- data/doc/docs/ApproveApi_md.html +293 -0
- data/doc/docs/CreatePromptRequest_md.html +123 -0
- data/doc/docs/Error_md.html +123 -0
- data/doc/docs/PromptAnswer_md.html +123 -0
- data/doc/docs/PromptMetadata_md.html +123 -0
- data/doc/docs/PromptStatus_md.html +123 -0
- data/doc/docs/Prompt_md.html +123 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/git_push_sh.html +157 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +141 -0
- data/doc/js/darkfish.js +161 -0
- data/doc/js/jquery.js +4 -0
- data/doc/js/navigation.js +141 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +109 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +229 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +1036 -0
- data/docs/AnswerMetadata.md +1 -1
- data/docs/CreatePromptRequest.md +3 -3
- data/docs/Prompt.md +3 -3
- data/docs/PromptAnswer.md +1 -1
- data/docs/PromptMetadata.md +2 -2
- data/docs/PromptStatus.md +1 -0
- data/lib/approveapi_swagger/api/approve_api.rb +1 -0
- data/lib/approveapi_swagger/models/answer_metadata.rb +15 -13
- data/lib/approveapi_swagger/models/create_prompt_request.rb +35 -33
- data/lib/approveapi_swagger/models/error.rb +2 -0
- data/lib/approveapi_swagger/models/prompt.rb +33 -26
- data/lib/approveapi_swagger/models/prompt_answer.rb +18 -16
- data/lib/approveapi_swagger/models/prompt_metadata.rb +26 -24
- data/lib/approveapi_swagger/models/prompt_status.rb +21 -4
- data/lib/approveapi_swagger/version.rb +1 -1
- data/pkg/approveapi_swagger-1.0.2.gem +0 -0
- metadata +78 -7
- data/pkg/approveapi_swagger-1.0.1.gem +0 -0
|
@@ -0,0 +1,941 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>class ApproveAPISwagger::Configuration - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "../";
|
|
11
|
+
var index_rel_prefix = "../";
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script src="../js/jquery.js"></script>
|
|
15
|
+
<script src="../js/darkfish.js"></script>
|
|
16
|
+
|
|
17
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
|
18
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<body id="top" role="document" class="class">
|
|
24
|
+
<nav role="navigation">
|
|
25
|
+
<div id="project-navigation">
|
|
26
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
27
|
+
<h2>
|
|
28
|
+
<a href="../index.html" rel="home">Home</a>
|
|
29
|
+
</h2>
|
|
30
|
+
|
|
31
|
+
<div id="table-of-contents-navigation">
|
|
32
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
|
33
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
|
34
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
39
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
40
|
+
<div id="search-field-wrapper">
|
|
41
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
42
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
43
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
44
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<ul id="search-results" aria-label="Search Results"
|
|
48
|
+
aria-busy="false" aria-expanded="false"
|
|
49
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
50
|
+
</form>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
<div id="class-metadata">
|
|
58
|
+
|
|
59
|
+
<div id="parent-class-section" class="nav-section">
|
|
60
|
+
<h3>Parent</h3>
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
<p class="link">Object
|
|
64
|
+
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
<!-- Method Quickref -->
|
|
70
|
+
<div id="method-list-section" class="nav-section">
|
|
71
|
+
<h3>Methods</h3>
|
|
72
|
+
|
|
73
|
+
<ul class="link-list" role="directory">
|
|
74
|
+
|
|
75
|
+
<li ><a href="#method-c-default">::default</a>
|
|
76
|
+
|
|
77
|
+
<li ><a href="#method-c-new">::new</a>
|
|
78
|
+
|
|
79
|
+
<li ><a href="#method-i-api_key_with_prefix">#api_key_with_prefix</a>
|
|
80
|
+
|
|
81
|
+
<li ><a href="#method-i-auth_settings">#auth_settings</a>
|
|
82
|
+
|
|
83
|
+
<li ><a href="#method-i-base_path-3D">#base_path=</a>
|
|
84
|
+
|
|
85
|
+
<li ><a href="#method-i-base_url">#base_url</a>
|
|
86
|
+
|
|
87
|
+
<li ><a href="#method-i-basic_auth_token">#basic_auth_token</a>
|
|
88
|
+
|
|
89
|
+
<li ><a href="#method-i-configure">#configure</a>
|
|
90
|
+
|
|
91
|
+
<li ><a href="#method-i-host-3D">#host=</a>
|
|
92
|
+
|
|
93
|
+
<li ><a href="#method-i-scheme-3D">#scheme=</a>
|
|
94
|
+
|
|
95
|
+
<li ><a href="#method-i-server_settings">#server_settings</a>
|
|
96
|
+
|
|
97
|
+
<li ><a href="#method-i-server_url">#server_url</a>
|
|
98
|
+
|
|
99
|
+
</ul>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
</div>
|
|
103
|
+
</nav>
|
|
104
|
+
|
|
105
|
+
<main role="main" aria-labelledby="class-ApproveAPISwagger::Configuration">
|
|
106
|
+
<h1 id="class-ApproveAPISwagger::Configuration" class="class">
|
|
107
|
+
class ApproveAPISwagger::Configuration
|
|
108
|
+
</h1>
|
|
109
|
+
|
|
110
|
+
<section class="description">
|
|
111
|
+
|
|
112
|
+
</section>
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
<section class="attribute-method-details" class="method-section">
|
|
124
|
+
<header>
|
|
125
|
+
<h3>Attributes</h3>
|
|
126
|
+
</header>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
<div id="attribute-i-access_token" class="method-detail">
|
|
130
|
+
<div class="method-heading attribute-method-heading">
|
|
131
|
+
<span class="method-name">access_token</span><span
|
|
132
|
+
class="attribute-access-type">[RW]</span>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<div class="method-description">
|
|
136
|
+
|
|
137
|
+
<p>Defines the access token (Bearer) used with OAuth2.</p>
|
|
138
|
+
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
<div id="attribute-i-api_key" class="method-detail">
|
|
143
|
+
<div class="method-heading attribute-method-heading">
|
|
144
|
+
<span class="method-name">api_key</span><span
|
|
145
|
+
class="attribute-access-type">[RW]</span>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div class="method-description">
|
|
149
|
+
|
|
150
|
+
<p>Defines API keys used with API Key authentications.</p>
|
|
151
|
+
|
|
152
|
+
<p>@return [Hash] key: parameter name, value: parameter value (API key)</p>
|
|
153
|
+
|
|
154
|
+
<p>@example parameter name is “api_key”, API key is “xxx” (e.g. “api_key=xxx” in query string)</p>
|
|
155
|
+
|
|
156
|
+
<pre class="ruby"><span class="ruby-identifier">config</span>.<span class="ruby-identifier">api_key</span>[<span class="ruby-string">'api_key'</span>] = <span class="ruby-string">'xxx'</span>
|
|
157
|
+
</pre>
|
|
158
|
+
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<div id="attribute-i-api_key_prefix" class="method-detail">
|
|
163
|
+
<div class="method-heading attribute-method-heading">
|
|
164
|
+
<span class="method-name">api_key_prefix</span><span
|
|
165
|
+
class="attribute-access-type">[RW]</span>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<div class="method-description">
|
|
169
|
+
|
|
170
|
+
<p>Defines API key prefixes used with API Key authentications.</p>
|
|
171
|
+
|
|
172
|
+
<p>@return [Hash] key: parameter name, value: API key prefix</p>
|
|
173
|
+
|
|
174
|
+
<p>@example parameter name is “Authorization”, API key prefix is “Token” (e.g. “Authorization: Token xxx” in headers)</p>
|
|
175
|
+
|
|
176
|
+
<pre class="ruby"><span class="ruby-identifier">config</span>.<span class="ruby-identifier">api_key_prefix</span>[<span class="ruby-string">'api_key'</span>] = <span class="ruby-string">'Token'</span>
|
|
177
|
+
</pre>
|
|
178
|
+
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<div id="attribute-i-base_path" class="method-detail">
|
|
183
|
+
<div class="method-heading attribute-method-heading">
|
|
184
|
+
<span class="method-name">base_path</span><span
|
|
185
|
+
class="attribute-access-type">[RW]</span>
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
<div class="method-description">
|
|
189
|
+
|
|
190
|
+
<p>Defines url base path</p>
|
|
191
|
+
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
<div id="attribute-i-cert_file" class="method-detail">
|
|
196
|
+
<div class="method-heading attribute-method-heading">
|
|
197
|
+
<span class="method-name">cert_file</span><span
|
|
198
|
+
class="attribute-access-type">[RW]</span>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<div class="method-description">
|
|
202
|
+
|
|
203
|
+
<pre>TLS/SSL setting</pre>
|
|
204
|
+
|
|
205
|
+
<p>Client certificate file (for client certificate)</p>
|
|
206
|
+
|
|
207
|
+
</div>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<div id="attribute-i-client_side_validation" class="method-detail">
|
|
211
|
+
<div class="method-heading attribute-method-heading">
|
|
212
|
+
<span class="method-name">client_side_validation</span><span
|
|
213
|
+
class="attribute-access-type">[RW]</span>
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
<div class="method-description">
|
|
217
|
+
|
|
218
|
+
<p>Set this to false to skip client side validation in the operation. Default to true. @return [true, false]</p>
|
|
219
|
+
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
|
|
223
|
+
<div id="attribute-i-debugging" class="method-detail">
|
|
224
|
+
<div class="method-heading attribute-method-heading">
|
|
225
|
+
<span class="method-name">debugging</span><span
|
|
226
|
+
class="attribute-access-type">[RW]</span>
|
|
227
|
+
</div>
|
|
228
|
+
|
|
229
|
+
<div class="method-description">
|
|
230
|
+
|
|
231
|
+
<p>Set this to enable/disable debugging. When enabled (set to true), HTTP request/response details will be logged with `logger.debug` (see the `logger` attribute). Default to false.</p>
|
|
232
|
+
|
|
233
|
+
<p>@return [true, false]</p>
|
|
234
|
+
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
|
|
238
|
+
<div id="attribute-i-force_ending_format" class="method-detail">
|
|
239
|
+
<div class="method-heading attribute-method-heading">
|
|
240
|
+
<span class="method-name">force_ending_format</span><span
|
|
241
|
+
class="attribute-access-type">[RW]</span>
|
|
242
|
+
</div>
|
|
243
|
+
|
|
244
|
+
<div class="method-description">
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
<div id="attribute-i-host" class="method-detail">
|
|
252
|
+
<div class="method-heading attribute-method-heading">
|
|
253
|
+
<span class="method-name">host</span><span
|
|
254
|
+
class="attribute-access-type">[RW]</span>
|
|
255
|
+
</div>
|
|
256
|
+
|
|
257
|
+
<div class="method-description">
|
|
258
|
+
|
|
259
|
+
<p>Defines url host</p>
|
|
260
|
+
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
|
|
264
|
+
<div id="attribute-i-inject_format" class="method-detail">
|
|
265
|
+
<div class="method-heading attribute-method-heading">
|
|
266
|
+
<span class="method-name">inject_format</span><span
|
|
267
|
+
class="attribute-access-type">[RW]</span>
|
|
268
|
+
</div>
|
|
269
|
+
|
|
270
|
+
<div class="method-description">
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
</div>
|
|
275
|
+
</div>
|
|
276
|
+
|
|
277
|
+
<div id="attribute-i-key_file" class="method-detail">
|
|
278
|
+
<div class="method-heading attribute-method-heading">
|
|
279
|
+
<span class="method-name">key_file</span><span
|
|
280
|
+
class="attribute-access-type">[RW]</span>
|
|
281
|
+
</div>
|
|
282
|
+
|
|
283
|
+
<div class="method-description">
|
|
284
|
+
|
|
285
|
+
<pre>TLS/SSL setting</pre>
|
|
286
|
+
|
|
287
|
+
<p>Client private key file (for client certificate)</p>
|
|
288
|
+
|
|
289
|
+
</div>
|
|
290
|
+
</div>
|
|
291
|
+
|
|
292
|
+
<div id="attribute-i-logger" class="method-detail">
|
|
293
|
+
<div class="method-heading attribute-method-heading">
|
|
294
|
+
<span class="method-name">logger</span><span
|
|
295
|
+
class="attribute-access-type">[RW]</span>
|
|
296
|
+
</div>
|
|
297
|
+
|
|
298
|
+
<div class="method-description">
|
|
299
|
+
|
|
300
|
+
<p>Defines the logger used for debugging. Default to `Rails.logger` (when in Rails) or logging to STDOUT.</p>
|
|
301
|
+
|
|
302
|
+
<p>@return [#debug]</p>
|
|
303
|
+
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
|
|
307
|
+
<div id="attribute-i-params_encoding" class="method-detail">
|
|
308
|
+
<div class="method-heading attribute-method-heading">
|
|
309
|
+
<span class="method-name">params_encoding</span><span
|
|
310
|
+
class="attribute-access-type">[RW]</span>
|
|
311
|
+
</div>
|
|
312
|
+
|
|
313
|
+
<div class="method-description">
|
|
314
|
+
|
|
315
|
+
<p>Set this to customize parameters encoding of array parameter with multi collectionFormat. Default to nil.</p>
|
|
316
|
+
|
|
317
|
+
<p>@see The <a href="Configuration.html#attribute-i-params_encoding"><code>params_encoding</code></a> option of Ethon. Related source code: <a href="https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96">github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96</a></p>
|
|
318
|
+
|
|
319
|
+
</div>
|
|
320
|
+
</div>
|
|
321
|
+
|
|
322
|
+
<div id="attribute-i-password" class="method-detail">
|
|
323
|
+
<div class="method-heading attribute-method-heading">
|
|
324
|
+
<span class="method-name">password</span><span
|
|
325
|
+
class="attribute-access-type">[RW]</span>
|
|
326
|
+
</div>
|
|
327
|
+
|
|
328
|
+
<div class="method-description">
|
|
329
|
+
|
|
330
|
+
<p>Defines the password used with HTTP basic authentication.</p>
|
|
331
|
+
|
|
332
|
+
<p>@return [String]</p>
|
|
333
|
+
|
|
334
|
+
</div>
|
|
335
|
+
</div>
|
|
336
|
+
|
|
337
|
+
<div id="attribute-i-scheme" class="method-detail">
|
|
338
|
+
<div class="method-heading attribute-method-heading">
|
|
339
|
+
<span class="method-name">scheme</span><span
|
|
340
|
+
class="attribute-access-type">[RW]</span>
|
|
341
|
+
</div>
|
|
342
|
+
|
|
343
|
+
<div class="method-description">
|
|
344
|
+
|
|
345
|
+
<p>Defines url scheme</p>
|
|
346
|
+
|
|
347
|
+
</div>
|
|
348
|
+
</div>
|
|
349
|
+
|
|
350
|
+
<div id="attribute-i-ssl_ca_cert" class="method-detail">
|
|
351
|
+
<div class="method-heading attribute-method-heading">
|
|
352
|
+
<span class="method-name">ssl_ca_cert</span><span
|
|
353
|
+
class="attribute-access-type">[RW]</span>
|
|
354
|
+
</div>
|
|
355
|
+
|
|
356
|
+
<div class="method-description">
|
|
357
|
+
|
|
358
|
+
<pre>TLS/SSL setting</pre>
|
|
359
|
+
|
|
360
|
+
<p>Set this to customize the certificate file to verify the peer.</p>
|
|
361
|
+
|
|
362
|
+
<p>@return [String] the path to the certificate file</p>
|
|
363
|
+
|
|
364
|
+
<p>@see The `cainfo` option of Typhoeus, `–cert` option of libcurl. Related source code: <a href="https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145">github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145</a></p>
|
|
365
|
+
|
|
366
|
+
</div>
|
|
367
|
+
</div>
|
|
368
|
+
|
|
369
|
+
<div id="attribute-i-temp_folder_path" class="method-detail">
|
|
370
|
+
<div class="method-heading attribute-method-heading">
|
|
371
|
+
<span class="method-name">temp_folder_path</span><span
|
|
372
|
+
class="attribute-access-type">[RW]</span>
|
|
373
|
+
</div>
|
|
374
|
+
|
|
375
|
+
<div class="method-description">
|
|
376
|
+
|
|
377
|
+
<p>Defines the temporary folder to store downloaded files (for API endpoints that have file response). Default to use `Tempfile`.</p>
|
|
378
|
+
|
|
379
|
+
<p>@return [String]</p>
|
|
380
|
+
|
|
381
|
+
</div>
|
|
382
|
+
</div>
|
|
383
|
+
|
|
384
|
+
<div id="attribute-i-timeout" class="method-detail">
|
|
385
|
+
<div class="method-heading attribute-method-heading">
|
|
386
|
+
<span class="method-name">timeout</span><span
|
|
387
|
+
class="attribute-access-type">[RW]</span>
|
|
388
|
+
</div>
|
|
389
|
+
|
|
390
|
+
<div class="method-description">
|
|
391
|
+
|
|
392
|
+
<p>The time limit for HTTP request in seconds. Default to 0 (never times out).</p>
|
|
393
|
+
|
|
394
|
+
</div>
|
|
395
|
+
</div>
|
|
396
|
+
|
|
397
|
+
<div id="attribute-i-username" class="method-detail">
|
|
398
|
+
<div class="method-heading attribute-method-heading">
|
|
399
|
+
<span class="method-name">username</span><span
|
|
400
|
+
class="attribute-access-type">[RW]</span>
|
|
401
|
+
</div>
|
|
402
|
+
|
|
403
|
+
<div class="method-description">
|
|
404
|
+
|
|
405
|
+
<p>Defines the username used with HTTP basic authentication.</p>
|
|
406
|
+
|
|
407
|
+
<p>@return [String]</p>
|
|
408
|
+
|
|
409
|
+
</div>
|
|
410
|
+
</div>
|
|
411
|
+
|
|
412
|
+
<div id="attribute-i-verify_ssl" class="method-detail">
|
|
413
|
+
<div class="method-heading attribute-method-heading">
|
|
414
|
+
<span class="method-name">verify_ssl</span><span
|
|
415
|
+
class="attribute-access-type">[RW]</span>
|
|
416
|
+
</div>
|
|
417
|
+
|
|
418
|
+
<div class="method-description">
|
|
419
|
+
|
|
420
|
+
<pre>TLS/SSL setting</pre>
|
|
421
|
+
|
|
422
|
+
<p>Set this to false to skip verifying SSL certificate when calling API from https server. Default to true.</p>
|
|
423
|
+
|
|
424
|
+
<p>@note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.</p>
|
|
425
|
+
|
|
426
|
+
<p>@return [true, false]</p>
|
|
427
|
+
|
|
428
|
+
</div>
|
|
429
|
+
</div>
|
|
430
|
+
|
|
431
|
+
<div id="attribute-i-verify_ssl_host" class="method-detail">
|
|
432
|
+
<div class="method-heading attribute-method-heading">
|
|
433
|
+
<span class="method-name">verify_ssl_host</span><span
|
|
434
|
+
class="attribute-access-type">[RW]</span>
|
|
435
|
+
</div>
|
|
436
|
+
|
|
437
|
+
<div class="method-description">
|
|
438
|
+
|
|
439
|
+
<pre>TLS/SSL setting</pre>
|
|
440
|
+
|
|
441
|
+
<p>Set this to false to skip verifying SSL host name Default to true.</p>
|
|
442
|
+
|
|
443
|
+
<p>@note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.</p>
|
|
444
|
+
|
|
445
|
+
<p>@return [true, false]</p>
|
|
446
|
+
|
|
447
|
+
</div>
|
|
448
|
+
</div>
|
|
449
|
+
|
|
450
|
+
</section>
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
|
455
|
+
<header>
|
|
456
|
+
<h3>Public Class Methods</h3>
|
|
457
|
+
</header>
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
<div id="method-c-default" class="method-detail ">
|
|
461
|
+
|
|
462
|
+
<div class="method-heading">
|
|
463
|
+
<span class="method-name">default</span><span
|
|
464
|
+
class="method-args">()</span>
|
|
465
|
+
|
|
466
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
467
|
+
|
|
468
|
+
</div>
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
<div class="method-description">
|
|
472
|
+
|
|
473
|
+
<p>The default <a href="Configuration.html"><code>Configuration</code></a> object.</p>
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
<div class="method-source-code" id="default-source">
|
|
479
|
+
<pre><span class="ruby-comment"># File lib/approveapi_swagger/configuration.rb, line 152</span>
|
|
480
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">default</span>
|
|
481
|
+
<span class="ruby-identifier">@@default</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Configuration</span>.<span class="ruby-identifier">new</span>
|
|
482
|
+
<span class="ruby-keyword">end</span></pre>
|
|
483
|
+
</div>
|
|
484
|
+
|
|
485
|
+
</div>
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
</div>
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
<div id="method-c-new" class="method-detail ">
|
|
494
|
+
|
|
495
|
+
<div class="method-heading">
|
|
496
|
+
<span class="method-name">new</span><span
|
|
497
|
+
class="method-args">() { |self| ... }</span>
|
|
498
|
+
|
|
499
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
500
|
+
|
|
501
|
+
</div>
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
<div class="method-description">
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
<div class="method-source-code" id="new-source">
|
|
512
|
+
<pre><span class="ruby-comment"># File lib/approveapi_swagger/configuration.rb, line 130</span>
|
|
513
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>
|
|
514
|
+
<span class="ruby-ivar">@scheme</span> = <span class="ruby-string">'https'</span>
|
|
515
|
+
<span class="ruby-ivar">@host</span> = <span class="ruby-string">'approve.sh'</span>
|
|
516
|
+
<span class="ruby-ivar">@base_path</span> = <span class="ruby-string">''</span>
|
|
517
|
+
<span class="ruby-ivar">@api_key</span> = {}
|
|
518
|
+
<span class="ruby-ivar">@api_key_prefix</span> = {}
|
|
519
|
+
<span class="ruby-ivar">@timeout</span> = <span class="ruby-value">0</span>
|
|
520
|
+
<span class="ruby-ivar">@client_side_validation</span> = <span class="ruby-keyword">true</span>
|
|
521
|
+
<span class="ruby-ivar">@verify_ssl</span> = <span class="ruby-keyword">true</span>
|
|
522
|
+
<span class="ruby-ivar">@verify_ssl_host</span> = <span class="ruby-keyword">true</span>
|
|
523
|
+
<span class="ruby-ivar">@params_encoding</span> = <span class="ruby-keyword">nil</span>
|
|
524
|
+
<span class="ruby-ivar">@cert_file</span> = <span class="ruby-keyword">nil</span>
|
|
525
|
+
<span class="ruby-ivar">@key_file</span> = <span class="ruby-keyword">nil</span>
|
|
526
|
+
<span class="ruby-ivar">@debugging</span> = <span class="ruby-keyword">false</span>
|
|
527
|
+
<span class="ruby-ivar">@inject_format</span> = <span class="ruby-keyword">false</span>
|
|
528
|
+
<span class="ruby-ivar">@force_ending_format</span> = <span class="ruby-keyword">false</span>
|
|
529
|
+
<span class="ruby-ivar">@logger</span> = <span class="ruby-keyword">defined?</span>(<span class="ruby-constant">Rails</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">logger</span> <span class="ruby-operator">:</span> <span class="ruby-constant">Logger</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">STDOUT</span>)
|
|
530
|
+
|
|
531
|
+
<span class="ruby-keyword">yield</span>(<span class="ruby-keyword">self</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
|
|
532
|
+
<span class="ruby-keyword">end</span></pre>
|
|
533
|
+
</div>
|
|
534
|
+
|
|
535
|
+
</div>
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
</div>
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
</section>
|
|
544
|
+
|
|
545
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
546
|
+
<header>
|
|
547
|
+
<h3>Public Instance Methods</h3>
|
|
548
|
+
</header>
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
<div id="method-i-api_key_with_prefix" class="method-detail ">
|
|
552
|
+
|
|
553
|
+
<div class="method-heading">
|
|
554
|
+
<span class="method-name">api_key_with_prefix</span><span
|
|
555
|
+
class="method-args">(param_name)</span>
|
|
556
|
+
|
|
557
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
558
|
+
|
|
559
|
+
</div>
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
<div class="method-description">
|
|
563
|
+
|
|
564
|
+
<p>Gets API key (with prefix if set). @param [String] param_name the parameter name of API key auth</p>
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
<div class="method-source-code" id="api_key_with_prefix-source">
|
|
570
|
+
<pre><span class="ruby-comment"># File lib/approveapi_swagger/configuration.rb, line 183</span>
|
|
571
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">api_key_with_prefix</span>(<span class="ruby-identifier">param_name</span>)
|
|
572
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@api_key_prefix</span>[<span class="ruby-identifier">param_name</span>]
|
|
573
|
+
<span class="ruby-node">"#{@api_key_prefix[param_name]} #{@api_key[param_name]}"</span>
|
|
574
|
+
<span class="ruby-keyword">else</span>
|
|
575
|
+
<span class="ruby-ivar">@api_key</span>[<span class="ruby-identifier">param_name</span>]
|
|
576
|
+
<span class="ruby-keyword">end</span>
|
|
577
|
+
<span class="ruby-keyword">end</span></pre>
|
|
578
|
+
</div>
|
|
579
|
+
|
|
580
|
+
</div>
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
</div>
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
<div id="method-i-auth_settings" class="method-detail ">
|
|
589
|
+
|
|
590
|
+
<div class="method-heading">
|
|
591
|
+
<span class="method-name">auth_settings</span><span
|
|
592
|
+
class="method-args">()</span>
|
|
593
|
+
|
|
594
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
595
|
+
|
|
596
|
+
</div>
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
<div class="method-description">
|
|
600
|
+
|
|
601
|
+
<p>Returns Auth Settings hash for api client.</p>
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
<div class="method-source-code" id="auth_settings-source">
|
|
607
|
+
<pre><span class="ruby-comment"># File lib/approveapi_swagger/configuration.rb, line 197</span>
|
|
608
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">auth_settings</span>
|
|
609
|
+
{
|
|
610
|
+
<span class="ruby-string">'apiKey'</span> <span class="ruby-operator">=></span>
|
|
611
|
+
{
|
|
612
|
+
<span class="ruby-value">type:</span> <span class="ruby-string">'basic'</span>,
|
|
613
|
+
<span class="ruby-value">in:</span> <span class="ruby-string">'header'</span>,
|
|
614
|
+
<span class="ruby-value">key:</span> <span class="ruby-string">'Authorization'</span>,
|
|
615
|
+
<span class="ruby-value">value:</span> <span class="ruby-identifier">basic_auth_token</span>
|
|
616
|
+
},
|
|
617
|
+
}
|
|
618
|
+
<span class="ruby-keyword">end</span></pre>
|
|
619
|
+
</div>
|
|
620
|
+
|
|
621
|
+
</div>
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
</div>
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
<div id="method-i-base_path-3D" class="method-detail ">
|
|
630
|
+
|
|
631
|
+
<div class="method-heading">
|
|
632
|
+
<span class="method-name">base_path=</span><span
|
|
633
|
+
class="method-args">(base_path)</span>
|
|
634
|
+
|
|
635
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
636
|
+
|
|
637
|
+
</div>
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
<div class="method-description">
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
<div class="method-source-code" id="base_path-3D-source">
|
|
648
|
+
<pre><span class="ruby-comment"># File lib/approveapi_swagger/configuration.rb, line 170</span>
|
|
649
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">base_path=</span>(<span class="ruby-identifier">base_path</span>)
|
|
650
|
+
<span class="ruby-comment"># Add leading and trailing slashes to base_path</span>
|
|
651
|
+
<span class="ruby-ivar">@base_path</span> = <span class="ruby-node">"/#{base_path}"</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/\/+/</span>, <span class="ruby-string">'/'</span>)
|
|
652
|
+
<span class="ruby-ivar">@base_path</span> = <span class="ruby-string">''</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@base_path</span> <span class="ruby-operator">==</span> <span class="ruby-string">'/'</span>
|
|
653
|
+
<span class="ruby-keyword">end</span></pre>
|
|
654
|
+
</div>
|
|
655
|
+
|
|
656
|
+
</div>
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
</div>
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
<div id="method-i-base_url" class="method-detail ">
|
|
665
|
+
|
|
666
|
+
<div class="method-heading">
|
|
667
|
+
<span class="method-name">base_url</span><span
|
|
668
|
+
class="method-args">()</span>
|
|
669
|
+
|
|
670
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
671
|
+
|
|
672
|
+
</div>
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
<div class="method-description">
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
<div class="method-source-code" id="base_url-source">
|
|
683
|
+
<pre><span class="ruby-comment"># File lib/approveapi_swagger/configuration.rb, line 176</span>
|
|
684
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">base_url</span>
|
|
685
|
+
<span class="ruby-identifier">url</span> = <span class="ruby-node">"#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}"</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/\/+\z/</span>, <span class="ruby-string">''</span>)
|
|
686
|
+
<span class="ruby-constant">URI</span>.<span class="ruby-identifier">encode</span>(<span class="ruby-identifier">url</span>)
|
|
687
|
+
<span class="ruby-keyword">end</span></pre>
|
|
688
|
+
</div>
|
|
689
|
+
|
|
690
|
+
</div>
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
</div>
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
<div id="method-i-basic_auth_token" class="method-detail ">
|
|
699
|
+
|
|
700
|
+
<div class="method-heading">
|
|
701
|
+
<span class="method-name">basic_auth_token</span><span
|
|
702
|
+
class="method-args">()</span>
|
|
703
|
+
|
|
704
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
705
|
+
|
|
706
|
+
</div>
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
<div class="method-description">
|
|
710
|
+
|
|
711
|
+
<p>Gets Basic Auth token string</p>
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
<div class="method-source-code" id="basic_auth_token-source">
|
|
717
|
+
<pre><span class="ruby-comment"># File lib/approveapi_swagger/configuration.rb, line 192</span>
|
|
718
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">basic_auth_token</span>
|
|
719
|
+
<span class="ruby-string">'Basic '</span> <span class="ruby-operator">+</span> [<span class="ruby-node">"#{username}:#{password}"</span>].<span class="ruby-identifier">pack</span>(<span class="ruby-string">'m'</span>).<span class="ruby-identifier">delete</span>(<span class="ruby-string">"\r\n"</span>)
|
|
720
|
+
<span class="ruby-keyword">end</span></pre>
|
|
721
|
+
</div>
|
|
722
|
+
|
|
723
|
+
</div>
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
</div>
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
<div id="method-i-configure" class="method-detail ">
|
|
732
|
+
|
|
733
|
+
<div class="method-heading">
|
|
734
|
+
<span class="method-name">configure</span><span
|
|
735
|
+
class="method-args">() { |self| ... }</span>
|
|
736
|
+
|
|
737
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
738
|
+
|
|
739
|
+
</div>
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
<div class="method-description">
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
<div class="method-source-code" id="configure-source">
|
|
750
|
+
<pre><span class="ruby-comment"># File lib/approveapi_swagger/configuration.rb, line 156</span>
|
|
751
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">configure</span>
|
|
752
|
+
<span class="ruby-keyword">yield</span>(<span class="ruby-keyword">self</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
|
|
753
|
+
<span class="ruby-keyword">end</span></pre>
|
|
754
|
+
</div>
|
|
755
|
+
|
|
756
|
+
</div>
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
|
|
761
|
+
</div>
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
<div id="method-i-host-3D" class="method-detail ">
|
|
765
|
+
|
|
766
|
+
<div class="method-heading">
|
|
767
|
+
<span class="method-name">host=</span><span
|
|
768
|
+
class="method-args">(host)</span>
|
|
769
|
+
|
|
770
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
771
|
+
|
|
772
|
+
</div>
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
<div class="method-description">
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
<div class="method-source-code" id="host-3D-source">
|
|
783
|
+
<pre><span class="ruby-comment"># File lib/approveapi_swagger/configuration.rb, line 165</span>
|
|
784
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">host=</span>(<span class="ruby-identifier">host</span>)
|
|
785
|
+
<span class="ruby-comment"># remove http(s):// and anything after a slash</span>
|
|
786
|
+
<span class="ruby-ivar">@host</span> = <span class="ruby-identifier">host</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/https?:\/\//</span>, <span class="ruby-string">''</span>).<span class="ruby-identifier">split</span>(<span class="ruby-string">'/'</span>).<span class="ruby-identifier">first</span>
|
|
787
|
+
<span class="ruby-keyword">end</span></pre>
|
|
788
|
+
</div>
|
|
789
|
+
|
|
790
|
+
</div>
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
</div>
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
<div id="method-i-scheme-3D" class="method-detail ">
|
|
799
|
+
|
|
800
|
+
<div class="method-heading">
|
|
801
|
+
<span class="method-name">scheme=</span><span
|
|
802
|
+
class="method-args">(scheme)</span>
|
|
803
|
+
|
|
804
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
805
|
+
|
|
806
|
+
</div>
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
<div class="method-description">
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
<div class="method-source-code" id="scheme-3D-source">
|
|
817
|
+
<pre><span class="ruby-comment"># File lib/approveapi_swagger/configuration.rb, line 160</span>
|
|
818
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">scheme=</span>(<span class="ruby-identifier">scheme</span>)
|
|
819
|
+
<span class="ruby-comment"># remove :// from scheme</span>
|
|
820
|
+
<span class="ruby-ivar">@scheme</span> = <span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/:\/\//</span>, <span class="ruby-string">''</span>)
|
|
821
|
+
<span class="ruby-keyword">end</span></pre>
|
|
822
|
+
</div>
|
|
823
|
+
|
|
824
|
+
</div>
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
</div>
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
<div id="method-i-server_settings" class="method-detail ">
|
|
833
|
+
|
|
834
|
+
<div class="method-heading">
|
|
835
|
+
<span class="method-name">server_settings</span><span
|
|
836
|
+
class="method-args">()</span>
|
|
837
|
+
|
|
838
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
839
|
+
|
|
840
|
+
</div>
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
<div class="method-description">
|
|
844
|
+
|
|
845
|
+
<p>Returns an array of Server setting</p>
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
<div class="method-source-code" id="server_settings-source">
|
|
851
|
+
<pre><span class="ruby-comment"># File lib/approveapi_swagger/configuration.rb, line 210</span>
|
|
852
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">server_settings</span>
|
|
853
|
+
[
|
|
854
|
+
{
|
|
855
|
+
<span class="ruby-value">url:</span> <span class="ruby-string">"https://approve.sh"</span>,
|
|
856
|
+
<span class="ruby-value">description:</span> <span class="ruby-string">"No descriptoin provided"</span>,
|
|
857
|
+
}
|
|
858
|
+
]
|
|
859
|
+
<span class="ruby-keyword">end</span></pre>
|
|
860
|
+
</div>
|
|
861
|
+
|
|
862
|
+
</div>
|
|
863
|
+
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
</div>
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
<div id="method-i-server_url" class="method-detail ">
|
|
871
|
+
|
|
872
|
+
<div class="method-heading">
|
|
873
|
+
<span class="method-name">server_url</span><span
|
|
874
|
+
class="method-args">(index, variables = {})</span>
|
|
875
|
+
|
|
876
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
877
|
+
|
|
878
|
+
</div>
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
<div class="method-description">
|
|
882
|
+
|
|
883
|
+
<p>Returns URL based on server settings</p>
|
|
884
|
+
|
|
885
|
+
<p>@param index array index of the server settings @param variables hash of variable and the corresponding value</p>
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
<div class="method-source-code" id="server_url-source">
|
|
891
|
+
<pre><span class="ruby-comment"># File lib/approveapi_swagger/configuration.rb, line 223</span>
|
|
892
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">server_url</span>(<span class="ruby-identifier">index</span>, <span class="ruby-identifier">variables</span> = {})
|
|
893
|
+
<span class="ruby-identifier">servers</span> = <span class="ruby-identifier">server_settings</span>
|
|
894
|
+
|
|
895
|
+
<span class="ruby-comment"># check array index out of bound</span>
|
|
896
|
+
<span class="ruby-keyword">if</span> (<span class="ruby-identifier">index</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">index</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">servers</span>.<span class="ruby-identifier">size</span>)
|
|
897
|
+
<span class="ruby-identifier">fail</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"Invalid index #{index} when selecting the server. Must be less than #{servers.size}"</span>
|
|
898
|
+
<span class="ruby-keyword">end</span>
|
|
899
|
+
|
|
900
|
+
<span class="ruby-identifier">server</span> = <span class="ruby-identifier">servers</span>[<span class="ruby-identifier">index</span>]
|
|
901
|
+
<span class="ruby-identifier">url</span> = <span class="ruby-identifier">server</span>[<span class="ruby-value">:url</span>]
|
|
902
|
+
|
|
903
|
+
<span class="ruby-comment"># go through variable and assign a value</span>
|
|
904
|
+
<span class="ruby-identifier">server</span>[<span class="ruby-value">:variables</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">variable</span><span class="ruby-operator">|</span>
|
|
905
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">variables</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">name</span>)
|
|
906
|
+
<span class="ruby-keyword">if</span> (<span class="ruby-identifier">server</span>[<span class="ruby-value">:variables</span>][<span class="ruby-identifier">name</span>][<span class="ruby-value">:enum_values</span>].<span class="ruby-identifier">include?</span> <span class="ruby-identifier">variables</span>[<span class="ruby-identifier">name</span>])
|
|
907
|
+
<span class="ruby-identifier">url</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-string">"{"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">"}"</span>, <span class="ruby-identifier">variables</span>[<span class="ruby-identifier">name</span>]
|
|
908
|
+
<span class="ruby-keyword">else</span>
|
|
909
|
+
<span class="ruby-identifier">fail</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."</span>
|
|
910
|
+
<span class="ruby-keyword">end</span>
|
|
911
|
+
<span class="ruby-keyword">else</span>
|
|
912
|
+
<span class="ruby-comment"># use default value</span>
|
|
913
|
+
<span class="ruby-identifier">url</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-string">"{"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">"}"</span>, <span class="ruby-identifier">server</span>[<span class="ruby-value">:variables</span>][<span class="ruby-identifier">name</span>][<span class="ruby-value">:default_value</span>]
|
|
914
|
+
<span class="ruby-keyword">end</span>
|
|
915
|
+
<span class="ruby-keyword">end</span>
|
|
916
|
+
|
|
917
|
+
<span class="ruby-identifier">url</span>
|
|
918
|
+
<span class="ruby-keyword">end</span></pre>
|
|
919
|
+
</div>
|
|
920
|
+
|
|
921
|
+
</div>
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
</div>
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
</section>
|
|
930
|
+
|
|
931
|
+
</section>
|
|
932
|
+
|
|
933
|
+
</main>
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
<footer id="validator-badges" role="contentinfo">
|
|
937
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
|
938
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
|
|
939
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
940
|
+
</footer>
|
|
941
|
+
|