lob 5.1.0 → 6.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (471) hide show
  1. checksums.yaml +5 -5
  2. data/CODE_SNIPPETS.md +1871 -0
  3. data/Gemfile +6 -1
  4. data/Gemfile.lock +72 -0
  5. data/LICENSE +21 -0
  6. data/MIGRATION.md +174 -0
  7. data/README.md +70 -154
  8. data/Rakefile +7 -5
  9. data/__tests__/Api/Address.unit.rb +210 -0
  10. data/__tests__/Api/BankAccount.unit.rb +244 -0
  11. data/__tests__/Api/BillingGroup.unit.rb +170 -0
  12. data/__tests__/Api/Card.unit.rb +183 -0
  13. data/__tests__/Api/CardOrder.unit.rb +89 -0
  14. data/__tests__/Api/Check.unit.rb +185 -0
  15. data/__tests__/Api/IntlAutocompletion.unit.rb +43 -0
  16. data/__tests__/Api/IntlVerification.unit.rb +71 -0
  17. data/__tests__/Api/Letter.unit.rb +191 -0
  18. data/__tests__/Api/Postcard.unit.rb +189 -0
  19. data/__tests__/Api/Require.unit.rb +21 -0
  20. data/__tests__/Api/ReverseGeocodeLookup.unit.rb +43 -0
  21. data/__tests__/Api/SelfMailer.unit.rb +190 -0
  22. data/__tests__/Api/Template.unit.rb +165 -0
  23. data/__tests__/Api/TemplateVersion.unit.rb +165 -0
  24. data/__tests__/Api/UsAutocompletion.unit.rb +42 -0
  25. data/__tests__/Api/UsVerification.unit.rb +71 -0
  26. data/__tests__/Api/ZipLookup.unit.rb +42 -0
  27. data/__tests__/Integration/Address.spec.rb +200 -0
  28. data/__tests__/Integration/BankAccount.spec.rb +243 -0
  29. data/__tests__/Integration/BillingGroup.spec.rb +163 -0
  30. data/__tests__/Integration/Card.spec.rb +198 -0
  31. data/__tests__/Integration/CardOrder.spec.rb +122 -0
  32. data/__tests__/Integration/Check.spec.rb +361 -0
  33. data/__tests__/Integration/IntlAutocompletion.spec.rb +54 -0
  34. data/__tests__/Integration/IntlVerification.spec.rb +90 -0
  35. data/__tests__/Integration/Letter.spec.rb +286 -0
  36. data/__tests__/Integration/Postcard.spec.rb +214 -0
  37. data/__tests__/Integration/ReverseGeocodeLookup.spec.rb +30 -0
  38. data/__tests__/Integration/SelfMailer.spec.rb +270 -0
  39. data/__tests__/Integration/Template.spec.rb +221 -0
  40. data/__tests__/Integration/TemplateVersion.spec.rb +275 -0
  41. data/__tests__/Integration/UsAutocompletion.spec.rb +54 -0
  42. data/__tests__/Integration/UsVerification.spec.rb +102 -0
  43. data/__tests__/Integration/ZipLookup.spec.rb +29 -0
  44. data/__tests__/TestFixtures.rb +36 -0
  45. data/docs/Address.md +52 -0
  46. data/docs/AddressDeletion.md +22 -0
  47. data/docs/AddressDomestic.md +40 -0
  48. data/docs/AddressDomesticExpanded.md +40 -0
  49. data/docs/AddressEditable.md +40 -0
  50. data/docs/AddressList.md +28 -0
  51. data/docs/AddressesApi.md +303 -0
  52. data/docs/BankAccount.md +44 -0
  53. data/docs/BankAccountDeletion.md +22 -0
  54. data/docs/BankAccountList.md +28 -0
  55. data/docs/BankAccountVerify.md +18 -0
  56. data/docs/BankAccountWritable.md +28 -0
  57. data/docs/BankAccountsApi.md +376 -0
  58. data/docs/BankTypeEnum.md +15 -0
  59. data/docs/BillingGroup.md +28 -0
  60. data/docs/BillingGroupEditable.md +20 -0
  61. data/docs/BillingGroupList.md +26 -0
  62. data/docs/BillingGroupsApi.md +305 -0
  63. data/docs/Buckslip.md +60 -0
  64. data/docs/BuckslipDeletion.md +20 -0
  65. data/docs/BuckslipEditable.md +24 -0
  66. data/docs/BuckslipOrder.md +42 -0
  67. data/docs/BuckslipOrderEditable.md +18 -0
  68. data/docs/BuckslipOrdersApi.md +157 -0
  69. data/docs/BuckslipOrdersList.md +26 -0
  70. data/docs/BuckslipUpdatable.md +22 -0
  71. data/docs/BuckslipsApi.md +372 -0
  72. data/docs/BuckslipsList.md +28 -0
  73. data/docs/BulkError.md +18 -0
  74. data/docs/BulkErrorProperties.md +20 -0
  75. data/docs/Campaign.md +52 -0
  76. data/docs/CampaignCreative.md +42 -0
  77. data/docs/CampaignDeletion.md +20 -0
  78. data/docs/CampaignUpdatable.md +36 -0
  79. data/docs/CampaignWritable.md +36 -0
  80. data/docs/CampaignsApi.md +376 -0
  81. data/docs/CampaignsList.md +28 -0
  82. data/docs/Card.md +54 -0
  83. data/docs/CardDeletion.md +22 -0
  84. data/docs/CardEditable.md +24 -0
  85. data/docs/CardList.md +28 -0
  86. data/docs/CardOrder.md +42 -0
  87. data/docs/CardOrderEditable.md +18 -0
  88. data/docs/CardOrderList.md +26 -0
  89. data/docs/CardOrdersApi.md +157 -0
  90. data/docs/CardUpdatable.md +22 -0
  91. data/docs/CardsApi.md +372 -0
  92. data/docs/Check.md +68 -0
  93. data/docs/CheckDeletion.md +22 -0
  94. data/docs/CheckEditable.md +48 -0
  95. data/docs/CheckList.md +28 -0
  96. data/docs/ChecksApi.md +315 -0
  97. data/docs/CmpScheduleType.md +15 -0
  98. data/docs/CmpUseType.md +15 -0
  99. data/docs/CountryExtended.md +15 -0
  100. data/docs/CountryExtendedExpanded.md +15 -0
  101. data/docs/CreativePatch.md +22 -0
  102. data/docs/CreativeResponse.md +42 -0
  103. data/docs/CreativeWritable.md +34 -0
  104. data/docs/CreativesApi.md +226 -0
  105. data/docs/CustomEnvelopeReturned.md +22 -0
  106. data/docs/DefaultApi.md +75 -0
  107. data/docs/DeliverabilityAnalysis.md +46 -0
  108. data/docs/DpvFootnote.md +15 -0
  109. data/docs/EngineHtml.md +15 -0
  110. data/docs/EventType.md +24 -0
  111. data/docs/Events.md +28 -0
  112. data/docs/Export.md +32 -0
  113. data/docs/ExportModel.md +18 -0
  114. data/docs/GeocodeAddresses.md +20 -0
  115. data/docs/GeocodeComponents.md +20 -0
  116. data/docs/HTTPValidationError.md +18 -0
  117. data/docs/IdentityValidation.md +34 -0
  118. data/docs/IdentityValidationApi.md +78 -0
  119. data/docs/InlineObject.md +18 -0
  120. data/docs/IntlAutocompletions.md +20 -0
  121. data/docs/IntlAutocompletionsApi.md +82 -0
  122. data/docs/IntlAutocompletionsWritable.md +26 -0
  123. data/docs/IntlComponents.md +26 -0
  124. data/docs/IntlSuggestions.md +30 -0
  125. data/docs/IntlVerification.md +38 -0
  126. data/docs/IntlVerificationOrError.md +40 -0
  127. data/docs/IntlVerificationWritable.md +32 -0
  128. data/docs/IntlVerifications.md +20 -0
  129. data/docs/IntlVerificationsApi.md +153 -0
  130. data/docs/IntlVerificationsPayload.md +18 -0
  131. data/docs/Letter.md +72 -0
  132. data/docs/LetterCustomEnvelope.md +22 -0
  133. data/docs/LetterDeletion.md +22 -0
  134. data/docs/LetterDetailsReturned.md +36 -0
  135. data/docs/LetterDetailsWritable.md +32 -0
  136. data/docs/LetterEditable.md +52 -0
  137. data/docs/LetterList.md +28 -0
  138. data/docs/LettersApi.md +317 -0
  139. data/docs/LobConfidenceScore.md +20 -0
  140. data/docs/LobError.md +22 -0
  141. data/docs/Location.md +20 -0
  142. data/docs/LocationAnalysis.md +22 -0
  143. data/docs/MailType.md +15 -0
  144. data/docs/MultiLineAddress.md +32 -0
  145. data/docs/MultipleComponents.md +30 -0
  146. data/docs/MultipleComponentsIntl.md +30 -0
  147. data/docs/MultipleComponentsList.md +18 -0
  148. data/docs/PlaceholderModel.md +28 -0
  149. data/docs/Postcard.md +60 -0
  150. data/docs/PostcardDeletion.md +22 -0
  151. data/docs/PostcardDetailsReturned.md +26 -0
  152. data/docs/PostcardDetailsWritable.md +20 -0
  153. data/docs/PostcardEditable.md +40 -0
  154. data/docs/PostcardList.md +28 -0
  155. data/docs/PostcardSize.md +15 -0
  156. data/docs/PostcardsApi.md +317 -0
  157. data/docs/QrCode.md +30 -0
  158. data/docs/ReturnEnvelope.md +24 -0
  159. data/docs/ReverseGeocode.md +22 -0
  160. data/docs/ReverseGeocodeLookupsApi.md +82 -0
  161. data/docs/SelfMailer.md +48 -0
  162. data/docs/SelfMailerDeletion.md +22 -0
  163. data/docs/SelfMailerEditable.md +38 -0
  164. data/docs/SelfMailerList.md +28 -0
  165. data/docs/SelfMailerSize.md +15 -0
  166. data/docs/SelfMailersApi.md +317 -0
  167. data/docs/SortBy.md +20 -0
  168. data/docs/SortBy1.md +20 -0
  169. data/docs/SortBy2.md +20 -0
  170. data/docs/SortBy3.md +20 -0
  171. data/docs/SortByDateModified.md +20 -0
  172. data/docs/Suggestions.md +26 -0
  173. data/docs/Template.md +34 -0
  174. data/docs/TemplateDeletion.md +22 -0
  175. data/docs/TemplateList.md +28 -0
  176. data/docs/TemplateUpdate.md +20 -0
  177. data/docs/TemplateVersion.md +36 -0
  178. data/docs/TemplateVersionDeletion.md +22 -0
  179. data/docs/TemplateVersionList.md +28 -0
  180. data/docs/TemplateVersionUpdatable.md +20 -0
  181. data/docs/TemplateVersionWritable.md +22 -0
  182. data/docs/TemplateVersionsApi.md +384 -0
  183. data/docs/TemplateWritable.md +24 -0
  184. data/docs/TemplatesApi.md +376 -0
  185. data/docs/Thumbnail.md +22 -0
  186. data/docs/TrackingEventCertified.md +34 -0
  187. data/docs/TrackingEventDetails.md +24 -0
  188. data/docs/TrackingEventNormal.md +34 -0
  189. data/docs/Upload.md +44 -0
  190. data/docs/UploadCreateExport.md +20 -0
  191. data/docs/UploadFile.md +20 -0
  192. data/docs/UploadState.md +15 -0
  193. data/docs/UploadUpdatable.md +20 -0
  194. data/docs/UploadWritable.md +18 -0
  195. data/docs/UploadsApi.md +584 -0
  196. data/docs/UsAutocompletions.md +22 -0
  197. data/docs/UsAutocompletionsApi.md +78 -0
  198. data/docs/UsAutocompletionsWritable.md +26 -0
  199. data/docs/UsComponents.md +70 -0
  200. data/docs/UsVerification.md +38 -0
  201. data/docs/UsVerificationOrError.md +40 -0
  202. data/docs/UsVerifications.md +20 -0
  203. data/docs/UsVerificationsApi.md +157 -0
  204. data/docs/UsVerificationsWritable.md +32 -0
  205. data/docs/ValidationError.md +22 -0
  206. data/docs/Zip.md +26 -0
  207. data/docs/ZipCodeType.md +15 -0
  208. data/docs/ZipEditable.md +18 -0
  209. data/docs/ZipLookupCity.md +26 -0
  210. data/docs/ZipLookupsApi.md +78 -0
  211. data/git_push.sh +57 -0
  212. data/lib/lob.rb +1 -7
  213. data/lib/openapi_client/api/addresses_api.rb +318 -0
  214. data/lib/openapi_client/api/bank_accounts_api.rb +397 -0
  215. data/lib/openapi_client/api/billing_groups_api.rb +320 -0
  216. data/lib/openapi_client/api/buckslip_orders_api.rb +183 -0
  217. data/lib/openapi_client/api/buckslips_api.rb +385 -0
  218. data/lib/openapi_client/api/campaigns_api.rb +389 -0
  219. data/lib/openapi_client/api/card_orders_api.rb +183 -0
  220. data/lib/openapi_client/api/cards_api.rb +382 -0
  221. data/lib/openapi_client/api/checks_api.rb +337 -0
  222. data/lib/openapi_client/api/creatives_api.rb +244 -0
  223. data/lib/openapi_client/api/default_api.rb +79 -0
  224. data/lib/openapi_client/api/identity_validation_api.rb +90 -0
  225. data/lib/openapi_client/api/intl_autocompletions_api.rb +97 -0
  226. data/lib/openapi_client/api/intl_verifications_api.rb +165 -0
  227. data/lib/openapi_client/api/letters_api.rb +343 -0
  228. data/lib/openapi_client/api/postcards_api.rb +340 -0
  229. data/lib/openapi_client/api/reverse_geocode_lookups_api.rb +101 -0
  230. data/lib/openapi_client/api/self_mailers_api.rb +340 -0
  231. data/lib/openapi_client/api/template_versions_api.rb +440 -0
  232. data/lib/openapi_client/api/templates_api.rb +397 -0
  233. data/lib/openapi_client/api/uploads_api.rb +604 -0
  234. data/lib/openapi_client/api/us_autocompletions_api.rb +90 -0
  235. data/lib/openapi_client/api/us_verifications_api.rb +172 -0
  236. data/lib/openapi_client/api/zip_lookups_api.rb +90 -0
  237. data/lib/openapi_client/api_client.rb +392 -0
  238. data/lib/openapi_client/api_error.rb +57 -0
  239. data/lib/openapi_client/configuration.rb +279 -0
  240. data/lib/openapi_client/models/address.rb +616 -0
  241. data/lib/openapi_client/models/address_deletion.rb +303 -0
  242. data/lib/openapi_client/models/address_domestic.rb +522 -0
  243. data/lib/openapi_client/models/address_domestic_expanded.rb +521 -0
  244. data/lib/openapi_client/models/address_editable.rb +503 -0
  245. data/lib/openapi_client/models/address_list.rb +324 -0
  246. data/lib/openapi_client/models/bank_account.rb +576 -0
  247. data/lib/openapi_client/models/bank_account_deletion.rb +303 -0
  248. data/lib/openapi_client/models/bank_account_list.rb +324 -0
  249. data/lib/openapi_client/models/bank_account_verify.rb +264 -0
  250. data/lib/openapi_client/models/bank_account_writable.rb +387 -0
  251. data/lib/openapi_client/models/bank_type_enum.rb +37 -0
  252. data/lib/openapi_client/models/billing_group.rb +395 -0
  253. data/lib/openapi_client/models/billing_group_editable.rb +278 -0
  254. data/lib/openapi_client/models/billing_group_list.rb +314 -0
  255. data/lib/openapi_client/models/buckslip.rb +814 -0
  256. data/lib/openapi_client/models/buckslip_deletion.rb +257 -0
  257. data/lib/openapi_client/models/buckslip_editable.rb +316 -0
  258. data/lib/openapi_client/models/buckslip_order.rb +438 -0
  259. data/lib/openapi_client/models/buckslip_order_editable.rb +262 -0
  260. data/lib/openapi_client/models/buckslip_orders_list.rb +312 -0
  261. data/lib/openapi_client/models/buckslip_updatable.rb +289 -0
  262. data/lib/openapi_client/models/buckslips_list.rb +324 -0
  263. data/lib/openapi_client/models/bulk_error.rb +229 -0
  264. data/lib/openapi_client/models/bulk_error_properties.rb +274 -0
  265. data/lib/openapi_client/models/campaign.rb +549 -0
  266. data/lib/openapi_client/models/campaign_creative.rb +467 -0
  267. data/lib/openapi_client/models/campaign_deletion.rb +257 -0
  268. data/lib/openapi_client/models/campaign_updatable.rb +341 -0
  269. data/lib/openapi_client/models/campaign_writable.rb +373 -0
  270. data/lib/openapi_client/models/campaigns_list.rb +324 -0
  271. data/lib/openapi_client/models/card.rb +681 -0
  272. data/lib/openapi_client/models/card_deletion.rb +303 -0
  273. data/lib/openapi_client/models/card_editable.rb +318 -0
  274. data/lib/openapi_client/models/card_list.rb +324 -0
  275. data/lib/openapi_client/models/card_order.rb +438 -0
  276. data/lib/openapi_client/models/card_order_editable.rb +261 -0
  277. data/lib/openapi_client/models/card_order_list.rb +273 -0
  278. data/lib/openapi_client/models/card_updatable.rb +289 -0
  279. data/lib/openapi_client/models/check.rb +812 -0
  280. data/lib/openapi_client/models/check_deletion.rb +303 -0
  281. data/lib/openapi_client/models/check_editable.rb +537 -0
  282. data/lib/openapi_client/models/check_list.rb +324 -0
  283. data/lib/openapi_client/models/chk_use_type.rb +38 -0
  284. data/lib/openapi_client/models/cmp_schedule_type.rb +36 -0
  285. data/lib/openapi_client/models/cmp_use_type.rb +38 -0
  286. data/lib/openapi_client/models/country_extended.rb +254 -0
  287. data/lib/openapi_client/models/country_extended_expanded.rb +255 -0
  288. data/lib/openapi_client/models/creative_patch.rb +274 -0
  289. data/lib/openapi_client/models/creative_response.rb +444 -0
  290. data/lib/openapi_client/models/creative_writable.rb +400 -0
  291. data/lib/openapi_client/models/custom_envelope_returned.rb +319 -0
  292. data/lib/openapi_client/models/deliverability_analysis.rb +601 -0
  293. data/lib/openapi_client/models/dpv_footnote.rb +54 -0
  294. data/lib/openapi_client/models/engine_html.rb +37 -0
  295. data/lib/openapi_client/models/event_type.rb +325 -0
  296. data/lib/openapi_client/models/events.rb +365 -0
  297. data/lib/openapi_client/models/export.rb +422 -0
  298. data/lib/openapi_client/models/export_model.rb +262 -0
  299. data/lib/openapi_client/models/geocode_addresses.rb +237 -0
  300. data/lib/openapi_client/models/geocode_components.rb +291 -0
  301. data/lib/openapi_client/models/http_validation_error.rb +230 -0
  302. data/lib/openapi_client/models/identity_validation.rb +460 -0
  303. data/lib/openapi_client/models/inline_object.rb +229 -0
  304. data/lib/openapi_client/models/intl_autocompletions.rb +282 -0
  305. data/lib/openapi_client/models/intl_autocompletions_writable.rb +278 -0
  306. data/lib/openapi_client/models/intl_components.rb +314 -0
  307. data/lib/openapi_client/models/intl_suggestions.rb +372 -0
  308. data/lib/openapi_client/models/intl_verification.rb +463 -0
  309. data/lib/openapi_client/models/intl_verification_or_error.rb +466 -0
  310. data/lib/openapi_client/models/intl_verification_writable.rb +388 -0
  311. data/lib/openapi_client/models/intl_verifications.rb +250 -0
  312. data/lib/openapi_client/models/intl_verifications_payload.rb +263 -0
  313. data/lib/openapi_client/models/letter.rb +737 -0
  314. data/lib/openapi_client/models/letter_custom_envelope.rb +300 -0
  315. data/lib/openapi_client/models/letter_deletion.rb +303 -0
  316. data/lib/openapi_client/models/letter_details_returned.rb +393 -0
  317. data/lib/openapi_client/models/letter_details_writable.rb +390 -0
  318. data/lib/openapi_client/models/letter_editable.rb +532 -0
  319. data/lib/openapi_client/models/letter_list.rb +324 -0
  320. data/lib/openapi_client/models/lob_confidence_score.rb +299 -0
  321. data/lib/openapi_client/models/lob_error.rb +296 -0
  322. data/lib/openapi_client/models/location.rb +289 -0
  323. data/lib/openapi_client/models/location_analysis.rb +305 -0
  324. data/lib/openapi_client/models/ltr_use_type.rb +38 -0
  325. data/lib/openapi_client/models/mail_type.rb +37 -0
  326. data/lib/openapi_client/models/multi_line_address.rb +431 -0
  327. data/lib/openapi_client/models/multiple_components.rb +405 -0
  328. data/lib/openapi_client/models/multiple_components_intl.rb +377 -0
  329. data/lib/openapi_client/models/multiple_components_list.rb +263 -0
  330. data/lib/openapi_client/models/optional_address_column_mapping.rb +259 -0
  331. data/lib/openapi_client/models/placeholder_model.rb +273 -0
  332. data/lib/openapi_client/models/postcard.rb +656 -0
  333. data/lib/openapi_client/models/postcard_deletion.rb +303 -0
  334. data/lib/openapi_client/models/postcard_details_returned.rb +321 -0
  335. data/lib/openapi_client/models/postcard_details_writable.rb +242 -0
  336. data/lib/openapi_client/models/postcard_editable.rb +393 -0
  337. data/lib/openapi_client/models/postcard_list.rb +324 -0
  338. data/lib/openapi_client/models/postcard_size.rb +38 -0
  339. data/lib/openapi_client/models/psc_use_type.rb +38 -0
  340. data/lib/openapi_client/models/qr_code.rb +339 -0
  341. data/lib/openapi_client/models/required_address_column_mapping.rb +285 -0
  342. data/lib/openapi_client/models/return_envelope.rb +258 -0
  343. data/lib/openapi_client/models/reverse_geocode.rb +304 -0
  344. data/lib/openapi_client/models/self_mailer.rb +584 -0
  345. data/lib/openapi_client/models/self_mailer_deletion.rb +303 -0
  346. data/lib/openapi_client/models/self_mailer_editable.rb +384 -0
  347. data/lib/openapi_client/models/self_mailer_list.rb +324 -0
  348. data/lib/openapi_client/models/self_mailer_size.rb +38 -0
  349. data/lib/openapi_client/models/sfm_use_type.rb +38 -0
  350. data/lib/openapi_client/models/sort_by.rb +283 -0
  351. data/lib/openapi_client/models/sort_by1.rb +283 -0
  352. data/lib/openapi_client/models/sort_by2.rb +283 -0
  353. data/lib/openapi_client/models/sort_by3.rb +283 -0
  354. data/lib/openapi_client/models/sort_by_date_modified.rb +283 -0
  355. data/lib/openapi_client/models/suggestions.rb +343 -0
  356. data/lib/openapi_client/models/template.rb +406 -0
  357. data/lib/openapi_client/models/template_deletion.rb +303 -0
  358. data/lib/openapi_client/models/template_list.rb +324 -0
  359. data/lib/openapi_client/models/template_update.rb +272 -0
  360. data/lib/openapi_client/models/template_version.rb +423 -0
  361. data/lib/openapi_client/models/template_version_deletion.rb +303 -0
  362. data/lib/openapi_client/models/template_version_list.rb +324 -0
  363. data/lib/openapi_client/models/template_version_updatable.rb +257 -0
  364. data/lib/openapi_client/models/template_version_writable.rb +291 -0
  365. data/lib/openapi_client/models/template_writable.rb +309 -0
  366. data/lib/openapi_client/models/thumbnail.rb +300 -0
  367. data/lib/openapi_client/models/tracking_event_certified.rb +419 -0
  368. data/lib/openapi_client/models/tracking_event_details.rb +308 -0
  369. data/lib/openapi_client/models/tracking_event_normal.rb +409 -0
  370. data/lib/openapi_client/models/upload.rb +498 -0
  371. data/lib/openapi_client/models/upload_create_export.rb +283 -0
  372. data/lib/openapi_client/models/upload_file.rb +283 -0
  373. data/lib/openapi_client/models/upload_state.rb +42 -0
  374. data/lib/openapi_client/models/upload_updatable.rb +267 -0
  375. data/lib/openapi_client/models/upload_writable.rb +271 -0
  376. data/lib/openapi_client/models/uploads_metadata.rb +237 -0
  377. data/lib/openapi_client/models/us_autocompletions.rb +328 -0
  378. data/lib/openapi_client/models/us_autocompletions_writable.rb +274 -0
  379. data/lib/openapi_client/models/us_components.rb +788 -0
  380. data/lib/openapi_client/models/us_verification.rb +461 -0
  381. data/lib/openapi_client/models/us_verification_or_error.rb +459 -0
  382. data/lib/openapi_client/models/us_verifications.rb +250 -0
  383. data/lib/openapi_client/models/us_verifications_writable.rb +421 -0
  384. data/lib/openapi_client/models/validation_error.rb +263 -0
  385. data/lib/openapi_client/models/zip.rb +363 -0
  386. data/lib/openapi_client/models/zip_code_type.rb +40 -0
  387. data/lib/openapi_client/models/zip_editable.rb +246 -0
  388. data/lib/openapi_client/models/zip_lookup_city.rb +331 -0
  389. data/lib/openapi_client/version.rb +15 -0
  390. data/lib/openapi_client.rb +212 -0
  391. data/openapi_client.gemspec +37 -0
  392. data/spec/api/addresses_api_spec.rb +88 -0
  393. data/spec/api/bank_accounts_api_spec.rb +101 -0
  394. data/spec/api/billing_groups_api_spec.rb +89 -0
  395. data/spec/api/campaigns_api_spec.rb +100 -0
  396. data/spec/api/card_orders_api_spec.rb +62 -0
  397. data/spec/api/cards_api_spec.rb +99 -0
  398. data/spec/api/checks_api_spec.rb +93 -0
  399. data/spec/api/creatives_api_spec.rb +73 -0
  400. data/spec/api/default_api_spec.rb +46 -0
  401. data/spec/api/identity_validation_api_spec.rb +47 -0
  402. data/spec/api/intl_autocompletions_api_spec.rb +48 -0
  403. data/spec/api/intl_verifications_api_spec.rb +60 -0
  404. data/spec/api/letters_api_spec.rb +94 -0
  405. data/spec/api/postcards_api_spec.rb +94 -0
  406. data/spec/api/reverse_geocode_lookups_api_spec.rb +48 -0
  407. data/spec/api/self_mailers_api_spec.rb +94 -0
  408. data/spec/api/template_versions_api_spec.rb +105 -0
  409. data/spec/api/templates_api_spec.rb +101 -0
  410. data/spec/api/uploads_api_spec.rb +135 -0
  411. data/spec/api/us_autocompletions_api_spec.rb +47 -0
  412. data/spec/api/us_verifications_api_spec.rb +61 -0
  413. data/spec/api/zip_lookups_api_spec.rb +47 -0
  414. data/spec/api_client_spec.rb +226 -0
  415. data/spec/configuration_spec.rb +42 -0
  416. data/spec/spec_helper.rb +107 -13
  417. metadata +452 -140
  418. data/.gitignore +0 -18
  419. data/.travis.yml +0 -16
  420. data/CHANGELOG.md +0 -114
  421. data/CONTRIBUTING.md +0 -19
  422. data/LICENSE.txt +0 -22
  423. data/examples/README.md +0 -33
  424. data/examples/checks.rb +0 -48
  425. data/examples/csv_checks/create_checks.rb +0 -47
  426. data/examples/csv_checks/input.csv +0 -6
  427. data/examples/csv_letters/create_letters.rb +0 -40
  428. data/examples/csv_letters/input.csv +0 -6
  429. data/examples/csv_letters/letter_template.html +0 -33
  430. data/examples/csv_postcards/create_postcards.rb +0 -45
  431. data/examples/csv_postcards/input.csv +0 -7
  432. data/examples/csv_postcards/postcard_back.html +0 -38
  433. data/examples/csv_postcards/postcard_front.html +0 -25
  434. data/examples/csv_verify/input.csv +0 -7
  435. data/examples/csv_verify/verify.rb +0 -36
  436. data/examples/letters.rb +0 -72
  437. data/examples/postcards.rb +0 -86
  438. data/lib/lob/client.rb +0 -71
  439. data/lib/lob/errors/invalid_request_error.rb +0 -4
  440. data/lib/lob/errors/lob_error.rb +0 -20
  441. data/lib/lob/resources/address.rb +0 -14
  442. data/lib/lob/resources/bank_account.rb +0 -30
  443. data/lib/lob/resources/check.rb +0 -14
  444. data/lib/lob/resources/group.rb +0 -14
  445. data/lib/lob/resources/groups_member.rb +0 -66
  446. data/lib/lob/resources/intl_verifications.rb +0 -26
  447. data/lib/lob/resources/letter.rb +0 -14
  448. data/lib/lob/resources/postcard.rb +0 -14
  449. data/lib/lob/resources/resource_base.rb +0 -139
  450. data/lib/lob/resources/us_autocompletions.rb +0 -26
  451. data/lib/lob/resources/us_verifications.rb +0 -27
  452. data/lib/lob/resources/us_zip_lookups.rb +0 -26
  453. data/lib/lob/version.rb +0 -3
  454. data/lob.gemspec +0 -28
  455. data/spec/lob/errors/lob_error_spec.rb +0 -19
  456. data/spec/lob/resources/address_spec.rb +0 -55
  457. data/spec/lob/resources/bank_account_spec.rb +0 -60
  458. data/spec/lob/resources/check_spec.rb +0 -98
  459. data/spec/lob/resources/group_spec.rb +0 -50
  460. data/spec/lob/resources/intl_verifications_spec.rb +0 -28
  461. data/spec/lob/resources/letter_spec.rb +0 -94
  462. data/spec/lob/resources/member_spec.rb +0 -65
  463. data/spec/lob/resources/postcard_spec.rb +0 -135
  464. data/spec/lob/resources/resource_base_spec.rb +0 -75
  465. data/spec/lob/resources/us_autocompletions_spec.rb +0 -24
  466. data/spec/lob/resources/us_verifications_spec.rb +0 -31
  467. data/spec/lob/resources/us_zip_lookups_spec.rb +0 -23
  468. data/spec/lob_spec.rb +0 -48
  469. data/spec/samples/8.5x11.pdf +0 -0
  470. data/spec/samples/postcardback.pdf +2 -2287
  471. data/spec/samples/postcardfront.pdf +1 -1549
data/CODE_SNIPPETS.md ADDED
@@ -0,0 +1,1871 @@
1
+ # Code Snippets
2
+
3
+ ## Address Api
4
+
5
+ ### Retrieve
6
+ ```bash
7
+ curl https://api.lob.com/v1/addresses/adr_fa85158b26c3eb7c \
8
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
9
+ ```
10
+
11
+ ```ruby
12
+ addressApi = AddressesApi.new(config)
13
+
14
+ begin
15
+ retrievedAddress = addressApi.get("adr_fa85158b26c3eb7c")
16
+ rescue => err
17
+ p err.message
18
+ end
19
+ ```
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+ ### Delete
28
+ ```bash
29
+ curl -X DELETE "https://api.lob.com/v1/addresses/adr_43769b47aed248c2" \
30
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
31
+ ```
32
+
33
+ ```ruby
34
+ addressApi = AddressesApi.new(config)
35
+
36
+ begin
37
+ deletedAddress = addressApi.delete("adr_43769b47aed248c2")
38
+ rescue => err
39
+ p err.message
40
+ end
41
+ ```
42
+
43
+
44
+ ### Create
45
+ ```bash
46
+ curl https://api.lob.com/v1/addresses \
47
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
48
+ -d "description=Harry - Office" \
49
+ -d "name=Harry Zhang" \
50
+ -d "company=Lob" \
51
+ -d "email=harry@lob.com" \
52
+ -d "phone=5555555555" \
53
+ -d "address_line1=210 King St" \
54
+ -d "address_line2=# 6100" \
55
+ -d "address_city=San Francisco" \
56
+ -d "address_state=CA" \
57
+ -d "address_zip=94107" \
58
+ -d "address_country=US" \
59
+ ```
60
+
61
+ ```ruby
62
+ addressCreate = AddressEditable.new({
63
+ description: "Harry - Office",
64
+ name: "Harry Zhang",
65
+ company: "Lob",
66
+ email: "harry@lob.com",
67
+ phone: "5555555555",
68
+ address_line1: "210 King St",
69
+ address_line2: "# 6100",
70
+ address_city: "San Francisco",
71
+ address_state: "CA",
72
+ address_zip: "94107",
73
+ address_country: "US",
74
+ });
75
+
76
+ addressApi = AddressesApi.new(config)
77
+
78
+ begin
79
+ createdAddress = addressApi.create(addressCreate)
80
+ rescue => err
81
+ p err.message
82
+ end
83
+ ```
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+ ### List
92
+ ```bash
93
+ curl -X GET "https://api.lob.com/v1/addresses?limit=2" \
94
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
95
+ ```
96
+
97
+ ```ruby
98
+ addressesApi = AddressesApi.new(config)
99
+
100
+ begin
101
+ addresses = addressesApi.list({ limit: 2 })
102
+ rescue => err
103
+ p err.message
104
+ end
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
+ ## Postcards Api
149
+
150
+ ### Retrieve
151
+ ```bash
152
+ curl https://api.lob.com/v1/postcards/psc_5c002b86ce47537a \
153
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
154
+ ```
155
+
156
+ ```ruby
157
+ postcardApi = PostcardsApi.new(config)
158
+
159
+ begin
160
+ retrievedPostcard = postcardApi.get("psc_5c002b86ce47537a")
161
+ rescue => err
162
+ p err.message
163
+ end
164
+ ```
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+ ### Delete
173
+ ```bash
174
+ curl -X DELETE "https://api.lob.com/v1/postcards/psc_5c002b86ce47537a" \
175
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
176
+ ```
177
+
178
+ ```ruby
179
+ postcardApi = PostcardsApi.new(config)
180
+
181
+ begin
182
+ deletedPostcard = postcardApi.cancel("psc_5c002b86ce47537a")
183
+ rescue => err
184
+ p err.message
185
+ end
186
+ ```
187
+
188
+
189
+ ### Create
190
+ ```bash
191
+ curl https://api.lob.com/v1/postcards \
192
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
193
+ -d "description=Demo Postcard job" \
194
+ -d "from=adr_210a8d4b0b76d77b" \
195
+ --data-urlencode "front=<html style='padding: 1in; font-size: 50;'>Front HTML for {{name}}</html>" \
196
+ --data-urlencode "back=<html style='padding: 1in; font-size: 20;'>Back HTML for {{name}}</html>" \
197
+ -d "to[name]=Harry Zhang" \
198
+ -d "to[address_line1]=210 King St" \
199
+ -d "to[address_line2]=# 6100" \
200
+ -d "to[address_city]=San Francisco" \
201
+ -d "to[address_state]=CA" \
202
+ -d "to[address_zip]=94107" \
203
+ -d "merge_variables[name]=Harry" \
204
+ ```
205
+
206
+ ```ruby
207
+ postcardCreate = PostcardEditable.new({
208
+ description: "Demo Postcard job",
209
+ from: "adr_210a8d4b0b76d77b",
210
+ front: "<html style='padding: 1in; font-size: 50;'>Front HTML for {{name}}</html>",
211
+ back: "<html style='padding: 1in; font-size: 20;'>Back HTML for {{name}}</html>",
212
+ to: AddressEditable.new({
213
+ name: "Harry Zhang",
214
+ address_line1: "210 King St",
215
+ address_line2: "# 6100",
216
+ address_city: "San Francisco",
217
+ address_state: "CA",
218
+ address_zip: "94107",
219
+ }),
220
+ merge_variables: {
221
+ name: "Harry"
222
+ },
223
+ });
224
+
225
+ postcardApi = PostcardsApi.new(config)
226
+
227
+ begin
228
+ createdPostcard = postcardApi.create(postcardCreate)
229
+ rescue => err
230
+ p err.message
231
+ end
232
+ ```
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+ ### List
241
+ ```bash
242
+ curl -X GET "https://api.lob.com/v1/postcards?limit=2" \
243
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
244
+ ```
245
+
246
+ ```ruby
247
+ postcardsApi = PostcardsApi.new(config)
248
+
249
+ begin
250
+ postcards = postcardsApi.list({ limit: 2 })
251
+ rescue => err
252
+ p err.message
253
+ end
254
+ ```
255
+
256
+
257
+ ## SelfMailers Api
258
+
259
+ ### Retrieve
260
+ ```bash
261
+ curl https://api.lob.com/v1/self_mailers/sfm_8ffbe811dea49dcf \
262
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
263
+ ```
264
+
265
+ ```ruby
266
+ selfMailerApi = SelfMailersApi.new(config)
267
+
268
+ begin
269
+ retrievedSelfMailer = selfMailerApi.get("sfm_8ffbe811dea49dcf")
270
+ rescue => err
271
+ p err.message
272
+ end
273
+ ```
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+ ### Delete
282
+ ```bash
283
+ curl -X DELETE "https://api.lob.com/v1/self_mailers/sfm_8ffbe811dea49dcf" \
284
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
285
+ ```
286
+
287
+ ```ruby
288
+ selfMailerApi = SelfMailersApi.new(config)
289
+
290
+ begin
291
+ deletedSelfMailer = selfMailerApi.delete("sfm_8ffbe811dea49dcf")
292
+ rescue => err
293
+ p err.message
294
+ end
295
+ ```
296
+
297
+
298
+ ### Create
299
+ ```bash
300
+ curl https://api.lob.com/v1/self_mailers \
301
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
302
+ -d "description=Demo Self Mailer job" \
303
+ -d "from=adr_210a8d4b0b76d77b" \
304
+ --data-urlencode "inside=<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>" \
305
+ --data-urlencode "outside=<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>" \
306
+ -d "to[name]=Harry Zhang" \
307
+ -d "to[address_line1]=210 King St" \
308
+ -d "to[address_line2]=# 6100" \
309
+ -d "to[address_city]=San Francisco" \
310
+ -d "to[address_state]=CA" \
311
+ -d "to[address_zip]=94107" \
312
+ -d "merge_variables[name]=Harry" \
313
+ ```
314
+
315
+ ```ruby
316
+ selfMailerCreate = SelfMailerEditable.new({
317
+ description: "Demo Self Mailer job",
318
+ from: "adr_210a8d4b0b76d77b",
319
+ inside: "<html style='padding: 1in; font-size: 50;'>Inside HTML for {{name}}</html>",
320
+ outside: "<html style='padding: 1in; font-size: 20;'>Outside HTML for {{name}}</html>",
321
+ to: AddressEditable.new({
322
+ name: "Harry Zhang",
323
+ address_line1: "210 King St",
324
+ address_line2: "# 6100",
325
+ address_city: "San Francisco",
326
+ address_state: "CA",
327
+ address_zip: "94107",
328
+ }),
329
+ merge_variables: {
330
+ name: "Harry"
331
+ },
332
+ });
333
+
334
+ selfMailerApi = SelfMailersApi.new(config)
335
+
336
+ begin
337
+ createdSelfMailer = selfMailerApi.create(selfMailerCreate)
338
+ rescue => err
339
+ p err.message
340
+ end
341
+ ```
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+ ### List
350
+ ```bash
351
+ curl -X GET "https://api.lob.com/v1/self_mailers?limit=2" \
352
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
353
+ ```
354
+
355
+ ```ruby
356
+ selfMailersApi = SelfMailersApi.new(config)
357
+
358
+ begin
359
+ selfMailers = selfMailersApi.list({ limit: 2 })
360
+ rescue => err
361
+ p err.message
362
+ end
363
+ ```
364
+
365
+
366
+ ## Letters Api
367
+
368
+ ### Retrieve
369
+ ```bash
370
+ curl https://api.lob.com/v1/letters/ltr_4868c3b754655f90 \
371
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
372
+ ```
373
+
374
+ ```ruby
375
+ letterApi = LettersApi.new(config)
376
+
377
+ begin
378
+ retrievedLetter = letterApi.get("ltr_4868c3b754655f90")
379
+ rescue => err
380
+ p err.message
381
+ end
382
+ ```
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+ ### Delete
391
+ ```bash
392
+ curl -X DELETE "https://api.lob.com/v1/letters/ltr_4868c3b754655f90" \
393
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
394
+ ```
395
+
396
+ ```ruby
397
+ letterApi = LettersApi.new(config)
398
+
399
+ begin
400
+ deletedLetter = letterApi.cancel("ltr_4868c3b754655f90")
401
+ rescue => err
402
+ p err.message
403
+ end
404
+ ```
405
+
406
+
407
+ ### Create
408
+ ```bash
409
+ curl https://api.lob.com/v1/letters \
410
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
411
+ -d "description=Demo Letter" \
412
+ -d "from=adr_210a8d4b0b76d77b" \
413
+ --data-urlencode "file=<html style='padding-top: 3in; margin: .5in;'>HTML Letter for {{name}}</html>" \
414
+ -d "color=true" \
415
+ -d "to[name]=Harry Zhang" \
416
+ -d "to[address_line1]=210 King St" \
417
+ -d "to[address_line2]=# 6100" \
418
+ -d "to[address_city]=San Francisco" \
419
+ -d "to[address_state]=CA" \
420
+ -d "to[address_zip]=94107" \
421
+ -d "merge_variables[name]=Harry" \
422
+ -d "cards[]=card_c51ae96f5cebf3e"
423
+ ```
424
+
425
+ ```ruby
426
+ letterCreate = LetterEditable.new({
427
+ description: "Demo Letter",
428
+ from: "adr_210a8d4b0b76d77b",
429
+ file: "<html style='padding-top: 3in; margin: .5in;'>HTML Letter for {{name}}</html>",
430
+ color: "true",
431
+ to: AddressEditable.new({
432
+ name: "Harry Zhang",
433
+ address_line1: "210 King St",
434
+ address_line2: "# 6100",
435
+ address_city: "San Francisco",
436
+ address_state: "CA",
437
+ address_zip: "94107",
438
+ }),
439
+ merge_variables: {
440
+ name: "Harry"
441
+ },
442
+ cards: [
443
+ "card_c51ae96f5cebf3e",
444
+ ],
445
+ });
446
+
447
+ letterApi = LettersApi.new(config)
448
+
449
+ begin
450
+ createdLetter = letterApi.create(letterCreate)
451
+ rescue => err
452
+ p err.message
453
+ end
454
+ ```
455
+
456
+
457
+
458
+
459
+
460
+
461
+
462
+ ### List
463
+ ```bash
464
+ curl -X GET "https://api.lob.com/v1/letters?limit=2" \
465
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
466
+ ```
467
+
468
+ ```ruby
469
+ lettersApi = LettersApi.new(config)
470
+
471
+ begin
472
+ letters = lettersApi.list({ limit: 2 })
473
+ rescue => err
474
+ p err.message
475
+ end
476
+ ```
477
+
478
+
479
+ ## Checks Api
480
+
481
+ ### Retrieve
482
+ ```bash
483
+ curl https://api.lob.com/v1/checks/chk_534f10783683daa0 \
484
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
485
+ ```
486
+
487
+ ```ruby
488
+ checkApi = ChecksApi.new(config)
489
+
490
+ begin
491
+ retrievedCheck = checkApi.get("chk_534f10783683daa0")
492
+ rescue => err
493
+ p err.message
494
+ end
495
+ ```
496
+
497
+
498
+
499
+
500
+
501
+
502
+
503
+ ### Delete
504
+ ```bash
505
+ curl -X DELETE "https://api.lob.com/v1/checks/chk_534f10783683daa0" \
506
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
507
+ ```
508
+
509
+ ```ruby
510
+ checkApi = ChecksApi.new(config)
511
+
512
+ begin
513
+ deletedCheck = checkApi.cancel("chk_534f10783683daa0")
514
+ rescue => err
515
+ p err.message
516
+ end
517
+ ```
518
+
519
+
520
+ ### Create
521
+ ```bash
522
+ curl https://api.lob.com/v1/checks \
523
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
524
+ -d "description=Demo Check" \
525
+ -d "bank_account=bank_8cad8df5354d33f" \
526
+ -d "amount=22.5" \
527
+ -d "memo=rent" \
528
+ --data-urlencode "logo=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png" \
529
+ --data-urlencode "check_bottom=<h1 style='padding-top:4in;'>Demo Check for {{name}}</h1>" \
530
+ -d "from=adr_210a8d4b0b76d77b" \
531
+ -d "to[name]=Harry Zhang" \
532
+ -d "to[address_line1]=210 King St" \
533
+ -d "to[address_line2]=# 6100" \
534
+ -d "to[address_city]=San Francisco" \
535
+ -d "to[address_state]=CA" \
536
+ -d "to[address_zip]=94107" \
537
+ -d "merge_variables[name]=Harry" \
538
+ ```
539
+
540
+ ```ruby
541
+ checkCreate = CheckEditable.new({
542
+ description: "Demo Check",
543
+ bank_account: "bank_8cad8df5354d33f",
544
+ amount: 22.5,
545
+ memo: "rent",
546
+ logo: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/check_logo.png",
547
+ check_bottom: "<h1 style='padding-top:4in;'>Demo Check for {{name}}</h1>",
548
+ from: "adr_210a8d4b0b76d77b",
549
+ to: AddressDomestic.new({
550
+ name: "Harry Zhang",
551
+ address_line1: "210 King St",
552
+ address_line2: "# 6100",
553
+ address_city: "San Francisco",
554
+ address_state: "CA",
555
+ address_zip: "94107",
556
+ }),
557
+ merge_variables: {
558
+ name: "Harry"
559
+ },
560
+ });
561
+
562
+ checkApi = ChecksApi.new(config)
563
+
564
+ begin
565
+ createdCheck = checkApi.create(checkCreate)
566
+ rescue => err
567
+ p err.message
568
+ end
569
+ ```
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+ ### List
578
+ ```bash
579
+ curl -X GET "https://api.lob.com/v1/checks?limit=2" \
580
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
581
+ ```
582
+
583
+ ```ruby
584
+ checksApi = ChecksApi.new(config)
585
+
586
+ begin
587
+ checks = checksApi.list({ limit: 2 })
588
+ rescue => err
589
+ p err.message
590
+ end
591
+ ```
592
+
593
+
594
+ ## BankAccounts Api
595
+
596
+ ### Retrieve
597
+ ```bash
598
+ curl https://api.lob.com/v1/bank_accounts/bank_8cad8df5354d33f \
599
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
600
+ ```
601
+
602
+ ```ruby
603
+ bankAccountApi = BankAccountsApi.new(config)
604
+
605
+ begin
606
+ retrievedBankAccount = bankAccountApi.get("bank_8cad8df5354d33f")
607
+ rescue => err
608
+ p err.message
609
+ end
610
+ ```
611
+
612
+
613
+
614
+
615
+
616
+
617
+
618
+ ### Delete
619
+ ```bash
620
+ curl -X DELETE "https://api.lob.com/v1/bank_accounts/bank_3e64d9904356b20" \
621
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
622
+ ```
623
+
624
+ ```ruby
625
+ bankAccountApi = BankAccountsApi.new(config)
626
+
627
+ begin
628
+ deletedBankAccount = bankAccountApi.delete("bank_3e64d9904356b20")
629
+ rescue => err
630
+ p err.message
631
+ end
632
+ ```
633
+
634
+
635
+
636
+ ### List
637
+ ```bash
638
+ curl -X GET "https://api.lob.com/v1/bank_accounts?limit=2" \
639
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
640
+ ```
641
+
642
+ ```ruby
643
+ bankAccountsApi = BankAccountsApi.new(config)
644
+
645
+ begin
646
+ bankAccounts = bankAccountsApi.list({ limit: 2 })
647
+ rescue => err
648
+ p err.message
649
+ end
650
+ ```
651
+
652
+
653
+
654
+
655
+
656
+
657
+ ### Verify
658
+ ```bash
659
+ curl https://api.lob.com/v1/bank_accounts/bank_dfceb4a2a05b57e/verify \
660
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
661
+ -d "amounts[]=25" \
662
+ -d "amounts[]=63" \
663
+ ```
664
+
665
+ ```ruby
666
+ verificationData = BankAccountVerify.new({
667
+ amounts: [
668
+ 25,
669
+ 63,
670
+ ],
671
+ })
672
+
673
+ bankAccountsApi = BankAccountsApi.new(config)
674
+
675
+ begin
676
+ verifiedAccount = bankAccountsApi.verify("bank_dfceb4a2a05b57e", verificationData)
677
+ rescue => err
678
+ p err.message
679
+ end
680
+ ```
681
+
682
+
683
+ ### Create
684
+ ```bash
685
+ curl https://api.lob.com/v1/bank_accounts \
686
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
687
+ -d "description=Test Bank Account" \
688
+ -d "routing_number=322271627" \
689
+ -d "account_number=123456789" \
690
+ -d "signatory=John Doe" \
691
+ -d "account_type=company" \
692
+ ```
693
+
694
+ ```ruby
695
+ bankAccountCreate = BankAccountWritable.new({
696
+ description: "Test Bank Account",
697
+ routing_number: "322271627",
698
+ account_number: "123456789",
699
+ signatory: "John Doe",
700
+ account_type: BankTypeEnum::COMPANY,
701
+ });
702
+
703
+ bankAccountApi = BankAccountsApi.new(config)
704
+
705
+ begin
706
+ createdBankAccount = bankAccountApi.create(bankAccountCreate)
707
+ rescue => err
708
+ p err.message
709
+ end
710
+ ```
711
+
712
+
713
+
714
+
715
+
716
+ ## Templates Api
717
+
718
+ ### Retrieve
719
+ ```bash
720
+ curl https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121 \
721
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
722
+ ```
723
+
724
+ ```ruby
725
+ templateApi = TemplatesApi.new(config)
726
+
727
+ begin
728
+ retrievedTemplate = templateApi.get("tmpl_c94e83ca2cd5121")
729
+ rescue => err
730
+ p err.message
731
+ end
732
+ ```
733
+
734
+
735
+
736
+
737
+
738
+
739
+
740
+
741
+
742
+ ### Delete
743
+ ```bash
744
+ curl -X DELETE "https://api.lob.com/v1/templates/tmpl_df934eeda694203" \
745
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
746
+ ```
747
+
748
+ ```ruby
749
+ templateApi = TemplatesApi.new(config)
750
+
751
+ begin
752
+ deletedTemplate = templateApi.delete("tmpl_df934eeda694203")
753
+ rescue => err
754
+ p err.message
755
+ end
756
+ ```
757
+
758
+ ### Delete
759
+ ```bash
760
+ curl -X DELETE "https://api.lob.com/v1/templates/tmpl_df934eeda694203" \
761
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
762
+ ```
763
+
764
+ ```ruby
765
+ templateApi = TemplatesApi.new(config)
766
+
767
+ begin
768
+ deletedTemplate = templateApi.delete("tmpl_df934eeda694203")
769
+ rescue => err
770
+ p err.message
771
+ end
772
+ ```
773
+
774
+
775
+
776
+ ### List
777
+ ```bash
778
+ curl -X GET "https://api.lob.com/v1/templates?limit=2" \
779
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
780
+ ```
781
+
782
+ ```ruby
783
+ templatesApi = TemplatesApi.new(config)
784
+
785
+ begin
786
+ templates = templatesApi.list({ limit: 2 })
787
+ rescue => err
788
+ p err.message
789
+ end
790
+ ```
791
+
792
+
793
+
794
+
795
+
796
+
797
+
798
+
799
+ ### Update
800
+ ```bash
801
+ curl -X PATCH https://api.lob.com/v1/tmpl_c94e83ca2cd5121 \
802
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
803
+ -d "description=updated template" \
804
+ -d "published_version=vrsn_362184d96d9b0c9" \
805
+ ```
806
+
807
+ ```ruby
808
+ templateUpdate = TemplateUpdate.new({
809
+ description: "updated template",
810
+ published_version: "vrsn_362184d96d9b0c9",
811
+ })
812
+
813
+ templateApi = TemplatesApi.new(config)
814
+
815
+ begin
816
+ updatedTemplate = templateApi.update("tmpl_c94e83ca2cd5121", templateUpdate)
817
+ rescue => err
818
+ p err.message
819
+ end
820
+ ```
821
+
822
+
823
+
824
+ ### Create
825
+ ```bash
826
+ curl https://api.lob.com/v1/templates \
827
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
828
+ -d "description=Test Template" \
829
+ --data-urlencode "html=<html>HTML for {{name}}</html>" \
830
+ ```
831
+
832
+ ```ruby
833
+ templateCreate = TemplateWritable.new({
834
+ description: "Test Template",
835
+ html: "<html>HTML for {{name}}</html>",
836
+ });
837
+
838
+ templateApi = TemplatesApi.new(config)
839
+
840
+ begin
841
+ createdTemplate = templateApi.create(templateCreate)
842
+ rescue => err
843
+ p err.message
844
+ end
845
+ ```
846
+
847
+
848
+
849
+
850
+
851
+
852
+
853
+ ## TemplateVersions Api
854
+
855
+ ### Retrieve
856
+ ```bash
857
+ curl https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121/versions/vrsn_534e339882d2282 \
858
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
859
+ ```
860
+
861
+ ```ruby
862
+ templateVersionApi = TemplateVersionsApi.new(config)
863
+
864
+ begin
865
+ retrievedTemplateVersion = templateVersionApi.get("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282")
866
+ rescue => err
867
+ p err.message
868
+ end
869
+ ```
870
+
871
+
872
+
873
+
874
+
875
+
876
+
877
+
878
+ ### Delete
879
+ ```bash
880
+ curl -X DELETE "https://api.lob.com/v1/templates/tmpl_4aa14648113e45b/versions/vrsn_534e339882d2282" \
881
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
882
+ ```
883
+
884
+ ```ruby
885
+ templateVersionApi = TemplateVersionsApi.new(config)
886
+
887
+ begin
888
+ deletedTemplateVersion = templateVersionApi.delete("tmpl_4aa14648113e45b", "vrsn_534e339882d2282")
889
+ rescue => err
890
+ p err.message
891
+ end
892
+ ```
893
+
894
+
895
+
896
+
897
+ ### List
898
+ ```bash
899
+ curl -X GET "https://api.lob.com/v1/templates/tmpl_dadaaf7b76c9f25/versions?limit=2" \
900
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
901
+ ```
902
+
903
+ ```ruby
904
+ templateVersionsApi = TemplateVersionsApi.new(config)
905
+
906
+ begin
907
+ templateVersions = templateVersionsApi.list("tmpl_dadaaf7b76c9f25", { limit: 2 })
908
+ rescue => err
909
+ p err.message
910
+ end
911
+ ```
912
+
913
+
914
+
915
+
916
+
917
+
918
+
919
+ ### Update
920
+ ```bash
921
+ curl -X PATCH https://api.lob.com/v1/vrsn_534e339882d2282 \
922
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
923
+ -d "description=updated template version" \
924
+ ```
925
+
926
+ ```ruby
927
+ templateVersionUpdatable = TemplateUpdate.new({
928
+ description: "updated template version",
929
+ })
930
+
931
+ templateVersionApi = TemplateVersionsApi.new(config)
932
+
933
+ begin
934
+ updatedTemplateVersion = templateVersionApi.update("tmpl_c94e83ca2cd5121", "vrsn_534e339882d2282", templateVersionUpdatable)
935
+ rescue => err
936
+ p err.message
937
+ end
938
+ ```
939
+
940
+
941
+ ### Create
942
+ ```bash
943
+ curl https://api.lob.com/v1/templates/tmpl_4aa14648113e45b/versions \
944
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
945
+ -d "description=Second Version" \
946
+ --data-urlencode "html=<html>Second HTML for {{name}}</html>" \
947
+ ```
948
+
949
+ ```ruby
950
+ templateVersionCreate = TemplateVersionWritable.new({
951
+ description: "Second Version",
952
+ html: "<html>Second HTML for {{name}}</html>",
953
+ });
954
+
955
+ templateVersionApi = TemplateVersionsApi.new(config)
956
+
957
+ begin
958
+ createdTemplateVersion = templateVersionApi.create("tmpl_4aa14648113e45b", templateVersionCreate)
959
+ rescue => err
960
+ p err.message
961
+ end
962
+ ```
963
+
964
+
965
+
966
+
967
+
968
+
969
+ ## BillingGroups Api
970
+
971
+ ### Retrieve
972
+ ```bash
973
+ curl https://api.lob.com/v1/billing_groups/bg_4bb02b527a72667d0 \
974
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
975
+ ```
976
+
977
+ ```ruby
978
+ billingGroupApi = BillingGroupsApi.new(config)
979
+
980
+ begin
981
+ retrievedBillingGroup = billingGroupApi.get("bg_4bb02b527a72667d0")
982
+ rescue => err
983
+ p err.message
984
+ end
985
+ ```
986
+
987
+ ### Retrieve
988
+ ```bash
989
+ curl https://api.lob.com/v1/billing_groups/bg_4bb02b527a72667d0 \
990
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
991
+ ```
992
+
993
+ ```ruby
994
+ billingGroupApi = BillingGroupsApi.new(config)
995
+
996
+ begin
997
+ retrievedBillingGroup = billingGroupApi.get("bg_4bb02b527a72667d0")
998
+ rescue => err
999
+ p err.message
1000
+ end
1001
+ ```
1002
+
1003
+
1004
+
1005
+
1006
+
1007
+ ### Create
1008
+ ```bash
1009
+ curl https://api.lob.com/v1/billing_groups \
1010
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1011
+ -d "description=Usage group used for the Marketing Department's resource sends" \
1012
+ -d "name=Marketing Department" \
1013
+ ```
1014
+
1015
+ ```ruby
1016
+ bgCreate = BillingGroupEditable.new({
1017
+ description: "Usage group used for the Marketing Department's resource sends",
1018
+ name: "Marketing Department",
1019
+ });
1020
+
1021
+ bgApi = BillingGroupsApi.new(config)
1022
+
1023
+ begin
1024
+ createdBillingGroup = bgApi.create(bgCreate)
1025
+ rescue => err
1026
+ p err.message
1027
+ end
1028
+ ```
1029
+
1030
+
1031
+
1032
+
1033
+ ### Update
1034
+ ```bash
1035
+ curl -X PATCH https://api.lob.com/v1/bg_759954f540a1bfdb5 \
1036
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1037
+ -d "description=demo replacement" \
1038
+ ```
1039
+
1040
+ ```ruby
1041
+ billingGroupEditable = BillingGroupEditable.new({
1042
+ description: "demo replacement",
1043
+ })
1044
+
1045
+ bgApi = BillingGroupsApi.new(config)
1046
+
1047
+ begin
1048
+ updatedBillingGroup = bgApi.update("bg_759954f540a1bfdb5", billingGroupEditable)
1049
+ rescue => err
1050
+ p err.message
1051
+ end
1052
+ ```
1053
+
1054
+
1055
+
1056
+
1057
+
1058
+ ### List
1059
+ ```bash
1060
+ curl -X GET "https://api.lob.com/v1/billing_groups?limit=2" \
1061
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
1062
+ ```
1063
+
1064
+ ```ruby
1065
+ billingGroupsApi = BillingGroupsApi.new(config)
1066
+
1067
+ begin
1068
+ billingGroups = billingGroupsApi.list({ limit: 2 })
1069
+ rescue => err
1070
+ p err.message
1071
+ end
1072
+ ```
1073
+
1074
+
1075
+
1076
+ ## Cards Api
1077
+
1078
+
1079
+ ### Retrieve
1080
+ ```bash
1081
+ curl https://api.lob.com/v1/cards/card_7a6d73c5c8457fc \
1082
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
1083
+ ```
1084
+
1085
+ ```ruby
1086
+ cardApi = CardsApi.new(config)
1087
+
1088
+ begin
1089
+ retrievedCard = cardApi.get("card_7a6d73c5c8457fc")
1090
+ rescue => err
1091
+ p err.message
1092
+ end
1093
+ ```
1094
+
1095
+
1096
+
1097
+
1098
+
1099
+
1100
+
1101
+
1102
+ ### Delete
1103
+ ```bash
1104
+ curl -X DELETE "https://api.lob.com/v1/cards/card_6afffd19045076c" \
1105
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
1106
+ ```
1107
+
1108
+ ```ruby
1109
+ cardApi = CardsApi.new(config)
1110
+
1111
+ begin
1112
+ deletedCard = cardApi.delete("card_6afffd19045076c")
1113
+ rescue => err
1114
+ p err.message
1115
+ end
1116
+ ```
1117
+
1118
+ ### Create
1119
+ ```bash
1120
+ curl https://api.lob.com/v1/cards \
1121
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1122
+ -d "front=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf" \
1123
+ -d "back=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf" \
1124
+ -d "size=2.125x3.375" \
1125
+ -d "description=Test Card" \
1126
+ ```
1127
+
1128
+ ```ruby
1129
+ cardCreate = CardEditable.new({
1130
+ front: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf",
1131
+ back: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf",
1132
+ size: "2.125x3.375",
1133
+ description: "Test Card",
1134
+ });
1135
+
1136
+ cardApi = CardsApi.new(config)
1137
+
1138
+ begin
1139
+ createdCard = cardApi.create(cardCreate)
1140
+ rescue => err
1141
+ p err.message
1142
+ end
1143
+ ```
1144
+
1145
+
1146
+
1147
+
1148
+
1149
+
1150
+
1151
+
1152
+
1153
+ ### List
1154
+ ```bash
1155
+ curl -X GET "https://api.lob.com/v1/cards?limit=2" \
1156
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
1157
+ ```
1158
+
1159
+ ```ruby
1160
+ cardsApi = CardsApi.new(config)
1161
+
1162
+ begin
1163
+ cards = cardsApi.list({ limit: 2 })
1164
+ rescue => err
1165
+ p err.message
1166
+ end
1167
+ ```
1168
+
1169
+
1170
+
1171
+
1172
+
1173
+
1174
+ ### Update
1175
+ ```bash
1176
+ curl -X PATCH https://api.lob.com/v1/card_6afffd19045076c \
1177
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1178
+ -d "description=Awesome card" \
1179
+ -d "auto_reorder=true" \
1180
+ -d "reorder_quantity=10000" \
1181
+ ```
1182
+
1183
+ ```ruby
1184
+ cardUpdatable = CardUpdatable.new({
1185
+ description: "Awesome card",
1186
+ auto_reorder: "true",
1187
+ reorder_quantity: 10000,
1188
+ })
1189
+
1190
+ cardApi = CardsApi.new(config)
1191
+
1192
+ begin
1193
+ updatedCard = cardApi.update("card_6afffd19045076c", cardUpdatable)
1194
+ rescue => err
1195
+ p err.message
1196
+ end
1197
+ ```
1198
+
1199
+
1200
+ ## CardOrders Api
1201
+
1202
+
1203
+
1204
+ ### Retrieve
1205
+ ```bash
1206
+ curl https://api.lob.com/v1/cards/card_6afffd19045076c/orders/ \
1207
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
1208
+ ```
1209
+
1210
+ ```ruby
1211
+ cardOrderApi = CardOrdersApi.new(config)
1212
+
1213
+ begin
1214
+ retrievedCardOrderList = cardOrderApi.get("card_6afffd19045076c", { limit: 2, offset: 1 })
1215
+ rescue => err
1216
+ p err.message
1217
+ end
1218
+ ```
1219
+
1220
+ ### Create
1221
+ ```bash
1222
+ curl https://api.lob.com/v1/cards/card_6afffd19045076c/orders \
1223
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1224
+ -d "quantity=10000" \
1225
+ ```
1226
+
1227
+ ```ruby
1228
+ cardOrderCreate = CardOrderEditable.new({
1229
+ quantity: 10000,
1230
+ });
1231
+
1232
+ cardOrderApi = CardOrdersApi.new(config)
1233
+
1234
+ begin
1235
+ createdCardOrder = cardOrderApi.create("card_6afffd19045076c", cardOrderCreate)
1236
+ rescue => err
1237
+ p err.message
1238
+ end
1239
+ ```
1240
+
1241
+
1242
+
1243
+
1244
+
1245
+ ## Campaigns Api
1246
+
1247
+
1248
+ ### Retrieve
1249
+ ```bash
1250
+ curl https://api.lob.com/v1/campaigns/cmp_e05ee61ff80764b \
1251
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
1252
+ ```
1253
+
1254
+ ```ruby
1255
+ campaignApi = CampaignsApi.new(config)
1256
+
1257
+ begin
1258
+ retrievedCampaign = campaignApi.get("cmp_e05ee61ff80764b")
1259
+ rescue => err
1260
+ p err.message
1261
+ end
1262
+ ```
1263
+
1264
+
1265
+
1266
+
1267
+
1268
+
1269
+
1270
+
1271
+ ### Delete
1272
+ ```bash
1273
+ curl -X DELETE "https://api.lob.com/v1/campaigns/cmp_e05ee61ff80764b" \
1274
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
1275
+ ```
1276
+
1277
+ ```ruby
1278
+ campaignApi = CampaignsApi.new(config)
1279
+
1280
+ begin
1281
+ deletedCampaign = campaignApi.delete("cmp_e05ee61ff80764b")
1282
+ rescue => err
1283
+ p err.message
1284
+ end
1285
+ ```
1286
+
1287
+
1288
+
1289
+
1290
+ ### Update
1291
+ ```bash
1292
+ curl -X PATCH https://api.lob.com/v1/cmp_e05ee61ff80764b \
1293
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1294
+ -d "description=Awesome campaign" \
1295
+ ```
1296
+
1297
+ ```ruby
1298
+ campaignUpdatable = CampaignUpdatable.new({
1299
+ description: "Awesome campaign",
1300
+ })
1301
+
1302
+ campaignApi = CampaignsApi.new(config)
1303
+
1304
+ begin
1305
+ updatedCampaign = campaignApi.update("cmp_e05ee61ff80764b", campaignUpdatable)
1306
+ rescue => err
1307
+ p err.message
1308
+ end
1309
+ ```
1310
+
1311
+
1312
+ ### Create
1313
+ ```bash
1314
+ curl https://api.lob.com/v1/campaigns \
1315
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1316
+ -d "name=My First Campaign" \
1317
+ -d "schedule_type=immediate" \
1318
+ ```
1319
+
1320
+ ```ruby
1321
+ campaignCreate = CampaignWritable.new({
1322
+ name: "My First Campaign",
1323
+ schedule_type: "immediate",
1324
+ });
1325
+
1326
+ campaignApi = CampaignsApi.new(config)
1327
+
1328
+ begin
1329
+ createdCampaign = campaignApi.create(campaignCreate)
1330
+ rescue => err
1331
+ p err.message
1332
+ end
1333
+ ```
1334
+
1335
+
1336
+
1337
+
1338
+
1339
+
1340
+
1341
+
1342
+
1343
+ ### List
1344
+ ```bash
1345
+ curl -X GET "https://api.lob.com/v1/campaigns?limit=2" \
1346
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
1347
+ ```
1348
+
1349
+ ```ruby
1350
+ campaignsApi = CampaignsApi.new(config)
1351
+
1352
+ begin
1353
+ campaigns = campaignsApi.list({ limit: 2 })
1354
+ rescue => err
1355
+ p err.message
1356
+ end
1357
+ ```
1358
+
1359
+
1360
+
1361
+ ## Creatives Api
1362
+
1363
+
1364
+
1365
+ ### Update
1366
+ ```bash
1367
+ curl -X PATCH https://api.lob.com/v1/crv_2a3b096c409b32c \
1368
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1369
+ -d "description=Our updated 4x6 postcard creative" \
1370
+ ```
1371
+
1372
+ ```ruby
1373
+ creativePatch = CreativePatch.new({
1374
+ description: "Our updated 4x6 postcard creative",
1375
+ })
1376
+
1377
+ creativeApi = CreativesApi.new(config)
1378
+
1379
+ begin
1380
+ updatedCreative = creativeApi.update("crv_2a3b096c409b32c", creativePatch)
1381
+ rescue => err
1382
+ p err.message
1383
+ end
1384
+ ```
1385
+
1386
+
1387
+ ### Retrieve
1388
+ ```bash
1389
+ curl https://api.lob.com/v1/creatives/crv_2a3b096c409b32c \
1390
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
1391
+ ```
1392
+
1393
+ ```ruby
1394
+ creativeApi = CreativesApi.new(config)
1395
+
1396
+ begin
1397
+ retrievedCreative = creativeApi.get("crv_2a3b096c409b32c")
1398
+ rescue => err
1399
+ p err.message
1400
+ end
1401
+ ```
1402
+
1403
+
1404
+ ### Create
1405
+ ```bash
1406
+ curl https://api.lob.com/v1/creatives \
1407
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1408
+ -d "campaign_id=cmp_e05ee61ff80764b" \
1409
+ -d "resource_type=postcard" \
1410
+ -d "description=Our 4x6 postcard creative" \
1411
+ -d "from=adr_210a8d4b0b76d77b" \
1412
+ -d "front=tmpl_4aa14648113e45b" \
1413
+ -d "back=tmpl_4aa14648113e45b" \
1414
+ -d "details[mail_type]=usps_first_class" \
1415
+ ```
1416
+
1417
+ ```ruby
1418
+ creativeCreate = CreativeWritable.new({
1419
+ campaign_id: "cmp_e05ee61ff80764b",
1420
+ resource_type: "postcard",
1421
+ description: "Our 4x6 postcard creative",
1422
+ from: "adr_210a8d4b0b76d77b",
1423
+ front: "tmpl_4aa14648113e45b",
1424
+ back: "tmpl_4aa14648113e45b",
1425
+ details: PostcardDetailsWritable.new({
1426
+ mail_type: "usps_first_class",
1427
+ }),
1428
+ });
1429
+
1430
+ creativeApi = CreativesApi.new(config)
1431
+
1432
+ begin
1433
+ createdCreative = creativeApi.create(creativeCreate)
1434
+ rescue => err
1435
+ p err.message
1436
+ end
1437
+ ```
1438
+
1439
+
1440
+
1441
+
1442
+
1443
+ ## Uploads Api
1444
+
1445
+ ### List
1446
+ ```bash
1447
+ curl -X GET "https://api.lob.com/v1/?limit=2" \
1448
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
1449
+ ```
1450
+
1451
+ ```ruby
1452
+ uploadsApi = UploadsApi.new(config)
1453
+
1454
+ begin
1455
+ uploads = uploadsApi.list_upload({ campaign_id: "cmp_e05ee61ff80764b" })
1456
+ rescue => err
1457
+ p err.message
1458
+ end
1459
+ ```
1460
+
1461
+ ### Retrieve Export
1462
+ ```bash
1463
+ curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9/exports/ex_6a94fe68fd151e0f8 \
1464
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1465
+ -d "type=failures"
1466
+ ```
1467
+
1468
+ ```ruby
1469
+ uploadsApi = UploadsApi.new(config)
1470
+
1471
+ begin
1472
+ retrievedExport = uploadsApi.get_export("upl_71be866e430b11e9", "ex_6a94fe68fd151e0f8")
1473
+ rescue => err
1474
+ p err.message
1475
+ end
1476
+ ```
1477
+
1478
+
1479
+
1480
+
1481
+
1482
+
1483
+
1484
+
1485
+ ### Upload File
1486
+
1487
+ ```bash
1488
+ curl -X POST https://api.lob.com/v1/uploads/upl_71be866e430b11e9/file \
1489
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1490
+ -F file=@<YOUR_FILE_NAME_HERE>
1491
+ ```
1492
+
1493
+ ```ruby
1494
+ # to come
1495
+ ```
1496
+
1497
+
1498
+ ### Retrieve
1499
+ ```bash
1500
+ curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9 \
1501
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
1502
+ ```
1503
+
1504
+ ```ruby
1505
+ uploadApi = UploadsApi.new(config)
1506
+
1507
+ begin
1508
+ retrievedUpload = uploadApi.get_upload("upl_71be866e430b11e9")
1509
+ rescue => err
1510
+ p err.message
1511
+ end
1512
+ ```
1513
+
1514
+
1515
+
1516
+
1517
+
1518
+ ### Create Export
1519
+ ```bash
1520
+ curl https://api.lob.com/v1/uploads/upl_71be866e430b11e9/exports \
1521
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1522
+ -d "type=failures"
1523
+ ```
1524
+
1525
+ ```ruby
1526
+ exportModel = ExportModel.new({
1527
+ type: "all"
1528
+ })
1529
+
1530
+ uploadsApi = UploadsApi.new(config)
1531
+
1532
+ begin
1533
+ createdExport = uploadsApi.create_export("upl_71be866e430b11e9", exportModel)
1534
+ rescue => err
1535
+ p err.message
1536
+ end
1537
+ ```
1538
+
1539
+
1540
+
1541
+ ### Update
1542
+ ```bash
1543
+ curl -X PATCH https://api.lob.com/v1/upl_71be866e430b11e9 \
1544
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1545
+ ```
1546
+
1547
+ ```ruby
1548
+ uploadUpdatable = UploadUpdatable.new({
1549
+ required_address_column_mapping: RequiredAddressColumnMapping.new({
1550
+ name: "recipient",
1551
+ address_line1: "primary line",
1552
+ address_city: "city",
1553
+ address_state: "state",
1554
+ address_zip: "zip_code",
1555
+ }),
1556
+ })
1557
+
1558
+ uploadApi = UploadsApi.new(config)
1559
+
1560
+ begin
1561
+ updatedUpload = uploadApi.update_upload("upl_71be866e430b11e9", uploadUpdatable)
1562
+ rescue => err
1563
+ p err.message
1564
+ end
1565
+ ```
1566
+
1567
+ ### Create
1568
+ ```bash
1569
+ curl https://api.lob.com/v1/uploads \
1570
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1571
+ -d "campaignId=cmp_e05ee61ff80764b" \
1572
+ ```
1573
+
1574
+ ```ruby
1575
+ uploadCreate = UploadWritable.new({
1576
+ campaign_id: "cmp_e05ee61ff80764b",
1577
+ });
1578
+
1579
+ uploadApi = UploadsApi.new(config)
1580
+
1581
+ begin
1582
+ createdUpload = uploadApi.create_upload(uploadCreate)
1583
+ rescue => err
1584
+ p err.message
1585
+ end
1586
+ ```
1587
+
1588
+
1589
+
1590
+
1591
+
1592
+
1593
+ ### Delete
1594
+ ```bash
1595
+ curl -X DELETE "https://api.lob.com/v1/uploads/upl_71be866e430b11e9" \
1596
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:
1597
+ ```
1598
+
1599
+ ```ruby
1600
+ uploadApi = UploadsApi.new(config)
1601
+
1602
+ begin
1603
+ deletedUpload = uploadApi.delete_upload("upl_71be866e430b11e9")
1604
+ rescue => err
1605
+ p err.message
1606
+ end
1607
+ ```
1608
+
1609
+ ## ZipLookups Api
1610
+
1611
+ ### ZipLookup
1612
+ ```bash
1613
+ curl https://api.lob.com/v1/us_zip_lookups \
1614
+ -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \
1615
+ -d "zip_code=94107"
1616
+ ```
1617
+
1618
+ ```ruby
1619
+ zipLookupsApi = ZipLookupsApi.new(config)
1620
+
1621
+ zipRequest = ZipEditable.new({
1622
+ zip_code: "94107"
1623
+ })
1624
+
1625
+ begin
1626
+ zipLookup = zipLookupsApi.lookup(zipRequest)
1627
+ rescue => err
1628
+ p err.message
1629
+ end
1630
+ ```
1631
+
1632
+ ## Reverse Geocode Lookups Api
1633
+
1634
+ ### Reverse Geocode Lookup
1635
+ ```bash
1636
+ curl https://api.lob.com/v1/us_reverse_geocode_lookups \
1637
+ -u <YOUR_LIVE_API_KEY>: \
1638
+ ```
1639
+
1640
+ ```ruby
1641
+ reverseGeocodeLookupsApi = ReverseGeocodeLookupsApi.new(config)
1642
+
1643
+ coordinates = Location.new({
1644
+ latitude: 37.777456,
1645
+ longitude: -122.393039,
1646
+ })
1647
+
1648
+ begin
1649
+ geocode = reverseGeocodeLookupsApi.lookup(coordinates)
1650
+ rescue => err
1651
+ p err.message
1652
+ end
1653
+ ```
1654
+
1655
+ ## USAutoCompletions Api
1656
+
1657
+ ### Autocomplete
1658
+ ```bash
1659
+ curl https://api.lob.com/v1/us_autocompletions \
1660
+ -u <YOUR_LIVE_API_KEY>: \
1661
+ -d "address_prefix=185 B" \
1662
+ -d "city=San Francisco" \
1663
+ -d "state=CA" \
1664
+ -d "zip_code=94017" \
1665
+ ```
1666
+
1667
+ ```ruby
1668
+ usAutocompletionsApi = UsAutocompletionsApi.new(config)
1669
+
1670
+ autocompletionData = UsAutocompletionsWritable.new({
1671
+ address_prefix: "185 B",
1672
+ city: "San Francisco",
1673
+ state: "CA",
1674
+ zip_code: "94017",
1675
+ })
1676
+
1677
+ begin
1678
+ autocompletedAddress = usAutocompletionsApi.autocomplete(autocompletionData)
1679
+ rescue => err
1680
+ p err.message
1681
+ end
1682
+ ```
1683
+
1684
+ ## UsVerifications Api
1685
+
1686
+ ### Bulk Verify
1687
+ ```bash
1688
+ curl https://api.lob.com/v1/bulk/us_verifications \
1689
+ -u <YOUR LIVE API KEY>: \
1690
+ --header "Content-Type: application/x-www-form-urlencoded" \
1691
+ --data-urlencode "addresses[0][primary_line]=210 King Street" \
1692
+ --data-urlencode "addresses[0][city]=San Francisco" \
1693
+ --data-urlencode "addresses[0][state]=CA" \
1694
+ --data-urlencode "addresses[0][zip_code]=94017" \
1695
+ --data-urlencode "addresses[1][primary_line]=185 BERRY ST STE 6600" \
1696
+ --data-urlencode "addresses[1][city]=SAN FRANCISCO" \
1697
+ --data-urlencode "addresses[1][state]=CA" \
1698
+ --data-urlencode "addresses[1][zip_code]=94017" \
1699
+ ```
1700
+
1701
+ ```ruby
1702
+ usVerificationsApi = UsVerificationsApi.new(config)
1703
+
1704
+
1705
+ verificationData0 = MultipleComponents.new({
1706
+ primary_line: "210 King Street",
1707
+ city: "San Francisco",
1708
+ state: "CA",
1709
+ zip_code: "94017",
1710
+ })
1711
+
1712
+ verificationData1 = MultipleComponents.new({
1713
+ primary_line: "185 BERRY ST STE 6600",
1714
+ city: "SAN FRANCISCO",
1715
+ state: "CA",
1716
+ zip_code: "94017",
1717
+ })
1718
+
1719
+
1720
+ addressList = MultipleComponentsList.new({
1721
+ addresses: [
1722
+ verificationData0,
1723
+ verificationData1,
1724
+ ],
1725
+ })
1726
+
1727
+ begin
1728
+ bulkVerifiedAddrs = usVerificationsApi.verifyBulk(addressList)
1729
+ rescue => err
1730
+ p err.message
1731
+ end
1732
+ ```
1733
+
1734
+ ### Single Verify
1735
+ ```bash
1736
+ curl https://api.lob.com/v1/us_verifications \
1737
+ -u <YOUR_LIVE_API_KEY>: \
1738
+ -d "primary_line=210 King Street" \
1739
+ -d "city=San Francisco" \
1740
+ -d "state=CA" \
1741
+ -d "zip_code=94017" \
1742
+ ```
1743
+
1744
+ ```ruby
1745
+ usVerificationsApi = UsVerificationsApi.new(config)
1746
+
1747
+ verificationData = UsVerificationsWritable.new({
1748
+ primary_line: "210 King Street",
1749
+ city: "San Francisco",
1750
+ state: "CA",
1751
+ zip_code: "94017",
1752
+ })
1753
+
1754
+ begin
1755
+ singleVerifiedAddr = usVerificationsApi.verifySingle(verificationData)
1756
+ rescue => err
1757
+ p err.message
1758
+ end
1759
+ ```
1760
+
1761
+ ## IntlAutocompletion Api
1762
+
1763
+ ### IntlAutocompletion
1764
+ ```bash
1765
+ curl https://api.lob.com/v1/intl_autocompletions \
1766
+ -u <YOUR_LIVE_API_KEY>: \
1767
+ -d "address_prefix=340 Wat" \
1768
+ -d "city=Summerside" \
1769
+ -d "state=Prince Edward Island" \
1770
+ -d "zip_code=C1N 1C4" \
1771
+ -d "country=CA" \
1772
+ ```
1773
+
1774
+ ```ruby
1775
+ intlAutocompletionsApi = IntlAutocompletionsApi.new(config)
1776
+
1777
+ autocompletionData = IntlAutocompletionsWritable.new({
1778
+ address_prefix: "340 Wat",
1779
+ city: "Summerside",
1780
+ state: "Prince Edward Island",
1781
+ zip_code: "C1N 1C4",
1782
+ country: CountryExtended::CA,
1783
+ })
1784
+
1785
+ begin
1786
+ autocompletedAddr = intlAutocompletionsApi.autocomplete(autocompletionData)
1787
+ rescue => err
1788
+ p err.message
1789
+ end
1790
+ ```
1791
+
1792
+ ## IntlVerifications Api
1793
+
1794
+ ### Single Verify
1795
+ ```bash
1796
+ curl https://api.lob.com/v1/intl_verifications \
1797
+ -u <YOUR_LIVE_API_KEY>: \
1798
+ -d "primary_line=370 Water St" \
1799
+ -d "city=Summerside" \
1800
+ -d "state=Prince Edward Island" \
1801
+ -d "postal_code=C1N 1C4" \
1802
+ -d "country=CA" \
1803
+ ```
1804
+
1805
+ ```ruby
1806
+ intlVerificationsApi = IntlVerificationsApi.new(config)
1807
+
1808
+ verificationData = IntlVerificationWritable.new({
1809
+ primary_line: "370 Water St",
1810
+ city: "Summerside",
1811
+ state: "Prince Edward Island",
1812
+ postal_code: "C1N 1C4",
1813
+ country: CountryExtended::CA,
1814
+ })
1815
+
1816
+ begin
1817
+ verifiedAddr = intlVerificationsApi.verifySingle(verificationData)
1818
+ rescue => err
1819
+ p err.message
1820
+ end
1821
+ ```
1822
+
1823
+ ### Bulk Verify
1824
+ ```bash
1825
+ curl https://api.lob.com/v1/bulk/intl_verifications \
1826
+ -u <YOUR LIVE API KEY>: \
1827
+ --header 'Content-Type: application/x-www-form-urlencoded' \
1828
+ --data-urlencode 'addresses[0][primary_line]=35 Tower Hill' \
1829
+ --data-urlencode 'addresses[0][city]=London' \
1830
+ --data-urlencode 'addresses[0][postal_code]=EC3N 4DR' \
1831
+ --data-urlencode 'addresses[0][country]=GB' \
1832
+ --data-urlencode 'addresses[1][primary_line]=370 Water St' \
1833
+ --data-urlencode 'addresses[1][city]=Summerside' \
1834
+ --data-urlencode 'addresses[1][state]=Prince Edward Island' \
1835
+ --data-urlencode 'addresses[1][postal_code]=C1N 1C4' \
1836
+ --data-urlencode 'addresses[1][country]=CA' \
1837
+ ```
1838
+
1839
+ ```ruby
1840
+ intlVerificationsApi = IntlVerificationsApi.new(config)
1841
+
1842
+ verificationData0 = MultipleComponentsIntl.new({
1843
+ primary_line: "35 Tower Hill",
1844
+ city: "London",
1845
+ postal_code: "EC3N 4DR",
1846
+ country: "GB",
1847
+ })
1848
+
1849
+ verificationData1 = MultipleComponentsIntl.new({
1850
+ primary_line: "370 Water St",
1851
+ city: "Summerside",
1852
+ state: "Prince Edward Island",
1853
+ postal_code: "C1N 1C4",
1854
+ country: "CA",
1855
+ })
1856
+
1857
+
1858
+ addressList = IntlVerificationsPayload.new({
1859
+ addresses: [
1860
+ verificationData0,
1861
+ verificationData1,
1862
+ ],
1863
+ })
1864
+
1865
+ begin
1866
+ bulkVerifiedAddrs = intlVerificationsApi.verifyBulk(addressList)
1867
+ rescue => err
1868
+ p err.message
1869
+ end
1870
+ ```
1871
+