openapi-client-generator 0.1.9

Generates a client library based on an OpenAPI spec.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
get:
  operationId: checks_list

  summary: List

  description: >-
    Returns a list of your checks. The checks are returned sorted by
    creation date, with the most recently created checks appearing first.

  tags:
    - Checks

  parameters:
    - $ref: "../../shared/parameters/limit.yml"
    - $ref: "../../shared/parameters/before_after.yml"
    - $ref: "../../shared/parameters/include.yml"
    - $ref: "../../shared/parameters/date_created.yml"
    - $ref: "../../shared/parameters/metadata.yml"
    - $ref: "../../shared/parameters/scheduled.yml"
    - $ref: "../../shared/parameters/send_date.yml"
    - $ref: "../../shared/parameters/mail_type.yml"
    - $ref: "../../shared/parameters/sort_by.yml"

  responses:
    "200":
      $ref: responses/all_checks.yml

    default:
      $ref: "../../shared/responses/mailpiece_error.yml"

  x-codeSamples:
    - lang: Shell
      source: |
        curl -X GET "https://api.lob.com/v1/checks?limit=2" \
          -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
      label: CURL
    - lang: typescript
      source: |
        try {
          const checks = await new ChecksApi(config).list(2);
        } catch (err: any) {
          console.error(err);
        }
      label: TYPESCRIPT
    - lang: Javascript
      source: |
        Lob.checks.list({limit: 2}, function (err, res) {
          console.log(err, res);
        });
      label: NODE
    - lang: Ruby
      source: |
        @lob.checks.list(limit: 2)
      label: RUBY
    - lang: Python
      source: |
        lob.Check.list(limit=2)
      label: PYTHON
    - lang: PHP
      source: |
        $lob->checks()->all(array(
          'limit' => 2
        ));
    - lang: Java
      source: |
        Map<String, Object> params = new HashMap<>();
        params.put("limit", 2);

        LobResponse<CheckCollection> response = Check.list(params);
        CheckCollection checks = response.getResponseBody();
      label: JAVA
    - lang: Elixir
      source: |
        Lob.Check.list(%{limit: 2})
      label: ELIXIR

post:
  operationId: check_create

  summary: Create

  description: >-
    Creates a new check with the provided properties.

  tags:
    - Checks

  parameters:
    - $ref: "../../shared/parameters/idempotency.yml#/idem-header"
    - $ref: "../../shared/parameters/idempotency.yml#/idem-query"

  requestBody:
    required: true
    content:
      application/json:
        schema:
          $ref: "models/check_editable.yml"
        example:
          description: Demo Check
          to:
            description: "Harry - Office"
            name: "Harry Zhang"
            company: "Lob"
            email: "harry@lob.com"
            phone: "5555555555"
            address_line1: "210 King St"
            address_line2: "# 6100"
            address_city: "San Francisco"
            address_state: "CA"
            address_zip: "94107"
            address_country: "US"
          from:
            name: Leore Avidar
            address_line1: 210 King St
            address_line2: "# 6100"
            address_city: San Francisco
            address_state: CA
            address_zip: "94107-1741"
          bank_account: bank_8cad8df5354d33f
          amount: 22.50
          memo: rent
          logo: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png"
          check_bottom: tmpl_23668b406d5afef
          merge_variables:
            name: Harry
          metadata:
            memo: rafting trip
          attachment: "./cool.pdf"
          send_date: "2017-11-01T00:00:00.000Z"
          mail_type: usps_first_class
          check_number: 10001

      application/x-www-form-urlencoded:
        schema:
          $ref: "models/check_editable.yml"
        example:
          description: Demo Check
          to:
            description: "Harry - Office"
            name: "Harry Zhang"
            company: "Lob"
            email: "harry@lob.com"
            phone: "5555555555"
            address_line1: "210 King St"
            address_line2: "# 6100"
            address_city: "San Francisco"
            address_state: "CA"
            address_zip: "94107"
            address_country: "US"
          from:
            name: Leore Avidar
            address_line1: 210 King St
            address_line2: "# 6100"
            address_city: San Francisco
            address_state: CA
            address_zip: "94107-1741"
          bank_account: bank_8cad8df5354d33f
          amount: 22.50
          memo: rent
          logo: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png"
          check_bottom: tmpl_23668b406d5afef
          merge_variables:
            name: Harry
          metadata:
            memo: rafting trip
          attachment: "./cool.pdf"
          send_date: "2017-11-01T00:00:00.000Z"
          mail_type: usps_first_class
          check_number: 10001
        encoding:
          to:
            style: deepObject
            explode: true
          from:
            style: deepObject
            explode: true
          merge_variables:
            style: deepObject
            explode: true
          metadata:
            style: deepObject
            explode: true

      multipart/form-data:
        schema:
          $ref: "models/check_editable.yml"
        example:
          description: Demo Check
          to:
            description: "Harry - Office"
            name: "Harry Zhang"
            company: "Lob"
            email: "harry@lob.com"
            phone: "5555555555"
            address_line1: "210 King St"
            address_line2: "# 6100"
            address_city: "San Francisco"
            address_state: "CA"
            address_zip: "94107"
            address_country: "US"
          from:
            name: Leore Avidar
            address_line1: 210 King St
            address_line2: "# 6100"
            address_city: San Francisco
            address_state: CA
            address_zip: "94107-1741"
          bank_account: bank_8cad8df5354d33f
          amount: 22.50
          memo: rent
          logo: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png"
          check_bottom: tmpl_23668b406d5afef
          merge_variables:
            name: Harry
          metadata:
            memo: rafting trip
          attachment: "./cool.pdf"
          send_date: "2017-11-01T00:00:00.000Z"
          mail_type: usps_first_class
          check_number: 10001
        encoding:
          logo:
            contentType: image/png, image/jpeg

  responses:
    "200":
      $ref: responses/post_check.yml

    default:
      $ref: "../../shared/responses/mailpiece_error.yml"

  x-codeSamples:
    - lang: Shell
      source: |
        curl https://api.lob.com/v1/checks \
          -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
          -d "description=Demo Check" \
          -d "to[name]=Harry Zhang" \
          -d "to[address_line1]=210 King St" \
          -d "to[address_line2]=# 6100" \
          -d "to[address_city]=San Francisco" \
          -d "to[address_state]=CA" \
          -d "to[address_zip]=94107" \
          -d "from=adr_210a8d4b0b76d77b" \
          -d "bank_account=bank_8cad8df5354d33f" \
          -d "amount=22.50" \
          -d "memo=rent" \
          --data-urlencode "logo=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png" \
          --data-urlencode "check_bottom=<h1 style='padding-top:4in;'>Demo Check for {{name}}</h1>" \
          -d "merge_variables[name]=Harry"
      label: CURL
    - lang: typescript
      source: |
        const checkCreate: CheckEditable = new CheckEditable({
          to: addressId,
          from: addressId,
          bank_account: bankAccountId,
          amount: 100
        });

        try {
          const myCheck = await new ChecksApi(config).create(checkCreate);
        } catch (err: any) {
          console.error(err);
        }
      label: TYPESCRIPT
    - lang: Javascript
      source: |
        Lob.checks.create({
          description: 'Demo Check',
          bank_account: 'bank_8cad8df5354d33f',
          to: {
            name: 'Harry Zhang',
            address_line1: '210 King St',
            address_line2: '# 6100',
            address_city: 'San Francisco',
            address_state: 'CA',
            address_zip: '94107'
          },
          from: 'adr_210a8d4b0b76d77b',
          amount: 22.50,
          memo: 'rent',
          logo: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png',
          check_bottom: '<h1 style="padding-top:4in;">Demo Check for {{name}}</h1>',
          merge_variables: {
            name: 'Harry'
          }
        }, function (err, res) {
          console.log(err, res);
        });
      label: NODE
    - lang: Ruby
      source: |
        @lob.checks.create(
          description: "Demo Check",
          bank_account: "bank_8cad8df5354d33f",
          to: {
            name: "Harry Zhang",
            address_line1: "210 King St",
            address_line2: "# 6100",
            address_city: "San Francisco",
            address_state: "CA",
            address_zip: "94107"
          },
          from: "adr_210a8d4b0b76d77b",
          amount: 22.50,
          memo: "rent",
          logo: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png",
          check_bottom: "<h1 style='padding-top:4in;'>Demo Check for {{name}}</h1>",
          merge_variables: {
            name: "Harry"
          }
        )
      label: RUBY
    - lang: Python
      source: |
        lob.Check.create(
          description = 'Demo Check',
          to_address = {
            'name': 'Harry Zhang',
            'address_line1': '210 King St',
            'address_line2': '# 6100',
            'address_city': 'San Francisco',
            'address_state': 'CA',
            'address_zip': '94107'
          },
          from_address = 'adr_210a8d4b0b76d77b',
          bank_account = 'bank_8cad8df5354d33f',
          amount = 22.50,
          memo = 'rent',
          logo = 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png',
          check_bottom = '<h1 style="padding-top:4in;">Demo Check for {{name}}</h1>',
          merge_variables = {
            'name': 'Harry'
          }
        )
      label: PYTHON
    - lang: PHP
      source: |
        $lob->checks()->create(array(
          'description'           => 'Demo Check',
          'to[name]'              => 'Harry Zhang',
          'to[address_line1]'     => '210 King St',
          'to[address_line2]'     => '# 6100',
          'to[address_city]'      => 'San Francisco',
          'to[address_zip]'       => '94107',
          'to[address_state]'     => 'CA',
          'from'                  => 'adr_210a8d4b0b76d77b',
          'bank_account'          => 'bank_8cad8df5354d33f',
          'amount'                => 22.50,
          'memo'                  => 'rent',
          'logo'                  => 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png',
          'check_bottom'          => '<h1 style="padding-top:4in;">Demo Check for {{name}}</h1>',
          'merge_variables[name]' => 'Harry'
        ));
    - lang: Java
      source: |
        Map<String, String> mergeVariables = new HashMap<>();
        mergeVariables.put("name", "Harry");

        LobResponse<Check> response = new Check.RequestBuilder()
                .setDescription("Demo Check")
                .setCheckBottom("<h1 style='padding-top:4in;'>Demo Check for {{name}}</h1>")
                .setMergeVariables(mergeVariables)
                .setAmount(22.50f)
                .memo("rent")
                .setLogo("https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png")
                .setTo(
                        new Address.RequestBuilder()
                                .setName("Harry Zhang")
                                .setLine1("210 King St Ste 6100")
                                .setCity("San Francisco")
                                .setState("CA")
                                .setZip("94107")
                )
                .setFrom("adr_210a8d4b0b76d77b")
                .setBankAccount("bank_8cad8df5354d33f")
                .create();

        Check check = response.getResponseBody();
      label: JAVA
    - lang: Elixir
      source: |
        Lob.Check.create(%{
          description: "Demo Check",
          bank_account: "bank_8cad8df5354d33f",
          to: %{
            name: "Harry Zhang",
            address_line1: "210 King St",
            address_line2: "# 6100",
            address_city: "San Francisco",
            address_state: "CA",
            address_zip: "94107"
          },
          from: "adr_210a8d4b0b76d77b",
          amount: 22.50,
          memo: "rent",
          logo: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png",
          check_bottom: "<h1 style='padding-top:4in;'>Demo Check for {{name}}</h1>",
          merge_variables: %{
            name: "Harry"
          }
        })
      label: ELIXIR