ship_engine 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (733) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +431 -0
  4. data/Rakefile +10 -0
  5. data/docs/AddFundsToCarrierRequestBody.md +16 -0
  6. data/docs/AddFundsToCarrierResponseBody.md +17 -0
  7. data/docs/AddFundsToInsuranceRequestBody.md +16 -0
  8. data/docs/AddFundsToInsuranceResponseBody.md +16 -0
  9. data/docs/AddToBatchRequestBody.md +16 -0
  10. data/docs/Address.md +16 -0
  11. data/docs/AddressResidentialIndicator.md +16 -0
  12. data/docs/AddressToValidate.md +16 -0
  13. data/docs/AddressValidatingShipment.md +61 -0
  14. data/docs/AddressValidationCode.md +16 -0
  15. data/docs/AddressValidationDetailCode.md +16 -0
  16. data/docs/AddressValidationMessageType.md +16 -0
  17. data/docs/AddressValidationResult.md +23 -0
  18. data/docs/AddressValidationStatus.md +16 -0
  19. data/docs/AddressesApi.md +118 -0
  20. data/docs/AdvancedShipmentOptions.md +47 -0
  21. data/docs/AncillaryServiceEndorsement.md +16 -0
  22. data/docs/Batch.md +51 -0
  23. data/docs/BatchResponseError.md +19 -0
  24. data/docs/BatchStatus.md +16 -0
  25. data/docs/BatchesApi.md +580 -0
  26. data/docs/BatchesSortBy.md +16 -0
  27. data/docs/BillToParty.md +16 -0
  28. data/docs/BulkRate.md +25 -0
  29. data/docs/CalculateRatesRequestBody.md +16 -0
  30. data/docs/CalculateRatesResponseBody.md +61 -0
  31. data/docs/Carrier.md +41 -0
  32. data/docs/CarrierAccountsApi.md +238 -0
  33. data/docs/CarrierAdvancedOption.md +21 -0
  34. data/docs/CarrierName.md +16 -0
  35. data/docs/CarrierNameWithSettings.md +16 -0
  36. data/docs/CarriersApi.md +336 -0
  37. data/docs/CollectOnDelivery.md +19 -0
  38. data/docs/CollectOnDeliveryPaymentType.md +16 -0
  39. data/docs/CompareBulkRatesRequestBody.md +16 -0
  40. data/docs/ConnectAccessWorldwideRequestBody.md +21 -0
  41. data/docs/ConnectAmazonBuyShippingRequestBody.md +23 -0
  42. data/docs/ConnectApcRequestBody.md +21 -0
  43. data/docs/ConnectAsendiaRequestBody.md +23 -0
  44. data/docs/ConnectAustraliaPostRequestBody.md +23 -0
  45. data/docs/ConnectCanadaPostRequestBody.md +25 -0
  46. data/docs/ConnectCarrierRequestBody.md +113 -0
  47. data/docs/ConnectCarrierResponseBody.md +17 -0
  48. data/docs/ConnectDhlEcommerceRequestBody.md +39 -0
  49. data/docs/ConnectDhlExpressAuRequestBody.md +19 -0
  50. data/docs/ConnectDhlExpressCaRequestBody.md +19 -0
  51. data/docs/ConnectDhlExpressRequestBody.md +19 -0
  52. data/docs/ConnectDhlExpressUkRequestBody.md +23 -0
  53. data/docs/ConnectDpdRequestBody.md +21 -0
  54. data/docs/ConnectEndiciaRequestBody.md +21 -0
  55. data/docs/ConnectFedexRequestBody.md +45 -0
  56. data/docs/ConnectFedexUkRequestBody.md +45 -0
  57. data/docs/ConnectFirstmileRequestBody.md +23 -0
  58. data/docs/ConnectGlobegisticsRequestBody.md +21 -0
  59. data/docs/ConnectImexRequestBody.md +21 -0
  60. data/docs/ConnectInsurerRequestBody.md +19 -0
  61. data/docs/ConnectNewgisticsRequestBody.md +23 -0
  62. data/docs/ConnectOntracRequestBody.md +21 -0
  63. data/docs/ConnectPurolatorRequestBody.md +21 -0
  64. data/docs/ConnectRoyalMailRequestBody.md +39 -0
  65. data/docs/ConnectRrDonnelleyRequestBody.md +21 -0
  66. data/docs/ConnectSekoRequestBody.md +19 -0
  67. data/docs/ConnectSendleRequestBody.md +21 -0
  68. data/docs/ConnectStampsRequestBody.md +21 -0
  69. data/docs/ConnectUpsRequestBody.md +51 -0
  70. data/docs/CreateAndValidateShipment.md +63 -0
  71. data/docs/CreateBatchRequestBody.md +23 -0
  72. data/docs/CreateBatchResponseBody.md +16 -0
  73. data/docs/CreateLabelFromRateRequestBody.md +16 -0
  74. data/docs/CreateLabelFromRateResponseBody.md +16 -0
  75. data/docs/CreateLabelFromShipmentRequestBody.md +23 -0
  76. data/docs/CreateLabelFromShipmentResponseBody.md +16 -0
  77. data/docs/CreateLabelRequestBody.md +16 -0
  78. data/docs/CreateLabelResponseBody.md +16 -0
  79. data/docs/CreateManifestByObjectRequestBody.md +25 -0
  80. data/docs/CreateManifestLabelIdsRequestBody.md +17 -0
  81. data/docs/CreateManifestRequestBody.md +25 -0
  82. data/docs/CreateManifestResponseBody.md +35 -0
  83. data/docs/CreatePackageTypeRequestBody.md +16 -0
  84. data/docs/CreatePackageTypeResponseBody.md +16 -0
  85. data/docs/CreateReturnLabelRequestBody.md +25 -0
  86. data/docs/CreateReturnLabelResponseBody.md +16 -0
  87. data/docs/CreateShipmentResponseBodyFields.md +19 -0
  88. data/docs/CreateShipmentsRequestBody.md +17 -0
  89. data/docs/CreateShipmentsResponseBody.md +19 -0
  90. data/docs/CreateTagResponseBody.md +16 -0
  91. data/docs/CreateWarehouseRequestBody.md +16 -0
  92. data/docs/CreateWarehouseResponseBody.md +16 -0
  93. data/docs/CreateWebhookRequestBody.md +19 -0
  94. data/docs/CreateWebhookResponseBody.md +16 -0
  95. data/docs/Currency.md +16 -0
  96. data/docs/CustomsItem.md +33 -0
  97. data/docs/DeliveryConfirmation.md +16 -0
  98. data/docs/DeprecatedManifest.md +33 -0
  99. data/docs/DhlExpressAccountSettings.md +21 -0
  100. data/docs/DhlExpressSettingsResponseBody.md +16 -0
  101. data/docs/DimensionUnit.md +16 -0
  102. data/docs/Dimensions.md +23 -0
  103. data/docs/DownloadsApi.md +71 -0
  104. data/docs/Error.md +23 -0
  105. data/docs/ErrorCode.md +16 -0
  106. data/docs/ErrorResponseBody.md +19 -0
  107. data/docs/ErrorSource.md +16 -0
  108. data/docs/ErrorType.md +16 -0
  109. data/docs/EstimateRatesRequestBody.md +16 -0
  110. data/docs/FedexAccountSettings.md +25 -0
  111. data/docs/FedexAccountSettingsRequestBody.md +16 -0
  112. data/docs/FedexPickupType.md +16 -0
  113. data/docs/FedexSettingsResponseBody.md +16 -0
  114. data/docs/GetBatchByExternalIdResponseBody.md +16 -0
  115. data/docs/GetBatchByIdResponseBody.md +16 -0
  116. data/docs/GetCarrierByIdResponseBody.md +16 -0
  117. data/docs/GetCarrierOptionsResponseBody.md +17 -0
  118. data/docs/GetCarrierSettingsResponseBody.md +45 -0
  119. data/docs/GetCarriersResponseBody.md +21 -0
  120. data/docs/GetInsuranceBalanceResponseBody.md +16 -0
  121. data/docs/GetLabelByExternalShipmentIdResponseBody.md +16 -0
  122. data/docs/GetLabelByIdResponseBody.md +16 -0
  123. data/docs/GetManifestByIdResponseBody.md +16 -0
  124. data/docs/GetPackageTypeByIdResponseBody.md +16 -0
  125. data/docs/GetRateByIdResponseBody.md +16 -0
  126. data/docs/GetShipmentByExternalIdResponseBody.md +16 -0
  127. data/docs/GetShipmentByIdResponseBody.md +16 -0
  128. data/docs/GetTrackingLogFromLabelResponseBody.md +16 -0
  129. data/docs/GetTrackingLogResponseBody.md +16 -0
  130. data/docs/GetWarehouseByIdResponseBody.md +16 -0
  131. data/docs/GetWebhookByIdResponseBody.md +16 -0
  132. data/docs/InsuranceApi.md +220 -0
  133. data/docs/InsuranceProvider.md +16 -0
  134. data/docs/InternationalShipmentOptions.md +21 -0
  135. data/docs/Label.md +81 -0
  136. data/docs/LabelChargeEvent.md +16 -0
  137. data/docs/LabelDownload.md +23 -0
  138. data/docs/LabelDownloadType.md +16 -0
  139. data/docs/LabelFormat.md +16 -0
  140. data/docs/LabelLayout.md +16 -0
  141. data/docs/LabelMessages.md +21 -0
  142. data/docs/LabelStatus.md +16 -0
  143. data/docs/LabelsApi.md +545 -0
  144. data/docs/Link.md +16 -0
  145. data/docs/ListBatchErrorsResponseBody.md +19 -0
  146. data/docs/ListBatchesResponseBody.md +25 -0
  147. data/docs/ListCarrierPackageTypesResponseBody.md +17 -0
  148. data/docs/ListCarrierServicesResponseBody.md +17 -0
  149. data/docs/ListCarriersResponseBody.md +17 -0
  150. data/docs/ListLabelsResponseBody.md +17 -0
  151. data/docs/ListManifestsResponseBody.md +25 -0
  152. data/docs/ListPackageTypesResponseBody.md +17 -0
  153. data/docs/ListShipmentErrorsResponseBody.md +19 -0
  154. data/docs/ListShipmentRatesResponseBody.md +16 -0
  155. data/docs/ListShipmentsResponseBody.md +25 -0
  156. data/docs/ListTagsResponseBody.md +17 -0
  157. data/docs/ListWarehousesResponseBody.md +17 -0
  158. data/docs/Manifest.md +33 -0
  159. data/docs/ManifestDownload.md +17 -0
  160. data/docs/Manifests.md +17 -0
  161. data/docs/ManifestsApi.md +191 -0
  162. data/docs/ModifyBatch.md +19 -0
  163. data/docs/MonetaryValue.md +19 -0
  164. data/docs/NonDelivery.md +16 -0
  165. data/docs/OptionalLink.md +19 -0
  166. data/docs/OrderSourceName.md +16 -0
  167. data/docs/Package.md +29 -0
  168. data/docs/PackageContents.md +16 -0
  169. data/docs/PackageType.md +25 -0
  170. data/docs/PackageTypesApi.md +281 -0
  171. data/docs/PagedListResponseBody.md +23 -0
  172. data/docs/PaginationLink.md +23 -0
  173. data/docs/ParseAddressRequestBody.md +19 -0
  174. data/docs/ParseAddressResponseBody.md +21 -0
  175. data/docs/ParseShipmentRequestBody.md +20 -0
  176. data/docs/ParseShipmentResponseBody.md +21 -0
  177. data/docs/PartialAddress.md +37 -0
  178. data/docs/PartialShipment.md +59 -0
  179. data/docs/PaymentAmount.md +19 -0
  180. data/docs/ProcessBatchRequestBody.md +21 -0
  181. data/docs/PurchaseLabelWithoutShipment.md +23 -0
  182. data/docs/Rate.md +65 -0
  183. data/docs/RateEstimateByCarrierId.md +17 -0
  184. data/docs/RateEstimateByCarrierIds.md +17 -0
  185. data/docs/RateEstimateOptions.md +41 -0
  186. data/docs/RateRequestBody.md +25 -0
  187. data/docs/RateRequestByShipmentIds.md +17 -0
  188. data/docs/RateRequestByShipments.md +17 -0
  189. data/docs/RateRequestOptions.md +17 -0
  190. data/docs/RateRequestRateOptions.md +17 -0
  191. data/docs/RateResponse.md +17 -0
  192. data/docs/RateResponseStatus.md +16 -0
  193. data/docs/RateType.md +16 -0
  194. data/docs/RatesApi.md +228 -0
  195. data/docs/RatesInformation.md +29 -0
  196. data/docs/RecognizedEntity.md +27 -0
  197. data/docs/RemoveFromBatchRequestBody.md +16 -0
  198. data/docs/ResponseMessage.md +23 -0
  199. data/docs/Service.md +29 -0
  200. data/docs/Shipment.md +16 -0
  201. data/docs/ShipmentIdRequest.md +17 -0
  202. data/docs/ShipmentItem.md +33 -0
  203. data/docs/ShipmentRequest.md +17 -0
  204. data/docs/ShipmentResponseError.md +21 -0
  205. data/docs/ShipmentStatus.md +16 -0
  206. data/docs/ShipmentsApi.md +653 -0
  207. data/docs/ShipmentsSortBy.md +16 -0
  208. data/docs/SmartPostHub.md +16 -0
  209. data/docs/SortDir.md +16 -0
  210. data/docs/Tag.md +17 -0
  211. data/docs/TagShipmentResponseBody.md +19 -0
  212. data/docs/TagsApi.md +226 -0
  213. data/docs/TrackEvent.md +39 -0
  214. data/docs/TrackingApi.md +185 -0
  215. data/docs/TrackingInformation.md +35 -0
  216. data/docs/TrackingStatus.md +16 -0
  217. data/docs/UpdateAmazonBuyShippingRequestBody.md +17 -0
  218. data/docs/UpdateCarrierSettingsRequestBody.md +51 -0
  219. data/docs/UpdateDhlExpressSettingsRequestBody.md +16 -0
  220. data/docs/UpdateFedexSettingsRequestBody.md +16 -0
  221. data/docs/UpdateNewgisticsSettingsRequestBody.md +19 -0
  222. data/docs/UpdatePackageTypeRequestBody.md +16 -0
  223. data/docs/UpdateShipmentFields.md +17 -0
  224. data/docs/UpdateShipmentRequestBody.md +61 -0
  225. data/docs/UpdateShipmentResponseBody.md +16 -0
  226. data/docs/UpdateUpsSettingsRequestBody.md +16 -0
  227. data/docs/UpdateWarehouseRequestBody.md +16 -0
  228. data/docs/UpdateWebhookRequestBody.md +17 -0
  229. data/docs/UpsAccountSettings.md +39 -0
  230. data/docs/UpsInvoice.md +23 -0
  231. data/docs/UpsPickupType.md +16 -0
  232. data/docs/UpsSettingsResponseBody.md +16 -0
  233. data/docs/ValidateAddress.md +16 -0
  234. data/docs/ValidateShipmentFields.md +17 -0
  235. data/docs/ValidationStatus.md +16 -0
  236. data/docs/VoidLabelResponseBody.md +19 -0
  237. data/docs/Warehouse.md +25 -0
  238. data/docs/WarehousesApi.md +281 -0
  239. data/docs/Webhook.md +21 -0
  240. data/docs/WebhookEvent.md +16 -0
  241. data/docs/WebhooksApi.md +281 -0
  242. data/docs/Weight.md +19 -0
  243. data/docs/WeightUnit.md +16 -0
  244. data/git_push.sh +58 -0
  245. data/lib/openapi_client.rb +278 -0
  246. data/lib/openapi_client/api/addresses_api.rb +150 -0
  247. data/lib/openapi_client/api/batches_api.rb +790 -0
  248. data/lib/openapi_client/api/carrier_accounts_api.rb +343 -0
  249. data/lib/openapi_client/api/carriers_api.rb +461 -0
  250. data/lib/openapi_client/api/downloads_api.rb +99 -0
  251. data/lib/openapi_client/api/insurance_api.rb +262 -0
  252. data/lib/openapi_client/api/labels_api.rb +812 -0
  253. data/lib/openapi_client/api/manifests_api.rb +278 -0
  254. data/lib/openapi_client/api/package_types_api.rb +375 -0
  255. data/lib/openapi_client/api/rates_api.rb +289 -0
  256. data/lib/openapi_client/api/shipments_api.rb +899 -0
  257. data/lib/openapi_client/api/tags_api.rb +286 -0
  258. data/lib/openapi_client/api/tracking_api.rb +232 -0
  259. data/lib/openapi_client/api/warehouses_api.rb +375 -0
  260. data/lib/openapi_client/api/webhooks_api.rb +375 -0
  261. data/lib/openapi_client/api_client.rb +388 -0
  262. data/lib/openapi_client/api_error.rb +57 -0
  263. data/lib/openapi_client/configuration.rb +248 -0
  264. data/lib/openapi_client/models/add_funds_to_carrier_request_body.rb +209 -0
  265. data/lib/openapi_client/models/add_funds_to_carrier_response_body.rb +213 -0
  266. data/lib/openapi_client/models/add_funds_to_insurance_request_body.rb +209 -0
  267. data/lib/openapi_client/models/add_funds_to_insurance_response_body.rb +209 -0
  268. data/lib/openapi_client/models/add_to_batch_request_body.rb +209 -0
  269. data/lib/openapi_client/models/address.rb +209 -0
  270. data/lib/openapi_client/models/address_residential_indicator.rb +37 -0
  271. data/lib/openapi_client/models/address_to_validate.rb +209 -0
  272. data/lib/openapi_client/models/address_validating_shipment.rb +484 -0
  273. data/lib/openapi_client/models/address_validation_code.rb +47 -0
  274. data/lib/openapi_client/models/address_validation_detail_code.rb +92 -0
  275. data/lib/openapi_client/models/address_validation_message_type.rb +37 -0
  276. data/lib/openapi_client/models/address_validation_result.rb +259 -0
  277. data/lib/openapi_client/models/address_validation_status.rb +38 -0
  278. data/lib/openapi_client/models/advanced_shipment_options.rb +434 -0
  279. data/lib/openapi_client/models/ancillary_service_endorsement.rb +40 -0
  280. data/lib/openapi_client/models/batch.rb +566 -0
  281. data/lib/openapi_client/models/batch_response_error.rb +233 -0
  282. data/lib/openapi_client/models/batch_status.rb +42 -0
  283. data/lib/openapi_client/models/batches_sort_by.rb +36 -0
  284. data/lib/openapi_client/models/bill_to_party.rb +36 -0
  285. data/lib/openapi_client/models/bulk_rate.rb +273 -0
  286. data/lib/openapi_client/models/calculate_rates_request_body.rb +225 -0
  287. data/lib/openapi_client/models/calculate_rates_response_body.rb +525 -0
  288. data/lib/openapi_client/models/carrier.rb +394 -0
  289. data/lib/openapi_client/models/carrier_advanced_option.rb +273 -0
  290. data/lib/openapi_client/models/carrier_name.rb +61 -0
  291. data/lib/openapi_client/models/carrier_name_with_settings.rb +38 -0
  292. data/lib/openapi_client/models/collect_on_delivery.rb +216 -0
  293. data/lib/openapi_client/models/collect_on_delivery_payment_type.rb +38 -0
  294. data/lib/openapi_client/models/compare_bulk_rates_request_body.rb +225 -0
  295. data/lib/openapi_client/models/connect_access_worldwide_request_body.rb +300 -0
  296. data/lib/openapi_client/models/connect_amazon_buy_shipping_request_body.rb +312 -0
  297. data/lib/openapi_client/models/connect_apc_request_body.rb +300 -0
  298. data/lib/openapi_client/models/connect_asendia_request_body.rb +334 -0
  299. data/lib/openapi_client/models/connect_australia_post_request_body.rb +334 -0
  300. data/lib/openapi_client/models/connect_canada_post_request_body.rb +368 -0
  301. data/lib/openapi_client/models/connect_carrier_request_body.rb +1661 -0
  302. data/lib/openapi_client/models/connect_carrier_response_body.rb +213 -0
  303. data/lib/openapi_client/models/connect_dhl_ecommerce_request_body.rb +536 -0
  304. data/lib/openapi_client/models/connect_dhl_express_au_request_body.rb +266 -0
  305. data/lib/openapi_client/models/connect_dhl_express_ca_request_body.rb +266 -0
  306. data/lib/openapi_client/models/connect_dhl_express_request_body.rb +266 -0
  307. data/lib/openapi_client/models/connect_dhl_express_uk_request_body.rb +315 -0
  308. data/lib/openapi_client/models/connect_dpd_request_body.rb +300 -0
  309. data/lib/openapi_client/models/connect_endicia_request_body.rb +300 -0
  310. data/lib/openapi_client/models/connect_fedex_request_body.rb +643 -0
  311. data/lib/openapi_client/models/connect_fedex_uk_request_body.rb +643 -0
  312. data/lib/openapi_client/models/connect_firstmile_request_body.rb +306 -0
  313. data/lib/openapi_client/models/connect_globegistics_request_body.rb +300 -0
  314. data/lib/openapi_client/models/connect_imex_request_body.rb +300 -0
  315. data/lib/openapi_client/models/connect_insurer_request_body.rb +245 -0
  316. data/lib/openapi_client/models/connect_newgistics_request_body.rb +316 -0
  317. data/lib/openapi_client/models/connect_ontrac_request_body.rb +300 -0
  318. data/lib/openapi_client/models/connect_purolator_request_body.rb +300 -0
  319. data/lib/openapi_client/models/connect_royal_mail_request_body.rb +513 -0
  320. data/lib/openapi_client/models/connect_rr_donnelley_request_body.rb +300 -0
  321. data/lib/openapi_client/models/connect_seko_request_body.rb +266 -0
  322. data/lib/openapi_client/models/connect_sendle_request_body.rb +281 -0
  323. data/lib/openapi_client/models/connect_stamps_request_body.rb +300 -0
  324. data/lib/openapi_client/models/connect_ups_request_body.rb +730 -0
  325. data/lib/openapi_client/models/create_and_validate_shipment.rb +472 -0
  326. data/lib/openapi_client/models/create_batch_request_body.rb +257 -0
  327. data/lib/openapi_client/models/create_batch_response_body.rb +209 -0
  328. data/lib/openapi_client/models/create_label_from_rate_request_body.rb +209 -0
  329. data/lib/openapi_client/models/create_label_from_rate_response_body.rb +209 -0
  330. data/lib/openapi_client/models/create_label_from_shipment_request_body.rb +234 -0
  331. data/lib/openapi_client/models/create_label_from_shipment_response_body.rb +209 -0
  332. data/lib/openapi_client/models/create_label_request_body.rb +209 -0
  333. data/lib/openapi_client/models/create_label_response_body.rb +209 -0
  334. data/lib/openapi_client/models/create_manifest_by_object_request_body.rb +267 -0
  335. data/lib/openapi_client/models/create_manifest_label_ids_request_body.rb +215 -0
  336. data/lib/openapi_client/models/create_manifest_request_body.rb +295 -0
  337. data/lib/openapi_client/models/create_manifest_response_body.rb +389 -0
  338. data/lib/openapi_client/models/create_package_type_request_body.rb +209 -0
  339. data/lib/openapi_client/models/create_package_type_response_body.rb +209 -0
  340. data/lib/openapi_client/models/create_return_label_request_body.rb +248 -0
  341. data/lib/openapi_client/models/create_return_label_response_body.rb +209 -0
  342. data/lib/openapi_client/models/create_shipment_response_body_fields.rb +219 -0
  343. data/lib/openapi_client/models/create_shipments_request_body.rb +215 -0
  344. data/lib/openapi_client/models/create_shipments_response_body.rb +232 -0
  345. data/lib/openapi_client/models/create_tag_response_body.rb +209 -0
  346. data/lib/openapi_client/models/create_warehouse_request_body.rb +209 -0
  347. data/lib/openapi_client/models/create_warehouse_response_body.rb +209 -0
  348. data/lib/openapi_client/models/create_webhook_request_body.rb +227 -0
  349. data/lib/openapi_client/models/create_webhook_response_body.rb +209 -0
  350. data/lib/openapi_client/models/currency.rb +40 -0
  351. data/lib/openapi_client/models/customs_item.rb +334 -0
  352. data/lib/openapi_client/models/delivery_confirmation.rb +40 -0
  353. data/lib/openapi_client/models/deprecated_manifest.rb +317 -0
  354. data/lib/openapi_client/models/dhl_express_account_settings.rb +243 -0
  355. data/lib/openapi_client/models/dhl_express_settings_response_body.rb +209 -0
  356. data/lib/openapi_client/models/dimension_unit.rb +36 -0
  357. data/lib/openapi_client/models/dimensions.rb +320 -0
  358. data/lib/openapi_client/models/error.rb +274 -0
  359. data/lib/openapi_client/models/error_code.rb +71 -0
  360. data/lib/openapi_client/models/error_response_body.rb +230 -0
  361. data/lib/openapi_client/models/error_source.rb +37 -0
  362. data/lib/openapi_client/models/error_type.rb +40 -0
  363. data/lib/openapi_client/models/estimate_rates_request_body.rb +225 -0
  364. data/lib/openapi_client/models/fedex_account_settings.rb +259 -0
  365. data/lib/openapi_client/models/fedex_account_settings_request_body.rb +209 -0
  366. data/lib/openapi_client/models/fedex_pickup_type.rb +40 -0
  367. data/lib/openapi_client/models/fedex_settings_response_body.rb +209 -0
  368. data/lib/openapi_client/models/get_batch_by_external_id_response_body.rb +209 -0
  369. data/lib/openapi_client/models/get_batch_by_id_response_body.rb +209 -0
  370. data/lib/openapi_client/models/get_carrier_by_id_response_body.rb +209 -0
  371. data/lib/openapi_client/models/get_carrier_options_response_body.rb +210 -0
  372. data/lib/openapi_client/models/get_carrier_settings_response_body.rb +413 -0
  373. data/lib/openapi_client/models/get_carriers_response_body.rb +254 -0
  374. data/lib/openapi_client/models/get_insurance_balance_response_body.rb +209 -0
  375. data/lib/openapi_client/models/get_label_by_external_shipment_id_response_body.rb +209 -0
  376. data/lib/openapi_client/models/get_label_by_id_response_body.rb +209 -0
  377. data/lib/openapi_client/models/get_manifest_by_id_response_body.rb +209 -0
  378. data/lib/openapi_client/models/get_package_type_by_id_response_body.rb +209 -0
  379. data/lib/openapi_client/models/get_rate_by_id_response_body.rb +209 -0
  380. data/lib/openapi_client/models/get_shipment_by_external_id_response_body.rb +209 -0
  381. data/lib/openapi_client/models/get_shipment_by_id_response_body.rb +209 -0
  382. data/lib/openapi_client/models/get_tracking_log_from_label_response_body.rb +209 -0
  383. data/lib/openapi_client/models/get_tracking_log_response_body.rb +209 -0
  384. data/lib/openapi_client/models/get_warehouse_by_id_response_body.rb +209 -0
  385. data/lib/openapi_client/models/get_webhook_by_id_response_body.rb +209 -0
  386. data/lib/openapi_client/models/insurance_provider.rb +38 -0
  387. data/lib/openapi_client/models/international_shipment_options.rb +240 -0
  388. data/lib/openapi_client/models/label.rb +548 -0
  389. data/lib/openapi_client/models/label_charge_event.rb +37 -0
  390. data/lib/openapi_client/models/label_download.rb +238 -0
  391. data/lib/openapi_client/models/label_download_type.rb +36 -0
  392. data/lib/openapi_client/models/label_format.rb +37 -0
  393. data/lib/openapi_client/models/label_layout.rb +36 -0
  394. data/lib/openapi_client/models/label_messages.rb +237 -0
  395. data/lib/openapi_client/models/label_status.rb +38 -0
  396. data/lib/openapi_client/models/link.rb +209 -0
  397. data/lib/openapi_client/models/list_batch_errors_response_body.rb +229 -0
  398. data/lib/openapi_client/models/list_batches_response_body.rb +331 -0
  399. data/lib/openapi_client/models/list_carrier_package_types_response_body.rb +210 -0
  400. data/lib/openapi_client/models/list_carrier_services_response_body.rb +210 -0
  401. data/lib/openapi_client/models/list_carriers_response_body.rb +215 -0
  402. data/lib/openapi_client/models/list_labels_response_body.rb +226 -0
  403. data/lib/openapi_client/models/list_manifests_response_body.rb +332 -0
  404. data/lib/openapi_client/models/list_package_types_response_body.rb +210 -0
  405. data/lib/openapi_client/models/list_shipment_errors_response_body.rb +229 -0
  406. data/lib/openapi_client/models/list_shipment_rates_response_body.rb +209 -0
  407. data/lib/openapi_client/models/list_shipments_response_body.rb +329 -0
  408. data/lib/openapi_client/models/list_tags_response_body.rb +210 -0
  409. data/lib/openapi_client/models/list_warehouses_response_body.rb +215 -0
  410. data/lib/openapi_client/models/manifest.rb +317 -0
  411. data/lib/openapi_client/models/manifest_download.rb +208 -0
  412. data/lib/openapi_client/models/manifests.rb +209 -0
  413. data/lib/openapi_client/models/modify_batch.rb +222 -0
  414. data/lib/openapi_client/models/monetary_value.rb +246 -0
  415. data/lib/openapi_client/models/non_delivery.rb +36 -0
  416. data/lib/openapi_client/models/optional_link.rb +233 -0
  417. data/lib/openapi_client/models/order_source_name.rb +54 -0
  418. data/lib/openapi_client/models/package.rb +287 -0
  419. data/lib/openapi_client/models/package_contents.rb +39 -0
  420. data/lib/openapi_client/models/package_type.rb +276 -0
  421. data/lib/openapi_client/models/paged_list_response_body.rb +314 -0
  422. data/lib/openapi_client/models/pagination_link.rb +258 -0
  423. data/lib/openapi_client/models/parse_address_request_body.rb +242 -0
  424. data/lib/openapi_client/models/parse_address_response_body.rb +273 -0
  425. data/lib/openapi_client/models/parse_shipment_request_body.rb +242 -0
  426. data/lib/openapi_client/models/parse_shipment_response_body.rb +273 -0
  427. data/lib/openapi_client/models/partial_address.rb +432 -0
  428. data/lib/openapi_client/models/partial_shipment.rb +442 -0
  429. data/lib/openapi_client/models/payment_amount.rb +230 -0
  430. data/lib/openapi_client/models/process_batch_request_body.rb +228 -0
  431. data/lib/openapi_client/models/purchase_label_without_shipment.rb +234 -0
  432. data/lib/openapi_client/models/rate.rb +696 -0
  433. data/lib/openapi_client/models/rate_estimate_by_carrier_id.rb +207 -0
  434. data/lib/openapi_client/models/rate_estimate_by_carrier_ids.rb +209 -0
  435. data/lib/openapi_client/models/rate_estimate_options.rb +381 -0
  436. data/lib/openapi_client/models/rate_request_body.rb +256 -0
  437. data/lib/openapi_client/models/rate_request_by_shipment_ids.rb +214 -0
  438. data/lib/openapi_client/models/rate_request_by_shipments.rb +214 -0
  439. data/lib/openapi_client/models/rate_request_options.rb +207 -0
  440. data/lib/openapi_client/models/rate_request_rate_options.rb +207 -0
  441. data/lib/openapi_client/models/rate_response.rb +207 -0
  442. data/lib/openapi_client/models/rate_response_status.rb +38 -0
  443. data/lib/openapi_client/models/rate_type.rb +36 -0
  444. data/lib/openapi_client/models/rates_information.rb +272 -0
  445. data/lib/openapi_client/models/recognized_entity.rb +389 -0
  446. data/lib/openapi_client/models/remove_from_batch_request_body.rb +209 -0
  447. data/lib/openapi_client/models/response_message.rb +251 -0
  448. data/lib/openapi_client/models/service.rb +297 -0
  449. data/lib/openapi_client/models/shipment.rb +209 -0
  450. data/lib/openapi_client/models/shipment_id_request.rb +207 -0
  451. data/lib/openapi_client/models/shipment_item.rb +347 -0
  452. data/lib/openapi_client/models/shipment_request.rb +207 -0
  453. data/lib/openapi_client/models/shipment_response_error.rb +257 -0
  454. data/lib/openapi_client/models/shipment_status.rb +38 -0
  455. data/lib/openapi_client/models/shipments_sort_by.rb +36 -0
  456. data/lib/openapi_client/models/smart_post_hub.rb +68 -0
  457. data/lib/openapi_client/models/sort_dir.rb +36 -0
  458. data/lib/openapi_client/models/tag.rb +232 -0
  459. data/lib/openapi_client/models/tag_shipment_response_body.rb +228 -0
  460. data/lib/openapi_client/models/track_event.rb +502 -0
  461. data/lib/openapi_client/models/tracking_information.rb +371 -0
  462. data/lib/openapi_client/models/tracking_status.rb +38 -0
  463. data/lib/openapi_client/models/update_amazon_buy_shipping_request_body.rb +223 -0
  464. data/lib/openapi_client/models/update_carrier_settings_request_body.rb +458 -0
  465. data/lib/openapi_client/models/update_dhl_express_settings_request_body.rb +209 -0
  466. data/lib/openapi_client/models/update_fedex_settings_request_body.rb +209 -0
  467. data/lib/openapi_client/models/update_newgistics_settings_request_body.rb +216 -0
  468. data/lib/openapi_client/models/update_package_type_request_body.rb +209 -0
  469. data/lib/openapi_client/models/update_shipment_fields.rb +206 -0
  470. data/lib/openapi_client/models/update_shipment_request_body.rb +469 -0
  471. data/lib/openapi_client/models/update_shipment_response_body.rb +209 -0
  472. data/lib/openapi_client/models/update_ups_settings_request_body.rb +209 -0
  473. data/lib/openapi_client/models/update_warehouse_request_body.rb +209 -0
  474. data/lib/openapi_client/models/update_webhook_request_body.rb +208 -0
  475. data/lib/openapi_client/models/ups_account_settings.rb +361 -0
  476. data/lib/openapi_client/models/ups_invoice.rb +267 -0
  477. data/lib/openapi_client/models/ups_pickup_type.rb +37 -0
  478. data/lib/openapi_client/models/ups_settings_response_body.rb +209 -0
  479. data/lib/openapi_client/models/validate_address.rb +37 -0
  480. data/lib/openapi_client/models/validate_shipment_fields.rb +206 -0
  481. data/lib/openapi_client/models/validation_status.rb +38 -0
  482. data/lib/openapi_client/models/void_label_response_body.rb +246 -0
  483. data/lib/openapi_client/models/warehouse.rb +263 -0
  484. data/lib/openapi_client/models/webhook.rb +227 -0
  485. data/lib/openapi_client/models/webhook_event.rb +41 -0
  486. data/lib/openapi_client/models/weight.rb +246 -0
  487. data/lib/openapi_client/models/weight_unit.rb +38 -0
  488. data/lib/openapi_client/version.rb +15 -0
  489. data/openapi_client-1.0.0.gem +0 -0
  490. data/ship_engine.gemspec +39 -0
  491. data/spec/api/addresses_api_spec.rb +59 -0
  492. data/spec/api/batches_api_spec.rb +164 -0
  493. data/spec/api/carrier_accounts_api_spec.rb +88 -0
  494. data/spec/api/carriers_api_spec.rb +107 -0
  495. data/spec/api/downloads_api_spec.rb +50 -0
  496. data/spec/api/insurance_api_spec.rb +81 -0
  497. data/spec/api/labels_api_spec.rb +161 -0
  498. data/spec/api/manifests_api_spec.rb +79 -0
  499. data/spec/api/package_types_api_spec.rb +95 -0
  500. data/spec/api/rates_api_spec.rb +83 -0
  501. data/spec/api/shipments_api_spec.rb +184 -0
  502. data/spec/api/tags_api_spec.rb +83 -0
  503. data/spec/api/tracking_api_spec.rb +74 -0
  504. data/spec/api/warehouses_api_spec.rb +95 -0
  505. data/spec/api/webhooks_api_spec.rb +95 -0
  506. data/spec/api_client_spec.rb +226 -0
  507. data/spec/configuration_spec.rb +42 -0
  508. data/spec/models/add_funds_to_carrier_request_body_spec.rb +35 -0
  509. data/spec/models/add_funds_to_carrier_response_body_spec.rb +41 -0
  510. data/spec/models/add_funds_to_insurance_request_body_spec.rb +35 -0
  511. data/spec/models/add_funds_to_insurance_response_body_spec.rb +35 -0
  512. data/spec/models/add_to_batch_request_body_spec.rb +35 -0
  513. data/spec/models/address_residential_indicator_spec.rb +35 -0
  514. data/spec/models/address_spec.rb +35 -0
  515. data/spec/models/address_to_validate_spec.rb +35 -0
  516. data/spec/models/address_validating_shipment_spec.rb +173 -0
  517. data/spec/models/address_validation_code_spec.rb +35 -0
  518. data/spec/models/address_validation_detail_code_spec.rb +35 -0
  519. data/spec/models/address_validation_message_type_spec.rb +35 -0
  520. data/spec/models/address_validation_result_spec.rb +59 -0
  521. data/spec/models/address_validation_status_spec.rb +35 -0
  522. data/spec/models/advanced_shipment_options_spec.rb +131 -0
  523. data/spec/models/ancillary_service_endorsement_spec.rb +35 -0
  524. data/spec/models/batch_response_error_spec.rb +47 -0
  525. data/spec/models/batch_spec.rb +143 -0
  526. data/spec/models/batch_status_spec.rb +35 -0
  527. data/spec/models/batches_sort_by_spec.rb +35 -0
  528. data/spec/models/bill_to_party_spec.rb +35 -0
  529. data/spec/models/bulk_rate_spec.rb +65 -0
  530. data/spec/models/calculate_rates_request_body_spec.rb +35 -0
  531. data/spec/models/calculate_rates_response_body_spec.rb +173 -0
  532. data/spec/models/carrier_advanced_option_spec.rb +53 -0
  533. data/spec/models/carrier_name_spec.rb +35 -0
  534. data/spec/models/carrier_name_with_settings_spec.rb +35 -0
  535. data/spec/models/carrier_spec.rb +113 -0
  536. data/spec/models/collect_on_delivery_payment_type_spec.rb +35 -0
  537. data/spec/models/collect_on_delivery_spec.rb +47 -0
  538. data/spec/models/compare_bulk_rates_request_body_spec.rb +35 -0
  539. data/spec/models/connect_access_worldwide_request_body_spec.rb +53 -0
  540. data/spec/models/connect_amazon_buy_shipping_request_body_spec.rb +59 -0
  541. data/spec/models/connect_apc_request_body_spec.rb +53 -0
  542. data/spec/models/connect_asendia_request_body_spec.rb +59 -0
  543. data/spec/models/connect_australia_post_request_body_spec.rb +59 -0
  544. data/spec/models/connect_canada_post_request_body_spec.rb +65 -0
  545. data/spec/models/connect_carrier_request_body_spec.rb +329 -0
  546. data/spec/models/connect_carrier_response_body_spec.rb +41 -0
  547. data/spec/models/connect_dhl_ecommerce_request_body_spec.rb +107 -0
  548. data/spec/models/connect_dhl_express_au_request_body_spec.rb +47 -0
  549. data/spec/models/connect_dhl_express_ca_request_body_spec.rb +47 -0
  550. data/spec/models/connect_dhl_express_request_body_spec.rb +47 -0
  551. data/spec/models/connect_dhl_express_uk_request_body_spec.rb +59 -0
  552. data/spec/models/connect_dpd_request_body_spec.rb +53 -0
  553. data/spec/models/connect_endicia_request_body_spec.rb +53 -0
  554. data/spec/models/connect_fedex_request_body_spec.rb +125 -0
  555. data/spec/models/connect_fedex_uk_request_body_spec.rb +125 -0
  556. data/spec/models/connect_firstmile_request_body_spec.rb +59 -0
  557. data/spec/models/connect_globegistics_request_body_spec.rb +53 -0
  558. data/spec/models/connect_imex_request_body_spec.rb +53 -0
  559. data/spec/models/connect_insurer_request_body_spec.rb +47 -0
  560. data/spec/models/connect_newgistics_request_body_spec.rb +59 -0
  561. data/spec/models/connect_ontrac_request_body_spec.rb +53 -0
  562. data/spec/models/connect_purolator_request_body_spec.rb +53 -0
  563. data/spec/models/connect_royal_mail_request_body_spec.rb +107 -0
  564. data/spec/models/connect_rr_donnelley_request_body_spec.rb +53 -0
  565. data/spec/models/connect_seko_request_body_spec.rb +47 -0
  566. data/spec/models/connect_sendle_request_body_spec.rb +53 -0
  567. data/spec/models/connect_stamps_request_body_spec.rb +53 -0
  568. data/spec/models/connect_ups_request_body_spec.rb +143 -0
  569. data/spec/models/create_and_validate_shipment_spec.rb +179 -0
  570. data/spec/models/create_batch_request_body_spec.rb +59 -0
  571. data/spec/models/create_batch_response_body_spec.rb +35 -0
  572. data/spec/models/create_label_from_rate_request_body_spec.rb +35 -0
  573. data/spec/models/create_label_from_rate_response_body_spec.rb +35 -0
  574. data/spec/models/create_label_from_shipment_request_body_spec.rb +59 -0
  575. data/spec/models/create_label_from_shipment_response_body_spec.rb +35 -0
  576. data/spec/models/create_label_request_body_spec.rb +35 -0
  577. data/spec/models/create_label_response_body_spec.rb +35 -0
  578. data/spec/models/create_manifest_by_object_request_body_spec.rb +65 -0
  579. data/spec/models/create_manifest_label_ids_request_body_spec.rb +41 -0
  580. data/spec/models/create_manifest_request_body_spec.rb +65 -0
  581. data/spec/models/create_manifest_response_body_spec.rb +95 -0
  582. data/spec/models/create_package_type_request_body_spec.rb +35 -0
  583. data/spec/models/create_package_type_response_body_spec.rb +35 -0
  584. data/spec/models/create_return_label_request_body_spec.rb +65 -0
  585. data/spec/models/create_return_label_response_body_spec.rb +35 -0
  586. data/spec/models/create_shipment_response_body_fields_spec.rb +47 -0
  587. data/spec/models/create_shipments_request_body_spec.rb +41 -0
  588. data/spec/models/create_shipments_response_body_spec.rb +47 -0
  589. data/spec/models/create_tag_response_body_spec.rb +35 -0
  590. data/spec/models/create_warehouse_request_body_spec.rb +35 -0
  591. data/spec/models/create_warehouse_response_body_spec.rb +35 -0
  592. data/spec/models/create_webhook_request_body_spec.rb +47 -0
  593. data/spec/models/create_webhook_response_body_spec.rb +35 -0
  594. data/spec/models/currency_spec.rb +35 -0
  595. data/spec/models/customs_item_spec.rb +89 -0
  596. data/spec/models/delivery_confirmation_spec.rb +35 -0
  597. data/spec/models/deprecated_manifest_spec.rb +89 -0
  598. data/spec/models/dhl_express_account_settings_spec.rb +53 -0
  599. data/spec/models/dhl_express_settings_response_body_spec.rb +35 -0
  600. data/spec/models/dimension_unit_spec.rb +35 -0
  601. data/spec/models/dimensions_spec.rb +59 -0
  602. data/spec/models/error_code_spec.rb +35 -0
  603. data/spec/models/error_response_body_spec.rb +47 -0
  604. data/spec/models/error_source_spec.rb +35 -0
  605. data/spec/models/error_spec.rb +59 -0
  606. data/spec/models/error_type_spec.rb +35 -0
  607. data/spec/models/estimate_rates_request_body_spec.rb +35 -0
  608. data/spec/models/fedex_account_settings_request_body_spec.rb +35 -0
  609. data/spec/models/fedex_account_settings_spec.rb +65 -0
  610. data/spec/models/fedex_pickup_type_spec.rb +35 -0
  611. data/spec/models/fedex_settings_response_body_spec.rb +35 -0
  612. data/spec/models/get_batch_by_external_id_response_body_spec.rb +35 -0
  613. data/spec/models/get_batch_by_id_response_body_spec.rb +35 -0
  614. data/spec/models/get_carrier_by_id_response_body_spec.rb +35 -0
  615. data/spec/models/get_carrier_options_response_body_spec.rb +41 -0
  616. data/spec/models/get_carrier_settings_response_body_spec.rb +125 -0
  617. data/spec/models/get_carriers_response_body_spec.rb +53 -0
  618. data/spec/models/get_insurance_balance_response_body_spec.rb +35 -0
  619. data/spec/models/get_label_by_external_shipment_id_response_body_spec.rb +35 -0
  620. data/spec/models/get_label_by_id_response_body_spec.rb +35 -0
  621. data/spec/models/get_manifest_by_id_response_body_spec.rb +35 -0
  622. data/spec/models/get_package_type_by_id_response_body_spec.rb +35 -0
  623. data/spec/models/get_rate_by_id_response_body_spec.rb +35 -0
  624. data/spec/models/get_shipment_by_external_id_response_body_spec.rb +35 -0
  625. data/spec/models/get_shipment_by_id_response_body_spec.rb +35 -0
  626. data/spec/models/get_tracking_log_from_label_response_body_spec.rb +35 -0
  627. data/spec/models/get_tracking_log_response_body_spec.rb +35 -0
  628. data/spec/models/get_warehouse_by_id_response_body_spec.rb +35 -0
  629. data/spec/models/get_webhook_by_id_response_body_spec.rb +35 -0
  630. data/spec/models/insurance_provider_spec.rb +35 -0
  631. data/spec/models/international_shipment_options_spec.rb +53 -0
  632. data/spec/models/label_charge_event_spec.rb +35 -0
  633. data/spec/models/label_download_spec.rb +59 -0
  634. data/spec/models/label_download_type_spec.rb +35 -0
  635. data/spec/models/label_format_spec.rb +35 -0
  636. data/spec/models/label_layout_spec.rb +35 -0
  637. data/spec/models/label_messages_spec.rb +53 -0
  638. data/spec/models/label_spec.rb +233 -0
  639. data/spec/models/label_status_spec.rb +35 -0
  640. data/spec/models/link_spec.rb +35 -0
  641. data/spec/models/list_batch_errors_response_body_spec.rb +47 -0
  642. data/spec/models/list_batches_response_body_spec.rb +65 -0
  643. data/spec/models/list_carrier_package_types_response_body_spec.rb +41 -0
  644. data/spec/models/list_carrier_services_response_body_spec.rb +41 -0
  645. data/spec/models/list_carriers_response_body_spec.rb +41 -0
  646. data/spec/models/list_labels_response_body_spec.rb +41 -0
  647. data/spec/models/list_manifests_response_body_spec.rb +65 -0
  648. data/spec/models/list_package_types_response_body_spec.rb +41 -0
  649. data/spec/models/list_shipment_errors_response_body_spec.rb +47 -0
  650. data/spec/models/list_shipment_rates_response_body_spec.rb +35 -0
  651. data/spec/models/list_shipments_response_body_spec.rb +65 -0
  652. data/spec/models/list_tags_response_body_spec.rb +41 -0
  653. data/spec/models/list_warehouses_response_body_spec.rb +41 -0
  654. data/spec/models/manifest_download_spec.rb +41 -0
  655. data/spec/models/manifest_spec.rb +89 -0
  656. data/spec/models/manifests_spec.rb +41 -0
  657. data/spec/models/modify_batch_spec.rb +47 -0
  658. data/spec/models/monetary_value_spec.rb +47 -0
  659. data/spec/models/non_delivery_spec.rb +35 -0
  660. data/spec/models/optional_link_spec.rb +47 -0
  661. data/spec/models/order_source_name_spec.rb +35 -0
  662. data/spec/models/package_contents_spec.rb +35 -0
  663. data/spec/models/package_spec.rb +77 -0
  664. data/spec/models/package_type_spec.rb +65 -0
  665. data/spec/models/paged_list_response_body_spec.rb +59 -0
  666. data/spec/models/pagination_link_spec.rb +59 -0
  667. data/spec/models/parse_address_request_body_spec.rb +47 -0
  668. data/spec/models/parse_address_response_body_spec.rb +53 -0
  669. data/spec/models/parse_shipment_request_body_spec.rb +47 -0
  670. data/spec/models/parse_shipment_response_body_spec.rb +53 -0
  671. data/spec/models/partial_address_spec.rb +101 -0
  672. data/spec/models/partial_shipment_spec.rb +167 -0
  673. data/spec/models/payment_amount_spec.rb +47 -0
  674. data/spec/models/process_batch_request_body_spec.rb +53 -0
  675. data/spec/models/purchase_label_without_shipment_spec.rb +59 -0
  676. data/spec/models/rate_estimate_by_carrier_id_spec.rb +41 -0
  677. data/spec/models/rate_estimate_by_carrier_ids_spec.rb +41 -0
  678. data/spec/models/rate_estimate_options_spec.rb +113 -0
  679. data/spec/models/rate_request_body_spec.rb +65 -0
  680. data/spec/models/rate_request_by_shipment_ids_spec.rb +41 -0
  681. data/spec/models/rate_request_by_shipments_spec.rb +41 -0
  682. data/spec/models/rate_request_options_spec.rb +41 -0
  683. data/spec/models/rate_request_rate_options_spec.rb +41 -0
  684. data/spec/models/rate_response_spec.rb +41 -0
  685. data/spec/models/rate_response_status_spec.rb +35 -0
  686. data/spec/models/rate_spec.rb +185 -0
  687. data/spec/models/rate_type_spec.rb +35 -0
  688. data/spec/models/rates_information_spec.rb +77 -0
  689. data/spec/models/recognized_entity_spec.rb +71 -0
  690. data/spec/models/remove_from_batch_request_body_spec.rb +35 -0
  691. data/spec/models/response_message_spec.rb +59 -0
  692. data/spec/models/service_spec.rb +77 -0
  693. data/spec/models/shipment_id_request_spec.rb +41 -0
  694. data/spec/models/shipment_item_spec.rb +89 -0
  695. data/spec/models/shipment_request_spec.rb +41 -0
  696. data/spec/models/shipment_response_error_spec.rb +53 -0
  697. data/spec/models/shipment_spec.rb +35 -0
  698. data/spec/models/shipment_status_spec.rb +35 -0
  699. data/spec/models/shipments_sort_by_spec.rb +35 -0
  700. data/spec/models/smart_post_hub_spec.rb +35 -0
  701. data/spec/models/sort_dir_spec.rb +35 -0
  702. data/spec/models/tag_shipment_response_body_spec.rb +47 -0
  703. data/spec/models/tag_spec.rb +41 -0
  704. data/spec/models/track_event_spec.rb +107 -0
  705. data/spec/models/tracking_information_spec.rb +95 -0
  706. data/spec/models/tracking_status_spec.rb +35 -0
  707. data/spec/models/update_amazon_buy_shipping_request_body_spec.rb +41 -0
  708. data/spec/models/update_carrier_settings_request_body_spec.rb +143 -0
  709. data/spec/models/update_dhl_express_settings_request_body_spec.rb +35 -0
  710. data/spec/models/update_fedex_settings_request_body_spec.rb +35 -0
  711. data/spec/models/update_newgistics_settings_request_body_spec.rb +47 -0
  712. data/spec/models/update_package_type_request_body_spec.rb +35 -0
  713. data/spec/models/update_shipment_fields_spec.rb +41 -0
  714. data/spec/models/update_shipment_request_body_spec.rb +173 -0
  715. data/spec/models/update_shipment_response_body_spec.rb +35 -0
  716. data/spec/models/update_ups_settings_request_body_spec.rb +35 -0
  717. data/spec/models/update_warehouse_request_body_spec.rb +35 -0
  718. data/spec/models/update_webhook_request_body_spec.rb +41 -0
  719. data/spec/models/ups_account_settings_spec.rb +107 -0
  720. data/spec/models/ups_invoice_spec.rb +59 -0
  721. data/spec/models/ups_pickup_type_spec.rb +35 -0
  722. data/spec/models/ups_settings_response_body_spec.rb +35 -0
  723. data/spec/models/validate_address_spec.rb +35 -0
  724. data/spec/models/validate_shipment_fields_spec.rb +41 -0
  725. data/spec/models/validation_status_spec.rb +35 -0
  726. data/spec/models/void_label_response_body_spec.rb +47 -0
  727. data/spec/models/warehouse_spec.rb +65 -0
  728. data/spec/models/webhook_event_spec.rb +35 -0
  729. data/spec/models/webhook_spec.rb +53 -0
  730. data/spec/models/weight_spec.rb +47 -0
  731. data/spec/models/weight_unit_spec.rb +35 -0
  732. data/spec/spec_helper.rb +111 -0
  733. metadata +1110 -0
@@ -0,0 +1,99 @@
1
+ =begin
2
+ #ShipEngine API
3
+
4
+ #ShipEngine's easy-to-use REST API lets you manage all of your shipping needs without worrying about the complexities of different carrier APIs and protocols. We handle all the heavy lifting so you can focus on providing a first-class shipping experience for your customers at the best possible prices. Each of ShipEngine's features can be used by itself or in conjunction with each other to build powerful shipping functionality into your application or service. ## Getting Started If you're new to REST APIs then be sure to read our [introduction to REST](https://www.shipengine.com/docs/rest/) to understand the basics. Learn how to [authenticate yourself to ShipEngine](https://www.shipengine.com/docs/auth/), and then use our [sandbox environment](https://www.shipengine.com/docs/sandbox/) to kick the tires and get familiar with our API. If you run into any problems, then be sure to check the [error handling guide](https://www.shipengine.com/docs/errors/) for tips. Here are some step-by-step **tutorials** to get you started: - [Learn how to create your first shipping label](https://www.shipengine.com/docs/labels/create-a-label/) - [Calculate shipping costs and compare rates across carriers](https://www.shipengine.com/docs/rates/) - [Track packages on-demand or in real time](https://www.shipengine.com/docs/tracking/) - [Validate mailing addresses anywhere on Earth](https://www.shipengine.com/docs/addresses/validation/) ## Shipping Labels for Every Major Carrier ShipEngine makes it easy to [create shipping labels for any carrier](https://www.shipengine.com/docs/labels/create-a-label/) and [download them](https://www.shipengine.com/docs/labels/downloading/) in a [variety of file formats](https://www.shipengine.com/docs/labels/formats/). You can even customize labels with your own [messages](https://www.shipengine.com/docs/labels/messages/) and [images](https://www.shipengine.com/docs/labels/branding/). ## Real-Time Package Tracking With ShipEngine you can [get the current status of a package](https://www.shipengine.com/docs/tracking/) or [subscribe to real-time tracking updates](https://www.shipengine.com/docs/tracking/webhooks/) via webhooks. You can also create [custimized tracking pages](https://www.shipengine.com/docs/tracking/branded-tracking-page/) with your own branding so your customers will always know where their package is. ## Compare Shipping Costs Across Carriers Make sure you ship as cost-effectively as possible by [comparing rates across carriers](https://www.shipengine.com/docs/rates/get-shipment-rates/) using the ShipEngine Rates API. Or if you don't know the full shipment details yet, then you can [get rate estimates](https://www.shipengine.com/docs/rates/estimate/) with limited address info. ## Worldwide Address Validation ShipEngine supports [address validation](https://www.shipengine.com/docs/addresses/validation/) for virtually [every country on Earth](https://www.shipengine.com/docs/addresses/validation/countries/), including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and over 160 others.
5
+
6
+ The version of the OpenAPI document: 1.1.202006302006
7
+ Contact: sales@shipengine.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module OpenapiClient
16
+ class DownloadsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Download File
23
+ # Get File
24
+ # @param subdir [String]
25
+ # @param filename [String]
26
+ # @param dir [String]
27
+ # @param [Hash] opts the optional parameters
28
+ # @option opts [String] :download
29
+ # @return [File]
30
+ def download_file(subdir, filename, dir, opts = {})
31
+ data, _status_code, _headers = download_file_with_http_info(subdir, filename, dir, opts)
32
+ data
33
+ end
34
+
35
+ # Download File
36
+ # Get File
37
+ # @param subdir [String]
38
+ # @param filename [String]
39
+ # @param dir [String]
40
+ # @param [Hash] opts the optional parameters
41
+ # @option opts [String] :download
42
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
43
+ def download_file_with_http_info(subdir, filename, dir, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: DownloadsApi.download_file ...'
46
+ end
47
+ # verify the required parameter 'subdir' is set
48
+ if @api_client.config.client_side_validation && subdir.nil?
49
+ fail ArgumentError, "Missing the required parameter 'subdir' when calling DownloadsApi.download_file"
50
+ end
51
+ # verify the required parameter 'filename' is set
52
+ if @api_client.config.client_side_validation && filename.nil?
53
+ fail ArgumentError, "Missing the required parameter 'filename' when calling DownloadsApi.download_file"
54
+ end
55
+ # verify the required parameter 'dir' is set
56
+ if @api_client.config.client_side_validation && dir.nil?
57
+ fail ArgumentError, "Missing the required parameter 'dir' when calling DownloadsApi.download_file"
58
+ end
59
+ # resource path
60
+ local_var_path = '/v1/downloads/{dir}/{subdir}/{filename}'.sub('{' + 'subdir' + '}', CGI.escape(subdir.to_s)).sub('{' + 'filename' + '}', CGI.escape(filename.to_s)).sub('{' + 'dir' + '}', CGI.escape(dir.to_s))
61
+
62
+ # query parameters
63
+ query_params = opts[:query_params] || {}
64
+ query_params[:'download'] = opts[:'download'] if !opts[:'download'].nil?
65
+
66
+ # header parameters
67
+ header_params = opts[:header_params] || {}
68
+ # HTTP header 'Accept' (if needed)
69
+ header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'image/png', 'application/zpl', 'application/json'])
70
+
71
+ # form parameters
72
+ form_params = opts[:form_params] || {}
73
+
74
+ # http body (model)
75
+ post_body = opts[:body]
76
+
77
+ # return_type
78
+ return_type = opts[:return_type] || 'File'
79
+
80
+ # auth_names
81
+ auth_names = opts[:auth_names] || ['api_key']
82
+
83
+ new_options = opts.merge(
84
+ :header_params => header_params,
85
+ :query_params => query_params,
86
+ :form_params => form_params,
87
+ :body => post_body,
88
+ :auth_names => auth_names,
89
+ :return_type => return_type
90
+ )
91
+
92
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
93
+ if @api_client.config.debugging
94
+ @api_client.config.logger.debug "API called: DownloadsApi#download_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
95
+ end
96
+ return data, status_code, headers
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,262 @@
1
+ =begin
2
+ #ShipEngine API
3
+
4
+ #ShipEngine's easy-to-use REST API lets you manage all of your shipping needs without worrying about the complexities of different carrier APIs and protocols. We handle all the heavy lifting so you can focus on providing a first-class shipping experience for your customers at the best possible prices. Each of ShipEngine's features can be used by itself or in conjunction with each other to build powerful shipping functionality into your application or service. ## Getting Started If you're new to REST APIs then be sure to read our [introduction to REST](https://www.shipengine.com/docs/rest/) to understand the basics. Learn how to [authenticate yourself to ShipEngine](https://www.shipengine.com/docs/auth/), and then use our [sandbox environment](https://www.shipengine.com/docs/sandbox/) to kick the tires and get familiar with our API. If you run into any problems, then be sure to check the [error handling guide](https://www.shipengine.com/docs/errors/) for tips. Here are some step-by-step **tutorials** to get you started: - [Learn how to create your first shipping label](https://www.shipengine.com/docs/labels/create-a-label/) - [Calculate shipping costs and compare rates across carriers](https://www.shipengine.com/docs/rates/) - [Track packages on-demand or in real time](https://www.shipengine.com/docs/tracking/) - [Validate mailing addresses anywhere on Earth](https://www.shipengine.com/docs/addresses/validation/) ## Shipping Labels for Every Major Carrier ShipEngine makes it easy to [create shipping labels for any carrier](https://www.shipengine.com/docs/labels/create-a-label/) and [download them](https://www.shipengine.com/docs/labels/downloading/) in a [variety of file formats](https://www.shipengine.com/docs/labels/formats/). You can even customize labels with your own [messages](https://www.shipengine.com/docs/labels/messages/) and [images](https://www.shipengine.com/docs/labels/branding/). ## Real-Time Package Tracking With ShipEngine you can [get the current status of a package](https://www.shipengine.com/docs/tracking/) or [subscribe to real-time tracking updates](https://www.shipengine.com/docs/tracking/webhooks/) via webhooks. You can also create [custimized tracking pages](https://www.shipengine.com/docs/tracking/branded-tracking-page/) with your own branding so your customers will always know where their package is. ## Compare Shipping Costs Across Carriers Make sure you ship as cost-effectively as possible by [comparing rates across carriers](https://www.shipengine.com/docs/rates/get-shipment-rates/) using the ShipEngine Rates API. Or if you don't know the full shipment details yet, then you can [get rate estimates](https://www.shipengine.com/docs/rates/estimate/) with limited address info. ## Worldwide Address Validation ShipEngine supports [address validation](https://www.shipengine.com/docs/addresses/validation/) for virtually [every country on Earth](https://www.shipengine.com/docs/addresses/validation/countries/), including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and over 160 others.
5
+
6
+ The version of the OpenAPI document: 1.1.202006302006
7
+ Contact: sales@shipengine.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module OpenapiClient
16
+ class InsuranceApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Add Funds To Insurance
23
+ # You may need to auto fund your account from time to time. For example, if you don't normally ship items over $100, and may want to add funds to insurance rather than keeping the account funded.
24
+ # @param add_funds_to_insurance_request_body [AddFundsToInsuranceRequestBody]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [AddFundsToInsuranceResponseBody]
27
+ def add_funds_to_insurance(add_funds_to_insurance_request_body, opts = {})
28
+ data, _status_code, _headers = add_funds_to_insurance_with_http_info(add_funds_to_insurance_request_body, opts)
29
+ data
30
+ end
31
+
32
+ # Add Funds To Insurance
33
+ # You may need to auto fund your account from time to time. For example, if you don&#39;t normally ship items over $100, and may want to add funds to insurance rather than keeping the account funded.
34
+ # @param add_funds_to_insurance_request_body [AddFundsToInsuranceRequestBody]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(AddFundsToInsuranceResponseBody, Integer, Hash)>] AddFundsToInsuranceResponseBody data, response status code and response headers
37
+ def add_funds_to_insurance_with_http_info(add_funds_to_insurance_request_body, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: InsuranceApi.add_funds_to_insurance ...'
40
+ end
41
+ # verify the required parameter 'add_funds_to_insurance_request_body' is set
42
+ if @api_client.config.client_side_validation && add_funds_to_insurance_request_body.nil?
43
+ fail ArgumentError, "Missing the required parameter 'add_funds_to_insurance_request_body' when calling InsuranceApi.add_funds_to_insurance"
44
+ end
45
+ # resource path
46
+ local_var_path = '/v1/insurance/shipsurance/add_funds'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+ # HTTP header 'Content-Type'
56
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
57
+
58
+ # form parameters
59
+ form_params = opts[:form_params] || {}
60
+
61
+ # http body (model)
62
+ post_body = opts[:body] || @api_client.object_to_http_body(add_funds_to_insurance_request_body)
63
+
64
+ # return_type
65
+ return_type = opts[:return_type] || 'AddFundsToInsuranceResponseBody'
66
+
67
+ # auth_names
68
+ auth_names = opts[:auth_names] || ['api_key']
69
+
70
+ new_options = opts.merge(
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: InsuranceApi#add_funds_to_insurance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+
86
+ # Connect a Shipsurance Account
87
+ # Connect a Shipsurance Account
88
+ # @param connect_insurer_request_body [ConnectInsurerRequestBody]
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [Object]
91
+ def connect_insurer(connect_insurer_request_body, opts = {})
92
+ data, _status_code, _headers = connect_insurer_with_http_info(connect_insurer_request_body, opts)
93
+ data
94
+ end
95
+
96
+ # Connect a Shipsurance Account
97
+ # Connect a Shipsurance Account
98
+ # @param connect_insurer_request_body [ConnectInsurerRequestBody]
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
101
+ def connect_insurer_with_http_info(connect_insurer_request_body, opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: InsuranceApi.connect_insurer ...'
104
+ end
105
+ # verify the required parameter 'connect_insurer_request_body' is set
106
+ if @api_client.config.client_side_validation && connect_insurer_request_body.nil?
107
+ fail ArgumentError, "Missing the required parameter 'connect_insurer_request_body' when calling InsuranceApi.connect_insurer"
108
+ end
109
+ # resource path
110
+ local_var_path = '/v1/connections/insurance/shipsurance'
111
+
112
+ # query parameters
113
+ query_params = opts[:query_params] || {}
114
+
115
+ # header parameters
116
+ header_params = opts[:header_params] || {}
117
+ # HTTP header 'Accept' (if needed)
118
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
119
+ # HTTP header 'Content-Type'
120
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
121
+
122
+ # form parameters
123
+ form_params = opts[:form_params] || {}
124
+
125
+ # http body (model)
126
+ post_body = opts[:body] || @api_client.object_to_http_body(connect_insurer_request_body)
127
+
128
+ # return_type
129
+ return_type = opts[:return_type] || 'Object'
130
+
131
+ # auth_names
132
+ auth_names = opts[:auth_names] || ['api_key']
133
+
134
+ new_options = opts.merge(
135
+ :header_params => header_params,
136
+ :query_params => query_params,
137
+ :form_params => form_params,
138
+ :body => post_body,
139
+ :auth_names => auth_names,
140
+ :return_type => return_type
141
+ )
142
+
143
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
144
+ if @api_client.config.debugging
145
+ @api_client.config.logger.debug "API called: InsuranceApi#connect_insurer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
146
+ end
147
+ return data, status_code, headers
148
+ end
149
+
150
+ # Disconnect a Shipsurance Account
151
+ # Disconnect a Shipsurance Account
152
+ # @param [Hash] opts the optional parameters
153
+ # @return [Object]
154
+ def disconnect_insurer(opts = {})
155
+ data, _status_code, _headers = disconnect_insurer_with_http_info(opts)
156
+ data
157
+ end
158
+
159
+ # Disconnect a Shipsurance Account
160
+ # Disconnect a Shipsurance Account
161
+ # @param [Hash] opts the optional parameters
162
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
163
+ def disconnect_insurer_with_http_info(opts = {})
164
+ if @api_client.config.debugging
165
+ @api_client.config.logger.debug 'Calling API: InsuranceApi.disconnect_insurer ...'
166
+ end
167
+ # resource path
168
+ local_var_path = '/v1/connections/insurance/shipsurance'
169
+
170
+ # query parameters
171
+ query_params = opts[:query_params] || {}
172
+
173
+ # header parameters
174
+ header_params = opts[:header_params] || {}
175
+ # HTTP header 'Accept' (if needed)
176
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
177
+
178
+ # form parameters
179
+ form_params = opts[:form_params] || {}
180
+
181
+ # http body (model)
182
+ post_body = opts[:body]
183
+
184
+ # return_type
185
+ return_type = opts[:return_type] || 'Object'
186
+
187
+ # auth_names
188
+ auth_names = opts[:auth_names] || ['api_key']
189
+
190
+ new_options = opts.merge(
191
+ :header_params => header_params,
192
+ :query_params => query_params,
193
+ :form_params => form_params,
194
+ :body => post_body,
195
+ :auth_names => auth_names,
196
+ :return_type => return_type
197
+ )
198
+
199
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
200
+ if @api_client.config.debugging
201
+ @api_client.config.logger.debug "API called: InsuranceApi#disconnect_insurer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
202
+ end
203
+ return data, status_code, headers
204
+ end
205
+
206
+ # Get Insurance Funds Balance
207
+ # Retrieve the balance of your Shipsurance account.
208
+ # @param [Hash] opts the optional parameters
209
+ # @return [GetInsuranceBalanceResponseBody]
210
+ def get_insurance_balance(opts = {})
211
+ data, _status_code, _headers = get_insurance_balance_with_http_info(opts)
212
+ data
213
+ end
214
+
215
+ # Get Insurance Funds Balance
216
+ # Retrieve the balance of your Shipsurance account.
217
+ # @param [Hash] opts the optional parameters
218
+ # @return [Array<(GetInsuranceBalanceResponseBody, Integer, Hash)>] GetInsuranceBalanceResponseBody data, response status code and response headers
219
+ def get_insurance_balance_with_http_info(opts = {})
220
+ if @api_client.config.debugging
221
+ @api_client.config.logger.debug 'Calling API: InsuranceApi.get_insurance_balance ...'
222
+ end
223
+ # resource path
224
+ local_var_path = '/v1/insurance/shipsurance/balance'
225
+
226
+ # query parameters
227
+ query_params = opts[:query_params] || {}
228
+
229
+ # header parameters
230
+ header_params = opts[:header_params] || {}
231
+ # HTTP header 'Accept' (if needed)
232
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
233
+
234
+ # form parameters
235
+ form_params = opts[:form_params] || {}
236
+
237
+ # http body (model)
238
+ post_body = opts[:body]
239
+
240
+ # return_type
241
+ return_type = opts[:return_type] || 'GetInsuranceBalanceResponseBody'
242
+
243
+ # auth_names
244
+ auth_names = opts[:auth_names] || ['api_key']
245
+
246
+ new_options = opts.merge(
247
+ :header_params => header_params,
248
+ :query_params => query_params,
249
+ :form_params => form_params,
250
+ :body => post_body,
251
+ :auth_names => auth_names,
252
+ :return_type => return_type
253
+ )
254
+
255
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
256
+ if @api_client.config.debugging
257
+ @api_client.config.logger.debug "API called: InsuranceApi#get_insurance_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
258
+ end
259
+ return data, status_code, headers
260
+ end
261
+ end
262
+ end
@@ -0,0 +1,812 @@
1
+ =begin
2
+ #ShipEngine API
3
+
4
+ #ShipEngine's easy-to-use REST API lets you manage all of your shipping needs without worrying about the complexities of different carrier APIs and protocols. We handle all the heavy lifting so you can focus on providing a first-class shipping experience for your customers at the best possible prices. Each of ShipEngine's features can be used by itself or in conjunction with each other to build powerful shipping functionality into your application or service. ## Getting Started If you're new to REST APIs then be sure to read our [introduction to REST](https://www.shipengine.com/docs/rest/) to understand the basics. Learn how to [authenticate yourself to ShipEngine](https://www.shipengine.com/docs/auth/), and then use our [sandbox environment](https://www.shipengine.com/docs/sandbox/) to kick the tires and get familiar with our API. If you run into any problems, then be sure to check the [error handling guide](https://www.shipengine.com/docs/errors/) for tips. Here are some step-by-step **tutorials** to get you started: - [Learn how to create your first shipping label](https://www.shipengine.com/docs/labels/create-a-label/) - [Calculate shipping costs and compare rates across carriers](https://www.shipengine.com/docs/rates/) - [Track packages on-demand or in real time](https://www.shipengine.com/docs/tracking/) - [Validate mailing addresses anywhere on Earth](https://www.shipengine.com/docs/addresses/validation/) ## Shipping Labels for Every Major Carrier ShipEngine makes it easy to [create shipping labels for any carrier](https://www.shipengine.com/docs/labels/create-a-label/) and [download them](https://www.shipengine.com/docs/labels/downloading/) in a [variety of file formats](https://www.shipengine.com/docs/labels/formats/). You can even customize labels with your own [messages](https://www.shipengine.com/docs/labels/messages/) and [images](https://www.shipengine.com/docs/labels/branding/). ## Real-Time Package Tracking With ShipEngine you can [get the current status of a package](https://www.shipengine.com/docs/tracking/) or [subscribe to real-time tracking updates](https://www.shipengine.com/docs/tracking/webhooks/) via webhooks. You can also create [custimized tracking pages](https://www.shipengine.com/docs/tracking/branded-tracking-page/) with your own branding so your customers will always know where their package is. ## Compare Shipping Costs Across Carriers Make sure you ship as cost-effectively as possible by [comparing rates across carriers](https://www.shipengine.com/docs/rates/get-shipment-rates/) using the ShipEngine Rates API. Or if you don't know the full shipment details yet, then you can [get rate estimates](https://www.shipengine.com/docs/rates/estimate/) with limited address info. ## Worldwide Address Validation ShipEngine supports [address validation](https://www.shipengine.com/docs/addresses/validation/) for virtually [every country on Earth](https://www.shipengine.com/docs/addresses/validation/countries/), including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and over 160 others.
5
+
6
+ The version of the OpenAPI document: 1.1.202006302006
7
+ Contact: sales@shipengine.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module OpenapiClient
16
+ class LabelsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Purchase Label
23
+ # Purchase and print a label for shipment
24
+ # @param create_label_request_body [CreateLabelRequestBody]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [CreateLabelResponseBody]
27
+ def create_label(create_label_request_body, opts = {})
28
+ data, _status_code, _headers = create_label_with_http_info(create_label_request_body, opts)
29
+ data
30
+ end
31
+
32
+ # Purchase Label
33
+ # Purchase and print a label for shipment
34
+ # @param create_label_request_body [CreateLabelRequestBody]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(CreateLabelResponseBody, Integer, Hash)>] CreateLabelResponseBody data, response status code and response headers
37
+ def create_label_with_http_info(create_label_request_body, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: LabelsApi.create_label ...'
40
+ end
41
+ # verify the required parameter 'create_label_request_body' is set
42
+ if @api_client.config.client_side_validation && create_label_request_body.nil?
43
+ fail ArgumentError, "Missing the required parameter 'create_label_request_body' when calling LabelsApi.create_label"
44
+ end
45
+ # resource path
46
+ local_var_path = '/v1/labels'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+ # HTTP header 'Content-Type'
56
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
57
+
58
+ # form parameters
59
+ form_params = opts[:form_params] || {}
60
+
61
+ # http body (model)
62
+ post_body = opts[:body] || @api_client.object_to_http_body(create_label_request_body)
63
+
64
+ # return_type
65
+ return_type = opts[:return_type] || 'CreateLabelResponseBody'
66
+
67
+ # auth_names
68
+ auth_names = opts[:auth_names] || ['api_key']
69
+
70
+ new_options = opts.merge(
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: LabelsApi#create_label\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+
86
+ # Purchase Label with Rate ID
87
+ # When retrieving rates for shipments using the `/rates` endpoint, the returned information contains a `rate_id` property that can be used to generate a label without having to refill in the shipment information repeatedly.
88
+ # @param rate_id [String] Rate ID
89
+ # @param create_label_from_rate_request_body [CreateLabelFromRateRequestBody]
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [CreateLabelFromRateResponseBody]
92
+ def create_label_from_rate(rate_id, create_label_from_rate_request_body, opts = {})
93
+ data, _status_code, _headers = create_label_from_rate_with_http_info(rate_id, create_label_from_rate_request_body, opts)
94
+ data
95
+ end
96
+
97
+ # Purchase Label with Rate ID
98
+ # When retrieving rates for shipments using the &#x60;/rates&#x60; endpoint, the returned information contains a &#x60;rate_id&#x60; property that can be used to generate a label without having to refill in the shipment information repeatedly.
99
+ # @param rate_id [String] Rate ID
100
+ # @param create_label_from_rate_request_body [CreateLabelFromRateRequestBody]
101
+ # @param [Hash] opts the optional parameters
102
+ # @return [Array<(CreateLabelFromRateResponseBody, Integer, Hash)>] CreateLabelFromRateResponseBody data, response status code and response headers
103
+ def create_label_from_rate_with_http_info(rate_id, create_label_from_rate_request_body, opts = {})
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug 'Calling API: LabelsApi.create_label_from_rate ...'
106
+ end
107
+ # verify the required parameter 'rate_id' is set
108
+ if @api_client.config.client_side_validation && rate_id.nil?
109
+ fail ArgumentError, "Missing the required parameter 'rate_id' when calling LabelsApi.create_label_from_rate"
110
+ end
111
+ if @api_client.config.client_side_validation && rate_id.to_s.length > 25
112
+ fail ArgumentError, 'invalid value for "rate_id" when calling LabelsApi.create_label_from_rate, the character length must be smaller than or equal to 25.'
113
+ end
114
+
115
+ if @api_client.config.client_side_validation && rate_id.to_s.length < 1
116
+ fail ArgumentError, 'invalid value for "rate_id" when calling LabelsApi.create_label_from_rate, the character length must be great than or equal to 1.'
117
+ end
118
+
119
+ pattern = Regexp.new(/^se(-[a-z0-9]+)+$/)
120
+ if @api_client.config.client_side_validation && rate_id !~ pattern
121
+ fail ArgumentError, "invalid value for 'rate_id' when calling LabelsApi.create_label_from_rate, must conform to the pattern #{pattern}."
122
+ end
123
+
124
+ # verify the required parameter 'create_label_from_rate_request_body' is set
125
+ if @api_client.config.client_side_validation && create_label_from_rate_request_body.nil?
126
+ fail ArgumentError, "Missing the required parameter 'create_label_from_rate_request_body' when calling LabelsApi.create_label_from_rate"
127
+ end
128
+ # resource path
129
+ local_var_path = '/v1/labels/rates/{rate_id}'.sub('{' + 'rate_id' + '}', CGI.escape(rate_id.to_s))
130
+
131
+ # query parameters
132
+ query_params = opts[:query_params] || {}
133
+
134
+ # header parameters
135
+ header_params = opts[:header_params] || {}
136
+ # HTTP header 'Accept' (if needed)
137
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
138
+ # HTTP header 'Content-Type'
139
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
140
+
141
+ # form parameters
142
+ form_params = opts[:form_params] || {}
143
+
144
+ # http body (model)
145
+ post_body = opts[:body] || @api_client.object_to_http_body(create_label_from_rate_request_body)
146
+
147
+ # return_type
148
+ return_type = opts[:return_type] || 'CreateLabelFromRateResponseBody'
149
+
150
+ # auth_names
151
+ auth_names = opts[:auth_names] || ['api_key']
152
+
153
+ new_options = opts.merge(
154
+ :header_params => header_params,
155
+ :query_params => query_params,
156
+ :form_params => form_params,
157
+ :body => post_body,
158
+ :auth_names => auth_names,
159
+ :return_type => return_type
160
+ )
161
+
162
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
163
+ if @api_client.config.debugging
164
+ @api_client.config.logger.debug "API called: LabelsApi#create_label_from_rate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
165
+ end
166
+ return data, status_code, headers
167
+ end
168
+
169
+ # Purchase Label with Shipment ID
170
+ # Purchase a label using a shipment ID that has already been created with the desired address and package info.
171
+ # @param shipment_id [String] Shipment ID
172
+ # @param create_label_from_shipment_request_body [CreateLabelFromShipmentRequestBody]
173
+ # @param [Hash] opts the optional parameters
174
+ # @return [CreateLabelFromShipmentResponseBody]
175
+ def create_label_from_shipment(shipment_id, create_label_from_shipment_request_body, opts = {})
176
+ data, _status_code, _headers = create_label_from_shipment_with_http_info(shipment_id, create_label_from_shipment_request_body, opts)
177
+ data
178
+ end
179
+
180
+ # Purchase Label with Shipment ID
181
+ # Purchase a label using a shipment ID that has already been created with the desired address and package info.
182
+ # @param shipment_id [String] Shipment ID
183
+ # @param create_label_from_shipment_request_body [CreateLabelFromShipmentRequestBody]
184
+ # @param [Hash] opts the optional parameters
185
+ # @return [Array<(CreateLabelFromShipmentResponseBody, Integer, Hash)>] CreateLabelFromShipmentResponseBody data, response status code and response headers
186
+ def create_label_from_shipment_with_http_info(shipment_id, create_label_from_shipment_request_body, opts = {})
187
+ if @api_client.config.debugging
188
+ @api_client.config.logger.debug 'Calling API: LabelsApi.create_label_from_shipment ...'
189
+ end
190
+ # verify the required parameter 'shipment_id' is set
191
+ if @api_client.config.client_side_validation && shipment_id.nil?
192
+ fail ArgumentError, "Missing the required parameter 'shipment_id' when calling LabelsApi.create_label_from_shipment"
193
+ end
194
+ if @api_client.config.client_side_validation && shipment_id.to_s.length > 25
195
+ fail ArgumentError, 'invalid value for "shipment_id" when calling LabelsApi.create_label_from_shipment, the character length must be smaller than or equal to 25.'
196
+ end
197
+
198
+ if @api_client.config.client_side_validation && shipment_id.to_s.length < 1
199
+ fail ArgumentError, 'invalid value for "shipment_id" when calling LabelsApi.create_label_from_shipment, the character length must be great than or equal to 1.'
200
+ end
201
+
202
+ pattern = Regexp.new(/^se(-[a-z0-9]+)+$/)
203
+ if @api_client.config.client_side_validation && shipment_id !~ pattern
204
+ fail ArgumentError, "invalid value for 'shipment_id' when calling LabelsApi.create_label_from_shipment, must conform to the pattern #{pattern}."
205
+ end
206
+
207
+ # verify the required parameter 'create_label_from_shipment_request_body' is set
208
+ if @api_client.config.client_side_validation && create_label_from_shipment_request_body.nil?
209
+ fail ArgumentError, "Missing the required parameter 'create_label_from_shipment_request_body' when calling LabelsApi.create_label_from_shipment"
210
+ end
211
+ # resource path
212
+ local_var_path = '/v1/labels/shipment/{shipment_id}'.sub('{' + 'shipment_id' + '}', CGI.escape(shipment_id.to_s))
213
+
214
+ # query parameters
215
+ query_params = opts[:query_params] || {}
216
+
217
+ # header parameters
218
+ header_params = opts[:header_params] || {}
219
+ # HTTP header 'Accept' (if needed)
220
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
221
+ # HTTP header 'Content-Type'
222
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
223
+
224
+ # form parameters
225
+ form_params = opts[:form_params] || {}
226
+
227
+ # http body (model)
228
+ post_body = opts[:body] || @api_client.object_to_http_body(create_label_from_shipment_request_body)
229
+
230
+ # return_type
231
+ return_type = opts[:return_type] || 'CreateLabelFromShipmentResponseBody'
232
+
233
+ # auth_names
234
+ auth_names = opts[:auth_names] || ['api_key']
235
+
236
+ new_options = opts.merge(
237
+ :header_params => header_params,
238
+ :query_params => query_params,
239
+ :form_params => form_params,
240
+ :body => post_body,
241
+ :auth_names => auth_names,
242
+ :return_type => return_type
243
+ )
244
+
245
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
246
+ if @api_client.config.debugging
247
+ @api_client.config.logger.debug "API called: LabelsApi#create_label_from_shipment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
248
+ end
249
+ return data, status_code, headers
250
+ end
251
+
252
+ # Create a return label
253
+ # Create a return label
254
+ # @param label_id [String] Label ID
255
+ # @param create_return_label_request_body [CreateReturnLabelRequestBody]
256
+ # @param [Hash] opts the optional parameters
257
+ # @return [CreateReturnLabelResponseBody]
258
+ def create_return_label(label_id, create_return_label_request_body, opts = {})
259
+ data, _status_code, _headers = create_return_label_with_http_info(label_id, create_return_label_request_body, opts)
260
+ data
261
+ end
262
+
263
+ # Create a return label
264
+ # Create a return label
265
+ # @param label_id [String] Label ID
266
+ # @param create_return_label_request_body [CreateReturnLabelRequestBody]
267
+ # @param [Hash] opts the optional parameters
268
+ # @return [Array<(CreateReturnLabelResponseBody, Integer, Hash)>] CreateReturnLabelResponseBody data, response status code and response headers
269
+ def create_return_label_with_http_info(label_id, create_return_label_request_body, opts = {})
270
+ if @api_client.config.debugging
271
+ @api_client.config.logger.debug 'Calling API: LabelsApi.create_return_label ...'
272
+ end
273
+ # verify the required parameter 'label_id' is set
274
+ if @api_client.config.client_side_validation && label_id.nil?
275
+ fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelsApi.create_return_label"
276
+ end
277
+ if @api_client.config.client_side_validation && label_id.to_s.length > 25
278
+ fail ArgumentError, 'invalid value for "label_id" when calling LabelsApi.create_return_label, the character length must be smaller than or equal to 25.'
279
+ end
280
+
281
+ if @api_client.config.client_side_validation && label_id.to_s.length < 1
282
+ fail ArgumentError, 'invalid value for "label_id" when calling LabelsApi.create_return_label, the character length must be great than or equal to 1.'
283
+ end
284
+
285
+ pattern = Regexp.new(/^se(-[a-z0-9]+)+$/)
286
+ if @api_client.config.client_side_validation && label_id !~ pattern
287
+ fail ArgumentError, "invalid value for 'label_id' when calling LabelsApi.create_return_label, must conform to the pattern #{pattern}."
288
+ end
289
+
290
+ # verify the required parameter 'create_return_label_request_body' is set
291
+ if @api_client.config.client_side_validation && create_return_label_request_body.nil?
292
+ fail ArgumentError, "Missing the required parameter 'create_return_label_request_body' when calling LabelsApi.create_return_label"
293
+ end
294
+ # resource path
295
+ local_var_path = '/v1/labels/{label_id}/return'.sub('{' + 'label_id' + '}', CGI.escape(label_id.to_s))
296
+
297
+ # query parameters
298
+ query_params = opts[:query_params] || {}
299
+
300
+ # header parameters
301
+ header_params = opts[:header_params] || {}
302
+ # HTTP header 'Accept' (if needed)
303
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
304
+ # HTTP header 'Content-Type'
305
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
306
+
307
+ # form parameters
308
+ form_params = opts[:form_params] || {}
309
+
310
+ # http body (model)
311
+ post_body = opts[:body] || @api_client.object_to_http_body(create_return_label_request_body)
312
+
313
+ # return_type
314
+ return_type = opts[:return_type] || 'CreateReturnLabelResponseBody'
315
+
316
+ # auth_names
317
+ auth_names = opts[:auth_names] || ['api_key']
318
+
319
+ new_options = opts.merge(
320
+ :header_params => header_params,
321
+ :query_params => query_params,
322
+ :form_params => form_params,
323
+ :body => post_body,
324
+ :auth_names => auth_names,
325
+ :return_type => return_type
326
+ )
327
+
328
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
329
+ if @api_client.config.debugging
330
+ @api_client.config.logger.debug "API called: LabelsApi#create_return_label\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
331
+ end
332
+ return data, status_code, headers
333
+ end
334
+
335
+ # Get Label By External Shipment ID
336
+ # Find a label by using the external shipment id that was used during label creation
337
+ # @param external_shipment_id [String]
338
+ # @param [Hash] opts the optional parameters
339
+ # @option opts [LabelDownloadType] :label_download_type
340
+ # @return [GetLabelByExternalShipmentIdResponseBody]
341
+ def get_label_by_external_shipment_id(external_shipment_id, opts = {})
342
+ data, _status_code, _headers = get_label_by_external_shipment_id_with_http_info(external_shipment_id, opts)
343
+ data
344
+ end
345
+
346
+ # Get Label By External Shipment ID
347
+ # Find a label by using the external shipment id that was used during label creation
348
+ # @param external_shipment_id [String]
349
+ # @param [Hash] opts the optional parameters
350
+ # @option opts [LabelDownloadType] :label_download_type
351
+ # @return [Array<(GetLabelByExternalShipmentIdResponseBody, Integer, Hash)>] GetLabelByExternalShipmentIdResponseBody data, response status code and response headers
352
+ def get_label_by_external_shipment_id_with_http_info(external_shipment_id, opts = {})
353
+ if @api_client.config.debugging
354
+ @api_client.config.logger.debug 'Calling API: LabelsApi.get_label_by_external_shipment_id ...'
355
+ end
356
+ # verify the required parameter 'external_shipment_id' is set
357
+ if @api_client.config.client_side_validation && external_shipment_id.nil?
358
+ fail ArgumentError, "Missing the required parameter 'external_shipment_id' when calling LabelsApi.get_label_by_external_shipment_id"
359
+ end
360
+ # resource path
361
+ local_var_path = '/v1/labels/external_shipment_id/{external_shipment_id}'.sub('{' + 'external_shipment_id' + '}', CGI.escape(external_shipment_id.to_s))
362
+
363
+ # query parameters
364
+ query_params = opts[:query_params] || {}
365
+ query_params[:'label_download_type'] = opts[:'label_download_type'] if !opts[:'label_download_type'].nil?
366
+
367
+ # header parameters
368
+ header_params = opts[:header_params] || {}
369
+ # HTTP header 'Accept' (if needed)
370
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
371
+
372
+ # form parameters
373
+ form_params = opts[:form_params] || {}
374
+
375
+ # http body (model)
376
+ post_body = opts[:body]
377
+
378
+ # return_type
379
+ return_type = opts[:return_type] || 'GetLabelByExternalShipmentIdResponseBody'
380
+
381
+ # auth_names
382
+ auth_names = opts[:auth_names] || ['api_key']
383
+
384
+ new_options = opts.merge(
385
+ :header_params => header_params,
386
+ :query_params => query_params,
387
+ :form_params => form_params,
388
+ :body => post_body,
389
+ :auth_names => auth_names,
390
+ :return_type => return_type
391
+ )
392
+
393
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
394
+ if @api_client.config.debugging
395
+ @api_client.config.logger.debug "API called: LabelsApi#get_label_by_external_shipment_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
396
+ end
397
+ return data, status_code, headers
398
+ end
399
+
400
+ # Get Label By ID
401
+ # Retrieve information for individual labels.
402
+ # @param label_id [String] Label ID
403
+ # @param [Hash] opts the optional parameters
404
+ # @option opts [LabelDownloadType] :label_download_type
405
+ # @return [GetLabelByIdResponseBody]
406
+ def get_label_by_id(label_id, opts = {})
407
+ data, _status_code, _headers = get_label_by_id_with_http_info(label_id, opts)
408
+ data
409
+ end
410
+
411
+ # Get Label By ID
412
+ # Retrieve information for individual labels.
413
+ # @param label_id [String] Label ID
414
+ # @param [Hash] opts the optional parameters
415
+ # @option opts [LabelDownloadType] :label_download_type
416
+ # @return [Array<(GetLabelByIdResponseBody, Integer, Hash)>] GetLabelByIdResponseBody data, response status code and response headers
417
+ def get_label_by_id_with_http_info(label_id, opts = {})
418
+ if @api_client.config.debugging
419
+ @api_client.config.logger.debug 'Calling API: LabelsApi.get_label_by_id ...'
420
+ end
421
+ # verify the required parameter 'label_id' is set
422
+ if @api_client.config.client_side_validation && label_id.nil?
423
+ fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelsApi.get_label_by_id"
424
+ end
425
+ if @api_client.config.client_side_validation && label_id.to_s.length > 25
426
+ fail ArgumentError, 'invalid value for "label_id" when calling LabelsApi.get_label_by_id, the character length must be smaller than or equal to 25.'
427
+ end
428
+
429
+ if @api_client.config.client_side_validation && label_id.to_s.length < 1
430
+ fail ArgumentError, 'invalid value for "label_id" when calling LabelsApi.get_label_by_id, the character length must be great than or equal to 1.'
431
+ end
432
+
433
+ pattern = Regexp.new(/^se(-[a-z0-9]+)+$/)
434
+ if @api_client.config.client_side_validation && label_id !~ pattern
435
+ fail ArgumentError, "invalid value for 'label_id' when calling LabelsApi.get_label_by_id, must conform to the pattern #{pattern}."
436
+ end
437
+
438
+ # resource path
439
+ local_var_path = '/v1/labels/{label_id}'.sub('{' + 'label_id' + '}', CGI.escape(label_id.to_s))
440
+
441
+ # query parameters
442
+ query_params = opts[:query_params] || {}
443
+ query_params[:'label_download_type'] = opts[:'label_download_type'] if !opts[:'label_download_type'].nil?
444
+
445
+ # header parameters
446
+ header_params = opts[:header_params] || {}
447
+ # HTTP header 'Accept' (if needed)
448
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
449
+
450
+ # form parameters
451
+ form_params = opts[:form_params] || {}
452
+
453
+ # http body (model)
454
+ post_body = opts[:body]
455
+
456
+ # return_type
457
+ return_type = opts[:return_type] || 'GetLabelByIdResponseBody'
458
+
459
+ # auth_names
460
+ auth_names = opts[:auth_names] || ['api_key']
461
+
462
+ new_options = opts.merge(
463
+ :header_params => header_params,
464
+ :query_params => query_params,
465
+ :form_params => form_params,
466
+ :body => post_body,
467
+ :auth_names => auth_names,
468
+ :return_type => return_type
469
+ )
470
+
471
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
472
+ if @api_client.config.debugging
473
+ @api_client.config.logger.debug "API called: LabelsApi#get_label_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
474
+ end
475
+ return data, status_code, headers
476
+ end
477
+
478
+ # Get Label Tracking Information
479
+ # Retrieve the label's tracking information
480
+ # @param label_id [String] Label ID
481
+ # @param [Hash] opts the optional parameters
482
+ # @return [GetTrackingLogFromLabelResponseBody]
483
+ def get_tracking_log_from_label(label_id, opts = {})
484
+ data, _status_code, _headers = get_tracking_log_from_label_with_http_info(label_id, opts)
485
+ data
486
+ end
487
+
488
+ # Get Label Tracking Information
489
+ # Retrieve the label&#39;s tracking information
490
+ # @param label_id [String] Label ID
491
+ # @param [Hash] opts the optional parameters
492
+ # @return [Array<(GetTrackingLogFromLabelResponseBody, Integer, Hash)>] GetTrackingLogFromLabelResponseBody data, response status code and response headers
493
+ def get_tracking_log_from_label_with_http_info(label_id, opts = {})
494
+ if @api_client.config.debugging
495
+ @api_client.config.logger.debug 'Calling API: LabelsApi.get_tracking_log_from_label ...'
496
+ end
497
+ # verify the required parameter 'label_id' is set
498
+ if @api_client.config.client_side_validation && label_id.nil?
499
+ fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelsApi.get_tracking_log_from_label"
500
+ end
501
+ if @api_client.config.client_side_validation && label_id.to_s.length > 25
502
+ fail ArgumentError, 'invalid value for "label_id" when calling LabelsApi.get_tracking_log_from_label, the character length must be smaller than or equal to 25.'
503
+ end
504
+
505
+ if @api_client.config.client_side_validation && label_id.to_s.length < 1
506
+ fail ArgumentError, 'invalid value for "label_id" when calling LabelsApi.get_tracking_log_from_label, the character length must be great than or equal to 1.'
507
+ end
508
+
509
+ pattern = Regexp.new(/^se(-[a-z0-9]+)+$/)
510
+ if @api_client.config.client_side_validation && label_id !~ pattern
511
+ fail ArgumentError, "invalid value for 'label_id' when calling LabelsApi.get_tracking_log_from_label, must conform to the pattern #{pattern}."
512
+ end
513
+
514
+ # resource path
515
+ local_var_path = '/v1/labels/{label_id}/track'.sub('{' + 'label_id' + '}', CGI.escape(label_id.to_s))
516
+
517
+ # query parameters
518
+ query_params = opts[:query_params] || {}
519
+
520
+ # header parameters
521
+ header_params = opts[:header_params] || {}
522
+ # HTTP header 'Accept' (if needed)
523
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
524
+
525
+ # form parameters
526
+ form_params = opts[:form_params] || {}
527
+
528
+ # http body (model)
529
+ post_body = opts[:body]
530
+
531
+ # return_type
532
+ return_type = opts[:return_type] || 'GetTrackingLogFromLabelResponseBody'
533
+
534
+ # auth_names
535
+ auth_names = opts[:auth_names] || ['api_key']
536
+
537
+ new_options = opts.merge(
538
+ :header_params => header_params,
539
+ :query_params => query_params,
540
+ :form_params => form_params,
541
+ :body => post_body,
542
+ :auth_names => auth_names,
543
+ :return_type => return_type
544
+ )
545
+
546
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
547
+ if @api_client.config.debugging
548
+ @api_client.config.logger.debug "API called: LabelsApi#get_tracking_log_from_label\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
549
+ end
550
+ return data, status_code, headers
551
+ end
552
+
553
+ # List labels
554
+ # This endpoint returns a list of labels that you've [created](https://www.shipengine.com/docs/labels/create-a-label/). You can optionally filter the results as well as control their sort order and the number of results returned at a time. By default, all labels are returned, 25 at a time, starting with the most recently created ones. You can combine multiple filter options to narrow-down the results. For example, if you only want to get your UPS labels for your east coast warehouse you could query by both `warehouse_id` and `carrier_id`
555
+ # @param [Hash] opts the optional parameters
556
+ # @option opts [LabelStatus] :label_status Only return labels that are currently in the specified status
557
+ # @option opts [String] :service_code Only return labels for a specific [carrier service](https://www.shipengine.com/docs/shipping/use-a-carrier-service/)
558
+ # @option opts [String] :carrier_id Only return labels for a specific [carrier account](https://www.shipengine.com/docs/carriers/setup/)
559
+ # @option opts [String] :tracking_number Only return labels with a specific tracking number
560
+ # @option opts [String] :batch_id Only return labels that were created in a specific [batch](https://www.shipengine.com/docs/labels/bulk/)
561
+ # @option opts [String] :rate_id Rate ID
562
+ # @option opts [String] :shipment_id Shipment ID
563
+ # @option opts [String] :warehouse_id Only return labels that originate from a specific [warehouse](https://www.shipengine.com/docs/shipping/ship-from-a-warehouse/)
564
+ # @option opts [DateTime] :created_at_start Only return labels that were created on or after a specific date/time
565
+ # @option opts [DateTime] :created_at_end Only return labels that were created on or before a specific date/time
566
+ # @option opts [Integer] :page Return a specific page of results. Defaults to the first page. If set to a number that&#39;s greater than the number of pages of results, an empty page is returned. (default to 1)
567
+ # @option opts [Integer] :page_size The number of results to return per response. (default to 25)
568
+ # @option opts [SortDir] :sort_dir Controls the sort order of the query.
569
+ # @option opts [String] :sort_by Controls which field the query is sorted by. (default to 'created_at')
570
+ # @return [ListLabelsResponseBody]
571
+ def list_labels(opts = {})
572
+ data, _status_code, _headers = list_labels_with_http_info(opts)
573
+ data
574
+ end
575
+
576
+ # List labels
577
+ # This endpoint returns a list of labels that you&#39;ve [created](https://www.shipengine.com/docs/labels/create-a-label/). You can optionally filter the results as well as control their sort order and the number of results returned at a time. By default, all labels are returned, 25 at a time, starting with the most recently created ones. You can combine multiple filter options to narrow-down the results. For example, if you only want to get your UPS labels for your east coast warehouse you could query by both &#x60;warehouse_id&#x60; and &#x60;carrier_id&#x60;
578
+ # @param [Hash] opts the optional parameters
579
+ # @option opts [LabelStatus] :label_status Only return labels that are currently in the specified status
580
+ # @option opts [String] :service_code Only return labels for a specific [carrier service](https://www.shipengine.com/docs/shipping/use-a-carrier-service/)
581
+ # @option opts [String] :carrier_id Only return labels for a specific [carrier account](https://www.shipengine.com/docs/carriers/setup/)
582
+ # @option opts [String] :tracking_number Only return labels with a specific tracking number
583
+ # @option opts [String] :batch_id Only return labels that were created in a specific [batch](https://www.shipengine.com/docs/labels/bulk/)
584
+ # @option opts [String] :rate_id Rate ID
585
+ # @option opts [String] :shipment_id Shipment ID
586
+ # @option opts [String] :warehouse_id Only return labels that originate from a specific [warehouse](https://www.shipengine.com/docs/shipping/ship-from-a-warehouse/)
587
+ # @option opts [DateTime] :created_at_start Only return labels that were created on or after a specific date/time
588
+ # @option opts [DateTime] :created_at_end Only return labels that were created on or before a specific date/time
589
+ # @option opts [Integer] :page Return a specific page of results. Defaults to the first page. If set to a number that&#39;s greater than the number of pages of results, an empty page is returned.
590
+ # @option opts [Integer] :page_size The number of results to return per response.
591
+ # @option opts [SortDir] :sort_dir Controls the sort order of the query.
592
+ # @option opts [String] :sort_by Controls which field the query is sorted by.
593
+ # @return [Array<(ListLabelsResponseBody, Integer, Hash)>] ListLabelsResponseBody data, response status code and response headers
594
+ def list_labels_with_http_info(opts = {})
595
+ if @api_client.config.debugging
596
+ @api_client.config.logger.debug 'Calling API: LabelsApi.list_labels ...'
597
+ end
598
+ pattern = Regexp.new(/^[a-z0-9]+(_[a-z0-9-]+)* ?$/)
599
+ if @api_client.config.client_side_validation && !opts[:'service_code'].nil? && opts[:'service_code'] !~ pattern
600
+ fail ArgumentError, "invalid value for 'opts[:\"service_code\"]' when calling LabelsApi.list_labels, must conform to the pattern #{pattern}."
601
+ end
602
+
603
+ if @api_client.config.client_side_validation && !opts[:'carrier_id'].nil? && opts[:'carrier_id'].to_s.length > 25
604
+ fail ArgumentError, 'invalid value for "opts[:"carrier_id"]" when calling LabelsApi.list_labels, the character length must be smaller than or equal to 25.'
605
+ end
606
+
607
+ if @api_client.config.client_side_validation && !opts[:'carrier_id'].nil? && opts[:'carrier_id'].to_s.length < 1
608
+ fail ArgumentError, 'invalid value for "opts[:"carrier_id"]" when calling LabelsApi.list_labels, the character length must be great than or equal to 1.'
609
+ end
610
+
611
+ pattern = Regexp.new(/^se(-[a-z0-9]+)+$/)
612
+ if @api_client.config.client_side_validation && !opts[:'carrier_id'].nil? && opts[:'carrier_id'] !~ pattern
613
+ fail ArgumentError, "invalid value for 'opts[:\"carrier_id\"]' when calling LabelsApi.list_labels, must conform to the pattern #{pattern}."
614
+ end
615
+
616
+ if @api_client.config.client_side_validation && !opts[:'tracking_number'].nil? && opts[:'tracking_number'].to_s.length < 1
617
+ fail ArgumentError, 'invalid value for "opts[:"tracking_number"]" when calling LabelsApi.list_labels, the character length must be great than or equal to 1.'
618
+ end
619
+
620
+ if @api_client.config.client_side_validation && !opts[:'batch_id'].nil? && opts[:'batch_id'].to_s.length > 25
621
+ fail ArgumentError, 'invalid value for "opts[:"batch_id"]" when calling LabelsApi.list_labels, the character length must be smaller than or equal to 25.'
622
+ end
623
+
624
+ if @api_client.config.client_side_validation && !opts[:'batch_id'].nil? && opts[:'batch_id'].to_s.length < 1
625
+ fail ArgumentError, 'invalid value for "opts[:"batch_id"]" when calling LabelsApi.list_labels, the character length must be great than or equal to 1.'
626
+ end
627
+
628
+ pattern = Regexp.new(/^se(-[a-z0-9]+)+$/)
629
+ if @api_client.config.client_side_validation && !opts[:'batch_id'].nil? && opts[:'batch_id'] !~ pattern
630
+ fail ArgumentError, "invalid value for 'opts[:\"batch_id\"]' when calling LabelsApi.list_labels, must conform to the pattern #{pattern}."
631
+ end
632
+
633
+ if @api_client.config.client_side_validation && !opts[:'rate_id'].nil? && opts[:'rate_id'].to_s.length > 25
634
+ fail ArgumentError, 'invalid value for "opts[:"rate_id"]" when calling LabelsApi.list_labels, the character length must be smaller than or equal to 25.'
635
+ end
636
+
637
+ if @api_client.config.client_side_validation && !opts[:'rate_id'].nil? && opts[:'rate_id'].to_s.length < 1
638
+ fail ArgumentError, 'invalid value for "opts[:"rate_id"]" when calling LabelsApi.list_labels, the character length must be great than or equal to 1.'
639
+ end
640
+
641
+ pattern = Regexp.new(/^se(-[a-z0-9]+)+$/)
642
+ if @api_client.config.client_side_validation && !opts[:'rate_id'].nil? && opts[:'rate_id'] !~ pattern
643
+ fail ArgumentError, "invalid value for 'opts[:\"rate_id\"]' when calling LabelsApi.list_labels, must conform to the pattern #{pattern}."
644
+ end
645
+
646
+ if @api_client.config.client_side_validation && !opts[:'shipment_id'].nil? && opts[:'shipment_id'].to_s.length > 25
647
+ fail ArgumentError, 'invalid value for "opts[:"shipment_id"]" when calling LabelsApi.list_labels, the character length must be smaller than or equal to 25.'
648
+ end
649
+
650
+ if @api_client.config.client_side_validation && !opts[:'shipment_id'].nil? && opts[:'shipment_id'].to_s.length < 1
651
+ fail ArgumentError, 'invalid value for "opts[:"shipment_id"]" when calling LabelsApi.list_labels, the character length must be great than or equal to 1.'
652
+ end
653
+
654
+ pattern = Regexp.new(/^se(-[a-z0-9]+)+$/)
655
+ if @api_client.config.client_side_validation && !opts[:'shipment_id'].nil? && opts[:'shipment_id'] !~ pattern
656
+ fail ArgumentError, "invalid value for 'opts[:\"shipment_id\"]' when calling LabelsApi.list_labels, must conform to the pattern #{pattern}."
657
+ end
658
+
659
+ if @api_client.config.client_side_validation && !opts[:'warehouse_id'].nil? && opts[:'warehouse_id'].to_s.length > 25
660
+ fail ArgumentError, 'invalid value for "opts[:"warehouse_id"]" when calling LabelsApi.list_labels, the character length must be smaller than or equal to 25.'
661
+ end
662
+
663
+ if @api_client.config.client_side_validation && !opts[:'warehouse_id'].nil? && opts[:'warehouse_id'].to_s.length < 1
664
+ fail ArgumentError, 'invalid value for "opts[:"warehouse_id"]" when calling LabelsApi.list_labels, the character length must be great than or equal to 1.'
665
+ end
666
+
667
+ pattern = Regexp.new(/^se(-[a-z0-9]+)+$/)
668
+ if @api_client.config.client_side_validation && !opts[:'warehouse_id'].nil? && opts[:'warehouse_id'] !~ pattern
669
+ fail ArgumentError, "invalid value for 'opts[:\"warehouse_id\"]' when calling LabelsApi.list_labels, must conform to the pattern #{pattern}."
670
+ end
671
+
672
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
673
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling LabelsApi.list_labels, must be greater than or equal to 1.'
674
+ end
675
+
676
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
677
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling LabelsApi.list_labels, must be greater than or equal to 1.'
678
+ end
679
+
680
+ allowable_values = ["modified_at", "created_at"]
681
+ if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
682
+ fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
683
+ end
684
+ # resource path
685
+ local_var_path = '/v1/labels'
686
+
687
+ # query parameters
688
+ query_params = opts[:query_params] || {}
689
+ query_params[:'label_status'] = opts[:'label_status'] if !opts[:'label_status'].nil?
690
+ query_params[:'service_code'] = opts[:'service_code'] if !opts[:'service_code'].nil?
691
+ query_params[:'carrier_id'] = opts[:'carrier_id'] if !opts[:'carrier_id'].nil?
692
+ query_params[:'tracking_number'] = opts[:'tracking_number'] if !opts[:'tracking_number'].nil?
693
+ query_params[:'batch_id'] = opts[:'batch_id'] if !opts[:'batch_id'].nil?
694
+ query_params[:'rate_id'] = opts[:'rate_id'] if !opts[:'rate_id'].nil?
695
+ query_params[:'shipment_id'] = opts[:'shipment_id'] if !opts[:'shipment_id'].nil?
696
+ query_params[:'warehouse_id'] = opts[:'warehouse_id'] if !opts[:'warehouse_id'].nil?
697
+ query_params[:'created_at_start'] = opts[:'created_at_start'] if !opts[:'created_at_start'].nil?
698
+ query_params[:'created_at_end'] = opts[:'created_at_end'] if !opts[:'created_at_end'].nil?
699
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
700
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
701
+ query_params[:'sort_dir'] = opts[:'sort_dir'] if !opts[:'sort_dir'].nil?
702
+ query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
703
+
704
+ # header parameters
705
+ header_params = opts[:header_params] || {}
706
+ # HTTP header 'Accept' (if needed)
707
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
708
+
709
+ # form parameters
710
+ form_params = opts[:form_params] || {}
711
+
712
+ # http body (model)
713
+ post_body = opts[:body]
714
+
715
+ # return_type
716
+ return_type = opts[:return_type] || 'ListLabelsResponseBody'
717
+
718
+ # auth_names
719
+ auth_names = opts[:auth_names] || ['api_key']
720
+
721
+ new_options = opts.merge(
722
+ :header_params => header_params,
723
+ :query_params => query_params,
724
+ :form_params => form_params,
725
+ :body => post_body,
726
+ :auth_names => auth_names,
727
+ :return_type => return_type
728
+ )
729
+
730
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
731
+ if @api_client.config.debugging
732
+ @api_client.config.logger.debug "API called: LabelsApi#list_labels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
733
+ end
734
+ return data, status_code, headers
735
+ end
736
+
737
+ # Void a Label By ID
738
+ # Void a label by ID to get a refund.
739
+ # @param label_id [String] Label ID
740
+ # @param [Hash] opts the optional parameters
741
+ # @return [VoidLabelResponseBody]
742
+ def void_label(label_id, opts = {})
743
+ data, _status_code, _headers = void_label_with_http_info(label_id, opts)
744
+ data
745
+ end
746
+
747
+ # Void a Label By ID
748
+ # Void a label by ID to get a refund.
749
+ # @param label_id [String] Label ID
750
+ # @param [Hash] opts the optional parameters
751
+ # @return [Array<(VoidLabelResponseBody, Integer, Hash)>] VoidLabelResponseBody data, response status code and response headers
752
+ def void_label_with_http_info(label_id, opts = {})
753
+ if @api_client.config.debugging
754
+ @api_client.config.logger.debug 'Calling API: LabelsApi.void_label ...'
755
+ end
756
+ # verify the required parameter 'label_id' is set
757
+ if @api_client.config.client_side_validation && label_id.nil?
758
+ fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelsApi.void_label"
759
+ end
760
+ if @api_client.config.client_side_validation && label_id.to_s.length > 25
761
+ fail ArgumentError, 'invalid value for "label_id" when calling LabelsApi.void_label, the character length must be smaller than or equal to 25.'
762
+ end
763
+
764
+ if @api_client.config.client_side_validation && label_id.to_s.length < 1
765
+ fail ArgumentError, 'invalid value for "label_id" when calling LabelsApi.void_label, the character length must be great than or equal to 1.'
766
+ end
767
+
768
+ pattern = Regexp.new(/^se(-[a-z0-9]+)+$/)
769
+ if @api_client.config.client_side_validation && label_id !~ pattern
770
+ fail ArgumentError, "invalid value for 'label_id' when calling LabelsApi.void_label, must conform to the pattern #{pattern}."
771
+ end
772
+
773
+ # resource path
774
+ local_var_path = '/v1/labels/{label_id}/void'.sub('{' + 'label_id' + '}', CGI.escape(label_id.to_s))
775
+
776
+ # query parameters
777
+ query_params = opts[:query_params] || {}
778
+
779
+ # header parameters
780
+ header_params = opts[:header_params] || {}
781
+ # HTTP header 'Accept' (if needed)
782
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
783
+
784
+ # form parameters
785
+ form_params = opts[:form_params] || {}
786
+
787
+ # http body (model)
788
+ post_body = opts[:body]
789
+
790
+ # return_type
791
+ return_type = opts[:return_type] || 'VoidLabelResponseBody'
792
+
793
+ # auth_names
794
+ auth_names = opts[:auth_names] || ['api_key']
795
+
796
+ new_options = opts.merge(
797
+ :header_params => header_params,
798
+ :query_params => query_params,
799
+ :form_params => form_params,
800
+ :body => post_body,
801
+ :auth_names => auth_names,
802
+ :return_type => return_type
803
+ )
804
+
805
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
806
+ if @api_client.config.debugging
807
+ @api_client.config.logger.debug "API called: LabelsApi#void_label\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
808
+ end
809
+ return data, status_code, headers
810
+ end
811
+ end
812
+ end