From 7c223f2dba3309e5983ee1df783acc443a55fcaa Mon Sep 17 00:00:00 2001 From: Sara G Date: Thu, 23 May 2019 08:21:31 -0500 Subject: [PATCH] first commit --- .DS_Store | Bin 0 -> 6148 bytes .gitignore | 39 + .rspec | 2 + .rubocop.yml | 154 + Gemfile | 7 + README.md | 381 +++ Rakefile | 8 + ...sWorldwideAccountInformationRequestBody.md | 10 + docs/Address.md | 18 + docs/AddressResidentialIndicator.md | 7 + docs/AddressValidatingShipment.md | 27 + docs/AddressValidationApi.md | 63 + docs/AddressValidationResult.md | 11 + docs/AddressValidationStatus.md | 7 + docs/AdvancedOptions.md | 20 + docs/AmazonAccountInformationRequestBody.md | 11 + docs/AmazonProductIdentifier.md | 7 + docs/ApcAccountInformationRequestBody.md | 10 + docs/ApiError.md | 9 + docs/AsendiaAccountInformationRequestBody.md | 11 + docs/BalanceResponseBody.md | 8 + docs/Batch.md | 25 + docs/BatchErrorsResponseBody.md | 9 + docs/BatchResponseError.md | 9 + docs/BatchStatus.md | 7 + docs/BatchesApi.md | 469 +++ docs/BatchesSortBy.md | 7 + docs/BillToParty.md | 7 + docs/BulkRateResponseBody.md | 12 + docs/CapturePayment.md | 7 + docs/Carrier.md | 20 + docs/CarrierAccountsApi.md | 2530 +++++++++++++++ docs/CarrierAdvancedOption.md | 10 + docs/CarrierListOptionsResponseBody.md | 8 + docs/CarrierListResponseBody.md | 8 + docs/CarrierListServicesResponseBody.md | 8 + docs/CarriersApi.md | 335 ++ ...nelAdvisorAccountInformationRequestBody.md | 10 + docs/ChannelAdvisorProductIdentifier.md | 7 + docs/Code.md | 7 + docs/Confirmation.md | 7 + docs/ConnectAccountResponseBody.md | 8 + docs/ConnectMarketplaceResponseBody.md | 8 + docs/Contents.md | 7 + docs/CreateBatchRequestBody.md | 11 + docs/CreateManifestRequestBody.md | 11 + docs/CreateShipmentResponseBody.md | 28 + docs/CreateShipmentsRequestBody.md | 8 + docs/CreateShipmentsResponseBody.md | 9 + docs/CreateWebhookRequestBody.md | 9 + docs/Currency.md | 7 + docs/CustomsItem.md | 13 + docs/DefaultAccountSettingsRequestBody.md | 8 + docs/DetailCode.md | 7 + ...lEcommerceAccountInformationRequestBody.md | 12 + ...DhlExpressAccountInformationRequestBody.md | 9 + docs/DhlExpressAccountSettings.md | 10 + ...lExpressUkAccountInformationRequestBody.md | 11 + docs/DimensionUnit.md | 7 + docs/Dimensions.md | 11 + docs/DpdAccountInformationRequestBody.md | 10 + docs/EbayAccessTokenRequestBody.md | 11 + docs/EndiciaAccountInformationRequestBody.md | 10 + docs/EnvironmentApi.md | 278 ++ docs/ErrorResponseBody.md | 9 + docs/EtsyAccessTokenRequestBody.md | 12 + docs/Event.md | 7 + docs/FedexAccountInformationRequestBody.md | 22 + docs/FedexAccountSettingsRequestBody.md | 12 + docs/FedexPickupType.md | 7 + docs/FedexUkAccountInformationRequestBody.md | 22 + docs/First.md | 8 + .../FirstMileAccountInformationRequestBody.md | 11 + ...obegisticsAccountInformationRequestBody.md | 10 + docs/ImexAccountInformationRequestBody.md | 10 + docs/InsuranceApi.md | 112 + docs/InsuranceProvider.md | 7 + docs/InternationalOptions.md | 10 + docs/Label.md | 26 + docs/LabelFormat.md | 7 + docs/LabelLayout.md | 7 + docs/LabelMessages.md | 10 + docs/LabelStatus.md | 7 + docs/LabelsApi.md | 367 +++ docs/Last.md | 8 + docs/Link.md | 9 + docs/Links.md | 11 + docs/ListBatchResponseBody.md | 12 + docs/ListLabelResponseBody.md | 12 + docs/ListManifestsRequestBody.md | 15 + docs/ListManifestsResponseBody.md | 12 + docs/ListShipmentResponseBody.md | 12 + docs/ListTagResponseBody.md | 8 + docs/MagentoAccountInformationRequestBody.md | 12 + docs/MagentoAccountSettingsRequestBody.md | 15 + docs/MailInnovationsEndorsement.md | 7 + docs/ManifestResponseBody.md | 16 + docs/ManifestsApi.md | 188 ++ docs/MarketplaceAccountsApi.md | 1652 ++++++++++ docs/ModelNext.md | 8 + docs/ModifyBatchRequestBody.md | 9 + docs/Money.md | 9 + ...NewgisticsAccountInformationRequestBody.md | 11 + docs/NewgisticsAccountSettingsRequestBody.md | 9 + docs/NonDelivery.md | 7 + docs/OntracAccountInformationRequestBody.md | 10 + docs/Package.md | 12 + docs/PackageListResponseBody.md | 8 + docs/PackagesApi.md | 278 ++ docs/PagedListResponseBody.md | 11 + docs/PaginationLink.md | 13 + docs/Prev.md | 8 + docs/ProcessBatchRequestBody.md | 10 + docs/ProviderError.md | 9 + docs/PurchaseLabelRequestBody.md | 14 + ...PurchaseLabelWithoutShipmentRequestBody.md | 11 + docs/Rate.md | 31 + docs/RateEstimateRequestBody.md | 20 + docs/RateRequestBody.md | 8 + docs/RateResponseBody.md | 14 + docs/RateResponseStatus.md | 7 + docs/RateShipmentRequestBody.md | 10 + docs/RateShipmentResponseBody.md | 27 + docs/RateShipmentsRequestBody.md | 10 + docs/RateType.md | 7 + docs/RatesApi.md | 228 ++ docs/ResponseMessage.md | 11 + .../RoyalMailAccountInformationRequestBody.md | 19 + ...rDonnelleyAccountInformationRequestBody.md | 10 + docs/Service.md | 14 + docs/Shipment.md | 26 + docs/ShipmentAddTagResponseBody.md | 9 + docs/ShipmentErrorsResponseBody.md | 9 + docs/ShipmentPackage.md | 12 + docs/ShipmentResponseError.md | 10 + docs/ShipmentStatus.md | 7 + docs/ShipmentsApi.md | 596 ++++ docs/ShipmentsSortBy.md | 7 + docs/ShopifyAccessTokenRequestBody.md | 11 + docs/SmartPostEndorsement.md | 7 + docs/SmartPostHub.md | 7 + docs/SortBy.md | 7 + docs/SortDir.md | 7 + docs/StampsAccountInformationRequestBody.md | 10 + docs/StampsAccountUrlResponseBody.md | 9 + docs/StampsAccountUrlsRequestBody.md | 8 + docs/StampsAccountUrlsResponseBody.md | 8 + docs/TagResponseBody.md | 8 + docs/TagsApi.md | 224 ++ docs/TrackEvent.md | 15 + docs/TrackingApi.md | 180 ++ docs/TrackingInformationResponseBody.md | 17 + docs/TrackingStatus.md | 7 + docs/Type.md | 7 + docs/UpdateWebhookRequestBody.md | 8 + docs/UpsAccountInformationRequestBody.md | 25 + docs/UpsAccountSettings.md | 19 + docs/UpsInvoice.md | 11 + docs/UpsPickupType.md | 7 + docs/UrlType.md | 7 + docs/V1LabelsResponse.md | 12 + docs/ValidateAddress.md | 7 + docs/ValidationStatus.md | 7 + docs/VoidLabelResponseBody.md | 9 + docs/Warehouse.md | 12 + docs/WarehouseListResponseBody.md | 8 + docs/WarehouseRequestBody.md | 11 + docs/WarehousesApi.md | 278 ++ docs/WebhookResponseBody.md | 10 + docs/Weight.md | 9 + docs/WeightUnit.md | 7 + lib/shipengine_api.rb | 203 ++ .../api/address_validation_api.rb | 77 + lib/shipengine_api/api/batches_api.rb | 566 ++++ .../api/carrier_accounts_api.rb | 2838 +++++++++++++++++ lib/shipengine_api/api/carriers_api.rb | 407 +++ lib/shipengine_api/api/environment_api.rb | 327 ++ lib/shipengine_api/api/insurance_api.rb | 125 + lib/shipengine_api/api/labels_api.rb | 518 +++ lib/shipengine_api/api/manifests_api.rb | 239 ++ .../api/marketplace_accounts_api.rb | 1655 ++++++++++ lib/shipengine_api/api/packages_api.rb | 327 ++ lib/shipengine_api/api/rates_api.rb | 251 ++ lib/shipengine_api/api/shipments_api.rb | 732 +++++ lib/shipengine_api/api/tags_api.rb | 238 ++ lib/shipengine_api/api/tracking_api.rb | 183 ++ lib/shipengine_api/api/warehouses_api.rb | 327 ++ lib/shipengine_api/api_client.rb | 389 +++ lib/shipengine_api/api_error.rb | 38 + lib/shipengine_api/configuration.rb | 209 ++ ...ldwide_account_information_request_body.rb | 201 ++ lib/shipengine_api/models/address.rb | 273 ++ .../models/address_residential_indicator.rb | 31 + .../models/address_validating_shipment.rb | 494 +++ .../models/address_validation_result.rb | 212 ++ .../models/address_validation_status.rb | 32 + lib/shipengine_api/models/advanced_options.rb | 291 ++ ...amazon_account_information_request_body.rb | 244 ++ .../models/amazon_product_identifier.rb | 30 + .../apc_account_information_request_body.rb | 201 ++ lib/shipengine_api/models/api_error.rb | 192 ++ ...sendia_account_information_request_body.rb | 210 ++ .../models/balance_response_body.rb | 183 ++ lib/shipengine_api/models/batch.rb | 404 +++ .../models/batch_errors_response_body.rb | 194 ++ .../models/batch_response_error.rb | 226 ++ lib/shipengine_api/models/batch_status.rb | 36 + lib/shipengine_api/models/batches_sort_by.rb | 30 + lib/shipengine_api/models/bill_to_party.rb | 30 + .../models/bulk_rate_response_body.rb | 289 ++ lib/shipengine_api/models/capture_payment.rb | 30 + lib/shipengine_api/models/carrier.rb | 331 ++ .../models/carrier_advanced_option.rb | 201 ++ .../carrier_list_options_response_body.rb | 185 ++ .../models/carrier_list_response_body.rb | 185 ++ .../carrier_list_services_response_body.rb | 185 ++ ...dvisor_account_information_request_body.rb | 201 ++ .../channel_advisor_product_identifier.rb | 30 + lib/shipengine_api/models/code.rb | 41 + lib/shipengine_api/models/confirmation.rb | 33 + .../models/connect_account_response_body.rb | 217 ++ .../connect_marketplace_response_body.rb | 184 ++ lib/shipengine_api/models/contents.rb | 33 + .../models/create_batch_request_body.rb | 248 ++ .../models/create_manifest_request_body.rb | 280 ++ .../models/create_shipment_response_body.rb | 505 +++ .../models/create_shipments_request_body.rb | 185 ++ .../models/create_shipments_response_body.rb | 194 ++ .../models/create_webhook_request_body.rb | 192 ++ lib/shipengine_api/models/currency.rb | 33 + lib/shipengine_api/models/customs_item.rb | 262 ++ .../default_account_settings_request_body.rb | 183 ++ lib/shipengine_api/models/detail_code.rb | 72 + ...mmerce_account_information_request_body.rb | 219 ++ ...xpress_account_information_request_body.rb | 192 ++ .../models/dhl_express_account_settings.rb | 201 ++ ...ess_uk_account_information_request_body.rb | 244 ++ lib/shipengine_api/models/dimension_unit.rb | 30 + lib/shipengine_api/models/dimensions.rb | 210 ++ .../dpd_account_information_request_body.rb | 201 ++ .../models/ebay_access_token_request_body.rb | 244 ++ ...ndicia_account_information_request_body.rb | 201 ++ .../models/error_response_body.rb | 195 ++ .../models/etsy_access_token_request_body.rb | 253 ++ lib/shipengine_api/models/event.rb | 34 + .../fedex_account_information_request_body.rb | 325 ++ .../fedex_account_settings_request_body.rb | 219 ++ .../models/fedex_pickup_type.rb | 34 + ...dex_uk_account_information_request_body.rb | 325 ++ lib/shipengine_api/models/first.rb | 208 ++ ...t_mile_account_information_request_body.rb | 244 ++ ...istics_account_information_request_body.rb | 201 ++ .../imex_account_information_request_body.rb | 201 ++ .../models/insurance_provider.rb | 31 + .../models/international_options.rb | 203 ++ lib/shipengine_api/models/label.rb | 661 ++++ lib/shipengine_api/models/label_format.rb | 31 + lib/shipengine_api/models/label_layout.rb | 30 + lib/shipengine_api/models/label_messages.rb | 201 ++ lib/shipengine_api/models/label_status.rb | 32 + lib/shipengine_api/models/last.rb | 208 ++ lib/shipengine_api/models/link.rb | 192 ++ lib/shipengine_api/models/links.rb | 231 ++ .../models/list_batch_response_body.rb | 221 ++ .../models/list_label_response_body.rb | 221 ++ .../models/list_manifests_request_body.rb | 314 ++ .../models/list_manifests_response_body.rb | 221 ++ .../models/list_shipment_response_body.rb | 221 ++ .../models/list_tag_response_body.rb | 185 ++ ...agento_account_information_request_body.rb | 219 ++ .../magento_account_settings_request_body.rb | 258 ++ .../models/mail_innovations_endorsement.rb | 34 + .../models/manifest_response_body.rb | 425 +++ lib/shipengine_api/models/model_next.rb | 199 ++ .../models/modify_batch_request_body.rb | 196 ++ lib/shipengine_api/models/money.rb | 192 ++ ...istics_account_information_request_body.rb | 210 ++ ...ewgistics_account_settings_request_body.rb | 192 ++ lib/shipengine_api/models/non_delivery.rb | 30 + ...ontrac_account_information_request_body.rb | 201 ++ lib/shipengine_api/models/package.rb | 258 ++ .../models/package_list_response_body.rb | 185 ++ .../models/paged_list_response_body.rb | 291 ++ lib/shipengine_api/models/pagination_link.rb | 228 ++ lib/shipengine_api/models/prev.rb | 199 ++ .../models/process_batch_request_body.rb | 201 ++ lib/shipengine_api/models/provider_error.rb | 226 ++ .../models/purchase_label_request_body.rb | 237 ++ ...ase_label_without_shipment_request_body.rb | 210 ++ lib/shipengine_api/models/rate.rb | 462 +++ .../models/rate_estimate_request_body.rb | 327 ++ .../models/rate_request_body.rb | 185 ++ .../models/rate_response_body.rb | 311 ++ .../models/rate_response_status.rb | 32 + .../models/rate_shipment_request_body.rb | 235 ++ .../models/rate_shipment_response_body.rb | 494 +++ .../models/rate_shipments_request_body.rb | 205 ++ lib/shipengine_api/models/rate_type.rb | 30 + lib/shipengine_api/models/response_message.rb | 210 ++ ...l_mail_account_information_request_body.rb | 314 ++ ...nelley_account_information_request_body.rb | 201 ++ lib/shipengine_api/models/service.rb | 271 ++ lib/shipengine_api/models/shipment.rb | 485 +++ .../models/shipment_add_tag_response_body.rb | 226 ++ .../models/shipment_errors_response_body.rb | 194 ++ lib/shipengine_api/models/shipment_package.rb | 219 ++ .../models/shipment_response_error.rb | 269 ++ lib/shipengine_api/models/shipment_status.rb | 32 + .../models/shipments_sort_by.rb | 30 + .../shopify_access_token_request_body.rb | 244 ++ .../models/smart_post_endorsement.rb | 34 + lib/shipengine_api/models/smart_post_hub.rb | 62 + lib/shipengine_api/models/sort_by.rb | 30 + lib/shipengine_api/models/sort_dir.rb | 30 + ...stamps_account_information_request_body.rb | 201 ++ .../stamps_account_url_response_body.rb | 192 ++ .../stamps_account_urls_request_body.rb | 185 ++ .../stamps_account_urls_response_body.rb | 185 ++ .../models/tag_response_body.rb | 183 ++ lib/shipengine_api/models/track_event.rb | 246 ++ .../tracking_information_response_body.rb | 266 ++ lib/shipengine_api/models/tracking_status.rb | 32 + lib/shipengine_api/models/type.rb | 31 + .../models/update_webhook_request_body.rb | 183 ++ .../ups_account_information_request_body.rb | 352 ++ .../models/ups_account_settings.rb | 282 ++ lib/shipengine_api/models/ups_invoice.rb | 244 ++ lib/shipengine_api/models/ups_pickup_type.rb | 31 + lib/shipengine_api/models/url_type.rb | 32 + .../models/v1_labels_response.rb | 307 ++ lib/shipengine_api/models/validate_address.rb | 31 + .../models/validation_status.rb | 32 + .../models/void_label_response_body.rb | 192 ++ lib/shipengine_api/models/warehouse.rb | 253 ++ .../models/warehouse_list_response_body.rb | 185 ++ .../models/warehouse_request_body.rb | 244 ++ .../models/webhook_response_body.rb | 235 ++ lib/shipengine_api/models/weight.rb | 192 ++ lib/shipengine_api/models/weight_unit.rb | 32 + lib/shipengine_api/version.rb | 15 + shipengine_api.gemspec | 45 + spec/api/address_validation_api_spec.rb | 47 + spec/api/batches_api_spec.rb | 140 + spec/api/carrier_accounts_api_spec.rb | 592 ++++ spec/api/carriers_api_spec.rb | 107 + spec/api/environment_api_spec.rb | 95 + spec/api/insurance_api_spec.rb | 58 + spec/api/labels_api_spec.rb | 120 + spec/api/manifests_api_spec.rb | 78 + spec/api/marketplace_accounts_api_spec.rb | 401 +++ spec/api/packages_api_spec.rb | 95 + spec/api/rates_api_spec.rb | 83 + spec/api/shipments_api_spec.rb | 171 + spec/api/tags_api_spec.rb | 83 + spec/api/tracking_api_spec.rb | 74 + spec/api/warehouses_api_spec.rb | 95 + spec/api_client_spec.rb | 226 ++ spec/configuration_spec.rb | 42 + ...e_account_information_request_body_spec.rb | 53 + .../address_residential_indicator_spec.rb | 35 + spec/models/address_spec.rb | 101 + .../address_validating_shipment_spec.rb | 155 + spec/models/address_validation_result_spec.rb | 59 + spec/models/address_validation_status_spec.rb | 35 + spec/models/advanced_options_spec.rb | 113 + ...n_account_information_request_body_spec.rb | 59 + spec/models/amazon_product_identifier_spec.rb | 35 + ...c_account_information_request_body_spec.rb | 53 + spec/models/api_error_spec.rb | 47 + ...a_account_information_request_body_spec.rb | 59 + spec/models/balance_response_body_spec.rb | 41 + .../models/batch_errors_response_body_spec.rb | 47 + spec/models/batch_response_error_spec.rb | 47 + spec/models/batch_spec.rb | 143 + spec/models/batch_status_spec.rb | 35 + spec/models/batches_sort_by_spec.rb | 35 + spec/models/bill_to_party_spec.rb | 35 + spec/models/bulk_rate_response_body_spec.rb | 65 + spec/models/capture_payment_spec.rb | 35 + spec/models/carrier_advanced_option_spec.rb | 53 + ...carrier_list_options_response_body_spec.rb | 41 + .../models/carrier_list_response_body_spec.rb | 41 + ...arrier_list_services_response_body_spec.rb | 41 + spec/models/carrier_spec.rb | 113 + ...r_account_information_request_body_spec.rb | 53 + ...channel_advisor_product_identifier_spec.rb | 35 + spec/models/code_spec.rb | 35 + spec/models/confirmation_spec.rb | 35 + .../connect_account_response_body_spec.rb | 41 + .../connect_marketplace_response_body_spec.rb | 41 + spec/models/contents_spec.rb | 35 + spec/models/create_batch_request_body_spec.rb | 59 + .../create_manifest_request_body_spec.rb | 59 + .../create_shipment_response_body_spec.rb | 161 + .../create_shipments_request_body_spec.rb | 41 + .../create_shipments_response_body_spec.rb | 47 + .../create_webhook_request_body_spec.rb | 47 + spec/models/currency_spec.rb | 35 + spec/models/customs_item_spec.rb | 71 + ...ault_account_settings_request_body_spec.rb | 41 + spec/models/detail_code_spec.rb | 35 + ...e_account_information_request_body_spec.rb | 65 + ...s_account_information_request_body_spec.rb | 47 + .../dhl_express_account_settings_spec.rb | 53 + ...k_account_information_request_body_spec.rb | 59 + spec/models/dimension_unit_spec.rb | 35 + spec/models/dimensions_spec.rb | 59 + ...d_account_information_request_body_spec.rb | 53 + .../ebay_access_token_request_body_spec.rb | 59 + ...a_account_information_request_body_spec.rb | 53 + spec/models/error_response_body_spec.rb | 47 + .../etsy_access_token_request_body_spec.rb | 65 + spec/models/event_spec.rb | 35 + ...x_account_information_request_body_spec.rb | 125 + ...edex_account_settings_request_body_spec.rb | 65 + spec/models/fedex_pickup_type_spec.rb | 35 + ...k_account_information_request_body_spec.rb | 125 + ...e_account_information_request_body_spec.rb | 59 + spec/models/first_spec.rb | 41 + ...s_account_information_request_body_spec.rb | 53 + ...x_account_information_request_body_spec.rb | 53 + spec/models/insurance_provider_spec.rb | 35 + spec/models/international_options_spec.rb | 53 + spec/models/label_format_spec.rb | 35 + spec/models/label_layout_spec.rb | 35 + spec/models/label_messages_spec.rb | 53 + spec/models/label_spec.rb | 149 + spec/models/label_status_spec.rb | 35 + spec/models/last_spec.rb | 41 + spec/models/link_spec.rb | 47 + spec/models/links_spec.rb | 59 + spec/models/list_batch_response_body_spec.rb | 65 + spec/models/list_label_response_body_spec.rb | 65 + .../list_manifests_request_body_spec.rb | 83 + .../list_manifests_response_body_spec.rb | 65 + .../list_shipment_response_body_spec.rb | 65 + spec/models/list_tag_response_body_spec.rb | 41 + ...o_account_information_request_body_spec.rb | 65 + ...ento_account_settings_request_body_spec.rb | 83 + .../mail_innovations_endorsement_spec.rb | 35 + spec/models/manifest_response_body_spec.rb | 89 + spec/models/model_next_spec.rb | 41 + spec/models/modify_batch_request_body_spec.rb | 47 + spec/models/money_spec.rb | 47 + ...s_account_information_request_body_spec.rb | 59 + ...tics_account_settings_request_body_spec.rb | 47 + spec/models/non_delivery_spec.rb | 35 + ...c_account_information_request_body_spec.rb | 53 + .../models/package_list_response_body_spec.rb | 41 + spec/models/package_spec.rb | 65 + spec/models/paged_list_response_body_spec.rb | 59 + spec/models/pagination_link_spec.rb | 71 + spec/models/prev_spec.rb | 41 + .../models/process_batch_request_body_spec.rb | 53 + spec/models/provider_error_spec.rb | 47 + .../purchase_label_request_body_spec.rb | 77 + ...abel_without_shipment_request_body_spec.rb | 59 + .../models/rate_estimate_request_body_spec.rb | 113 + spec/models/rate_request_body_spec.rb | 41 + spec/models/rate_response_body_spec.rb | 77 + spec/models/rate_response_status_spec.rb | 35 + .../models/rate_shipment_request_body_spec.rb | 53 + .../rate_shipment_response_body_spec.rb | 155 + .../rate_shipments_request_body_spec.rb | 53 + spec/models/rate_spec.rb | 179 ++ spec/models/rate_type_spec.rb | 35 + spec/models/response_message_spec.rb | 59 + ...l_account_information_request_body_spec.rb | 107 + ...y_account_information_request_body_spec.rb | 53 + spec/models/service_spec.rb | 77 + .../shipment_add_tag_response_body_spec.rb | 47 + .../shipment_errors_response_body_spec.rb | 47 + spec/models/shipment_package_spec.rb | 65 + spec/models/shipment_response_error_spec.rb | 53 + spec/models/shipment_spec.rb | 149 + spec/models/shipment_status_spec.rb | 35 + spec/models/shipments_sort_by_spec.rb | 35 + .../shopify_access_token_request_body_spec.rb | 59 + spec/models/smart_post_endorsement_spec.rb | 35 + spec/models/smart_post_hub_spec.rb | 35 + spec/models/sort_by_spec.rb | 35 + spec/models/sort_dir_spec.rb | 35 + ...s_account_information_request_body_spec.rb | 53 + .../stamps_account_url_response_body_spec.rb | 47 + .../stamps_account_urls_request_body_spec.rb | 41 + .../stamps_account_urls_response_body_spec.rb | 41 + spec/models/tag_response_body_spec.rb | 41 + spec/models/track_event_spec.rb | 83 + ...tracking_information_response_body_spec.rb | 95 + spec/models/tracking_status_spec.rb | 35 + spec/models/type_spec.rb | 35 + .../update_webhook_request_body_spec.rb | 41 + ...s_account_information_request_body_spec.rb | 143 + spec/models/ups_account_settings_spec.rb | 107 + spec/models/ups_invoice_spec.rb | 59 + spec/models/ups_pickup_type_spec.rb | 35 + spec/models/url_type_spec.rb | 35 + spec/models/v1_labels_response_spec.rb | 65 + spec/models/validate_address_spec.rb | 35 + spec/models/validation_status_spec.rb | 35 + spec/models/void_label_response_body_spec.rb | 47 + .../warehouse_list_response_body_spec.rb | 41 + spec/models/warehouse_request_body_spec.rb | 59 + spec/models/warehouse_spec.rb | 65 + spec/models/webhook_response_body_spec.rb | 53 + spec/models/weight_spec.rb | 47 + spec/models/weight_unit_spec.rb | 35 + spec/spec_helper.rb | 111 + 508 files changed, 59703 insertions(+) create mode 100644 .DS_Store create mode 100755 .gitignore create mode 100755 .rspec create mode 100755 .rubocop.yml create mode 100755 Gemfile create mode 100755 README.md create mode 100755 Rakefile create mode 100755 docs/AccessWorldwideAccountInformationRequestBody.md create mode 100755 docs/Address.md create mode 100755 docs/AddressResidentialIndicator.md create mode 100755 docs/AddressValidatingShipment.md create mode 100755 docs/AddressValidationApi.md create mode 100755 docs/AddressValidationResult.md create mode 100755 docs/AddressValidationStatus.md create mode 100755 docs/AdvancedOptions.md create mode 100755 docs/AmazonAccountInformationRequestBody.md create mode 100755 docs/AmazonProductIdentifier.md create mode 100755 docs/ApcAccountInformationRequestBody.md create mode 100755 docs/ApiError.md create mode 100755 docs/AsendiaAccountInformationRequestBody.md create mode 100755 docs/BalanceResponseBody.md create mode 100755 docs/Batch.md create mode 100755 docs/BatchErrorsResponseBody.md create mode 100755 docs/BatchResponseError.md create mode 100755 docs/BatchStatus.md create mode 100755 docs/BatchesApi.md create mode 100755 docs/BatchesSortBy.md create mode 100755 docs/BillToParty.md create mode 100755 docs/BulkRateResponseBody.md create mode 100755 docs/CapturePayment.md create mode 100755 docs/Carrier.md create mode 100755 docs/CarrierAccountsApi.md create mode 100755 docs/CarrierAdvancedOption.md create mode 100755 docs/CarrierListOptionsResponseBody.md create mode 100755 docs/CarrierListResponseBody.md create mode 100755 docs/CarrierListServicesResponseBody.md create mode 100755 docs/CarriersApi.md create mode 100755 docs/ChannelAdvisorAccountInformationRequestBody.md create mode 100755 docs/ChannelAdvisorProductIdentifier.md create mode 100755 docs/Code.md create mode 100755 docs/Confirmation.md create mode 100755 docs/ConnectAccountResponseBody.md create mode 100755 docs/ConnectMarketplaceResponseBody.md create mode 100755 docs/Contents.md create mode 100755 docs/CreateBatchRequestBody.md create mode 100755 docs/CreateManifestRequestBody.md create mode 100755 docs/CreateShipmentResponseBody.md create mode 100755 docs/CreateShipmentsRequestBody.md create mode 100755 docs/CreateShipmentsResponseBody.md create mode 100755 docs/CreateWebhookRequestBody.md create mode 100755 docs/Currency.md create mode 100755 docs/CustomsItem.md create mode 100755 docs/DefaultAccountSettingsRequestBody.md create mode 100755 docs/DetailCode.md create mode 100755 docs/DhlEcommerceAccountInformationRequestBody.md create mode 100755 docs/DhlExpressAccountInformationRequestBody.md create mode 100755 docs/DhlExpressAccountSettings.md create mode 100755 docs/DhlExpressUkAccountInformationRequestBody.md create mode 100755 docs/DimensionUnit.md create mode 100755 docs/Dimensions.md create mode 100755 docs/DpdAccountInformationRequestBody.md create mode 100755 docs/EbayAccessTokenRequestBody.md create mode 100755 docs/EndiciaAccountInformationRequestBody.md create mode 100755 docs/EnvironmentApi.md create mode 100755 docs/ErrorResponseBody.md create mode 100755 docs/EtsyAccessTokenRequestBody.md create mode 100755 docs/Event.md create mode 100755 docs/FedexAccountInformationRequestBody.md create mode 100755 docs/FedexAccountSettingsRequestBody.md create mode 100755 docs/FedexPickupType.md create mode 100755 docs/FedexUkAccountInformationRequestBody.md create mode 100755 docs/First.md create mode 100755 docs/FirstMileAccountInformationRequestBody.md create mode 100755 docs/GlobegisticsAccountInformationRequestBody.md create mode 100755 docs/ImexAccountInformationRequestBody.md create mode 100755 docs/InsuranceApi.md create mode 100755 docs/InsuranceProvider.md create mode 100755 docs/InternationalOptions.md create mode 100755 docs/Label.md create mode 100755 docs/LabelFormat.md create mode 100755 docs/LabelLayout.md create mode 100755 docs/LabelMessages.md create mode 100755 docs/LabelStatus.md create mode 100755 docs/LabelsApi.md create mode 100755 docs/Last.md create mode 100755 docs/Link.md create mode 100755 docs/Links.md create mode 100755 docs/ListBatchResponseBody.md create mode 100755 docs/ListLabelResponseBody.md create mode 100755 docs/ListManifestsRequestBody.md create mode 100755 docs/ListManifestsResponseBody.md create mode 100755 docs/ListShipmentResponseBody.md create mode 100755 docs/ListTagResponseBody.md create mode 100755 docs/MagentoAccountInformationRequestBody.md create mode 100755 docs/MagentoAccountSettingsRequestBody.md create mode 100755 docs/MailInnovationsEndorsement.md create mode 100755 docs/ManifestResponseBody.md create mode 100755 docs/ManifestsApi.md create mode 100755 docs/MarketplaceAccountsApi.md create mode 100755 docs/ModelNext.md create mode 100755 docs/ModifyBatchRequestBody.md create mode 100755 docs/Money.md create mode 100755 docs/NewgisticsAccountInformationRequestBody.md create mode 100755 docs/NewgisticsAccountSettingsRequestBody.md create mode 100755 docs/NonDelivery.md create mode 100755 docs/OntracAccountInformationRequestBody.md create mode 100755 docs/Package.md create mode 100755 docs/PackageListResponseBody.md create mode 100755 docs/PackagesApi.md create mode 100755 docs/PagedListResponseBody.md create mode 100755 docs/PaginationLink.md create mode 100755 docs/Prev.md create mode 100755 docs/ProcessBatchRequestBody.md create mode 100755 docs/ProviderError.md create mode 100755 docs/PurchaseLabelRequestBody.md create mode 100755 docs/PurchaseLabelWithoutShipmentRequestBody.md create mode 100755 docs/Rate.md create mode 100755 docs/RateEstimateRequestBody.md create mode 100755 docs/RateRequestBody.md create mode 100755 docs/RateResponseBody.md create mode 100755 docs/RateResponseStatus.md create mode 100755 docs/RateShipmentRequestBody.md create mode 100755 docs/RateShipmentResponseBody.md create mode 100755 docs/RateShipmentsRequestBody.md create mode 100755 docs/RateType.md create mode 100755 docs/RatesApi.md create mode 100755 docs/ResponseMessage.md create mode 100755 docs/RoyalMailAccountInformationRequestBody.md create mode 100755 docs/RrDonnelleyAccountInformationRequestBody.md create mode 100755 docs/Service.md create mode 100755 docs/Shipment.md create mode 100755 docs/ShipmentAddTagResponseBody.md create mode 100755 docs/ShipmentErrorsResponseBody.md create mode 100755 docs/ShipmentPackage.md create mode 100755 docs/ShipmentResponseError.md create mode 100755 docs/ShipmentStatus.md create mode 100755 docs/ShipmentsApi.md create mode 100755 docs/ShipmentsSortBy.md create mode 100755 docs/ShopifyAccessTokenRequestBody.md create mode 100755 docs/SmartPostEndorsement.md create mode 100755 docs/SmartPostHub.md create mode 100755 docs/SortBy.md create mode 100755 docs/SortDir.md create mode 100755 docs/StampsAccountInformationRequestBody.md create mode 100755 docs/StampsAccountUrlResponseBody.md create mode 100755 docs/StampsAccountUrlsRequestBody.md create mode 100755 docs/StampsAccountUrlsResponseBody.md create mode 100755 docs/TagResponseBody.md create mode 100755 docs/TagsApi.md create mode 100755 docs/TrackEvent.md create mode 100755 docs/TrackingApi.md create mode 100755 docs/TrackingInformationResponseBody.md create mode 100755 docs/TrackingStatus.md create mode 100755 docs/Type.md create mode 100755 docs/UpdateWebhookRequestBody.md create mode 100755 docs/UpsAccountInformationRequestBody.md create mode 100755 docs/UpsAccountSettings.md create mode 100755 docs/UpsInvoice.md create mode 100755 docs/UpsPickupType.md create mode 100755 docs/UrlType.md create mode 100755 docs/V1LabelsResponse.md create mode 100755 docs/ValidateAddress.md create mode 100755 docs/ValidationStatus.md create mode 100755 docs/VoidLabelResponseBody.md create mode 100755 docs/Warehouse.md create mode 100755 docs/WarehouseListResponseBody.md create mode 100755 docs/WarehouseRequestBody.md create mode 100755 docs/WarehousesApi.md create mode 100755 docs/WebhookResponseBody.md create mode 100755 docs/Weight.md create mode 100755 docs/WeightUnit.md create mode 100755 lib/shipengine_api.rb create mode 100755 lib/shipengine_api/api/address_validation_api.rb create mode 100755 lib/shipengine_api/api/batches_api.rb create mode 100755 lib/shipengine_api/api/carrier_accounts_api.rb create mode 100755 lib/shipengine_api/api/carriers_api.rb create mode 100755 lib/shipengine_api/api/environment_api.rb create mode 100755 lib/shipengine_api/api/insurance_api.rb create mode 100755 lib/shipengine_api/api/labels_api.rb create mode 100755 lib/shipengine_api/api/manifests_api.rb create mode 100755 lib/shipengine_api/api/marketplace_accounts_api.rb create mode 100755 lib/shipengine_api/api/packages_api.rb create mode 100755 lib/shipengine_api/api/rates_api.rb create mode 100755 lib/shipengine_api/api/shipments_api.rb create mode 100755 lib/shipengine_api/api/tags_api.rb create mode 100755 lib/shipengine_api/api/tracking_api.rb create mode 100755 lib/shipengine_api/api/warehouses_api.rb create mode 100755 lib/shipengine_api/api_client.rb create mode 100755 lib/shipengine_api/api_error.rb create mode 100755 lib/shipengine_api/configuration.rb create mode 100755 lib/shipengine_api/models/access_worldwide_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/address.rb create mode 100755 lib/shipengine_api/models/address_residential_indicator.rb create mode 100755 lib/shipengine_api/models/address_validating_shipment.rb create mode 100755 lib/shipengine_api/models/address_validation_result.rb create mode 100755 lib/shipengine_api/models/address_validation_status.rb create mode 100755 lib/shipengine_api/models/advanced_options.rb create mode 100755 lib/shipengine_api/models/amazon_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/amazon_product_identifier.rb create mode 100755 lib/shipengine_api/models/apc_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/api_error.rb create mode 100755 lib/shipengine_api/models/asendia_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/balance_response_body.rb create mode 100755 lib/shipengine_api/models/batch.rb create mode 100755 lib/shipengine_api/models/batch_errors_response_body.rb create mode 100755 lib/shipengine_api/models/batch_response_error.rb create mode 100755 lib/shipengine_api/models/batch_status.rb create mode 100755 lib/shipengine_api/models/batches_sort_by.rb create mode 100755 lib/shipengine_api/models/bill_to_party.rb create mode 100755 lib/shipengine_api/models/bulk_rate_response_body.rb create mode 100755 lib/shipengine_api/models/capture_payment.rb create mode 100755 lib/shipengine_api/models/carrier.rb create mode 100755 lib/shipengine_api/models/carrier_advanced_option.rb create mode 100755 lib/shipengine_api/models/carrier_list_options_response_body.rb create mode 100755 lib/shipengine_api/models/carrier_list_response_body.rb create mode 100755 lib/shipengine_api/models/carrier_list_services_response_body.rb create mode 100755 lib/shipengine_api/models/channel_advisor_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/channel_advisor_product_identifier.rb create mode 100755 lib/shipengine_api/models/code.rb create mode 100755 lib/shipengine_api/models/confirmation.rb create mode 100755 lib/shipengine_api/models/connect_account_response_body.rb create mode 100755 lib/shipengine_api/models/connect_marketplace_response_body.rb create mode 100755 lib/shipengine_api/models/contents.rb create mode 100755 lib/shipengine_api/models/create_batch_request_body.rb create mode 100755 lib/shipengine_api/models/create_manifest_request_body.rb create mode 100755 lib/shipengine_api/models/create_shipment_response_body.rb create mode 100755 lib/shipengine_api/models/create_shipments_request_body.rb create mode 100755 lib/shipengine_api/models/create_shipments_response_body.rb create mode 100755 lib/shipengine_api/models/create_webhook_request_body.rb create mode 100755 lib/shipengine_api/models/currency.rb create mode 100755 lib/shipengine_api/models/customs_item.rb create mode 100755 lib/shipengine_api/models/default_account_settings_request_body.rb create mode 100755 lib/shipengine_api/models/detail_code.rb create mode 100755 lib/shipengine_api/models/dhl_ecommerce_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/dhl_express_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/dhl_express_account_settings.rb create mode 100755 lib/shipengine_api/models/dhl_express_uk_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/dimension_unit.rb create mode 100755 lib/shipengine_api/models/dimensions.rb create mode 100755 lib/shipengine_api/models/dpd_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/ebay_access_token_request_body.rb create mode 100755 lib/shipengine_api/models/endicia_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/error_response_body.rb create mode 100755 lib/shipengine_api/models/etsy_access_token_request_body.rb create mode 100755 lib/shipengine_api/models/event.rb create mode 100755 lib/shipengine_api/models/fedex_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/fedex_account_settings_request_body.rb create mode 100755 lib/shipengine_api/models/fedex_pickup_type.rb create mode 100755 lib/shipengine_api/models/fedex_uk_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/first.rb create mode 100755 lib/shipengine_api/models/first_mile_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/globegistics_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/imex_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/insurance_provider.rb create mode 100755 lib/shipengine_api/models/international_options.rb create mode 100755 lib/shipengine_api/models/label.rb create mode 100755 lib/shipengine_api/models/label_format.rb create mode 100755 lib/shipengine_api/models/label_layout.rb create mode 100755 lib/shipengine_api/models/label_messages.rb create mode 100755 lib/shipengine_api/models/label_status.rb create mode 100755 lib/shipengine_api/models/last.rb create mode 100755 lib/shipengine_api/models/link.rb create mode 100755 lib/shipengine_api/models/links.rb create mode 100755 lib/shipengine_api/models/list_batch_response_body.rb create mode 100755 lib/shipengine_api/models/list_label_response_body.rb create mode 100755 lib/shipengine_api/models/list_manifests_request_body.rb create mode 100755 lib/shipengine_api/models/list_manifests_response_body.rb create mode 100755 lib/shipengine_api/models/list_shipment_response_body.rb create mode 100755 lib/shipengine_api/models/list_tag_response_body.rb create mode 100755 lib/shipengine_api/models/magento_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/magento_account_settings_request_body.rb create mode 100755 lib/shipengine_api/models/mail_innovations_endorsement.rb create mode 100755 lib/shipengine_api/models/manifest_response_body.rb create mode 100755 lib/shipengine_api/models/model_next.rb create mode 100755 lib/shipengine_api/models/modify_batch_request_body.rb create mode 100755 lib/shipengine_api/models/money.rb create mode 100755 lib/shipengine_api/models/newgistics_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/newgistics_account_settings_request_body.rb create mode 100755 lib/shipengine_api/models/non_delivery.rb create mode 100755 lib/shipengine_api/models/ontrac_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/package.rb create mode 100755 lib/shipengine_api/models/package_list_response_body.rb create mode 100755 lib/shipengine_api/models/paged_list_response_body.rb create mode 100755 lib/shipengine_api/models/pagination_link.rb create mode 100755 lib/shipengine_api/models/prev.rb create mode 100755 lib/shipengine_api/models/process_batch_request_body.rb create mode 100755 lib/shipengine_api/models/provider_error.rb create mode 100755 lib/shipengine_api/models/purchase_label_request_body.rb create mode 100755 lib/shipengine_api/models/purchase_label_without_shipment_request_body.rb create mode 100755 lib/shipengine_api/models/rate.rb create mode 100755 lib/shipengine_api/models/rate_estimate_request_body.rb create mode 100755 lib/shipengine_api/models/rate_request_body.rb create mode 100755 lib/shipengine_api/models/rate_response_body.rb create mode 100755 lib/shipengine_api/models/rate_response_status.rb create mode 100755 lib/shipengine_api/models/rate_shipment_request_body.rb create mode 100755 lib/shipengine_api/models/rate_shipment_response_body.rb create mode 100755 lib/shipengine_api/models/rate_shipments_request_body.rb create mode 100755 lib/shipengine_api/models/rate_type.rb create mode 100755 lib/shipengine_api/models/response_message.rb create mode 100755 lib/shipengine_api/models/royal_mail_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/rr_donnelley_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/service.rb create mode 100755 lib/shipengine_api/models/shipment.rb create mode 100755 lib/shipengine_api/models/shipment_add_tag_response_body.rb create mode 100755 lib/shipengine_api/models/shipment_errors_response_body.rb create mode 100755 lib/shipengine_api/models/shipment_package.rb create mode 100755 lib/shipengine_api/models/shipment_response_error.rb create mode 100755 lib/shipengine_api/models/shipment_status.rb create mode 100755 lib/shipengine_api/models/shipments_sort_by.rb create mode 100755 lib/shipengine_api/models/shopify_access_token_request_body.rb create mode 100755 lib/shipengine_api/models/smart_post_endorsement.rb create mode 100755 lib/shipengine_api/models/smart_post_hub.rb create mode 100755 lib/shipengine_api/models/sort_by.rb create mode 100755 lib/shipengine_api/models/sort_dir.rb create mode 100755 lib/shipengine_api/models/stamps_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/stamps_account_url_response_body.rb create mode 100755 lib/shipengine_api/models/stamps_account_urls_request_body.rb create mode 100755 lib/shipengine_api/models/stamps_account_urls_response_body.rb create mode 100755 lib/shipengine_api/models/tag_response_body.rb create mode 100755 lib/shipengine_api/models/track_event.rb create mode 100755 lib/shipengine_api/models/tracking_information_response_body.rb create mode 100755 lib/shipengine_api/models/tracking_status.rb create mode 100755 lib/shipengine_api/models/type.rb create mode 100755 lib/shipengine_api/models/update_webhook_request_body.rb create mode 100755 lib/shipengine_api/models/ups_account_information_request_body.rb create mode 100755 lib/shipengine_api/models/ups_account_settings.rb create mode 100755 lib/shipengine_api/models/ups_invoice.rb create mode 100755 lib/shipengine_api/models/ups_pickup_type.rb create mode 100755 lib/shipengine_api/models/url_type.rb create mode 100755 lib/shipengine_api/models/v1_labels_response.rb create mode 100755 lib/shipengine_api/models/validate_address.rb create mode 100755 lib/shipengine_api/models/validation_status.rb create mode 100755 lib/shipengine_api/models/void_label_response_body.rb create mode 100755 lib/shipengine_api/models/warehouse.rb create mode 100755 lib/shipengine_api/models/warehouse_list_response_body.rb create mode 100755 lib/shipengine_api/models/warehouse_request_body.rb create mode 100755 lib/shipengine_api/models/webhook_response_body.rb create mode 100755 lib/shipengine_api/models/weight.rb create mode 100755 lib/shipengine_api/models/weight_unit.rb create mode 100755 lib/shipengine_api/version.rb create mode 100755 shipengine_api.gemspec create mode 100755 spec/api/address_validation_api_spec.rb create mode 100755 spec/api/batches_api_spec.rb create mode 100755 spec/api/carrier_accounts_api_spec.rb create mode 100755 spec/api/carriers_api_spec.rb create mode 100755 spec/api/environment_api_spec.rb create mode 100755 spec/api/insurance_api_spec.rb create mode 100755 spec/api/labels_api_spec.rb create mode 100755 spec/api/manifests_api_spec.rb create mode 100755 spec/api/marketplace_accounts_api_spec.rb create mode 100755 spec/api/packages_api_spec.rb create mode 100755 spec/api/rates_api_spec.rb create mode 100755 spec/api/shipments_api_spec.rb create mode 100755 spec/api/tags_api_spec.rb create mode 100755 spec/api/tracking_api_spec.rb create mode 100755 spec/api/warehouses_api_spec.rb create mode 100755 spec/api_client_spec.rb create mode 100755 spec/configuration_spec.rb create mode 100755 spec/models/access_worldwide_account_information_request_body_spec.rb create mode 100755 spec/models/address_residential_indicator_spec.rb create mode 100755 spec/models/address_spec.rb create mode 100755 spec/models/address_validating_shipment_spec.rb create mode 100755 spec/models/address_validation_result_spec.rb create mode 100755 spec/models/address_validation_status_spec.rb create mode 100755 spec/models/advanced_options_spec.rb create mode 100755 spec/models/amazon_account_information_request_body_spec.rb create mode 100755 spec/models/amazon_product_identifier_spec.rb create mode 100755 spec/models/apc_account_information_request_body_spec.rb create mode 100755 spec/models/api_error_spec.rb create mode 100755 spec/models/asendia_account_information_request_body_spec.rb create mode 100755 spec/models/balance_response_body_spec.rb create mode 100755 spec/models/batch_errors_response_body_spec.rb create mode 100755 spec/models/batch_response_error_spec.rb create mode 100755 spec/models/batch_spec.rb create mode 100755 spec/models/batch_status_spec.rb create mode 100755 spec/models/batches_sort_by_spec.rb create mode 100755 spec/models/bill_to_party_spec.rb create mode 100755 spec/models/bulk_rate_response_body_spec.rb create mode 100755 spec/models/capture_payment_spec.rb create mode 100755 spec/models/carrier_advanced_option_spec.rb create mode 100755 spec/models/carrier_list_options_response_body_spec.rb create mode 100755 spec/models/carrier_list_response_body_spec.rb create mode 100755 spec/models/carrier_list_services_response_body_spec.rb create mode 100755 spec/models/carrier_spec.rb create mode 100755 spec/models/channel_advisor_account_information_request_body_spec.rb create mode 100755 spec/models/channel_advisor_product_identifier_spec.rb create mode 100755 spec/models/code_spec.rb create mode 100755 spec/models/confirmation_spec.rb create mode 100755 spec/models/connect_account_response_body_spec.rb create mode 100755 spec/models/connect_marketplace_response_body_spec.rb create mode 100755 spec/models/contents_spec.rb create mode 100755 spec/models/create_batch_request_body_spec.rb create mode 100755 spec/models/create_manifest_request_body_spec.rb create mode 100755 spec/models/create_shipment_response_body_spec.rb create mode 100755 spec/models/create_shipments_request_body_spec.rb create mode 100755 spec/models/create_shipments_response_body_spec.rb create mode 100755 spec/models/create_webhook_request_body_spec.rb create mode 100755 spec/models/currency_spec.rb create mode 100755 spec/models/customs_item_spec.rb create mode 100755 spec/models/default_account_settings_request_body_spec.rb create mode 100755 spec/models/detail_code_spec.rb create mode 100755 spec/models/dhl_ecommerce_account_information_request_body_spec.rb create mode 100755 spec/models/dhl_express_account_information_request_body_spec.rb create mode 100755 spec/models/dhl_express_account_settings_spec.rb create mode 100755 spec/models/dhl_express_uk_account_information_request_body_spec.rb create mode 100755 spec/models/dimension_unit_spec.rb create mode 100755 spec/models/dimensions_spec.rb create mode 100755 spec/models/dpd_account_information_request_body_spec.rb create mode 100755 spec/models/ebay_access_token_request_body_spec.rb create mode 100755 spec/models/endicia_account_information_request_body_spec.rb create mode 100755 spec/models/error_response_body_spec.rb create mode 100755 spec/models/etsy_access_token_request_body_spec.rb create mode 100755 spec/models/event_spec.rb create mode 100755 spec/models/fedex_account_information_request_body_spec.rb create mode 100755 spec/models/fedex_account_settings_request_body_spec.rb create mode 100755 spec/models/fedex_pickup_type_spec.rb create mode 100755 spec/models/fedex_uk_account_information_request_body_spec.rb create mode 100755 spec/models/first_mile_account_information_request_body_spec.rb create mode 100755 spec/models/first_spec.rb create mode 100755 spec/models/globegistics_account_information_request_body_spec.rb create mode 100755 spec/models/imex_account_information_request_body_spec.rb create mode 100755 spec/models/insurance_provider_spec.rb create mode 100755 spec/models/international_options_spec.rb create mode 100755 spec/models/label_format_spec.rb create mode 100755 spec/models/label_layout_spec.rb create mode 100755 spec/models/label_messages_spec.rb create mode 100755 spec/models/label_spec.rb create mode 100755 spec/models/label_status_spec.rb create mode 100755 spec/models/last_spec.rb create mode 100755 spec/models/link_spec.rb create mode 100755 spec/models/links_spec.rb create mode 100755 spec/models/list_batch_response_body_spec.rb create mode 100755 spec/models/list_label_response_body_spec.rb create mode 100755 spec/models/list_manifests_request_body_spec.rb create mode 100755 spec/models/list_manifests_response_body_spec.rb create mode 100755 spec/models/list_shipment_response_body_spec.rb create mode 100755 spec/models/list_tag_response_body_spec.rb create mode 100755 spec/models/magento_account_information_request_body_spec.rb create mode 100755 spec/models/magento_account_settings_request_body_spec.rb create mode 100755 spec/models/mail_innovations_endorsement_spec.rb create mode 100755 spec/models/manifest_response_body_spec.rb create mode 100755 spec/models/model_next_spec.rb create mode 100755 spec/models/modify_batch_request_body_spec.rb create mode 100755 spec/models/money_spec.rb create mode 100755 spec/models/newgistics_account_information_request_body_spec.rb create mode 100755 spec/models/newgistics_account_settings_request_body_spec.rb create mode 100755 spec/models/non_delivery_spec.rb create mode 100755 spec/models/ontrac_account_information_request_body_spec.rb create mode 100755 spec/models/package_list_response_body_spec.rb create mode 100755 spec/models/package_spec.rb create mode 100755 spec/models/paged_list_response_body_spec.rb create mode 100755 spec/models/pagination_link_spec.rb create mode 100755 spec/models/prev_spec.rb create mode 100755 spec/models/process_batch_request_body_spec.rb create mode 100755 spec/models/provider_error_spec.rb create mode 100755 spec/models/purchase_label_request_body_spec.rb create mode 100755 spec/models/purchase_label_without_shipment_request_body_spec.rb create mode 100755 spec/models/rate_estimate_request_body_spec.rb create mode 100755 spec/models/rate_request_body_spec.rb create mode 100755 spec/models/rate_response_body_spec.rb create mode 100755 spec/models/rate_response_status_spec.rb create mode 100755 spec/models/rate_shipment_request_body_spec.rb create mode 100755 spec/models/rate_shipment_response_body_spec.rb create mode 100755 spec/models/rate_shipments_request_body_spec.rb create mode 100755 spec/models/rate_spec.rb create mode 100755 spec/models/rate_type_spec.rb create mode 100755 spec/models/response_message_spec.rb create mode 100755 spec/models/royal_mail_account_information_request_body_spec.rb create mode 100755 spec/models/rr_donnelley_account_information_request_body_spec.rb create mode 100755 spec/models/service_spec.rb create mode 100755 spec/models/shipment_add_tag_response_body_spec.rb create mode 100755 spec/models/shipment_errors_response_body_spec.rb create mode 100755 spec/models/shipment_package_spec.rb create mode 100755 spec/models/shipment_response_error_spec.rb create mode 100755 spec/models/shipment_spec.rb create mode 100755 spec/models/shipment_status_spec.rb create mode 100755 spec/models/shipments_sort_by_spec.rb create mode 100755 spec/models/shopify_access_token_request_body_spec.rb create mode 100755 spec/models/smart_post_endorsement_spec.rb create mode 100755 spec/models/smart_post_hub_spec.rb create mode 100755 spec/models/sort_by_spec.rb create mode 100755 spec/models/sort_dir_spec.rb create mode 100755 spec/models/stamps_account_information_request_body_spec.rb create mode 100755 spec/models/stamps_account_url_response_body_spec.rb create mode 100755 spec/models/stamps_account_urls_request_body_spec.rb create mode 100755 spec/models/stamps_account_urls_response_body_spec.rb create mode 100755 spec/models/tag_response_body_spec.rb create mode 100755 spec/models/track_event_spec.rb create mode 100755 spec/models/tracking_information_response_body_spec.rb create mode 100755 spec/models/tracking_status_spec.rb create mode 100755 spec/models/type_spec.rb create mode 100755 spec/models/update_webhook_request_body_spec.rb create mode 100755 spec/models/ups_account_information_request_body_spec.rb create mode 100755 spec/models/ups_account_settings_spec.rb create mode 100755 spec/models/ups_invoice_spec.rb create mode 100755 spec/models/ups_pickup_type_spec.rb create mode 100755 spec/models/url_type_spec.rb create mode 100755 spec/models/v1_labels_response_spec.rb create mode 100755 spec/models/validate_address_spec.rb create mode 100755 spec/models/validation_status_spec.rb create mode 100755 spec/models/void_label_response_body_spec.rb create mode 100755 spec/models/warehouse_list_response_body_spec.rb create mode 100755 spec/models/warehouse_request_body_spec.rb create mode 100755 spec/models/warehouse_spec.rb create mode 100755 spec/models/webhook_response_body_spec.rb create mode 100755 spec/models/weight_spec.rb create mode 100755 spec/models/weight_unit_spec.rb create mode 100755 spec/spec_helper.rb diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..fe08be147437b0167b4ddfc55b51d44a827f918f GIT binary patch literal 6148 zcmeH~JqiLr422WjLa^D=avBfd4F=H@cmdJ16BNXLj_%73f~&QNyg>3zG82}4#m+`V zbbTLIBE5*r;6_}#|6BN{`G3^HlnPLRKT|-v z&2F>COXc1A_Ig&|XVumX4*GF~m!AM6b`>w+ZrCrj0Bf=ZQGxMCz-3^d0$)|&0ix&< At^fc4 literal 0 HcmV?d00001 diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..c021594 --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# + +*.gem +*.rbc +/.config +/coverage/ +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +## Specific to RubyMotion: +.dat* +.repl_history +build/ + +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ + +## Environment normalization: +/.bundle/ +/vendor/bundle +/lib/bundler/man/ + +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock +# .ruby-version +# .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc diff --git a/.rspec b/.rspec new file mode 100755 index 0000000..83e16f8 --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100755 index 0000000..19a777e --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,154 @@ +# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) +# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) +AllCops: + TargetRubyVersion: 2.2 + # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop + # to ignore them, so only the ones explicitly set in this file are enabled. + DisabledByDefault: true + Exclude: + - '**/templates/**/*' + - '**/vendor/**/*' + - 'actionpack/lib/action_dispatch/journey/parser.rb' + +# Prefer &&/|| over and/or. +Style/AndOr: + Enabled: true + +# Do not use braces for hash literals when they are the last argument of a +# method call. +Style/BracesAroundHashParameters: + Enabled: true + EnforcedStyle: context_dependent + +# Align `when` with `case`. +Layout/CaseIndentation: + Enabled: true + +# Align comments with method definitions. +Layout/CommentIndentation: + Enabled: true + +Layout/ElseAlignment: + Enabled: true + +Layout/EmptyLineAfterMagicComment: + Enabled: true + +# In a regular class definition, no empty lines around the body. +Layout/EmptyLinesAroundClassBody: + Enabled: true + +# In a regular method definition, no empty lines around the body. +Layout/EmptyLinesAroundMethodBody: + Enabled: true + +# In a regular module definition, no empty lines around the body. +Layout/EmptyLinesAroundModuleBody: + Enabled: true + +Layout/FirstParameterIndentation: + Enabled: true + +# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. +Style/HashSyntax: + Enabled: false + +# Method definitions after `private` or `protected` isolated calls need one +# extra level of indentation. +Layout/IndentationConsistency: + Enabled: true + EnforcedStyle: rails + +# Two spaces, no tabs (for indentation). +Layout/IndentationWidth: + Enabled: true + +Layout/LeadingCommentSpace: + Enabled: true + +Layout/SpaceAfterColon: + Enabled: true + +Layout/SpaceAfterComma: + Enabled: true + +Layout/SpaceAroundEqualsInParameterDefault: + Enabled: true + +Layout/SpaceAroundKeyword: + Enabled: true + +Layout/SpaceAroundOperators: + Enabled: true + +Layout/SpaceBeforeComma: + Enabled: true + +Layout/SpaceBeforeFirstArg: + Enabled: true + +Style/DefWithParentheses: + Enabled: true + +# Defining a method with parameters needs parentheses. +Style/MethodDefParentheses: + Enabled: true + +Style/FrozenStringLiteralComment: + Enabled: false + EnforcedStyle: always + +# Use `foo {}` not `foo{}`. +Layout/SpaceBeforeBlockBraces: + Enabled: true + +# Use `foo { bar }` not `foo {bar}`. +Layout/SpaceInsideBlockBraces: + Enabled: true + +# Use `{ a: 1 }` not `{a:1}`. +Layout/SpaceInsideHashLiteralBraces: + Enabled: true + +Layout/SpaceInsideParens: + Enabled: true + +# Check quotes usage according to lint rule below. +#Style/StringLiterals: +# Enabled: true +# EnforcedStyle: single_quotes + +# Detect hard tabs, no hard tabs. +Layout/Tab: + Enabled: true + +# Blank lines should not have any spaces. +Layout/TrailingBlankLines: + Enabled: true + +# No trailing whitespace. +Layout/TrailingWhitespace: + Enabled: false + +# Use quotes for string literals when they are enough. +Style/UnneededPercentQ: + Enabled: true + +# Align `end` with the matching keyword or starting expression except for +# assignments, where it should be aligned with the LHS. +Lint/EndAlignment: + Enabled: true + EnforcedStyleAlignWith: variable + AutoCorrect: true + +# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. +Lint/RequireParentheses: + Enabled: true + +Style/RedundantReturn: + Enabled: true + AllowMultipleReturnValues: true + +Style/Semicolon: + Enabled: true + AllowAsExpressionSeparator: true diff --git a/Gemfile b/Gemfile new file mode 100755 index 0000000..d255a3a --- /dev/null +++ b/Gemfile @@ -0,0 +1,7 @@ +source 'https://rubygems.org' + +gemspec + +group :development, :test do + gem 'rake', '~> 12.0.0' +end diff --git a/README.md b/README.md new file mode 100755 index 0000000..891eeaf --- /dev/null +++ b/README.md @@ -0,0 +1,381 @@ +# ShipEngine - the Ruby library for the ShipEngine™ + +ShipEngine - the Ruby gem for the ShipEngine + +This library is currently in __beta__ + +## Installation + +### Build a gem + +To build the Ruby code into a gem: + +```shell +gem build shipengine_api.gemspec +``` + +Then either install the gem locally: + +```shell +gem install ./shipengine_api-1.0.0-262c365.gem +``` +(for development, run `gem install --dev ./shipengine_api-1.0.0-262c365.gem` to install the development dependencies) + +or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). + +Finally add this to the Gemfile: + + gem 'shipengine_api', '~> 1.0.0-262c365' + +### Install from Git + +If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: + + gem 'shipengine_api', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' + +### Include the Ruby code directly + +Include the Ruby code directly using `-I` as follows: + +```shell +ruby -Ilib script.rb +``` + +## Getting Started + +Please follow the [installation](#installation) procedure and then run the following code: +```ruby +# Load the gem +require 'shipengine_api' + +# Setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::AddressValidationApi.new + +body = [ShipEngineApi::Address.new] # Array
| + + +begin + #addresses.validate_addresses + result = api_instance.v1_addresses_validate_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling AddressValidationApi->v1_addresses_validate_post: #{e}" +end + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.shipengine.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ShipEngineApi::AddressValidationApi* | [**v1_addresses_validate_post**](docs/AddressValidationApi.md#v1_addresses_validate_post) | **POST** /v1/addresses/validate | addresses.validate_addresses +*ShipEngineApi::BatchesApi* | [**v1_batches_add_by_batch_id_post**](docs/BatchesApi.md#v1_batches_add_by_batch_id_post) | **POST** /v1/batches/{batch_id}/add | batches.add_to_batch +*ShipEngineApi::BatchesApi* | [**v1_batches_by_batch_id_get**](docs/BatchesApi.md#v1_batches_by_batch_id_get) | **GET** /v1/batches/{batch_id} | batches.get_by_id +*ShipEngineApi::BatchesApi* | [**v1_batches_errors_by_batch_id_get**](docs/BatchesApi.md#v1_batches_errors_by_batch_id_get) | **GET** /v1/batches/{batch_id}/errors | batches.find_errors +*ShipEngineApi::BatchesApi* | [**v1_batches_external_batch_id_by_external_batch_id_get**](docs/BatchesApi.md#v1_batches_external_batch_id_by_external_batch_id_get) | **GET** /v1/batches/external_batch_id/{external_batch_id} | batches.get_by_external_id +*ShipEngineApi::BatchesApi* | [**v1_batches_get**](docs/BatchesApi.md#v1_batches_get) | **GET** /v1/batches | batches.find +*ShipEngineApi::BatchesApi* | [**v1_batches_post**](docs/BatchesApi.md#v1_batches_post) | **POST** /v1/batches | batches.create +*ShipEngineApi::BatchesApi* | [**v1_batches_process_labels_by_batch_id_post**](docs/BatchesApi.md#v1_batches_process_labels_by_batch_id_post) | **POST** /v1/batches/{batch_id}/process/labels | batches.process +*ShipEngineApi::BatchesApi* | [**v1_batches_remove_by_batch_id_post**](docs/BatchesApi.md#v1_batches_remove_by_batch_id_post) | **POST** /v1/batches/{batch_id}/remove | batches.remove_from_batch +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_access_worldwide_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_access_worldwide_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/access_worldwide/{carrier_id} | access_worldwide_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_access_worldwide_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_access_worldwide_post) | **POST** /v1/connections/carriers/access_worldwide | access_worldwide_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_apc_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_apc_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/apc/{carrier_id} | apc_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_apc_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_apc_post) | **POST** /v1/connections/carriers/apc | apc_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_asendia_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_asendia_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/asendia/{carrier_id} | asendia_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_asendia_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_asendia_post) | **POST** /v1/connections/carriers/asendia | asendia_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/dhl_ecommerce/{carrier_id} | dhl_ecommerce_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_dhl_ecommerce_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_dhl_ecommerce_post) | **POST** /v1/connections/carriers/dhl_ecommerce | dhl_ecommerce_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_dhl_express_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_dhl_express_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/dhl_express/{carrier_id} | dhl_express_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_dhl_express_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_dhl_express_post) | **POST** /v1/connections/carriers/dhl_express | dhl_express_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_dhl_express_settings_by_carrier_id_get**](docs/CarrierAccountsApi.md#v1_connections_carriers_dhl_express_settings_by_carrier_id_get) | **GET** /v1/connections/carriers/dhl_express/{carrier_id}/settings | dhl_express_account_carrier.get_settings +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_dhl_express_settings_by_carrier_id_put**](docs/CarrierAccountsApi.md#v1_connections_carriers_dhl_express_settings_by_carrier_id_put) | **PUT** /v1/connections/carriers/dhl_express/{carrier_id}/settings | dhl_express_account_carrier.update_settings +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_dhl_express_uk_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_dhl_express_uk_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/dhl_express_uk/{carrier_id} | dhl_express_uk_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_dhl_express_uk_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_dhl_express_uk_post) | **POST** /v1/connections/carriers/dhl_express_uk | dhl_express_uk_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_dpd_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_dpd_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/dpd/{carrier_id} | dpd_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_dpd_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_dpd_post) | **POST** /v1/connections/carriers/dpd | dpd_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_endicia_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_endicia_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/endicia/{carrier_id} | endicia_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_endicia_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_endicia_post) | **POST** /v1/connections/carriers/endicia | endicia_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_fedex_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_fedex_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/fedex/{carrier_id} | fedex_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_fedex_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_fedex_post) | **POST** /v1/connections/carriers/fedex | fedex_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_fedex_settings_by_carrier_id_get**](docs/CarrierAccountsApi.md#v1_connections_carriers_fedex_settings_by_carrier_id_get) | **GET** /v1/connections/carriers/fedex/{carrier_id}/settings | fedex_account_carrier.get_settings +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_fedex_settings_by_carrier_id_put**](docs/CarrierAccountsApi.md#v1_connections_carriers_fedex_settings_by_carrier_id_put) | **PUT** /v1/connections/carriers/fedex/{carrier_id}/settings | fedex_account_carrier.update_settings +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_fedex_uk_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_fedex_uk_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/fedex_uk/{carrier_id} | fedex_uk_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_fedex_uk_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_fedex_uk_post) | **POST** /v1/connections/carriers/fedex_uk | fedex_uk_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_firstmile_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_firstmile_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/firstmile/{carrier_id} | first_mile_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_firstmile_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_firstmile_post) | **POST** /v1/connections/carriers/firstmile | first_mile_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_globegistics_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_globegistics_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/globegistics/{carrier_id} | globegistics_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_globegistics_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_globegistics_post) | **POST** /v1/connections/carriers/globegistics | globegistics_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_imex_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_imex_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/imex/{carrier_id} | imex_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_imex_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_imex_post) | **POST** /v1/connections/carriers/imex | imex_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_newgistics_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_newgistics_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/newgistics/{carrier_id} | newgistics_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_newgistics_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_newgistics_post) | **POST** /v1/connections/carriers/newgistics | newgistics_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_newgistics_settings_by_carrier_id_put**](docs/CarrierAccountsApi.md#v1_connections_carriers_newgistics_settings_by_carrier_id_put) | **PUT** /v1/connections/carriers/newgistics/{carrier_id}/settings | newgistics_account_carrier.update_settings +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_ontrac_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_ontrac_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/ontrac/{carrier_id} | ontrac_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_ontrac_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_ontrac_post) | **POST** /v1/connections/carriers/ontrac | ontrac_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_royal_mail_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_royal_mail_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/royal_mail/{carrier_id} | royal_mail_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_royal_mail_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_royal_mail_post) | **POST** /v1/connections/carriers/royal_mail | royal_mail_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_rr_donnelley_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_rr_donnelley_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/rr_donnelley/{carrier_id} | rr_donnelley_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_rr_donnelley_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_rr_donnelley_post) | **POST** /v1/connections/carriers/rr_donnelley | rr_donnelley_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_stamps_com_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_stamps_com_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/stamps_com/{carrier_id} | stamps_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_stamps_com_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_stamps_com_post) | **POST** /v1/connections/carriers/stamps_com | stamps_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put**](docs/CarrierAccountsApi.md#v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put) | **PUT** /v1/connections/carriers/stamps_com/{carrier_id}/request_account_url | stamps_account_carrier.get_account_url +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_ups_by_carrier_id_delete**](docs/CarrierAccountsApi.md#v1_connections_carriers_ups_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/ups/{carrier_id} | ups_account_carrier.disconnect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_ups_post**](docs/CarrierAccountsApi.md#v1_connections_carriers_ups_post) | **POST** /v1/connections/carriers/ups | ups_account_carrier.connect_account +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_ups_settings_by_carrier_id_get**](docs/CarrierAccountsApi.md#v1_connections_carriers_ups_settings_by_carrier_id_get) | **GET** /v1/connections/carriers/ups/{carrier_id}/settings | ups_account_carrier.get_settings +*ShipEngineApi::CarrierAccountsApi* | [**v1_connections_carriers_ups_settings_by_carrier_id_put**](docs/CarrierAccountsApi.md#v1_connections_carriers_ups_settings_by_carrier_id_put) | **PUT** /v1/connections/carriers/ups/{carrier_id}/settings | ups_account_carrier.update_settings +*ShipEngineApi::CarriersApi* | [**v1_carriers_add_funds_by_carrier_id_put**](docs/CarriersApi.md#v1_carriers_add_funds_by_carrier_id_put) | **PUT** /v1/carriers/{carrier_id}/add_funds | carriers.add_funds +*ShipEngineApi::CarriersApi* | [**v1_carriers_by_carrier_id_get**](docs/CarriersApi.md#v1_carriers_by_carrier_id_get) | **GET** /v1/carriers/{carrier_id} | carriers.get_by_id +*ShipEngineApi::CarriersApi* | [**v1_carriers_get**](docs/CarriersApi.md#v1_carriers_get) | **GET** /v1/carriers | carriers.find +*ShipEngineApi::CarriersApi* | [**v1_carriers_options_by_carrier_id_get**](docs/CarriersApi.md#v1_carriers_options_by_carrier_id_get) | **GET** /v1/carriers/{carrier_id}/options | carriers.get_options +*ShipEngineApi::CarriersApi* | [**v1_carriers_packages_by_carrier_id_get**](docs/CarriersApi.md#v1_carriers_packages_by_carrier_id_get) | **GET** /v1/carriers/{carrier_id}/packages | carriers.find_packages +*ShipEngineApi::CarriersApi* | [**v1_carriers_services_by_carrier_id_get**](docs/CarriersApi.md#v1_carriers_services_by_carrier_id_get) | **GET** /v1/carriers/{carrier_id}/services | carriers.find_services +*ShipEngineApi::EnvironmentApi* | [**v1_environment_webhooks_by_webhook_id_delete**](docs/EnvironmentApi.md#v1_environment_webhooks_by_webhook_id_delete) | **DELETE** /v1/environment/webhooks/{webhook_id} | environment.delete_webhook +*ShipEngineApi::EnvironmentApi* | [**v1_environment_webhooks_by_webhook_id_get**](docs/EnvironmentApi.md#v1_environment_webhooks_by_webhook_id_get) | **GET** /v1/environment/webhooks/{webhook_id} | environment.get_webhook_by_id +*ShipEngineApi::EnvironmentApi* | [**v1_environment_webhooks_by_webhook_id_put**](docs/EnvironmentApi.md#v1_environment_webhooks_by_webhook_id_put) | **PUT** /v1/environment/webhooks/{webhook_id} | environment.update_webhook +*ShipEngineApi::EnvironmentApi* | [**v1_environment_webhooks_get**](docs/EnvironmentApi.md#v1_environment_webhooks_get) | **GET** /v1/environment/webhooks | environment.webhooks +*ShipEngineApi::EnvironmentApi* | [**v1_environment_webhooks_post**](docs/EnvironmentApi.md#v1_environment_webhooks_post) | **POST** /v1/environment/webhooks | environment.create_webhook +*ShipEngineApi::InsuranceApi* | [**v1_insurance_shipsurance_add_funds_patch**](docs/InsuranceApi.md#v1_insurance_shipsurance_add_funds_patch) | **PATCH** /v1/insurance/shipsurance/add_funds | insurance.add_funds +*ShipEngineApi::InsuranceApi* | [**v1_insurance_shipsurance_balance_get**](docs/InsuranceApi.md#v1_insurance_shipsurance_balance_get) | **GET** /v1/insurance/shipsurance/balance | insurance.get_balance +*ShipEngineApi::LabelsApi* | [**v1_labels_by_label_id_get**](docs/LabelsApi.md#v1_labels_by_label_id_get) | **GET** /v1/labels/{label_id} | labels.get_by_id +*ShipEngineApi::LabelsApi* | [**v1_labels_get**](docs/LabelsApi.md#v1_labels_get) | **GET** /v1/labels | Searchforshippinglabelsyou'vecreated +*ShipEngineApi::LabelsApi* | [**v1_labels_rates_by_rate_id_post**](docs/LabelsApi.md#v1_labels_rates_by_rate_id_post) | **POST** /v1/labels/rates/{rate_id} | labels.purchase_label_with_rate +*ShipEngineApi::LabelsApi* | [**v1_labels_shipment_by_shipment_id_post**](docs/LabelsApi.md#v1_labels_shipment_by_shipment_id_post) | **POST** /v1/labels/shipment/{shipment_id} | labels.purchase_label_with_shipment +*ShipEngineApi::LabelsApi* | [**v1_labels_track_by_label_id_get**](docs/LabelsApi.md#v1_labels_track_by_label_id_get) | **GET** /v1/labels/{label_id}/track | labels.track +*ShipEngineApi::LabelsApi* | [**v1_labels_void_by_label_id_put**](docs/LabelsApi.md#v1_labels_void_by_label_id_put) | **PUT** /v1/labels/{label_id}/void | labels.void_label +*ShipEngineApi::ManifestsApi* | [**v1_manifests_by_manifest_id_get**](docs/ManifestsApi.md#v1_manifests_by_manifest_id_get) | **GET** /v1/manifests/{manifest_id} | manifests.get_by_id +*ShipEngineApi::ManifestsApi* | [**v1_manifests_get**](docs/ManifestsApi.md#v1_manifests_get) | **GET** /v1/manifests | manifests.find +*ShipEngineApi::ManifestsApi* | [**v1_manifests_post**](docs/ManifestsApi.md#v1_manifests_post) | **POST** /v1/manifests | manifests.create +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_amazon_deactivate_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_amazon_deactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/amazon/{store_id}/deactivate | amazon_account.deactivate +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_amazon_post**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_amazon_post) | **POST** /v-beta/connections/marketplaces/amazon | amazon_account.connect +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_amazon_reactivate_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_amazon_reactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/amazon/{store_id}/reactivate | amazon_account.reactivate +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_amazon_settings_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_amazon_settings_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/amazon/{store_id}/settings | amazon_account.update_settings +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_amazon_test_by_store_id_get**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_amazon_test_by_store_id_get) | **GET** /v-beta/connections/marketplaces/amazon/{store_id}/test | amazon_account.test +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_channeladvisor_deactivate_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_channeladvisor_deactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/channeladvisor/{store_id}/deactivate | channel_advisor_account.deactivate +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_channeladvisor_post**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_channeladvisor_post) | **POST** /v-beta/connections/marketplaces/channeladvisor | channel_advisor_account.connect +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_channeladvisor_reactivate_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_channeladvisor_reactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/channeladvisor/{store_id}/reactivate | channel_advisor_account.reactivate +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/channeladvisor/{store_id}/settings | channel_advisor_account.update_settings +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_channeladvisor_test_by_store_id_get**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_channeladvisor_test_by_store_id_get) | **GET** /v-beta/connections/marketplaces/channeladvisor/{store_id}/test | channel_advisor_account.test +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_ebay_access_token_post**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_ebay_access_token_post) | **POST** /v-beta/connections/marketplaces/ebay/access_token | ebay_account.connect_access_token +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_ebay_deactivate_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_ebay_deactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/ebay/{store_id}/deactivate | ebay_account.deactivate +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_ebay_reactivate_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_ebay_reactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/ebay/{store_id}/reactivate | ebay_account.reactivate +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_ebay_settings_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_ebay_settings_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/ebay/{store_id}/settings | ebay_account.update_settings +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_ebay_test_by_store_id_get**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_ebay_test_by_store_id_get) | **GET** /v-beta/connections/marketplaces/ebay/{store_id}/test | ebay_account.test +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_etsy_access_token_post**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_etsy_access_token_post) | **POST** /v-beta/connections/marketplaces/etsy/access_token | etsy_account.connect +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_etsy_deactivate_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_etsy_deactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/etsy/{store_id}/deactivate | etsy_account.deactivate +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_etsy_reactivate_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_etsy_reactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/etsy/{store_id}/reactivate | etsy_account.reactivate +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_etsy_settings_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_etsy_settings_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/etsy/{store_id}/settings | etsy_account.update_settings +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_etsy_test_by_store_id_get**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_etsy_test_by_store_id_get) | **GET** /v-beta/connections/marketplaces/etsy/{store_id}/test | etsy_account.test +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_magento_deactivate_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_magento_deactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/magento/{store_id}/deactivate | magento_account.deactivate +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_magento_post**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_magento_post) | **POST** /v-beta/connections/marketplaces/magento | magento_account.connect +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_magento_reactivate_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_magento_reactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/magento/{store_id}/reactivate | magento_account.reactivate +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_magento_settings_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_magento_settings_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/magento/{store_id}/settings | magento_account.update_settings +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_magento_test_by_store_id_get**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_magento_test_by_store_id_get) | **GET** /v-beta/connections/marketplaces/magento/{store_id}/test | magento_account.test +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_shopify_access_token_post**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_shopify_access_token_post) | **POST** /v-beta/connections/marketplaces/shopify/access_token | shopify_account.connect_access_token +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_shopify_deactivate_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_shopify_deactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/shopify/{store_id}/deactivate | shopify_account.deactivate +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_shopify_reactivate_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_shopify_reactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/shopify/{store_id}/reactivate | shopify_account.reactivate +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_shopify_settings_by_store_id_put**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_shopify_settings_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/shopify/{store_id}/settings | shopify_account.update_settings +*ShipEngineApi::MarketplaceAccountsApi* | [**v_beta_connections_marketplaces_shopify_test_by_store_id_get**](docs/MarketplaceAccountsApi.md#v_beta_connections_marketplaces_shopify_test_by_store_id_get) | **GET** /v-beta/connections/marketplaces/shopify/{store_id}/test | shopify_account.test +*ShipEngineApi::PackagesApi* | [**v1_packages_by_package_id_delete**](docs/PackagesApi.md#v1_packages_by_package_id_delete) | **DELETE** /v1/packages/{package_id} | packages.delete +*ShipEngineApi::PackagesApi* | [**v1_packages_by_package_id_get**](docs/PackagesApi.md#v1_packages_by_package_id_get) | **GET** /v1/packages/{package_id} | packages.get_by_id +*ShipEngineApi::PackagesApi* | [**v1_packages_by_package_id_put**](docs/PackagesApi.md#v1_packages_by_package_id_put) | **PUT** /v1/packages/{package_id} | packages.update +*ShipEngineApi::PackagesApi* | [**v1_packages_get**](docs/PackagesApi.md#v1_packages_get) | **GET** /v1/packages | packages.find +*ShipEngineApi::PackagesApi* | [**v1_packages_post**](docs/PackagesApi.md#v1_packages_post) | **POST** /v1/packages | packages.create +*ShipEngineApi::RatesApi* | [**v1_rates_bulk_post**](docs/RatesApi.md#v1_rates_bulk_post) | **POST** /v1/rates/bulk | rates.bulk_rate_shipments +*ShipEngineApi::RatesApi* | [**v1_rates_by_rate_id_get**](docs/RatesApi.md#v1_rates_by_rate_id_get) | **GET** /v1/rates/{rate_id} | rates.get_by_id +*ShipEngineApi::RatesApi* | [**v1_rates_estimate_post**](docs/RatesApi.md#v1_rates_estimate_post) | **POST** /v1/rates/estimate | rates.estimate +*ShipEngineApi::RatesApi* | [**v1_rates_post**](docs/RatesApi.md#v1_rates_post) | **POST** /v1/rates | rates.rate_shipment +*ShipEngineApi::ShipmentsApi* | [**v1_shipments_by_shipment_id_get**](docs/ShipmentsApi.md#v1_shipments_by_shipment_id_get) | **GET** /v1/shipments/{shipment_id} | shipments.get_by_id +*ShipEngineApi::ShipmentsApi* | [**v1_shipments_by_shipment_id_put**](docs/ShipmentsApi.md#v1_shipments_by_shipment_id_put) | **PUT** /v1/shipments/{shipment_id} | shipments.update_shipment +*ShipEngineApi::ShipmentsApi* | [**v1_shipments_cancel_by_shipment_id_put**](docs/ShipmentsApi.md#v1_shipments_cancel_by_shipment_id_put) | **PUT** /v1/shipments/{shipment_id}/cancel | shipments.cancel +*ShipEngineApi::ShipmentsApi* | [**v1_shipments_errors_by_shipment_id_get**](docs/ShipmentsApi.md#v1_shipments_errors_by_shipment_id_get) | **GET** /v1/shipments/{shipment_id}/errors | shipments.find_errors +*ShipEngineApi::ShipmentsApi* | [**v1_shipments_external_shipment_id_by_external_shipment_id_get**](docs/ShipmentsApi.md#v1_shipments_external_shipment_id_by_external_shipment_id_get) | **GET** /v1/shipments/external_shipment_id/{external_shipment_id} | shipments.get_by_external_id +*ShipEngineApi::ShipmentsApi* | [**v1_shipments_get**](docs/ShipmentsApi.md#v1_shipments_get) | **GET** /v1/shipments | shipments.find +*ShipEngineApi::ShipmentsApi* | [**v1_shipments_post**](docs/ShipmentsApi.md#v1_shipments_post) | **POST** /v1/shipments | shipments.create_shipments +*ShipEngineApi::ShipmentsApi* | [**v1_shipments_rates_by_shipment_id_get**](docs/ShipmentsApi.md#v1_shipments_rates_by_shipment_id_get) | **GET** /v1/shipments/{shipment_id}/rates | shipments.get_rates_for_shipment +*ShipEngineApi::ShipmentsApi* | [**v1_shipments_tags_by_shipment_id_and_tag_delete**](docs/ShipmentsApi.md#v1_shipments_tags_by_shipment_id_and_tag_delete) | **DELETE** /v1/shipments/{shipment_id}/tags/{tag} | shipments.remove_tag +*ShipEngineApi::ShipmentsApi* | [**v1_shipments_tags_by_shipment_id_and_tag_post**](docs/ShipmentsApi.md#v1_shipments_tags_by_shipment_id_and_tag_post) | **POST** /v1/shipments/{shipment_id}/tags/{tag} | shipments.add_tag +*ShipEngineApi::TagsApi* | [**v1_tags_by_tag_name_and_new_name_put**](docs/TagsApi.md#v1_tags_by_tag_name_and_new_name_put) | **PUT** /v1/tags/{tag_name}/{new_name} | tags.update_tag +*ShipEngineApi::TagsApi* | [**v1_tags_by_tag_name_delete**](docs/TagsApi.md#v1_tags_by_tag_name_delete) | **DELETE** /v1/tags/{tag_name} | tags.delete +*ShipEngineApi::TagsApi* | [**v1_tags_by_tag_name_post**](docs/TagsApi.md#v1_tags_by_tag_name_post) | **POST** /v1/tags/{tag_name} | tags.add_tag +*ShipEngineApi::TagsApi* | [**v1_tags_get**](docs/TagsApi.md#v1_tags_get) | **GET** /v1/tags | tags.find_tags +*ShipEngineApi::TrackingApi* | [**v1_tracking_get**](docs/TrackingApi.md#v1_tracking_get) | **GET** /v1/tracking | tracking.track +*ShipEngineApi::TrackingApi* | [**v1_tracking_start_post**](docs/TrackingApi.md#v1_tracking_start_post) | **POST** /v1/tracking/start | tracking.start_tracking +*ShipEngineApi::TrackingApi* | [**v1_tracking_stop_post**](docs/TrackingApi.md#v1_tracking_stop_post) | **POST** /v1/tracking/stop | tracking.stop_tracking +*ShipEngineApi::WarehousesApi* | [**v1_warehouses_by_warehouse_id_delete**](docs/WarehousesApi.md#v1_warehouses_by_warehouse_id_delete) | **DELETE** /v1/warehouses/{warehouse_id} | warehouses.delete +*ShipEngineApi::WarehousesApi* | [**v1_warehouses_by_warehouse_id_get**](docs/WarehousesApi.md#v1_warehouses_by_warehouse_id_get) | **GET** /v1/warehouses/{warehouse_id} | warehouses.get_by_id +*ShipEngineApi::WarehousesApi* | [**v1_warehouses_by_warehouse_id_put**](docs/WarehousesApi.md#v1_warehouses_by_warehouse_id_put) | **PUT** /v1/warehouses/{warehouse_id} | warehouses.update +*ShipEngineApi::WarehousesApi* | [**v1_warehouses_get**](docs/WarehousesApi.md#v1_warehouses_get) | **GET** /v1/warehouses | warehouses.find +*ShipEngineApi::WarehousesApi* | [**v1_warehouses_post**](docs/WarehousesApi.md#v1_warehouses_post) | **POST** /v1/warehouses | warehouses.create + + +## Documentation for Models + + - [ShipEngineApi::AccessWorldwideAccountInformationRequestBody](docs/AccessWorldwideAccountInformationRequestBody.md) + - [ShipEngineApi::Address](docs/Address.md) + - [ShipEngineApi::AddressResidentialIndicator](docs/AddressResidentialIndicator.md) + - [ShipEngineApi::AddressValidatingShipment](docs/AddressValidatingShipment.md) + - [ShipEngineApi::AddressValidationResult](docs/AddressValidationResult.md) + - [ShipEngineApi::AddressValidationStatus](docs/AddressValidationStatus.md) + - [ShipEngineApi::AdvancedOptions](docs/AdvancedOptions.md) + - [ShipEngineApi::AmazonAccountInformationRequestBody](docs/AmazonAccountInformationRequestBody.md) + - [ShipEngineApi::AmazonProductIdentifier](docs/AmazonProductIdentifier.md) + - [ShipEngineApi::ApcAccountInformationRequestBody](docs/ApcAccountInformationRequestBody.md) + - [ShipEngineApi::ApiError](docs/ApiError.md) + - [ShipEngineApi::AsendiaAccountInformationRequestBody](docs/AsendiaAccountInformationRequestBody.md) + - [ShipEngineApi::BalanceResponseBody](docs/BalanceResponseBody.md) + - [ShipEngineApi::Batch](docs/Batch.md) + - [ShipEngineApi::BatchErrorsResponseBody](docs/BatchErrorsResponseBody.md) + - [ShipEngineApi::BatchResponseError](docs/BatchResponseError.md) + - [ShipEngineApi::BatchStatus](docs/BatchStatus.md) + - [ShipEngineApi::BatchesSortBy](docs/BatchesSortBy.md) + - [ShipEngineApi::BillToParty](docs/BillToParty.md) + - [ShipEngineApi::BulkRateResponseBody](docs/BulkRateResponseBody.md) + - [ShipEngineApi::CapturePayment](docs/CapturePayment.md) + - [ShipEngineApi::Carrier](docs/Carrier.md) + - [ShipEngineApi::CarrierAdvancedOption](docs/CarrierAdvancedOption.md) + - [ShipEngineApi::CarrierListOptionsResponseBody](docs/CarrierListOptionsResponseBody.md) + - [ShipEngineApi::CarrierListResponseBody](docs/CarrierListResponseBody.md) + - [ShipEngineApi::CarrierListServicesResponseBody](docs/CarrierListServicesResponseBody.md) + - [ShipEngineApi::ChannelAdvisorAccountInformationRequestBody](docs/ChannelAdvisorAccountInformationRequestBody.md) + - [ShipEngineApi::ChannelAdvisorProductIdentifier](docs/ChannelAdvisorProductIdentifier.md) + - [ShipEngineApi::Code](docs/Code.md) + - [ShipEngineApi::Confirmation](docs/Confirmation.md) + - [ShipEngineApi::ConnectAccountResponseBody](docs/ConnectAccountResponseBody.md) + - [ShipEngineApi::ConnectMarketplaceResponseBody](docs/ConnectMarketplaceResponseBody.md) + - [ShipEngineApi::Contents](docs/Contents.md) + - [ShipEngineApi::CreateBatchRequestBody](docs/CreateBatchRequestBody.md) + - [ShipEngineApi::CreateManifestRequestBody](docs/CreateManifestRequestBody.md) + - [ShipEngineApi::CreateShipmentResponseBody](docs/CreateShipmentResponseBody.md) + - [ShipEngineApi::CreateShipmentsRequestBody](docs/CreateShipmentsRequestBody.md) + - [ShipEngineApi::CreateShipmentsResponseBody](docs/CreateShipmentsResponseBody.md) + - [ShipEngineApi::CreateWebhookRequestBody](docs/CreateWebhookRequestBody.md) + - [ShipEngineApi::Currency](docs/Currency.md) + - [ShipEngineApi::CustomsItem](docs/CustomsItem.md) + - [ShipEngineApi::DefaultAccountSettingsRequestBody](docs/DefaultAccountSettingsRequestBody.md) + - [ShipEngineApi::DetailCode](docs/DetailCode.md) + - [ShipEngineApi::DhlEcommerceAccountInformationRequestBody](docs/DhlEcommerceAccountInformationRequestBody.md) + - [ShipEngineApi::DhlExpressAccountInformationRequestBody](docs/DhlExpressAccountInformationRequestBody.md) + - [ShipEngineApi::DhlExpressAccountSettings](docs/DhlExpressAccountSettings.md) + - [ShipEngineApi::DhlExpressUkAccountInformationRequestBody](docs/DhlExpressUkAccountInformationRequestBody.md) + - [ShipEngineApi::DimensionUnit](docs/DimensionUnit.md) + - [ShipEngineApi::Dimensions](docs/Dimensions.md) + - [ShipEngineApi::DpdAccountInformationRequestBody](docs/DpdAccountInformationRequestBody.md) + - [ShipEngineApi::EbayAccessTokenRequestBody](docs/EbayAccessTokenRequestBody.md) + - [ShipEngineApi::EndiciaAccountInformationRequestBody](docs/EndiciaAccountInformationRequestBody.md) + - [ShipEngineApi::ErrorResponseBody](docs/ErrorResponseBody.md) + - [ShipEngineApi::EtsyAccessTokenRequestBody](docs/EtsyAccessTokenRequestBody.md) + - [ShipEngineApi::Event](docs/Event.md) + - [ShipEngineApi::FedexAccountInformationRequestBody](docs/FedexAccountInformationRequestBody.md) + - [ShipEngineApi::FedexAccountSettingsRequestBody](docs/FedexAccountSettingsRequestBody.md) + - [ShipEngineApi::FedexPickupType](docs/FedexPickupType.md) + - [ShipEngineApi::FedexUkAccountInformationRequestBody](docs/FedexUkAccountInformationRequestBody.md) + - [ShipEngineApi::First](docs/First.md) + - [ShipEngineApi::FirstMileAccountInformationRequestBody](docs/FirstMileAccountInformationRequestBody.md) + - [ShipEngineApi::GlobegisticsAccountInformationRequestBody](docs/GlobegisticsAccountInformationRequestBody.md) + - [ShipEngineApi::ImexAccountInformationRequestBody](docs/ImexAccountInformationRequestBody.md) + - [ShipEngineApi::InsuranceProvider](docs/InsuranceProvider.md) + - [ShipEngineApi::InternationalOptions](docs/InternationalOptions.md) + - [ShipEngineApi::Label](docs/Label.md) + - [ShipEngineApi::LabelFormat](docs/LabelFormat.md) + - [ShipEngineApi::LabelLayout](docs/LabelLayout.md) + - [ShipEngineApi::LabelMessages](docs/LabelMessages.md) + - [ShipEngineApi::LabelStatus](docs/LabelStatus.md) + - [ShipEngineApi::Last](docs/Last.md) + - [ShipEngineApi::Link](docs/Link.md) + - [ShipEngineApi::Links](docs/Links.md) + - [ShipEngineApi::ListBatchResponseBody](docs/ListBatchResponseBody.md) + - [ShipEngineApi::ListLabelResponseBody](docs/ListLabelResponseBody.md) + - [ShipEngineApi::ListManifestsRequestBody](docs/ListManifestsRequestBody.md) + - [ShipEngineApi::ListManifestsResponseBody](docs/ListManifestsResponseBody.md) + - [ShipEngineApi::ListShipmentResponseBody](docs/ListShipmentResponseBody.md) + - [ShipEngineApi::ListTagResponseBody](docs/ListTagResponseBody.md) + - [ShipEngineApi::MagentoAccountInformationRequestBody](docs/MagentoAccountInformationRequestBody.md) + - [ShipEngineApi::MagentoAccountSettingsRequestBody](docs/MagentoAccountSettingsRequestBody.md) + - [ShipEngineApi::MailInnovationsEndorsement](docs/MailInnovationsEndorsement.md) + - [ShipEngineApi::ManifestResponseBody](docs/ManifestResponseBody.md) + - [ShipEngineApi::ModelNext](docs/ModelNext.md) + - [ShipEngineApi::ModifyBatchRequestBody](docs/ModifyBatchRequestBody.md) + - [ShipEngineApi::Money](docs/Money.md) + - [ShipEngineApi::NewgisticsAccountInformationRequestBody](docs/NewgisticsAccountInformationRequestBody.md) + - [ShipEngineApi::NewgisticsAccountSettingsRequestBody](docs/NewgisticsAccountSettingsRequestBody.md) + - [ShipEngineApi::NonDelivery](docs/NonDelivery.md) + - [ShipEngineApi::OntracAccountInformationRequestBody](docs/OntracAccountInformationRequestBody.md) + - [ShipEngineApi::Package](docs/Package.md) + - [ShipEngineApi::PackageListResponseBody](docs/PackageListResponseBody.md) + - [ShipEngineApi::PagedListResponseBody](docs/PagedListResponseBody.md) + - [ShipEngineApi::PaginationLink](docs/PaginationLink.md) + - [ShipEngineApi::Prev](docs/Prev.md) + - [ShipEngineApi::ProcessBatchRequestBody](docs/ProcessBatchRequestBody.md) + - [ShipEngineApi::ProviderError](docs/ProviderError.md) + - [ShipEngineApi::PurchaseLabelRequestBody](docs/PurchaseLabelRequestBody.md) + - [ShipEngineApi::PurchaseLabelWithoutShipmentRequestBody](docs/PurchaseLabelWithoutShipmentRequestBody.md) + - [ShipEngineApi::Rate](docs/Rate.md) + - [ShipEngineApi::RateEstimateRequestBody](docs/RateEstimateRequestBody.md) + - [ShipEngineApi::RateRequestBody](docs/RateRequestBody.md) + - [ShipEngineApi::RateResponseBody](docs/RateResponseBody.md) + - [ShipEngineApi::RateResponseStatus](docs/RateResponseStatus.md) + - [ShipEngineApi::RateShipmentRequestBody](docs/RateShipmentRequestBody.md) + - [ShipEngineApi::RateShipmentResponseBody](docs/RateShipmentResponseBody.md) + - [ShipEngineApi::RateShipmentsRequestBody](docs/RateShipmentsRequestBody.md) + - [ShipEngineApi::RateType](docs/RateType.md) + - [ShipEngineApi::ResponseMessage](docs/ResponseMessage.md) + - [ShipEngineApi::RoyalMailAccountInformationRequestBody](docs/RoyalMailAccountInformationRequestBody.md) + - [ShipEngineApi::RrDonnelleyAccountInformationRequestBody](docs/RrDonnelleyAccountInformationRequestBody.md) + - [ShipEngineApi::Service](docs/Service.md) + - [ShipEngineApi::Shipment](docs/Shipment.md) + - [ShipEngineApi::ShipmentAddTagResponseBody](docs/ShipmentAddTagResponseBody.md) + - [ShipEngineApi::ShipmentErrorsResponseBody](docs/ShipmentErrorsResponseBody.md) + - [ShipEngineApi::ShipmentPackage](docs/ShipmentPackage.md) + - [ShipEngineApi::ShipmentResponseError](docs/ShipmentResponseError.md) + - [ShipEngineApi::ShipmentStatus](docs/ShipmentStatus.md) + - [ShipEngineApi::ShipmentsSortBy](docs/ShipmentsSortBy.md) + - [ShipEngineApi::ShopifyAccessTokenRequestBody](docs/ShopifyAccessTokenRequestBody.md) + - [ShipEngineApi::SmartPostEndorsement](docs/SmartPostEndorsement.md) + - [ShipEngineApi::SmartPostHub](docs/SmartPostHub.md) + - [ShipEngineApi::SortBy](docs/SortBy.md) + - [ShipEngineApi::SortDir](docs/SortDir.md) + - [ShipEngineApi::StampsAccountInformationRequestBody](docs/StampsAccountInformationRequestBody.md) + - [ShipEngineApi::StampsAccountUrlResponseBody](docs/StampsAccountUrlResponseBody.md) + - [ShipEngineApi::StampsAccountUrlsRequestBody](docs/StampsAccountUrlsRequestBody.md) + - [ShipEngineApi::StampsAccountUrlsResponseBody](docs/StampsAccountUrlsResponseBody.md) + - [ShipEngineApi::TagResponseBody](docs/TagResponseBody.md) + - [ShipEngineApi::TrackEvent](docs/TrackEvent.md) + - [ShipEngineApi::TrackingInformationResponseBody](docs/TrackingInformationResponseBody.md) + - [ShipEngineApi::TrackingStatus](docs/TrackingStatus.md) + - [ShipEngineApi::Type](docs/Type.md) + - [ShipEngineApi::UpdateWebhookRequestBody](docs/UpdateWebhookRequestBody.md) + - [ShipEngineApi::UpsAccountInformationRequestBody](docs/UpsAccountInformationRequestBody.md) + - [ShipEngineApi::UpsAccountSettings](docs/UpsAccountSettings.md) + - [ShipEngineApi::UpsInvoice](docs/UpsInvoice.md) + - [ShipEngineApi::UpsPickupType](docs/UpsPickupType.md) + - [ShipEngineApi::UrlType](docs/UrlType.md) + - [ShipEngineApi::V1LabelsResponse](docs/V1LabelsResponse.md) + - [ShipEngineApi::ValidateAddress](docs/ValidateAddress.md) + - [ShipEngineApi::ValidationStatus](docs/ValidationStatus.md) + - [ShipEngineApi::VoidLabelResponseBody](docs/VoidLabelResponseBody.md) + - [ShipEngineApi::Warehouse](docs/Warehouse.md) + - [ShipEngineApi::WarehouseListResponseBody](docs/WarehouseListResponseBody.md) + - [ShipEngineApi::WarehouseRequestBody](docs/WarehouseRequestBody.md) + - [ShipEngineApi::WebhookResponseBody](docs/WebhookResponseBody.md) + - [ShipEngineApi::Weight](docs/Weight.md) + - [ShipEngineApi::WeightUnit](docs/WeightUnit.md) + + +## Documentation for Authorization + + +### api-key + +- **Type**: API key +- **API key parameter name**: api-key +- **Location**: HTTP header + diff --git a/Rakefile b/Rakefile new file mode 100755 index 0000000..d52c3e3 --- /dev/null +++ b/Rakefile @@ -0,0 +1,8 @@ +begin + require 'rspec/core/rake_task' + + RSpec::Core::RakeTask.new(:spec) + task default: :spec +rescue LoadError + # no rspec available +end diff --git a/docs/AccessWorldwideAccountInformationRequestBody.md b/docs/AccessWorldwideAccountInformationRequestBody.md new file mode 100755 index 0000000..5d37f05 --- /dev/null +++ b/docs/AccessWorldwideAccountInformationRequestBody.md @@ -0,0 +1,10 @@ +# ShipEngineApi::AccessWorldwideAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**username** | **String** | | [optional] +**password** | **String** | | [optional] + + diff --git a/docs/Address.md b/docs/Address.md new file mode 100755 index 0000000..fe22782 --- /dev/null +++ b/docs/Address.md @@ -0,0 +1,18 @@ +# ShipEngineApi::Address + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**phone** | **String** | | [optional] +**company_name** | **String** | | [optional] +**address_line1** | **String** | | [optional] +**address_line2** | **String** | | [optional] +**address_line3** | **String** | | [optional] +**city_locality** | **String** | | [optional] +**state_province** | **String** | | [optional] +**postal_code** | **String** | | [optional] +**country_code** | **String** | | [optional] +**address_residential_indicator** | [**AddressResidentialIndicator**](AddressResidentialIndicator.md) | | [optional] + + diff --git a/docs/AddressResidentialIndicator.md b/docs/AddressResidentialIndicator.md new file mode 100755 index 0000000..ddb12d3 --- /dev/null +++ b/docs/AddressResidentialIndicator.md @@ -0,0 +1,7 @@ +# ShipEngineApi::AddressResidentialIndicator + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/AddressValidatingShipment.md b/docs/AddressValidatingShipment.md new file mode 100755 index 0000000..a976507 --- /dev/null +++ b/docs/AddressValidatingShipment.md @@ -0,0 +1,27 @@ +# ShipEngineApi::AddressValidatingShipment + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**validate_address** | [**ValidateAddress**](ValidateAddress.md) | | [optional] +**shipment_id** | **String** | A string that uniquely identifies the shipment id | [optional] +**carrier_id** | **String** | A string that uniquely identifies the carrier id | [optional] +**service_code** | **String** | | [optional] +**external_shipment_id** | **String** | A string that uniquely identifies the external shipment id | [optional] +**ship_date** | **DateTime** | | [optional] +**created_at** | **DateTime** | | [optional] +**modified_at** | **DateTime** | | [optional] +**shipment_status** | [**ShipmentStatus**](ShipmentStatus.md) | | [optional] +**ship_to** | [**Address**](Address.md) | | [optional] +**ship_from** | [**Address**](Address.md) | | [optional] +**warehouse_id** | **String** | A string that uniquely identifies the warehouse id | [optional] +**return_to** | [**Address**](Address.md) | | [optional] +**confirmation** | [**Confirmation**](Confirmation.md) | | [optional] +**customs** | [**InternationalOptions**](InternationalOptions.md) | | [optional] +**advanced_options** | [**AdvancedOptions**](AdvancedOptions.md) | | [optional] +**insurance_provider** | [**InsuranceProvider**](InsuranceProvider.md) | | [optional] +**tags** | [**Array<TagResponseBody>**](TagResponseBody.md) | | [optional] +**packages** | [**Array<ShipmentPackage>**](ShipmentPackage.md) | | [optional] +**total_weight** | [**Weight**](Weight.md) | | [optional] + + diff --git a/docs/AddressValidationApi.md b/docs/AddressValidationApi.md new file mode 100755 index 0000000..38f7d0a --- /dev/null +++ b/docs/AddressValidationApi.md @@ -0,0 +1,63 @@ +# ShipEngineApi::AddressValidationApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v1_addresses_validate_post**](AddressValidationApi.md#v1_addresses_validate_post) | **POST** /v1/addresses/validate | addresses.validate_addresses + + +# **v1_addresses_validate_post** +> Array<AddressValidationResult> v1_addresses_validate_post(body) + +addresses.validate_addresses + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::AddressValidationApi.new + +body = [ShipEngineApi::Address.new] # Array
| + + +begin + #addresses.validate_addresses + result = api_instance.v1_addresses_validate_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling AddressValidationApi->v1_addresses_validate_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Array<Address>**](Address.md)| | + +### Return type + +[**Array<AddressValidationResult>**](AddressValidationResult.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/AddressValidationResult.md b/docs/AddressValidationResult.md new file mode 100755 index 0000000..9b0b810 --- /dev/null +++ b/docs/AddressValidationResult.md @@ -0,0 +1,11 @@ +# ShipEngineApi::AddressValidationResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | [**AddressValidationStatus**](AddressValidationStatus.md) | | [optional] +**original_address** | [**Address**](Address.md) | | [optional] +**matched_address** | [**Address**](Address.md) | | [optional] +**messages** | [**Array<ResponseMessage>**](ResponseMessage.md) | | [optional] + + diff --git a/docs/AddressValidationStatus.md b/docs/AddressValidationStatus.md new file mode 100755 index 0000000..7e2e862 --- /dev/null +++ b/docs/AddressValidationStatus.md @@ -0,0 +1,7 @@ +# ShipEngineApi::AddressValidationStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/AdvancedOptions.md b/docs/AdvancedOptions.md new file mode 100755 index 0000000..8589ed7 --- /dev/null +++ b/docs/AdvancedOptions.md @@ -0,0 +1,20 @@ +# ShipEngineApi::AdvancedOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bill_to_account** | **String** | | [optional] +**bill_to_country_code** | **String** | | [optional] +**bill_to_party** | [**BillToParty**](BillToParty.md) | | [optional] +**bill_to_postal_code** | **String** | | [optional] +**contains_alcohol** | **BOOLEAN** | | [optional] +**delivered_duty_paid** | **BOOLEAN** | | [optional] +**non_machinable** | **BOOLEAN** | | [optional] +**saturday_delivery** | **BOOLEAN** | | [optional] +**use_ups_ground_freight_pricing** | **BOOLEAN** | | [optional] +**freight_class** | **String** | | [optional] +**custom_field1** | **String** | | [optional] +**custom_field2** | **String** | | [optional] +**custom_field3** | **String** | | [optional] + + diff --git a/docs/AmazonAccountInformationRequestBody.md b/docs/AmazonAccountInformationRequestBody.md new file mode 100755 index 0000000..dd167f5 --- /dev/null +++ b/docs/AmazonAccountInformationRequestBody.md @@ -0,0 +1,11 @@ +# ShipEngineApi::AmazonAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**store_name** | **String** | | [optional] +**merchant_seller_id** | **String** | A string that uniquely identifies the merchant seller id | [optional] +**product_identifier** | [**AmazonProductIdentifier**](AmazonProductIdentifier.md) | | [optional] +**mws_auth_token** | **String** | | [optional] + + diff --git a/docs/AmazonProductIdentifier.md b/docs/AmazonProductIdentifier.md new file mode 100755 index 0000000..df06948 --- /dev/null +++ b/docs/AmazonProductIdentifier.md @@ -0,0 +1,7 @@ +# ShipEngineApi::AmazonProductIdentifier + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/ApcAccountInformationRequestBody.md b/docs/ApcAccountInformationRequestBody.md new file mode 100755 index 0000000..39f2871 --- /dev/null +++ b/docs/ApcAccountInformationRequestBody.md @@ -0,0 +1,10 @@ +# ShipEngineApi::ApcAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**username** | **String** | | [optional] +**password** | **String** | | [optional] + + diff --git a/docs/ApiError.md b/docs/ApiError.md new file mode 100755 index 0000000..2d1c87f --- /dev/null +++ b/docs/ApiError.md @@ -0,0 +1,9 @@ +# ShipEngineApi::ApiError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **String** | | [optional] +**message** | **String** | | [optional] + + diff --git a/docs/AsendiaAccountInformationRequestBody.md b/docs/AsendiaAccountInformationRequestBody.md new file mode 100755 index 0000000..f605dd1 --- /dev/null +++ b/docs/AsendiaAccountInformationRequestBody.md @@ -0,0 +1,11 @@ +# ShipEngineApi::AsendiaAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**account_number** | **String** | | [optional] +**ftp_username** | **String** | | [optional] +**ftp_password** | **String** | | [optional] + + diff --git a/docs/BalanceResponseBody.md b/docs/BalanceResponseBody.md new file mode 100755 index 0000000..51b730e --- /dev/null +++ b/docs/BalanceResponseBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::BalanceResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**balance** | [**Money**](Money.md) | | [optional] + + diff --git a/docs/Batch.md b/docs/Batch.md new file mode 100755 index 0000000..e5a3222 --- /dev/null +++ b/docs/Batch.md @@ -0,0 +1,25 @@ +# ShipEngineApi::Batch + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label_layout** | **String** | | [optional] +**label_format** | [**LabelFormat**](LabelFormat.md) | | [optional] +**batch_id** | **String** | A string that uniquely identifies the batch id | [optional] +**external_batch_id** | **String** | A string that uniquely identifies the external batch id | [optional] +**batch_notes** | **String** | | [optional] +**created_at** | **DateTime** | | [optional] +**processed_at** | **DateTime** | | [optional] +**errors** | **Integer** | | [optional] +**warnings** | **Integer** | | [optional] +**completed** | **Integer** | | [optional] +**forms** | **Integer** | | [optional] +**count** | **Integer** | | [optional] +**batch_shipments_url** | [**Link**](Link.md) | | [optional] +**batch_labels_url** | [**Link**](Link.md) | | [optional] +**batch_errors_url** | [**Link**](Link.md) | | [optional] +**label_download** | [**Link**](Link.md) | | [optional] +**form_download** | [**Link**](Link.md) | | [optional] +**status** | [**BatchStatus**](BatchStatus.md) | | [optional] + + diff --git a/docs/BatchErrorsResponseBody.md b/docs/BatchErrorsResponseBody.md new file mode 100755 index 0000000..e48b862 --- /dev/null +++ b/docs/BatchErrorsResponseBody.md @@ -0,0 +1,9 @@ +# ShipEngineApi::BatchErrorsResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | [**Array<BatchResponseError>**](BatchResponseError.md) | | [optional] +**links** | [**PaginationLink**](PaginationLink.md) | | [optional] + + diff --git a/docs/BatchResponseError.md b/docs/BatchResponseError.md new file mode 100755 index 0000000..26f3aa8 --- /dev/null +++ b/docs/BatchResponseError.md @@ -0,0 +1,9 @@ +# ShipEngineApi::BatchResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **String** | | [optional] +**shipment_id** | **String** | A string that uniquely identifies the shipment id | [optional] + + diff --git a/docs/BatchStatus.md b/docs/BatchStatus.md new file mode 100755 index 0000000..b0a4d80 --- /dev/null +++ b/docs/BatchStatus.md @@ -0,0 +1,7 @@ +# ShipEngineApi::BatchStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/BatchesApi.md b/docs/BatchesApi.md new file mode 100755 index 0000000..39a9608 --- /dev/null +++ b/docs/BatchesApi.md @@ -0,0 +1,469 @@ +# ShipEngineApi::BatchesApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v1_batches_add_by_batch_id_post**](BatchesApi.md#v1_batches_add_by_batch_id_post) | **POST** /v1/batches/{batch_id}/add | batches.add_to_batch +[**v1_batches_by_batch_id_get**](BatchesApi.md#v1_batches_by_batch_id_get) | **GET** /v1/batches/{batch_id} | batches.get_by_id +[**v1_batches_errors_by_batch_id_get**](BatchesApi.md#v1_batches_errors_by_batch_id_get) | **GET** /v1/batches/{batch_id}/errors | batches.find_errors +[**v1_batches_external_batch_id_by_external_batch_id_get**](BatchesApi.md#v1_batches_external_batch_id_by_external_batch_id_get) | **GET** /v1/batches/external_batch_id/{external_batch_id} | batches.get_by_external_id +[**v1_batches_get**](BatchesApi.md#v1_batches_get) | **GET** /v1/batches | batches.find +[**v1_batches_post**](BatchesApi.md#v1_batches_post) | **POST** /v1/batches | batches.create +[**v1_batches_process_labels_by_batch_id_post**](BatchesApi.md#v1_batches_process_labels_by_batch_id_post) | **POST** /v1/batches/{batch_id}/process/labels | batches.process +[**v1_batches_remove_by_batch_id_post**](BatchesApi.md#v1_batches_remove_by_batch_id_post) | **POST** /v1/batches/{batch_id}/remove | batches.remove_from_batch + + +# **v1_batches_add_by_batch_id_post** +> v1_batches_add_by_batch_id_post(batch_id, body) + +batches.add_to_batch + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::BatchesApi.new + +batch_id = 'batch_id_example' # String | + +body = ShipEngineApi::ModifyBatchRequestBody.new # ModifyBatchRequestBody | + + +begin + #batches.add_to_batch + api_instance.v1_batches_add_by_batch_id_post(batch_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling BatchesApi->v1_batches_add_by_batch_id_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **batch_id** | **String**| | + **body** | [**ModifyBatchRequestBody**](ModifyBatchRequestBody.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_batches_by_batch_id_get** +> Batch v1_batches_by_batch_id_get(batch_id) + +batches.get_by_id + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::BatchesApi.new + +batch_id = 'batch_id_example' # String | + + +begin + #batches.get_by_id + result = api_instance.v1_batches_by_batch_id_get(batch_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling BatchesApi->v1_batches_by_batch_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **batch_id** | **String**| | + +### Return type + +[**Batch**](Batch.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_batches_errors_by_batch_id_get** +> BatchErrorsResponseBody v1_batches_errors_by_batch_id_get(batch_id, opts) + +batches.find_errors + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::BatchesApi.new + +batch_id = 'batch_id_example' # String | + +opts = { + page: 56, # Integer | + pagesize: 56 # Integer | +} + +begin + #batches.find_errors + result = api_instance.v1_batches_errors_by_batch_id_get(batch_id, opts) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling BatchesApi->v1_batches_errors_by_batch_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **batch_id** | **String**| | + **page** | **Integer**| | [optional] + **pagesize** | **Integer**| | [optional] + +### Return type + +[**BatchErrorsResponseBody**](BatchErrorsResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_batches_external_batch_id_by_external_batch_id_get** +> Batch v1_batches_external_batch_id_by_external_batch_id_get(external_batch_id) + +batches.get_by_external_id + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::BatchesApi.new + +external_batch_id = 'external_batch_id_example' # String | + + +begin + #batches.get_by_external_id + result = api_instance.v1_batches_external_batch_id_by_external_batch_id_get(external_batch_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling BatchesApi->v1_batches_external_batch_id_by_external_batch_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **external_batch_id** | **String**| | + +### Return type + +[**Batch**](Batch.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_batches_get** +> ListBatchResponseBody v1_batches_get(opts) + +batches.find + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::BatchesApi.new + +opts = { + status: 'status_example', # String | + page: 56, # Integer | + page_size: 56, # Integer | + sort_dir: 'sort_dir_example', # String | + sort_by: 'sort_by_example' # String | +} + +begin + #batches.find + result = api_instance.v1_batches_get(opts) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling BatchesApi->v1_batches_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **String**| | [optional] + **page** | **Integer**| | [optional] + **page_size** | **Integer**| | [optional] + **sort_dir** | **String**| | [optional] + **sort_by** | **String**| | [optional] + +### Return type + +[**ListBatchResponseBody**](ListBatchResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_batches_post** +> Batch v1_batches_post(body) + +batches.create + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::BatchesApi.new + +body = ShipEngineApi::CreateBatchRequestBody.new # CreateBatchRequestBody | + + +begin + #batches.create + result = api_instance.v1_batches_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling BatchesApi->v1_batches_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CreateBatchRequestBody**](CreateBatchRequestBody.md)| | + +### Return type + +[**Batch**](Batch.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_batches_process_labels_by_batch_id_post** +> v1_batches_process_labels_by_batch_id_post(batch_id, body) + +batches.process + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::BatchesApi.new + +batch_id = 'batch_id_example' # String | + +body = ShipEngineApi::ProcessBatchRequestBody.new # ProcessBatchRequestBody | + + +begin + #batches.process + api_instance.v1_batches_process_labels_by_batch_id_post(batch_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling BatchesApi->v1_batches_process_labels_by_batch_id_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **batch_id** | **String**| | + **body** | [**ProcessBatchRequestBody**](ProcessBatchRequestBody.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_batches_remove_by_batch_id_post** +> v1_batches_remove_by_batch_id_post(batch_id, body) + +batches.remove_from_batch + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::BatchesApi.new + +batch_id = 'batch_id_example' # String | + +body = ShipEngineApi::ModifyBatchRequestBody.new # ModifyBatchRequestBody | + + +begin + #batches.remove_from_batch + api_instance.v1_batches_remove_by_batch_id_post(batch_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling BatchesApi->v1_batches_remove_by_batch_id_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **batch_id** | **String**| | + **body** | [**ModifyBatchRequestBody**](ModifyBatchRequestBody.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/BatchesSortBy.md b/docs/BatchesSortBy.md new file mode 100755 index 0000000..d5f3812 --- /dev/null +++ b/docs/BatchesSortBy.md @@ -0,0 +1,7 @@ +# ShipEngineApi::BatchesSortBy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/BillToParty.md b/docs/BillToParty.md new file mode 100755 index 0000000..0369070 --- /dev/null +++ b/docs/BillToParty.md @@ -0,0 +1,7 @@ +# ShipEngineApi::BillToParty + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/BulkRateResponseBody.md b/docs/BulkRateResponseBody.md new file mode 100755 index 0000000..1357433 --- /dev/null +++ b/docs/BulkRateResponseBody.md @@ -0,0 +1,12 @@ +# ShipEngineApi::BulkRateResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rate_request_id** | **String** | A string that uniquely identifies the rate request id | [optional] +**shipment_id** | **String** | A string that uniquely identifies the shipment id | [optional] +**created_at** | **DateTime** | | [optional] +**status** | [**RateResponseStatus**](RateResponseStatus.md) | | [optional] +**errors** | [**Array<ProviderError>**](ProviderError.md) | | [optional] + + diff --git a/docs/CapturePayment.md b/docs/CapturePayment.md new file mode 100755 index 0000000..4a29b2d --- /dev/null +++ b/docs/CapturePayment.md @@ -0,0 +1,7 @@ +# ShipEngineApi::CapturePayment + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/Carrier.md b/docs/Carrier.md new file mode 100755 index 0000000..c03c8ad --- /dev/null +++ b/docs/Carrier.md @@ -0,0 +1,20 @@ +# ShipEngineApi::Carrier + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**carrier_id** | **String** | A string that uniquely identifies the carrier id | [optional] +**carrier_code** | **String** | | [optional] +**account_number** | **String** | | [optional] +**requires_funded_amount** | **BOOLEAN** | | [optional] +**balance** | **Float** | | [optional] +**nickname** | **String** | | [optional] +**friendly_name** | **String** | | [optional] +**primary** | **BOOLEAN** | | [optional] +**has_multi_package_supporting_services** | **BOOLEAN** | | [optional] +**supports_label_messages** | **BOOLEAN** | | [optional] +**services** | [**Array<Service>**](Service.md) | | [optional] +**packages** | [**Array<Package>**](Package.md) | | [optional] +**options** | [**Array<CarrierAdvancedOption>**](CarrierAdvancedOption.md) | | [optional] + + diff --git a/docs/CarrierAccountsApi.md b/docs/CarrierAccountsApi.md new file mode 100755 index 0000000..3c0e39d --- /dev/null +++ b/docs/CarrierAccountsApi.md @@ -0,0 +1,2530 @@ +# ShipEngineApi::CarrierAccountsApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v1_connections_carriers_access_worldwide_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_access_worldwide_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/access_worldwide/{carrier_id} | access_worldwide_account_carrier.disconnect_account +[**v1_connections_carriers_access_worldwide_post**](CarrierAccountsApi.md#v1_connections_carriers_access_worldwide_post) | **POST** /v1/connections/carriers/access_worldwide | access_worldwide_account_carrier.connect_account +[**v1_connections_carriers_apc_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_apc_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/apc/{carrier_id} | apc_account_carrier.disconnect_account +[**v1_connections_carriers_apc_post**](CarrierAccountsApi.md#v1_connections_carriers_apc_post) | **POST** /v1/connections/carriers/apc | apc_account_carrier.connect_account +[**v1_connections_carriers_asendia_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_asendia_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/asendia/{carrier_id} | asendia_account_carrier.disconnect_account +[**v1_connections_carriers_asendia_post**](CarrierAccountsApi.md#v1_connections_carriers_asendia_post) | **POST** /v1/connections/carriers/asendia | asendia_account_carrier.connect_account +[**v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/dhl_ecommerce/{carrier_id} | dhl_ecommerce_account_carrier.disconnect_account +[**v1_connections_carriers_dhl_ecommerce_post**](CarrierAccountsApi.md#v1_connections_carriers_dhl_ecommerce_post) | **POST** /v1/connections/carriers/dhl_ecommerce | dhl_ecommerce_account_carrier.connect_account +[**v1_connections_carriers_dhl_express_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_dhl_express_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/dhl_express/{carrier_id} | dhl_express_account_carrier.disconnect_account +[**v1_connections_carriers_dhl_express_post**](CarrierAccountsApi.md#v1_connections_carriers_dhl_express_post) | **POST** /v1/connections/carriers/dhl_express | dhl_express_account_carrier.connect_account +[**v1_connections_carriers_dhl_express_settings_by_carrier_id_get**](CarrierAccountsApi.md#v1_connections_carriers_dhl_express_settings_by_carrier_id_get) | **GET** /v1/connections/carriers/dhl_express/{carrier_id}/settings | dhl_express_account_carrier.get_settings +[**v1_connections_carriers_dhl_express_settings_by_carrier_id_put**](CarrierAccountsApi.md#v1_connections_carriers_dhl_express_settings_by_carrier_id_put) | **PUT** /v1/connections/carriers/dhl_express/{carrier_id}/settings | dhl_express_account_carrier.update_settings +[**v1_connections_carriers_dhl_express_uk_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_dhl_express_uk_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/dhl_express_uk/{carrier_id} | dhl_express_uk_account_carrier.disconnect_account +[**v1_connections_carriers_dhl_express_uk_post**](CarrierAccountsApi.md#v1_connections_carriers_dhl_express_uk_post) | **POST** /v1/connections/carriers/dhl_express_uk | dhl_express_uk_account_carrier.connect_account +[**v1_connections_carriers_dpd_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_dpd_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/dpd/{carrier_id} | dpd_account_carrier.disconnect_account +[**v1_connections_carriers_dpd_post**](CarrierAccountsApi.md#v1_connections_carriers_dpd_post) | **POST** /v1/connections/carriers/dpd | dpd_account_carrier.connect_account +[**v1_connections_carriers_endicia_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_endicia_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/endicia/{carrier_id} | endicia_account_carrier.disconnect_account +[**v1_connections_carriers_endicia_post**](CarrierAccountsApi.md#v1_connections_carriers_endicia_post) | **POST** /v1/connections/carriers/endicia | endicia_account_carrier.connect_account +[**v1_connections_carriers_fedex_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_fedex_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/fedex/{carrier_id} | fedex_account_carrier.disconnect_account +[**v1_connections_carriers_fedex_post**](CarrierAccountsApi.md#v1_connections_carriers_fedex_post) | **POST** /v1/connections/carriers/fedex | fedex_account_carrier.connect_account +[**v1_connections_carriers_fedex_settings_by_carrier_id_get**](CarrierAccountsApi.md#v1_connections_carriers_fedex_settings_by_carrier_id_get) | **GET** /v1/connections/carriers/fedex/{carrier_id}/settings | fedex_account_carrier.get_settings +[**v1_connections_carriers_fedex_settings_by_carrier_id_put**](CarrierAccountsApi.md#v1_connections_carriers_fedex_settings_by_carrier_id_put) | **PUT** /v1/connections/carriers/fedex/{carrier_id}/settings | fedex_account_carrier.update_settings +[**v1_connections_carriers_fedex_uk_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_fedex_uk_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/fedex_uk/{carrier_id} | fedex_uk_account_carrier.disconnect_account +[**v1_connections_carriers_fedex_uk_post**](CarrierAccountsApi.md#v1_connections_carriers_fedex_uk_post) | **POST** /v1/connections/carriers/fedex_uk | fedex_uk_account_carrier.connect_account +[**v1_connections_carriers_firstmile_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_firstmile_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/firstmile/{carrier_id} | first_mile_account_carrier.disconnect_account +[**v1_connections_carriers_firstmile_post**](CarrierAccountsApi.md#v1_connections_carriers_firstmile_post) | **POST** /v1/connections/carriers/firstmile | first_mile_account_carrier.connect_account +[**v1_connections_carriers_globegistics_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_globegistics_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/globegistics/{carrier_id} | globegistics_account_carrier.disconnect_account +[**v1_connections_carriers_globegistics_post**](CarrierAccountsApi.md#v1_connections_carriers_globegistics_post) | **POST** /v1/connections/carriers/globegistics | globegistics_account_carrier.connect_account +[**v1_connections_carriers_imex_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_imex_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/imex/{carrier_id} | imex_account_carrier.disconnect_account +[**v1_connections_carriers_imex_post**](CarrierAccountsApi.md#v1_connections_carriers_imex_post) | **POST** /v1/connections/carriers/imex | imex_account_carrier.connect_account +[**v1_connections_carriers_newgistics_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_newgistics_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/newgistics/{carrier_id} | newgistics_account_carrier.disconnect_account +[**v1_connections_carriers_newgistics_post**](CarrierAccountsApi.md#v1_connections_carriers_newgistics_post) | **POST** /v1/connections/carriers/newgistics | newgistics_account_carrier.connect_account +[**v1_connections_carriers_newgistics_settings_by_carrier_id_put**](CarrierAccountsApi.md#v1_connections_carriers_newgistics_settings_by_carrier_id_put) | **PUT** /v1/connections/carriers/newgistics/{carrier_id}/settings | newgistics_account_carrier.update_settings +[**v1_connections_carriers_ontrac_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_ontrac_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/ontrac/{carrier_id} | ontrac_account_carrier.disconnect_account +[**v1_connections_carriers_ontrac_post**](CarrierAccountsApi.md#v1_connections_carriers_ontrac_post) | **POST** /v1/connections/carriers/ontrac | ontrac_account_carrier.connect_account +[**v1_connections_carriers_royal_mail_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_royal_mail_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/royal_mail/{carrier_id} | royal_mail_account_carrier.disconnect_account +[**v1_connections_carriers_royal_mail_post**](CarrierAccountsApi.md#v1_connections_carriers_royal_mail_post) | **POST** /v1/connections/carriers/royal_mail | royal_mail_account_carrier.connect_account +[**v1_connections_carriers_rr_donnelley_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_rr_donnelley_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/rr_donnelley/{carrier_id} | rr_donnelley_account_carrier.disconnect_account +[**v1_connections_carriers_rr_donnelley_post**](CarrierAccountsApi.md#v1_connections_carriers_rr_donnelley_post) | **POST** /v1/connections/carriers/rr_donnelley | rr_donnelley_account_carrier.connect_account +[**v1_connections_carriers_stamps_com_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_stamps_com_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/stamps_com/{carrier_id} | stamps_account_carrier.disconnect_account +[**v1_connections_carriers_stamps_com_post**](CarrierAccountsApi.md#v1_connections_carriers_stamps_com_post) | **POST** /v1/connections/carriers/stamps_com | stamps_account_carrier.connect_account +[**v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put**](CarrierAccountsApi.md#v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put) | **PUT** /v1/connections/carriers/stamps_com/{carrier_id}/request_account_url | stamps_account_carrier.get_account_url +[**v1_connections_carriers_ups_by_carrier_id_delete**](CarrierAccountsApi.md#v1_connections_carriers_ups_by_carrier_id_delete) | **DELETE** /v1/connections/carriers/ups/{carrier_id} | ups_account_carrier.disconnect_account +[**v1_connections_carriers_ups_post**](CarrierAccountsApi.md#v1_connections_carriers_ups_post) | **POST** /v1/connections/carriers/ups | ups_account_carrier.connect_account +[**v1_connections_carriers_ups_settings_by_carrier_id_get**](CarrierAccountsApi.md#v1_connections_carriers_ups_settings_by_carrier_id_get) | **GET** /v1/connections/carriers/ups/{carrier_id}/settings | ups_account_carrier.get_settings +[**v1_connections_carriers_ups_settings_by_carrier_id_put**](CarrierAccountsApi.md#v1_connections_carriers_ups_settings_by_carrier_id_put) | **PUT** /v1/connections/carriers/ups/{carrier_id}/settings | ups_account_carrier.update_settings + + +# **v1_connections_carriers_access_worldwide_by_carrier_id_delete** +> v1_connections_carriers_access_worldwide_by_carrier_id_delete(carrier_id) + +access_worldwide_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #access_worldwide_account_carrier.disconnect_account + api_instance.v1_connections_carriers_access_worldwide_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_access_worldwide_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_access_worldwide_post** +> ConnectAccountResponseBody v1_connections_carriers_access_worldwide_post(body) + +access_worldwide_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::AccessWorldwideAccountInformationRequestBody.new # AccessWorldwideAccountInformationRequestBody | + + +begin + #access_worldwide_account_carrier.connect_account + result = api_instance.v1_connections_carriers_access_worldwide_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_access_worldwide_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AccessWorldwideAccountInformationRequestBody**](AccessWorldwideAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_apc_by_carrier_id_delete** +> v1_connections_carriers_apc_by_carrier_id_delete(carrier_id) + +apc_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #apc_account_carrier.disconnect_account + api_instance.v1_connections_carriers_apc_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_apc_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_apc_post** +> ConnectAccountResponseBody v1_connections_carriers_apc_post(body) + +apc_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::AccessWorldwideAccountInformationRequestBody.new # AccessWorldwideAccountInformationRequestBody | + + +begin + #apc_account_carrier.connect_account + result = api_instance.v1_connections_carriers_apc_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_apc_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AccessWorldwideAccountInformationRequestBody**](AccessWorldwideAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_asendia_by_carrier_id_delete** +> v1_connections_carriers_asendia_by_carrier_id_delete(carrier_id) + +asendia_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #asendia_account_carrier.disconnect_account + api_instance.v1_connections_carriers_asendia_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_asendia_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_asendia_post** +> ConnectAccountResponseBody v1_connections_carriers_asendia_post(body) + +asendia_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::AsendiaAccountInformationRequestBody.new # AsendiaAccountInformationRequestBody | + + +begin + #asendia_account_carrier.connect_account + result = api_instance.v1_connections_carriers_asendia_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_asendia_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AsendiaAccountInformationRequestBody**](AsendiaAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete** +> v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete(carrier_id) + +dhl_ecommerce_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #dhl_ecommerce_account_carrier.disconnect_account + api_instance.v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_dhl_ecommerce_post** +> ConnectAccountResponseBody v1_connections_carriers_dhl_ecommerce_post(body) + +dhl_ecommerce_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::DhlEcommerceAccountInformationRequestBody.new # DhlEcommerceAccountInformationRequestBody | + + +begin + #dhl_ecommerce_account_carrier.connect_account + result = api_instance.v1_connections_carriers_dhl_ecommerce_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_dhl_ecommerce_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**DhlEcommerceAccountInformationRequestBody**](DhlEcommerceAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_dhl_express_by_carrier_id_delete** +> v1_connections_carriers_dhl_express_by_carrier_id_delete(carrier_id) + +dhl_express_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #dhl_express_account_carrier.disconnect_account + api_instance.v1_connections_carriers_dhl_express_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_dhl_express_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_dhl_express_post** +> ConnectAccountResponseBody v1_connections_carriers_dhl_express_post(body) + +dhl_express_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::DhlExpressAccountInformationRequestBody.new # DhlExpressAccountInformationRequestBody | + + +begin + #dhl_express_account_carrier.connect_account + result = api_instance.v1_connections_carriers_dhl_express_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_dhl_express_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**DhlExpressAccountInformationRequestBody**](DhlExpressAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_dhl_express_settings_by_carrier_id_get** +> DhlExpressAccountSettings v1_connections_carriers_dhl_express_settings_by_carrier_id_get(carrier_id) + +dhl_express_account_carrier.get_settings + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #dhl_express_account_carrier.get_settings + result = api_instance.v1_connections_carriers_dhl_express_settings_by_carrier_id_get(carrier_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_dhl_express_settings_by_carrier_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +[**DhlExpressAccountSettings**](DhlExpressAccountSettings.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_dhl_express_settings_by_carrier_id_put** +> v1_connections_carriers_dhl_express_settings_by_carrier_id_put(carrier_id, body) + +dhl_express_account_carrier.update_settings + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + +body = ShipEngineApi::DhlExpressAccountSettings.new # DhlExpressAccountSettings | + + +begin + #dhl_express_account_carrier.update_settings + api_instance.v1_connections_carriers_dhl_express_settings_by_carrier_id_put(carrier_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_dhl_express_settings_by_carrier_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + **body** | [**DhlExpressAccountSettings**](DhlExpressAccountSettings.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_dhl_express_uk_by_carrier_id_delete** +> v1_connections_carriers_dhl_express_uk_by_carrier_id_delete(carrier_id) + +dhl_express_uk_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #dhl_express_uk_account_carrier.disconnect_account + api_instance.v1_connections_carriers_dhl_express_uk_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_dhl_express_uk_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_dhl_express_uk_post** +> ConnectAccountResponseBody v1_connections_carriers_dhl_express_uk_post(body) + +dhl_express_uk_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::DhlExpressUkAccountInformationRequestBody.new # DhlExpressUkAccountInformationRequestBody | + + +begin + #dhl_express_uk_account_carrier.connect_account + result = api_instance.v1_connections_carriers_dhl_express_uk_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_dhl_express_uk_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**DhlExpressUkAccountInformationRequestBody**](DhlExpressUkAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_dpd_by_carrier_id_delete** +> v1_connections_carriers_dpd_by_carrier_id_delete(carrier_id) + +dpd_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #dpd_account_carrier.disconnect_account + api_instance.v1_connections_carriers_dpd_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_dpd_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_dpd_post** +> ConnectAccountResponseBody v1_connections_carriers_dpd_post(body) + +dpd_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::DpdAccountInformationRequestBody.new # DpdAccountInformationRequestBody | + + +begin + #dpd_account_carrier.connect_account + result = api_instance.v1_connections_carriers_dpd_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_dpd_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**DpdAccountInformationRequestBody**](DpdAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_endicia_by_carrier_id_delete** +> v1_connections_carriers_endicia_by_carrier_id_delete(carrier_id) + +endicia_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #endicia_account_carrier.disconnect_account + api_instance.v1_connections_carriers_endicia_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_endicia_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_endicia_post** +> ConnectAccountResponseBody v1_connections_carriers_endicia_post(body) + +endicia_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::EndiciaAccountInformationRequestBody.new # EndiciaAccountInformationRequestBody | + + +begin + #endicia_account_carrier.connect_account + result = api_instance.v1_connections_carriers_endicia_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_endicia_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**EndiciaAccountInformationRequestBody**](EndiciaAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_fedex_by_carrier_id_delete** +> v1_connections_carriers_fedex_by_carrier_id_delete(carrier_id) + +fedex_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #fedex_account_carrier.disconnect_account + api_instance.v1_connections_carriers_fedex_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_fedex_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_fedex_post** +> ConnectAccountResponseBody v1_connections_carriers_fedex_post(body) + +fedex_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::FedexAccountInformationRequestBody.new # FedexAccountInformationRequestBody | + + +begin + #fedex_account_carrier.connect_account + result = api_instance.v1_connections_carriers_fedex_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_fedex_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**FedexAccountInformationRequestBody**](FedexAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_fedex_settings_by_carrier_id_get** +> UpsAccountSettings v1_connections_carriers_fedex_settings_by_carrier_id_get(carrier_id) + +fedex_account_carrier.get_settings + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #fedex_account_carrier.get_settings + result = api_instance.v1_connections_carriers_fedex_settings_by_carrier_id_get(carrier_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_fedex_settings_by_carrier_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +[**UpsAccountSettings**](UpsAccountSettings.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_fedex_settings_by_carrier_id_put** +> v1_connections_carriers_fedex_settings_by_carrier_id_put(carrier_id, body) + +fedex_account_carrier.update_settings + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + +body = ShipEngineApi::FedexAccountSettingsRequestBody.new # FedexAccountSettingsRequestBody | + + +begin + #fedex_account_carrier.update_settings + api_instance.v1_connections_carriers_fedex_settings_by_carrier_id_put(carrier_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_fedex_settings_by_carrier_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + **body** | [**FedexAccountSettingsRequestBody**](FedexAccountSettingsRequestBody.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_fedex_uk_by_carrier_id_delete** +> v1_connections_carriers_fedex_uk_by_carrier_id_delete(carrier_id) + +fedex_uk_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #fedex_uk_account_carrier.disconnect_account + api_instance.v1_connections_carriers_fedex_uk_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_fedex_uk_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_fedex_uk_post** +> ConnectAccountResponseBody v1_connections_carriers_fedex_uk_post(body) + +fedex_uk_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::FedexUkAccountInformationRequestBody.new # FedexUkAccountInformationRequestBody | + + +begin + #fedex_uk_account_carrier.connect_account + result = api_instance.v1_connections_carriers_fedex_uk_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_fedex_uk_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**FedexUkAccountInformationRequestBody**](FedexUkAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_firstmile_by_carrier_id_delete** +> v1_connections_carriers_firstmile_by_carrier_id_delete(carrier_id) + +first_mile_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #first_mile_account_carrier.disconnect_account + api_instance.v1_connections_carriers_firstmile_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_firstmile_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_firstmile_post** +> ConnectAccountResponseBody v1_connections_carriers_firstmile_post(body) + +first_mile_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::FirstMileAccountInformationRequestBody.new # FirstMileAccountInformationRequestBody | + + +begin + #first_mile_account_carrier.connect_account + result = api_instance.v1_connections_carriers_firstmile_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_firstmile_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**FirstMileAccountInformationRequestBody**](FirstMileAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_globegistics_by_carrier_id_delete** +> v1_connections_carriers_globegistics_by_carrier_id_delete(carrier_id) + +globegistics_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #globegistics_account_carrier.disconnect_account + api_instance.v1_connections_carriers_globegistics_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_globegistics_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_globegistics_post** +> ConnectAccountResponseBody v1_connections_carriers_globegistics_post(body) + +globegistics_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::AccessWorldwideAccountInformationRequestBody.new # AccessWorldwideAccountInformationRequestBody | + + +begin + #globegistics_account_carrier.connect_account + result = api_instance.v1_connections_carriers_globegistics_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_globegistics_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AccessWorldwideAccountInformationRequestBody**](AccessWorldwideAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_imex_by_carrier_id_delete** +> v1_connections_carriers_imex_by_carrier_id_delete(carrier_id) + +imex_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #imex_account_carrier.disconnect_account + api_instance.v1_connections_carriers_imex_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_imex_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_imex_post** +> ConnectAccountResponseBody v1_connections_carriers_imex_post(body) + +imex_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::AccessWorldwideAccountInformationRequestBody.new # AccessWorldwideAccountInformationRequestBody | + + +begin + #imex_account_carrier.connect_account + result = api_instance.v1_connections_carriers_imex_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_imex_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AccessWorldwideAccountInformationRequestBody**](AccessWorldwideAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_newgistics_by_carrier_id_delete** +> v1_connections_carriers_newgistics_by_carrier_id_delete(carrier_id) + +newgistics_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #newgistics_account_carrier.disconnect_account + api_instance.v1_connections_carriers_newgistics_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_newgistics_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_newgistics_post** +> ConnectAccountResponseBody v1_connections_carriers_newgistics_post(body) + +newgistics_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::NewgisticsAccountInformationRequestBody.new # NewgisticsAccountInformationRequestBody | + + +begin + #newgistics_account_carrier.connect_account + result = api_instance.v1_connections_carriers_newgistics_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_newgistics_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**NewgisticsAccountInformationRequestBody**](NewgisticsAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_newgistics_settings_by_carrier_id_put** +> v1_connections_carriers_newgistics_settings_by_carrier_id_put(carrier_id, body) + +newgistics_account_carrier.update_settings + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + +body = ShipEngineApi::NewgisticsAccountSettingsRequestBody.new # NewgisticsAccountSettingsRequestBody | + + +begin + #newgistics_account_carrier.update_settings + api_instance.v1_connections_carriers_newgistics_settings_by_carrier_id_put(carrier_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_newgistics_settings_by_carrier_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + **body** | [**NewgisticsAccountSettingsRequestBody**](NewgisticsAccountSettingsRequestBody.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_ontrac_by_carrier_id_delete** +> v1_connections_carriers_ontrac_by_carrier_id_delete(carrier_id) + +ontrac_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #ontrac_account_carrier.disconnect_account + api_instance.v1_connections_carriers_ontrac_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_ontrac_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_ontrac_post** +> ConnectAccountResponseBody v1_connections_carriers_ontrac_post(body) + +ontrac_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::DpdAccountInformationRequestBody.new # DpdAccountInformationRequestBody | + + +begin + #ontrac_account_carrier.connect_account + result = api_instance.v1_connections_carriers_ontrac_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_ontrac_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**DpdAccountInformationRequestBody**](DpdAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_royal_mail_by_carrier_id_delete** +> v1_connections_carriers_royal_mail_by_carrier_id_delete(carrier_id) + +royal_mail_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #royal_mail_account_carrier.disconnect_account + api_instance.v1_connections_carriers_royal_mail_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_royal_mail_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_royal_mail_post** +> ConnectAccountResponseBody v1_connections_carriers_royal_mail_post(body) + +royal_mail_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::RoyalMailAccountInformationRequestBody.new # RoyalMailAccountInformationRequestBody | + + +begin + #royal_mail_account_carrier.connect_account + result = api_instance.v1_connections_carriers_royal_mail_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_royal_mail_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**RoyalMailAccountInformationRequestBody**](RoyalMailAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_rr_donnelley_by_carrier_id_delete** +> v1_connections_carriers_rr_donnelley_by_carrier_id_delete(carrier_id) + +rr_donnelley_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #rr_donnelley_account_carrier.disconnect_account + api_instance.v1_connections_carriers_rr_donnelley_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_rr_donnelley_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_rr_donnelley_post** +> ConnectAccountResponseBody v1_connections_carriers_rr_donnelley_post(body) + +rr_donnelley_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::AccessWorldwideAccountInformationRequestBody.new # AccessWorldwideAccountInformationRequestBody | + + +begin + #rr_donnelley_account_carrier.connect_account + result = api_instance.v1_connections_carriers_rr_donnelley_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_rr_donnelley_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AccessWorldwideAccountInformationRequestBody**](AccessWorldwideAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_stamps_com_by_carrier_id_delete** +> v1_connections_carriers_stamps_com_by_carrier_id_delete(carrier_id) + +stamps_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #stamps_account_carrier.disconnect_account + api_instance.v1_connections_carriers_stamps_com_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_stamps_com_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_stamps_com_post** +> ConnectAccountResponseBody v1_connections_carriers_stamps_com_post(body) + +stamps_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::AccessWorldwideAccountInformationRequestBody.new # AccessWorldwideAccountInformationRequestBody | + + +begin + #stamps_account_carrier.connect_account + result = api_instance.v1_connections_carriers_stamps_com_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_stamps_com_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AccessWorldwideAccountInformationRequestBody**](AccessWorldwideAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put** +> StampsAccountUrlsResponseBody v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put(carrier_id, body) + +stamps_account_carrier.get_account_url + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + +body = ShipEngineApi::StampsAccountUrlsRequestBody.new # StampsAccountUrlsRequestBody | + + +begin + #stamps_account_carrier.get_account_url + result = api_instance.v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put(carrier_id, body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + **body** | [**StampsAccountUrlsRequestBody**](StampsAccountUrlsRequestBody.md)| | + +### Return type + +[**StampsAccountUrlsResponseBody**](StampsAccountUrlsResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_ups_by_carrier_id_delete** +> v1_connections_carriers_ups_by_carrier_id_delete(carrier_id) + +ups_account_carrier.disconnect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #ups_account_carrier.disconnect_account + api_instance.v1_connections_carriers_ups_by_carrier_id_delete(carrier_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_ups_by_carrier_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_ups_post** +> ConnectAccountResponseBody v1_connections_carriers_ups_post(body) + +ups_account_carrier.connect_account + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +body = ShipEngineApi::UpsAccountInformationRequestBody.new # UpsAccountInformationRequestBody | + + +begin + #ups_account_carrier.connect_account + result = api_instance.v1_connections_carriers_ups_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_ups_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**UpsAccountInformationRequestBody**](UpsAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectAccountResponseBody**](ConnectAccountResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_ups_settings_by_carrier_id_get** +> UpsAccountSettings v1_connections_carriers_ups_settings_by_carrier_id_get(carrier_id) + +ups_account_carrier.get_settings + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #ups_account_carrier.get_settings + result = api_instance.v1_connections_carriers_ups_settings_by_carrier_id_get(carrier_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_ups_settings_by_carrier_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +[**UpsAccountSettings**](UpsAccountSettings.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_connections_carriers_ups_settings_by_carrier_id_put** +> v1_connections_carriers_ups_settings_by_carrier_id_put(carrier_id, body) + +ups_account_carrier.update_settings + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarrierAccountsApi.new + +carrier_id = 'carrier_id_example' # String | + +body = ShipEngineApi::UpsAccountSettings.new # UpsAccountSettings | + + +begin + #ups_account_carrier.update_settings + api_instance.v1_connections_carriers_ups_settings_by_carrier_id_put(carrier_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarrierAccountsApi->v1_connections_carriers_ups_settings_by_carrier_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + **body** | [**UpsAccountSettings**](UpsAccountSettings.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/CarrierAdvancedOption.md b/docs/CarrierAdvancedOption.md new file mode 100755 index 0000000..47edbc4 --- /dev/null +++ b/docs/CarrierAdvancedOption.md @@ -0,0 +1,10 @@ +# ShipEngineApi::CarrierAdvancedOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**default_value** | **String** | | [optional] +**description** | **String** | | [optional] + + diff --git a/docs/CarrierListOptionsResponseBody.md b/docs/CarrierListOptionsResponseBody.md new file mode 100755 index 0000000..5266426 --- /dev/null +++ b/docs/CarrierListOptionsResponseBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::CarrierListOptionsResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**options** | [**Array<CarrierAdvancedOption>**](CarrierAdvancedOption.md) | | [optional] + + diff --git a/docs/CarrierListResponseBody.md b/docs/CarrierListResponseBody.md new file mode 100755 index 0000000..a262601 --- /dev/null +++ b/docs/CarrierListResponseBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::CarrierListResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**carriers** | [**Array<Carrier>**](Carrier.md) | | [optional] + + diff --git a/docs/CarrierListServicesResponseBody.md b/docs/CarrierListServicesResponseBody.md new file mode 100755 index 0000000..1e23ebd --- /dev/null +++ b/docs/CarrierListServicesResponseBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::CarrierListServicesResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**services** | [**Array<Service>**](Service.md) | | [optional] + + diff --git a/docs/CarriersApi.md b/docs/CarriersApi.md new file mode 100755 index 0000000..c130067 --- /dev/null +++ b/docs/CarriersApi.md @@ -0,0 +1,335 @@ +# ShipEngineApi::CarriersApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v1_carriers_add_funds_by_carrier_id_put**](CarriersApi.md#v1_carriers_add_funds_by_carrier_id_put) | **PUT** /v1/carriers/{carrier_id}/add_funds | carriers.add_funds +[**v1_carriers_by_carrier_id_get**](CarriersApi.md#v1_carriers_by_carrier_id_get) | **GET** /v1/carriers/{carrier_id} | carriers.get_by_id +[**v1_carriers_get**](CarriersApi.md#v1_carriers_get) | **GET** /v1/carriers | carriers.find +[**v1_carriers_options_by_carrier_id_get**](CarriersApi.md#v1_carriers_options_by_carrier_id_get) | **GET** /v1/carriers/{carrier_id}/options | carriers.get_options +[**v1_carriers_packages_by_carrier_id_get**](CarriersApi.md#v1_carriers_packages_by_carrier_id_get) | **GET** /v1/carriers/{carrier_id}/packages | carriers.find_packages +[**v1_carriers_services_by_carrier_id_get**](CarriersApi.md#v1_carriers_services_by_carrier_id_get) | **GET** /v1/carriers/{carrier_id}/services | carriers.find_services + + +# **v1_carriers_add_funds_by_carrier_id_put** +> BalanceResponseBody v1_carriers_add_funds_by_carrier_id_put(carrier_id, body) + +carriers.add_funds + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarriersApi.new + +carrier_id = 'carrier_id_example' # String | + +body = ShipEngineApi::Money.new # Money | + + +begin + #carriers.add_funds + result = api_instance.v1_carriers_add_funds_by_carrier_id_put(carrier_id, body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarriersApi->v1_carriers_add_funds_by_carrier_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + **body** | [**Money**](Money.md)| | + +### Return type + +[**BalanceResponseBody**](BalanceResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_carriers_by_carrier_id_get** +> Carrier v1_carriers_by_carrier_id_get(carrier_id) + +carriers.get_by_id + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarriersApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #carriers.get_by_id + result = api_instance.v1_carriers_by_carrier_id_get(carrier_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarriersApi->v1_carriers_by_carrier_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +[**Carrier**](Carrier.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_carriers_get** +> CarrierListResponseBody v1_carriers_get + +carriers.find + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarriersApi.new + +begin + #carriers.find + result = api_instance.v1_carriers_get + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarriersApi->v1_carriers_get: #{e}" +end +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**CarrierListResponseBody**](CarrierListResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_carriers_options_by_carrier_id_get** +> CarrierListOptionsResponseBody v1_carriers_options_by_carrier_id_get(carrier_id) + +carriers.get_options + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarriersApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #carriers.get_options + result = api_instance.v1_carriers_options_by_carrier_id_get(carrier_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarriersApi->v1_carriers_options_by_carrier_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +[**CarrierListOptionsResponseBody**](CarrierListOptionsResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_carriers_packages_by_carrier_id_get** +> PackageListResponseBody v1_carriers_packages_by_carrier_id_get(carrier_id) + +carriers.find_packages + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarriersApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #carriers.find_packages + result = api_instance.v1_carriers_packages_by_carrier_id_get(carrier_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarriersApi->v1_carriers_packages_by_carrier_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +[**PackageListResponseBody**](PackageListResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_carriers_services_by_carrier_id_get** +> CarrierListServicesResponseBody v1_carriers_services_by_carrier_id_get(carrier_id) + +carriers.find_services + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::CarriersApi.new + +carrier_id = 'carrier_id_example' # String | + + +begin + #carriers.find_services + result = api_instance.v1_carriers_services_by_carrier_id_get(carrier_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling CarriersApi->v1_carriers_services_by_carrier_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_id** | **String**| | + +### Return type + +[**CarrierListServicesResponseBody**](CarrierListServicesResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/ChannelAdvisorAccountInformationRequestBody.md b/docs/ChannelAdvisorAccountInformationRequestBody.md new file mode 100755 index 0000000..a2fa01c --- /dev/null +++ b/docs/ChannelAdvisorAccountInformationRequestBody.md @@ -0,0 +1,10 @@ +# ShipEngineApi::ChannelAdvisorAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**store_name** | **String** | | [optional] +**profile_id** | **Integer** | | [optional] +**product_identifier** | [**ChannelAdvisorProductIdentifier**](ChannelAdvisorProductIdentifier.md) | | [optional] + + diff --git a/docs/ChannelAdvisorProductIdentifier.md b/docs/ChannelAdvisorProductIdentifier.md new file mode 100755 index 0000000..0a229fa --- /dev/null +++ b/docs/ChannelAdvisorProductIdentifier.md @@ -0,0 +1,7 @@ +# ShipEngineApi::ChannelAdvisorProductIdentifier + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/Code.md b/docs/Code.md new file mode 100755 index 0000000..15e38e8 --- /dev/null +++ b/docs/Code.md @@ -0,0 +1,7 @@ +# ShipEngineApi::Code + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/Confirmation.md b/docs/Confirmation.md new file mode 100755 index 0000000..b92772e --- /dev/null +++ b/docs/Confirmation.md @@ -0,0 +1,7 @@ +# ShipEngineApi::Confirmation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/ConnectAccountResponseBody.md b/docs/ConnectAccountResponseBody.md new file mode 100755 index 0000000..506aa82 --- /dev/null +++ b/docs/ConnectAccountResponseBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::ConnectAccountResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**carrier_id** | **String** | A string that uniquely identifies the carrier id | [optional] + + diff --git a/docs/ConnectMarketplaceResponseBody.md b/docs/ConnectMarketplaceResponseBody.md new file mode 100755 index 0000000..3116ecf --- /dev/null +++ b/docs/ConnectMarketplaceResponseBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::ConnectMarketplaceResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**store_id** | **String** | A UUID that uniquely identifies the store id | [optional] + + diff --git a/docs/Contents.md b/docs/Contents.md new file mode 100755 index 0000000..f35ecc7 --- /dev/null +++ b/docs/Contents.md @@ -0,0 +1,7 @@ +# ShipEngineApi::Contents + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/CreateBatchRequestBody.md b/docs/CreateBatchRequestBody.md new file mode 100755 index 0000000..07128b4 --- /dev/null +++ b/docs/CreateBatchRequestBody.md @@ -0,0 +1,11 @@ +# ShipEngineApi::CreateBatchRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**external_batch_id** | **String** | A string that uniquely identifies the external batch id | [optional] +**batch_notes** | **String** | | [optional] +**shipment_ids** | **Array<String>** | | [optional] +**rate_ids** | **Array<String>** | | [optional] + + diff --git a/docs/CreateManifestRequestBody.md b/docs/CreateManifestRequestBody.md new file mode 100755 index 0000000..b54fab3 --- /dev/null +++ b/docs/CreateManifestRequestBody.md @@ -0,0 +1,11 @@ +# ShipEngineApi::CreateManifestRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**carrier_id** | **String** | A string that uniquely identifies the carrier id | [optional] +**excluded_label_ids** | **Array<String>** | | [optional] +**warehouse_id** | **String** | A string that uniquely identifies the warehouse id | [optional] +**ship_date** | **DateTime** | | [optional] + + diff --git a/docs/CreateShipmentResponseBody.md b/docs/CreateShipmentResponseBody.md new file mode 100755 index 0000000..a8e3b49 --- /dev/null +++ b/docs/CreateShipmentResponseBody.md @@ -0,0 +1,28 @@ +# ShipEngineApi::CreateShipmentResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | **Array<String>** | | [optional] +**address_validation** | [**AddressValidationResult**](AddressValidationResult.md) | | [optional] +**shipment_id** | **String** | A string that uniquely identifies the shipment id | [optional] +**carrier_id** | **String** | A string that uniquely identifies the carrier id | [optional] +**service_code** | **String** | | [optional] +**external_shipment_id** | **String** | A string that uniquely identifies the external shipment id | [optional] +**ship_date** | **DateTime** | | [optional] +**created_at** | **DateTime** | | [optional] +**modified_at** | **DateTime** | | [optional] +**shipment_status** | [**ShipmentStatus**](ShipmentStatus.md) | | [optional] +**ship_to** | [**Address**](Address.md) | | [optional] +**ship_from** | [**Address**](Address.md) | | [optional] +**warehouse_id** | **String** | A string that uniquely identifies the warehouse id | [optional] +**return_to** | [**Address**](Address.md) | | [optional] +**confirmation** | [**Confirmation**](Confirmation.md) | | [optional] +**customs** | [**InternationalOptions**](InternationalOptions.md) | | [optional] +**advanced_options** | [**AdvancedOptions**](AdvancedOptions.md) | | [optional] +**insurance_provider** | [**InsuranceProvider**](InsuranceProvider.md) | | [optional] +**tags** | [**Array<TagResponseBody>**](TagResponseBody.md) | | [optional] +**packages** | [**Array<ShipmentPackage>**](ShipmentPackage.md) | | [optional] +**total_weight** | [**Weight**](Weight.md) | | [optional] + + diff --git a/docs/CreateShipmentsRequestBody.md b/docs/CreateShipmentsRequestBody.md new file mode 100755 index 0000000..a0f9121 --- /dev/null +++ b/docs/CreateShipmentsRequestBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::CreateShipmentsRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shipments** | [**Array<AddressValidatingShipment>**](AddressValidatingShipment.md) | | [optional] + + diff --git a/docs/CreateShipmentsResponseBody.md b/docs/CreateShipmentsResponseBody.md new file mode 100755 index 0000000..6a13d3c --- /dev/null +++ b/docs/CreateShipmentsResponseBody.md @@ -0,0 +1,9 @@ +# ShipEngineApi::CreateShipmentsResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**has_errors** | **BOOLEAN** | | [optional] +**shipments** | [**Array<CreateShipmentResponseBody>**](CreateShipmentResponseBody.md) | | [optional] + + diff --git a/docs/CreateWebhookRequestBody.md b/docs/CreateWebhookRequestBody.md new file mode 100755 index 0000000..703960b --- /dev/null +++ b/docs/CreateWebhookRequestBody.md @@ -0,0 +1,9 @@ +# ShipEngineApi::CreateWebhookRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**event** | [**Event**](Event.md) | | [optional] +**url** | **String** | | [optional] + + diff --git a/docs/Currency.md b/docs/Currency.md new file mode 100755 index 0000000..5843c7a --- /dev/null +++ b/docs/Currency.md @@ -0,0 +1,7 @@ +# ShipEngineApi::Currency + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/CustomsItem.md b/docs/CustomsItem.md new file mode 100755 index 0000000..608b25e --- /dev/null +++ b/docs/CustomsItem.md @@ -0,0 +1,13 @@ +# ShipEngineApi::CustomsItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customs_item_id** | **String** | A string that uniquely identifies the customs item id | [optional] +**description** | **String** | | [optional] +**quantity** | **Integer** | | [optional] +**value** | **Float** | | [optional] +**harmonized_tariff_code** | **String** | | [optional] +**country_of_origin** | **String** | | [optional] + + diff --git a/docs/DefaultAccountSettingsRequestBody.md b/docs/DefaultAccountSettingsRequestBody.md new file mode 100755 index 0000000..05cf00e --- /dev/null +++ b/docs/DefaultAccountSettingsRequestBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::DefaultAccountSettingsRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**automatically_import_sales_orders** | **BOOLEAN** | | [optional] + + diff --git a/docs/DetailCode.md b/docs/DetailCode.md new file mode 100755 index 0000000..e42798f --- /dev/null +++ b/docs/DetailCode.md @@ -0,0 +1,7 @@ +# ShipEngineApi::DetailCode + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/DhlEcommerceAccountInformationRequestBody.md b/docs/DhlEcommerceAccountInformationRequestBody.md new file mode 100755 index 0000000..e203ef3 --- /dev/null +++ b/docs/DhlEcommerceAccountInformationRequestBody.md @@ -0,0 +1,12 @@ +# ShipEngineApi::DhlEcommerceAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**account_number** | **String** | | [optional] +**pickup_number** | **String** | | [optional] +**ftp_username** | **String** | | [optional] +**ftp_password** | **String** | | [optional] + + diff --git a/docs/DhlExpressAccountInformationRequestBody.md b/docs/DhlExpressAccountInformationRequestBody.md new file mode 100755 index 0000000..b24bf24 --- /dev/null +++ b/docs/DhlExpressAccountInformationRequestBody.md @@ -0,0 +1,9 @@ +# ShipEngineApi::DhlExpressAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**account_number** | **String** | | [optional] + + diff --git a/docs/DhlExpressAccountSettings.md b/docs/DhlExpressAccountSettings.md new file mode 100755 index 0000000..6da98cd --- /dev/null +++ b/docs/DhlExpressAccountSettings.md @@ -0,0 +1,10 @@ +# ShipEngineApi::DhlExpressAccountSettings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**should_hide_account_number_on_archive_doc** | **BOOLEAN** | | [optional] +**is_primary_account** | **BOOLEAN** | | [optional] + + diff --git a/docs/DhlExpressUkAccountInformationRequestBody.md b/docs/DhlExpressUkAccountInformationRequestBody.md new file mode 100755 index 0000000..5127188 --- /dev/null +++ b/docs/DhlExpressUkAccountInformationRequestBody.md @@ -0,0 +1,11 @@ +# ShipEngineApi::DhlExpressUkAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_number** | **String** | | [optional] +**site_id** | **String** | A string that uniquely identifies the site id | [optional] +**password** | **String** | | [optional] +**nickname** | **String** | | [optional] + + diff --git a/docs/DimensionUnit.md b/docs/DimensionUnit.md new file mode 100755 index 0000000..f7f80fe --- /dev/null +++ b/docs/DimensionUnit.md @@ -0,0 +1,7 @@ +# ShipEngineApi::DimensionUnit + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/Dimensions.md b/docs/Dimensions.md new file mode 100755 index 0000000..c7d6b3c --- /dev/null +++ b/docs/Dimensions.md @@ -0,0 +1,11 @@ +# ShipEngineApi::Dimensions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**unit** | [**DimensionUnit**](DimensionUnit.md) | | [optional] +**length** | **Float** | | [optional] +**width** | **Float** | | [optional] +**height** | **Float** | | [optional] + + diff --git a/docs/DpdAccountInformationRequestBody.md b/docs/DpdAccountInformationRequestBody.md new file mode 100755 index 0000000..12fe1a1 --- /dev/null +++ b/docs/DpdAccountInformationRequestBody.md @@ -0,0 +1,10 @@ +# ShipEngineApi::DpdAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_number** | **String** | | [optional] +**password** | **String** | | [optional] +**nickname** | **String** | | [optional] + + diff --git a/docs/EbayAccessTokenRequestBody.md b/docs/EbayAccessTokenRequestBody.md new file mode 100755 index 0000000..0bb9e94 --- /dev/null +++ b/docs/EbayAccessTokenRequestBody.md @@ -0,0 +1,11 @@ +# ShipEngineApi::EbayAccessTokenRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **String** | | [optional] +**store_name** | **String** | | [optional] +**access_token** | **String** | | [optional] +**private_application_id** | **String** | A string that uniquely identifies the private application id | [optional] + + diff --git a/docs/EndiciaAccountInformationRequestBody.md b/docs/EndiciaAccountInformationRequestBody.md new file mode 100755 index 0000000..4852348 --- /dev/null +++ b/docs/EndiciaAccountInformationRequestBody.md @@ -0,0 +1,10 @@ +# ShipEngineApi::EndiciaAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**account** | **String** | | [optional] +**passphrase** | **String** | | [optional] + + diff --git a/docs/EnvironmentApi.md b/docs/EnvironmentApi.md new file mode 100755 index 0000000..062d93a --- /dev/null +++ b/docs/EnvironmentApi.md @@ -0,0 +1,278 @@ +# ShipEngineApi::EnvironmentApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v1_environment_webhooks_by_webhook_id_delete**](EnvironmentApi.md#v1_environment_webhooks_by_webhook_id_delete) | **DELETE** /v1/environment/webhooks/{webhook_id} | environment.delete_webhook +[**v1_environment_webhooks_by_webhook_id_get**](EnvironmentApi.md#v1_environment_webhooks_by_webhook_id_get) | **GET** /v1/environment/webhooks/{webhook_id} | environment.get_webhook_by_id +[**v1_environment_webhooks_by_webhook_id_put**](EnvironmentApi.md#v1_environment_webhooks_by_webhook_id_put) | **PUT** /v1/environment/webhooks/{webhook_id} | environment.update_webhook +[**v1_environment_webhooks_get**](EnvironmentApi.md#v1_environment_webhooks_get) | **GET** /v1/environment/webhooks | environment.webhooks +[**v1_environment_webhooks_post**](EnvironmentApi.md#v1_environment_webhooks_post) | **POST** /v1/environment/webhooks | environment.create_webhook + + +# **v1_environment_webhooks_by_webhook_id_delete** +> v1_environment_webhooks_by_webhook_id_delete(webhook_id) + +environment.delete_webhook + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::EnvironmentApi.new + +webhook_id = 'webhook_id_example' # String | + + +begin + #environment.delete_webhook + api_instance.v1_environment_webhooks_by_webhook_id_delete(webhook_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling EnvironmentApi->v1_environment_webhooks_by_webhook_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **webhook_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_environment_webhooks_by_webhook_id_get** +> WebhookResponseBody v1_environment_webhooks_by_webhook_id_get(webhook_id) + +environment.get_webhook_by_id + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::EnvironmentApi.new + +webhook_id = 'webhook_id_example' # String | + + +begin + #environment.get_webhook_by_id + result = api_instance.v1_environment_webhooks_by_webhook_id_get(webhook_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling EnvironmentApi->v1_environment_webhooks_by_webhook_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **webhook_id** | **String**| | + +### Return type + +[**WebhookResponseBody**](WebhookResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_environment_webhooks_by_webhook_id_put** +> v1_environment_webhooks_by_webhook_id_put(webhook_id, body) + +environment.update_webhook + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::EnvironmentApi.new + +webhook_id = 'webhook_id_example' # String | + +body = ShipEngineApi::UpdateWebhookRequestBody.new # UpdateWebhookRequestBody | + + +begin + #environment.update_webhook + api_instance.v1_environment_webhooks_by_webhook_id_put(webhook_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling EnvironmentApi->v1_environment_webhooks_by_webhook_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **webhook_id** | **String**| | + **body** | [**UpdateWebhookRequestBody**](UpdateWebhookRequestBody.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_environment_webhooks_get** +> Array<WebhookResponseBody> v1_environment_webhooks_get + +environment.webhooks + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::EnvironmentApi.new + +begin + #environment.webhooks + result = api_instance.v1_environment_webhooks_get + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling EnvironmentApi->v1_environment_webhooks_get: #{e}" +end +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Array<WebhookResponseBody>**](WebhookResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_environment_webhooks_post** +> WebhookResponseBody v1_environment_webhooks_post(body) + +environment.create_webhook + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::EnvironmentApi.new + +body = ShipEngineApi::CreateWebhookRequestBody.new # CreateWebhookRequestBody | + + +begin + #environment.create_webhook + result = api_instance.v1_environment_webhooks_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling EnvironmentApi->v1_environment_webhooks_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CreateWebhookRequestBody**](CreateWebhookRequestBody.md)| | + +### Return type + +[**WebhookResponseBody**](WebhookResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/ErrorResponseBody.md b/docs/ErrorResponseBody.md new file mode 100755 index 0000000..a9f7308 --- /dev/null +++ b/docs/ErrorResponseBody.md @@ -0,0 +1,9 @@ +# ShipEngineApi::ErrorResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_id** | **String** | A UUID that uniquely identifies the request id | [optional] +**errors** | [**Array<ApiError>**](ApiError.md) | | [optional] + + diff --git a/docs/EtsyAccessTokenRequestBody.md b/docs/EtsyAccessTokenRequestBody.md new file mode 100755 index 0000000..1de96d0 --- /dev/null +++ b/docs/EtsyAccessTokenRequestBody.md @@ -0,0 +1,12 @@ +# ShipEngineApi::EtsyAccessTokenRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**store_name** | **String** | | [optional] +**access_token** | **String** | | [optional] +**access_token_secret** | **String** | | [optional] +**shop_id** | **Integer** | | [optional] +**private_application_id** | **String** | A string that uniquely identifies the private application id | [optional] + + diff --git a/docs/Event.md b/docs/Event.md new file mode 100755 index 0000000..b795cde --- /dev/null +++ b/docs/Event.md @@ -0,0 +1,7 @@ +# ShipEngineApi::Event + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/FedexAccountInformationRequestBody.md b/docs/FedexAccountInformationRequestBody.md new file mode 100755 index 0000000..e7977e7 --- /dev/null +++ b/docs/FedexAccountInformationRequestBody.md @@ -0,0 +1,22 @@ +# ShipEngineApi::FedexAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_number** | **String** | | [optional] +**address1** | **String** | | [optional] +**address2** | **String** | | [optional] +**city** | **String** | | [optional] +**company** | **String** | | [optional] +**country_code** | **String** | | [optional] +**email** | **String** | The email address | [optional] +**first_name** | **String** | | [optional] +**last_name** | **String** | | [optional] +**phone** | **String** | | [optional] +**postal_code** | **String** | | [optional] +**state** | **String** | | [optional] +**nickname** | **String** | | [optional] +**agree_to_eula** | **BOOLEAN** | | [optional] +**meter_number** | **String** | | [optional] + + diff --git a/docs/FedexAccountSettingsRequestBody.md b/docs/FedexAccountSettingsRequestBody.md new file mode 100755 index 0000000..74e42c3 --- /dev/null +++ b/docs/FedexAccountSettingsRequestBody.md @@ -0,0 +1,12 @@ +# ShipEngineApi::FedexAccountSettingsRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**pickup_type** | [**FedexPickupType**](FedexPickupType.md) | | [optional] +**smart_post_hub** | [**SmartPostHub**](SmartPostHub.md) | | [optional] +**smart_post_endorsement** | [**SmartPostEndorsement**](SmartPostEndorsement.md) | | [optional] +**is_primary_account** | **BOOLEAN** | | [optional] + + diff --git a/docs/FedexPickupType.md b/docs/FedexPickupType.md new file mode 100755 index 0000000..bb8ac81 --- /dev/null +++ b/docs/FedexPickupType.md @@ -0,0 +1,7 @@ +# ShipEngineApi::FedexPickupType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/FedexUkAccountInformationRequestBody.md b/docs/FedexUkAccountInformationRequestBody.md new file mode 100755 index 0000000..97ed287 --- /dev/null +++ b/docs/FedexUkAccountInformationRequestBody.md @@ -0,0 +1,22 @@ +# ShipEngineApi::FedexUkAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_number** | **String** | | [optional] +**address1** | **String** | | [optional] +**address2** | **String** | | [optional] +**city** | **String** | | [optional] +**company** | **String** | | [optional] +**country_code** | **String** | | [optional] +**email** | **String** | The email address | [optional] +**first_name** | **String** | | [optional] +**last_name** | **String** | | [optional] +**phone** | **String** | | [optional] +**postal_code** | **String** | | [optional] +**state_province** | **String** | | [optional] +**nickname** | **String** | | [optional] +**agree_to_eula** | **BOOLEAN** | | [optional] +**meter_number** | **String** | | [optional] + + diff --git a/docs/First.md b/docs/First.md new file mode 100755 index 0000000..44bcead --- /dev/null +++ b/docs/First.md @@ -0,0 +1,8 @@ +# ShipEngineApi::First + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | | + + diff --git a/docs/FirstMileAccountInformationRequestBody.md b/docs/FirstMileAccountInformationRequestBody.md new file mode 100755 index 0000000..9188349 --- /dev/null +++ b/docs/FirstMileAccountInformationRequestBody.md @@ -0,0 +1,11 @@ +# ShipEngineApi::FirstMileAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**mailer_id** | **String** | A string that uniquely identifies the mailer id | [optional] +**profile_name** | **String** | | [optional] +**password** | **String** | | [optional] + + diff --git a/docs/GlobegisticsAccountInformationRequestBody.md b/docs/GlobegisticsAccountInformationRequestBody.md new file mode 100755 index 0000000..4e0c8a6 --- /dev/null +++ b/docs/GlobegisticsAccountInformationRequestBody.md @@ -0,0 +1,10 @@ +# ShipEngineApi::GlobegisticsAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**username** | **String** | | [optional] +**password** | **String** | | [optional] + + diff --git a/docs/ImexAccountInformationRequestBody.md b/docs/ImexAccountInformationRequestBody.md new file mode 100755 index 0000000..bb429e0 --- /dev/null +++ b/docs/ImexAccountInformationRequestBody.md @@ -0,0 +1,10 @@ +# ShipEngineApi::ImexAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**username** | **String** | | [optional] +**password** | **String** | | [optional] + + diff --git a/docs/InsuranceApi.md b/docs/InsuranceApi.md new file mode 100755 index 0000000..36946d7 --- /dev/null +++ b/docs/InsuranceApi.md @@ -0,0 +1,112 @@ +# ShipEngineApi::InsuranceApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v1_insurance_shipsurance_add_funds_patch**](InsuranceApi.md#v1_insurance_shipsurance_add_funds_patch) | **PATCH** /v1/insurance/shipsurance/add_funds | insurance.add_funds +[**v1_insurance_shipsurance_balance_get**](InsuranceApi.md#v1_insurance_shipsurance_balance_get) | **GET** /v1/insurance/shipsurance/balance | insurance.get_balance + + +# **v1_insurance_shipsurance_add_funds_patch** +> Money v1_insurance_shipsurance_add_funds_patch(body) + +insurance.add_funds + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::InsuranceApi.new + +body = ShipEngineApi::Money.new # Money | + + +begin + #insurance.add_funds + result = api_instance.v1_insurance_shipsurance_add_funds_patch(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling InsuranceApi->v1_insurance_shipsurance_add_funds_patch: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Money**](Money.md)| | + +### Return type + +[**Money**](Money.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_insurance_shipsurance_balance_get** +> Money v1_insurance_shipsurance_balance_get + +insurance.get_balance + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::InsuranceApi.new + +begin + #insurance.get_balance + result = api_instance.v1_insurance_shipsurance_balance_get + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling InsuranceApi->v1_insurance_shipsurance_balance_get: #{e}" +end +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Money**](Money.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/InsuranceProvider.md b/docs/InsuranceProvider.md new file mode 100755 index 0000000..ad16a2f --- /dev/null +++ b/docs/InsuranceProvider.md @@ -0,0 +1,7 @@ +# ShipEngineApi::InsuranceProvider + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/InternationalOptions.md b/docs/InternationalOptions.md new file mode 100755 index 0000000..56d1ccd --- /dev/null +++ b/docs/InternationalOptions.md @@ -0,0 +1,10 @@ +# ShipEngineApi::InternationalOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contents** | [**Contents**](Contents.md) | | [optional] +**customs_items** | [**Array<CustomsItem>**](CustomsItem.md) | | [optional] +**non_delivery** | [**NonDelivery**](NonDelivery.md) | | [optional] + + diff --git a/docs/Label.md b/docs/Label.md new file mode 100755 index 0000000..cc8f776 --- /dev/null +++ b/docs/Label.md @@ -0,0 +1,26 @@ +# ShipEngineApi::Label + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label_id** | **String** | A string that uniquely identifies the label. This ID is generated by ShipEngine when the label is created. | +**status** | [**LabelStatus**](LabelStatus.md) | | +**shipment_id** | **String** | The shipment that this label is for. ShipEngine can create a shipment for you automatically when you [create a label](https://docs.shipengine.com/docs/quickstart-create-a-label), or you can [create your own shipment](https://docs.shipengine.com/docs/create-a-shipment) and then [use it to print a label](https://docs.shipengine.com/docs/use-a-shipment-to-print-a-label) | +**ship_date** | **DateTime** | The date that the package was (or will be) shippped. ShipEngine will take the day of week into consideration when setting this. For example, if a carrier does not operate on Sundays, then a package that would have shipped on Sunday will ship on Monday instead. | +**created_at** | **DateTime** | The date and time that the label was created in ShipEngine. | +**tracking_number** | **String** | The tracking number for the package. Tracking number formats vary across carriers. | +**is_return_label** | **BOOLEAN** | Indicates whether this is a return label. You may also want to set the `rma_number` so you know what is being returned. | +**rma_number** | **String** | An optional Return Merchandise Authorization number. This field is useful for return labels. You can set it to any string value. | +**is_international** | **BOOLEAN** | Indicates whether this is an international shipment. That is, the originating country and destination country are different. | +**batch_id** | **String** | If this label was created as part of a [batch](https://docs.shipengine.com/docs/using-batches), then this is the unique ID of that batch. | +**carrier_id** | **String** | The unique ID of the [carrier account](https://docs.shipengine.com/docs/setup-a-carrier) that was used to create this label | +**service_code** | **String** | The [carrier service](https://docs.shipengine.com/docs/use-a-specific-service) that will be used to ship the package, such as `fedex_ground`, `usps_first_class_mail`, `flat_rate_envelope`, etc. | +**voided** | **BOOLEAN** | Indicates whether the label has been [voided](https://docs.shipengine.com/docs/void-a-label) | +**voided_at** | **DateTime** | The date and time that the label was [voided](https://docs.shipengine.com/docs/void-a-label), or `null` if the label has not been voided | +**label_format** | [**LabelFormat**](LabelFormat.md) | | +**label_layout** | [**LabelLayout**](LabelLayout.md) | | +**trackable** | **BOOLEAN** | Indicates whether the shipment is trackable, in which case the `tracking_status` field will reflect the current status and each package will have a `tracking_number`. | +**carrier_code** | **String** | The [shipping carrier](https://docs.shipengine.com/docs/setup-a-carrier) who will ship the package, such as `fedex`, `dhl_express`, `stamps_com`, etc. | +**tracking_status** | [**TrackingStatus**](TrackingStatus.md) | | + + diff --git a/docs/LabelFormat.md b/docs/LabelFormat.md new file mode 100755 index 0000000..99745c9 --- /dev/null +++ b/docs/LabelFormat.md @@ -0,0 +1,7 @@ +# ShipEngineApi::LabelFormat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/LabelLayout.md b/docs/LabelLayout.md new file mode 100755 index 0000000..a3ef309 --- /dev/null +++ b/docs/LabelLayout.md @@ -0,0 +1,7 @@ +# ShipEngineApi::LabelLayout + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/LabelMessages.md b/docs/LabelMessages.md new file mode 100755 index 0000000..579c98d --- /dev/null +++ b/docs/LabelMessages.md @@ -0,0 +1,10 @@ +# ShipEngineApi::LabelMessages + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reference1** | **String** | | [optional] +**reference2** | **String** | | [optional] +**reference3** | **String** | | [optional] + + diff --git a/docs/LabelStatus.md b/docs/LabelStatus.md new file mode 100755 index 0000000..06d940b --- /dev/null +++ b/docs/LabelStatus.md @@ -0,0 +1,7 @@ +# ShipEngineApi::LabelStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/LabelsApi.md b/docs/LabelsApi.md new file mode 100755 index 0000000..4c0993f --- /dev/null +++ b/docs/LabelsApi.md @@ -0,0 +1,367 @@ +# ShipEngineApi::LabelsApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v1_labels_by_label_id_get**](LabelsApi.md#v1_labels_by_label_id_get) | **GET** /v1/labels/{label_id} | labels.get_by_id +[**v1_labels_get**](LabelsApi.md#v1_labels_get) | **GET** /v1/labels | Searchforshippinglabelsyou'vecreated +[**v1_labels_rates_by_rate_id_post**](LabelsApi.md#v1_labels_rates_by_rate_id_post) | **POST** /v1/labels/rates/{rate_id} | labels.purchase_label_with_rate +[**v1_labels_shipment_by_shipment_id_post**](LabelsApi.md#v1_labels_shipment_by_shipment_id_post) | **POST** /v1/labels/shipment/{shipment_id} | labels.purchase_label_with_shipment +[**v1_labels_track_by_label_id_get**](LabelsApi.md#v1_labels_track_by_label_id_get) | **GET** /v1/labels/{label_id}/track | labels.track +[**v1_labels_void_by_label_id_put**](LabelsApi.md#v1_labels_void_by_label_id_put) | **PUT** /v1/labels/{label_id}/void | labels.void_label + + +# **v1_labels_by_label_id_get** +> Label v1_labels_by_label_id_get(label_id) + +labels.get_by_id + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::LabelsApi.new + +label_id = 'label_id_example' # String | + + +begin + #labels.get_by_id + result = api_instance.v1_labels_by_label_id_get(label_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling LabelsApi->v1_labels_by_label_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **String**| | + +### Return type + +[**Label**](Label.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_labels_get** +> V1LabelsResponse v1_labels_get(opts) + +Searchforshippinglabelsyou'vecreated + +This endpoint returns a list of labels that you've [created](https://docs.shipengine.com/docs/quickstart-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` > ###### Warning > Test labels (those created with `test_label: true`) are not included in the results. If you've only ever created test labels, then the results will be empty. + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::LabelsApi.new + +opts = { + label_status: 'label_status_example', # String | Only return labels that are currently in the specified status + carrier_id: 'carrier_id_example', # String | Only return labels for a specific [carrier account](https://docs.shipengine.com/docs/setup-a-carrier) + service_code: 'service_code_example', # String | Only return labels for a specific [carrier service](https://docs.shipengine.com/docs/use-a-specific-service) + tracking_number: 'tracking_number_example', # String | Only return labels with a specific tracking number + batch_id: 'batch_id_example', # String | Only return labels that were created in a specific [batch](https://docs.shipengine.com/docs/using-batches) + warehouse_id: 'warehouse_id_example', # String | Only return labels that originate from a specific [warehouse](https://docs.shipengine.com/docs/ship-from-a-warehouse) + created_at_start: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Only return labels that were created on or after a specific date/time + created_at_end: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Only return labels that were created on or before a specific date/time + page: 1, # Integer | Return a specific \"page\" of results. Defaults to the first page. If set to a number that's greater than the number of pages of results, an empty page will be returned. + page_size: 25, # Integer | The number of labels to return per response. Defaults to 25. + sort_dir: 'sort_dir_example', # String | Controls the sort order of the query. Defaults to `desc`. + sort_by: 'created_at' # String | Controls which property the query is sorted by. Defaults to `created_at`. +} + +begin + #Searchforshippinglabelsyou'vecreated + result = api_instance.v1_labels_get(opts) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling LabelsApi->v1_labels_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_status** | **String**| Only return labels that are currently in the specified status | [optional] + **carrier_id** | **String**| Only return labels for a specific [carrier account](https://docs.shipengine.com/docs/setup-a-carrier) | [optional] + **service_code** | **String**| Only return labels for a specific [carrier service](https://docs.shipengine.com/docs/use-a-specific-service) | [optional] + **tracking_number** | **String**| Only return labels with a specific tracking number | [optional] + **batch_id** | **String**| Only return labels that were created in a specific [batch](https://docs.shipengine.com/docs/using-batches) | [optional] + **warehouse_id** | **String**| Only return labels that originate from a specific [warehouse](https://docs.shipengine.com/docs/ship-from-a-warehouse) | [optional] + **created_at_start** | **DateTime**| Only return labels that were created on or after a specific date/time | [optional] + **created_at_end** | **DateTime**| Only return labels that were created on or before a specific date/time | [optional] + **page** | **Integer**| Return a specific \"page\" of results. Defaults to the first page. If set to a number that's greater than the number of pages of results, an empty page will be returned. | [optional] [default to 1] + **page_size** | **Integer**| The number of labels to return per response. Defaults to 25. | [optional] [default to 25] + **sort_dir** | **String**| Controls the sort order of the query. Defaults to `desc`. | [optional] + **sort_by** | **String**| Controls which property the query is sorted by. Defaults to `created_at`. | [optional] [default to created_at] + +### Return type + +[**V1LabelsResponse**](V1LabelsResponse.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_labels_rates_by_rate_id_post** +> Label v1_labels_rates_by_rate_id_post(rate_id, body) + +labels.purchase_label_with_rate + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::LabelsApi.new + +rate_id = 'rate_id_example' # String | + +body = ShipEngineApi::PurchaseLabelWithoutShipmentRequestBody.new # PurchaseLabelWithoutShipmentRequestBody | + + +begin + #labels.purchase_label_with_rate + result = api_instance.v1_labels_rates_by_rate_id_post(rate_id, body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling LabelsApi->v1_labels_rates_by_rate_id_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **rate_id** | **String**| | + **body** | [**PurchaseLabelWithoutShipmentRequestBody**](PurchaseLabelWithoutShipmentRequestBody.md)| | + +### Return type + +[**Label**](Label.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_labels_shipment_by_shipment_id_post** +> Label v1_labels_shipment_by_shipment_id_post(shipment_id, body) + +labels.purchase_label_with_shipment + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::LabelsApi.new + +shipment_id = 'shipment_id_example' # String | + +body = ShipEngineApi::PurchaseLabelWithoutShipmentRequestBody.new # PurchaseLabelWithoutShipmentRequestBody | + + +begin + #labels.purchase_label_with_shipment + result = api_instance.v1_labels_shipment_by_shipment_id_post(shipment_id, body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling LabelsApi->v1_labels_shipment_by_shipment_id_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **shipment_id** | **String**| | + **body** | [**PurchaseLabelWithoutShipmentRequestBody**](PurchaseLabelWithoutShipmentRequestBody.md)| | + +### Return type + +[**Label**](Label.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_labels_track_by_label_id_get** +> TrackingInformationResponseBody v1_labels_track_by_label_id_get(label_id) + +labels.track + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::LabelsApi.new + +label_id = 'label_id_example' # String | + + +begin + #labels.track + result = api_instance.v1_labels_track_by_label_id_get(label_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling LabelsApi->v1_labels_track_by_label_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **String**| | + +### Return type + +[**TrackingInformationResponseBody**](TrackingInformationResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_labels_void_by_label_id_put** +> VoidLabelResponseBody v1_labels_void_by_label_id_put(label_id) + +labels.void_label + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::LabelsApi.new + +label_id = 'label_id_example' # String | + + +begin + #labels.void_label + result = api_instance.v1_labels_void_by_label_id_put(label_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling LabelsApi->v1_labels_void_by_label_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **label_id** | **String**| | + +### Return type + +[**VoidLabelResponseBody**](VoidLabelResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/Last.md b/docs/Last.md new file mode 100755 index 0000000..2dd54b6 --- /dev/null +++ b/docs/Last.md @@ -0,0 +1,8 @@ +# ShipEngineApi::Last + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | | + + diff --git a/docs/Link.md b/docs/Link.md new file mode 100755 index 0000000..ce7dd4c --- /dev/null +++ b/docs/Link.md @@ -0,0 +1,9 @@ +# ShipEngineApi::Link + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | | [optional] +**type** | **String** | | [optional] + + diff --git a/docs/Links.md b/docs/Links.md new file mode 100755 index 0000000..07ca355 --- /dev/null +++ b/docs/Links.md @@ -0,0 +1,11 @@ +# ShipEngineApi::Links + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**first** | [**First**](First.md) | | +**last** | [**Last**](Last.md) | | +**prev** | [**Prev**](Prev.md) | | +**_next** | [**ModelNext**](ModelNext.md) | | + + diff --git a/docs/ListBatchResponseBody.md b/docs/ListBatchResponseBody.md new file mode 100755 index 0000000..4033892 --- /dev/null +++ b/docs/ListBatchResponseBody.md @@ -0,0 +1,12 @@ +# ShipEngineApi::ListBatchResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**batches** | [**Array<Batch>**](Batch.md) | | [optional] +**total** | **Integer** | | [optional] +**page** | **Integer** | | [optional] +**pages** | **Integer** | | [optional] +**links** | [**PaginationLink**](PaginationLink.md) | | [optional] + + diff --git a/docs/ListLabelResponseBody.md b/docs/ListLabelResponseBody.md new file mode 100755 index 0000000..ebfb1af --- /dev/null +++ b/docs/ListLabelResponseBody.md @@ -0,0 +1,12 @@ +# ShipEngineApi::ListLabelResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**labels** | [**Array<Label>**](Label.md) | | [optional] +**total** | **Integer** | | [optional] +**page** | **Integer** | | [optional] +**pages** | **Integer** | | [optional] +**links** | [**PaginationLink**](PaginationLink.md) | | [optional] + + diff --git a/docs/ListManifestsRequestBody.md b/docs/ListManifestsRequestBody.md new file mode 100755 index 0000000..91d5a81 --- /dev/null +++ b/docs/ListManifestsRequestBody.md @@ -0,0 +1,15 @@ +# ShipEngineApi::ListManifestsRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**warehouse_id** | **String** | A string that uniquely identifies the warehouse id | [optional] +**ship_date_start** | **DateTime** | | [optional] +**ship_date_end** | **DateTime** | | [optional] +**created_at_start** | **DateTime** | | [optional] +**created_at_end** | **DateTime** | | [optional] +**carrier_id** | **String** | A string that uniquely identifies the carrier id | [optional] +**page** | **Integer** | | [optional] +**page_size** | **Integer** | | [optional] + + diff --git a/docs/ListManifestsResponseBody.md b/docs/ListManifestsResponseBody.md new file mode 100755 index 0000000..f27752e --- /dev/null +++ b/docs/ListManifestsResponseBody.md @@ -0,0 +1,12 @@ +# ShipEngineApi::ListManifestsResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**manifests** | [**Array<ManifestResponseBody>**](ManifestResponseBody.md) | | [optional] +**total** | **Integer** | | [optional] +**page** | **Integer** | | [optional] +**pages** | **Integer** | | [optional] +**links** | [**PaginationLink**](PaginationLink.md) | | [optional] + + diff --git a/docs/ListShipmentResponseBody.md b/docs/ListShipmentResponseBody.md new file mode 100755 index 0000000..7f3a0a6 --- /dev/null +++ b/docs/ListShipmentResponseBody.md @@ -0,0 +1,12 @@ +# ShipEngineApi::ListShipmentResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shipments** | [**Array<Shipment>**](Shipment.md) | | [optional] +**total** | **Integer** | | [optional] +**page** | **Integer** | | [optional] +**pages** | **Integer** | | [optional] +**links** | [**PaginationLink**](PaginationLink.md) | | [optional] + + diff --git a/docs/ListTagResponseBody.md b/docs/ListTagResponseBody.md new file mode 100755 index 0000000..c49f4b6 --- /dev/null +++ b/docs/ListTagResponseBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::ListTagResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tags** | [**Array<TagResponseBody>**](TagResponseBody.md) | | [optional] + + diff --git a/docs/MagentoAccountInformationRequestBody.md b/docs/MagentoAccountInformationRequestBody.md new file mode 100755 index 0000000..b676922 --- /dev/null +++ b/docs/MagentoAccountInformationRequestBody.md @@ -0,0 +1,12 @@ +# ShipEngineApi::MagentoAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**store_name** | **String** | | [optional] +**store_url** | **String** | | [optional] +**username** | **String** | | [optional] +**password** | **String** | | [optional] +**settings** | [**MagentoAccountSettingsRequestBody**](MagentoAccountSettingsRequestBody.md) | | [optional] + + diff --git a/docs/MagentoAccountSettingsRequestBody.md b/docs/MagentoAccountSettingsRequestBody.md new file mode 100755 index 0000000..9722e21 --- /dev/null +++ b/docs/MagentoAccountSettingsRequestBody.md @@ -0,0 +1,15 @@ +# ShipEngineApi::MagentoAccountSettingsRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**automatically_import_sales_orders** | **BOOLEAN** | | [optional] +**unpaid_status** | **Array<String>** | | [optional] +**paid_status** | **Array<String>** | | [optional] +**shipped_status** | **Array<String>** | | [optional] +**cancelled_status** | **Array<String>** | | [optional] +**hold_status** | **Array<String>** | | [optional] +**warehouse_location** | **Array<String>** | | [optional] +**capture_payment** | [**CapturePayment**](CapturePayment.md) | | [optional] + + diff --git a/docs/MailInnovationsEndorsement.md b/docs/MailInnovationsEndorsement.md new file mode 100755 index 0000000..e546cfc --- /dev/null +++ b/docs/MailInnovationsEndorsement.md @@ -0,0 +1,7 @@ +# ShipEngineApi::MailInnovationsEndorsement + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/ManifestResponseBody.md b/docs/ManifestResponseBody.md new file mode 100755 index 0000000..ed6f9b6 --- /dev/null +++ b/docs/ManifestResponseBody.md @@ -0,0 +1,16 @@ +# ShipEngineApi::ManifestResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**manifest_id** | **String** | A string that uniquely identifies the manifest id | [optional] +**form_id** | **String** | A string that uniquely identifies the form id | [optional] +**created_at** | **DateTime** | | [optional] +**ship_date** | **DateTime** | | [optional] +**shipments** | **Integer** | | [optional] +**warehouse_id** | **String** | A string that uniquely identifies the warehouse id | [optional] +**submission_id** | **String** | A string that uniquely identifies the submission id | [optional] +**carrier_id** | **String** | A string that uniquely identifies the carrier id | [optional] +**manifest_download** | [**Link**](Link.md) | | [optional] + + diff --git a/docs/ManifestsApi.md b/docs/ManifestsApi.md new file mode 100755 index 0000000..31eeb41 --- /dev/null +++ b/docs/ManifestsApi.md @@ -0,0 +1,188 @@ +# ShipEngineApi::ManifestsApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v1_manifests_by_manifest_id_get**](ManifestsApi.md#v1_manifests_by_manifest_id_get) | **GET** /v1/manifests/{manifest_id} | manifests.get_by_id +[**v1_manifests_get**](ManifestsApi.md#v1_manifests_get) | **GET** /v1/manifests | manifests.find +[**v1_manifests_post**](ManifestsApi.md#v1_manifests_post) | **POST** /v1/manifests | manifests.create + + +# **v1_manifests_by_manifest_id_get** +> ManifestResponseBody v1_manifests_by_manifest_id_get(manifest_id) + +manifests.get_by_id + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::ManifestsApi.new + +manifest_id = 'manifest_id_example' # String | + + +begin + #manifests.get_by_id + result = api_instance.v1_manifests_by_manifest_id_get(manifest_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling ManifestsApi->v1_manifests_by_manifest_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **manifest_id** | **String**| | + +### Return type + +[**ManifestResponseBody**](ManifestResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_manifests_get** +> ListManifestsResponseBody v1_manifests_get(opts) + +manifests.find + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::ManifestsApi.new + +opts = { + warehouse_id: 'warehouse_id_example', # String | + ship_date_start: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | + ship_date_end: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | + created_at_start: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | + created_at_end: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | + carrier_id: 'carrier_id_example', # String | + page: 56, # Integer | + page_size: 56 # Integer | +} + +begin + #manifests.find + result = api_instance.v1_manifests_get(opts) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling ManifestsApi->v1_manifests_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **warehouse_id** | **String**| | [optional] + **ship_date_start** | **DateTime**| | [optional] + **ship_date_end** | **DateTime**| | [optional] + **created_at_start** | **DateTime**| | [optional] + **created_at_end** | **DateTime**| | [optional] + **carrier_id** | **String**| | [optional] + **page** | **Integer**| | [optional] + **page_size** | **Integer**| | [optional] + +### Return type + +[**ListManifestsResponseBody**](ListManifestsResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_manifests_post** +> ManifestResponseBody v1_manifests_post(body) + +manifests.create + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::ManifestsApi.new + +body = ShipEngineApi::CreateManifestRequestBody.new # CreateManifestRequestBody | + + +begin + #manifests.create + result = api_instance.v1_manifests_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling ManifestsApi->v1_manifests_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CreateManifestRequestBody**](CreateManifestRequestBody.md)| | + +### Return type + +[**ManifestResponseBody**](ManifestResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/MarketplaceAccountsApi.md b/docs/MarketplaceAccountsApi.md new file mode 100755 index 0000000..e283f7a --- /dev/null +++ b/docs/MarketplaceAccountsApi.md @@ -0,0 +1,1652 @@ +# ShipEngineApi::MarketplaceAccountsApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v_beta_connections_marketplaces_amazon_deactivate_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_amazon_deactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/amazon/{store_id}/deactivate | amazon_account.deactivate +[**v_beta_connections_marketplaces_amazon_post**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_amazon_post) | **POST** /v-beta/connections/marketplaces/amazon | amazon_account.connect +[**v_beta_connections_marketplaces_amazon_reactivate_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_amazon_reactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/amazon/{store_id}/reactivate | amazon_account.reactivate +[**v_beta_connections_marketplaces_amazon_settings_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_amazon_settings_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/amazon/{store_id}/settings | amazon_account.update_settings +[**v_beta_connections_marketplaces_amazon_test_by_store_id_get**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_amazon_test_by_store_id_get) | **GET** /v-beta/connections/marketplaces/amazon/{store_id}/test | amazon_account.test +[**v_beta_connections_marketplaces_channeladvisor_deactivate_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_channeladvisor_deactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/channeladvisor/{store_id}/deactivate | channel_advisor_account.deactivate +[**v_beta_connections_marketplaces_channeladvisor_post**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_channeladvisor_post) | **POST** /v-beta/connections/marketplaces/channeladvisor | channel_advisor_account.connect +[**v_beta_connections_marketplaces_channeladvisor_reactivate_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_channeladvisor_reactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/channeladvisor/{store_id}/reactivate | channel_advisor_account.reactivate +[**v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/channeladvisor/{store_id}/settings | channel_advisor_account.update_settings +[**v_beta_connections_marketplaces_channeladvisor_test_by_store_id_get**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_channeladvisor_test_by_store_id_get) | **GET** /v-beta/connections/marketplaces/channeladvisor/{store_id}/test | channel_advisor_account.test +[**v_beta_connections_marketplaces_ebay_access_token_post**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_ebay_access_token_post) | **POST** /v-beta/connections/marketplaces/ebay/access_token | ebay_account.connect_access_token +[**v_beta_connections_marketplaces_ebay_deactivate_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_ebay_deactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/ebay/{store_id}/deactivate | ebay_account.deactivate +[**v_beta_connections_marketplaces_ebay_reactivate_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_ebay_reactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/ebay/{store_id}/reactivate | ebay_account.reactivate +[**v_beta_connections_marketplaces_ebay_settings_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_ebay_settings_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/ebay/{store_id}/settings | ebay_account.update_settings +[**v_beta_connections_marketplaces_ebay_test_by_store_id_get**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_ebay_test_by_store_id_get) | **GET** /v-beta/connections/marketplaces/ebay/{store_id}/test | ebay_account.test +[**v_beta_connections_marketplaces_etsy_access_token_post**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_etsy_access_token_post) | **POST** /v-beta/connections/marketplaces/etsy/access_token | etsy_account.connect +[**v_beta_connections_marketplaces_etsy_deactivate_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_etsy_deactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/etsy/{store_id}/deactivate | etsy_account.deactivate +[**v_beta_connections_marketplaces_etsy_reactivate_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_etsy_reactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/etsy/{store_id}/reactivate | etsy_account.reactivate +[**v_beta_connections_marketplaces_etsy_settings_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_etsy_settings_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/etsy/{store_id}/settings | etsy_account.update_settings +[**v_beta_connections_marketplaces_etsy_test_by_store_id_get**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_etsy_test_by_store_id_get) | **GET** /v-beta/connections/marketplaces/etsy/{store_id}/test | etsy_account.test +[**v_beta_connections_marketplaces_magento_deactivate_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_magento_deactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/magento/{store_id}/deactivate | magento_account.deactivate +[**v_beta_connections_marketplaces_magento_post**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_magento_post) | **POST** /v-beta/connections/marketplaces/magento | magento_account.connect +[**v_beta_connections_marketplaces_magento_reactivate_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_magento_reactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/magento/{store_id}/reactivate | magento_account.reactivate +[**v_beta_connections_marketplaces_magento_settings_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_magento_settings_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/magento/{store_id}/settings | magento_account.update_settings +[**v_beta_connections_marketplaces_magento_test_by_store_id_get**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_magento_test_by_store_id_get) | **GET** /v-beta/connections/marketplaces/magento/{store_id}/test | magento_account.test +[**v_beta_connections_marketplaces_shopify_access_token_post**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_shopify_access_token_post) | **POST** /v-beta/connections/marketplaces/shopify/access_token | shopify_account.connect_access_token +[**v_beta_connections_marketplaces_shopify_deactivate_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_shopify_deactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/shopify/{store_id}/deactivate | shopify_account.deactivate +[**v_beta_connections_marketplaces_shopify_reactivate_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_shopify_reactivate_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/shopify/{store_id}/reactivate | shopify_account.reactivate +[**v_beta_connections_marketplaces_shopify_settings_by_store_id_put**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_shopify_settings_by_store_id_put) | **PUT** /v-beta/connections/marketplaces/shopify/{store_id}/settings | shopify_account.update_settings +[**v_beta_connections_marketplaces_shopify_test_by_store_id_get**](MarketplaceAccountsApi.md#v_beta_connections_marketplaces_shopify_test_by_store_id_get) | **GET** /v-beta/connections/marketplaces/shopify/{store_id}/test | shopify_account.test + + +# **v_beta_connections_marketplaces_amazon_deactivate_by_store_id_put** +> v_beta_connections_marketplaces_amazon_deactivate_by_store_id_put(store_id) + +amazon_account.deactivate + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #amazon_account.deactivate + api_instance.v_beta_connections_marketplaces_amazon_deactivate_by_store_id_put(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_amazon_deactivate_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_amazon_post** +> ConnectMarketplaceResponseBody v_beta_connections_marketplaces_amazon_post(body) + +amazon_account.connect + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +body = ShipEngineApi::AmazonAccountInformationRequestBody.new # AmazonAccountInformationRequestBody | + + +begin + #amazon_account.connect + result = api_instance.v_beta_connections_marketplaces_amazon_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_amazon_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AmazonAccountInformationRequestBody**](AmazonAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectMarketplaceResponseBody**](ConnectMarketplaceResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_amazon_reactivate_by_store_id_put** +> v_beta_connections_marketplaces_amazon_reactivate_by_store_id_put(store_id) + +amazon_account.reactivate + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #amazon_account.reactivate + api_instance.v_beta_connections_marketplaces_amazon_reactivate_by_store_id_put(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_amazon_reactivate_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_amazon_settings_by_store_id_put** +> v_beta_connections_marketplaces_amazon_settings_by_store_id_put(store_id, body) + +amazon_account.update_settings + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + +body = ShipEngineApi::DefaultAccountSettingsRequestBody.new # DefaultAccountSettingsRequestBody | + + +begin + #amazon_account.update_settings + api_instance.v_beta_connections_marketplaces_amazon_settings_by_store_id_put(store_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_amazon_settings_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + **body** | [**DefaultAccountSettingsRequestBody**](DefaultAccountSettingsRequestBody.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_amazon_test_by_store_id_get** +> v_beta_connections_marketplaces_amazon_test_by_store_id_get(store_id) + +amazon_account.test + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #amazon_account.test + api_instance.v_beta_connections_marketplaces_amazon_test_by_store_id_get(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_amazon_test_by_store_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_channeladvisor_deactivate_by_store_id_put** +> v_beta_connections_marketplaces_channeladvisor_deactivate_by_store_id_put(store_id) + +channel_advisor_account.deactivate + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #channel_advisor_account.deactivate + api_instance.v_beta_connections_marketplaces_channeladvisor_deactivate_by_store_id_put(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_channeladvisor_deactivate_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_channeladvisor_post** +> ConnectMarketplaceResponseBody v_beta_connections_marketplaces_channeladvisor_post(body) + +channel_advisor_account.connect + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +body = ShipEngineApi::ChannelAdvisorAccountInformationRequestBody.new # ChannelAdvisorAccountInformationRequestBody | + + +begin + #channel_advisor_account.connect + result = api_instance.v_beta_connections_marketplaces_channeladvisor_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_channeladvisor_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ChannelAdvisorAccountInformationRequestBody**](ChannelAdvisorAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectMarketplaceResponseBody**](ConnectMarketplaceResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_channeladvisor_reactivate_by_store_id_put** +> v_beta_connections_marketplaces_channeladvisor_reactivate_by_store_id_put(store_id) + +channel_advisor_account.reactivate + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #channel_advisor_account.reactivate + api_instance.v_beta_connections_marketplaces_channeladvisor_reactivate_by_store_id_put(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_channeladvisor_reactivate_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put** +> v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put(store_id, body) + +channel_advisor_account.update_settings + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + +body = ShipEngineApi::DefaultAccountSettingsRequestBody.new # DefaultAccountSettingsRequestBody | + + +begin + #channel_advisor_account.update_settings + api_instance.v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put(store_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + **body** | [**DefaultAccountSettingsRequestBody**](DefaultAccountSettingsRequestBody.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_channeladvisor_test_by_store_id_get** +> v_beta_connections_marketplaces_channeladvisor_test_by_store_id_get(store_id) + +channel_advisor_account.test + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #channel_advisor_account.test + api_instance.v_beta_connections_marketplaces_channeladvisor_test_by_store_id_get(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_channeladvisor_test_by_store_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_ebay_access_token_post** +> ConnectMarketplaceResponseBody v_beta_connections_marketplaces_ebay_access_token_post(body) + +ebay_account.connect_access_token + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +body = ShipEngineApi::EbayAccessTokenRequestBody.new # EbayAccessTokenRequestBody | + + +begin + #ebay_account.connect_access_token + result = api_instance.v_beta_connections_marketplaces_ebay_access_token_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_ebay_access_token_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**EbayAccessTokenRequestBody**](EbayAccessTokenRequestBody.md)| | + +### Return type + +[**ConnectMarketplaceResponseBody**](ConnectMarketplaceResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_ebay_deactivate_by_store_id_put** +> v_beta_connections_marketplaces_ebay_deactivate_by_store_id_put(store_id) + +ebay_account.deactivate + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #ebay_account.deactivate + api_instance.v_beta_connections_marketplaces_ebay_deactivate_by_store_id_put(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_ebay_deactivate_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_ebay_reactivate_by_store_id_put** +> v_beta_connections_marketplaces_ebay_reactivate_by_store_id_put(store_id) + +ebay_account.reactivate + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #ebay_account.reactivate + api_instance.v_beta_connections_marketplaces_ebay_reactivate_by_store_id_put(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_ebay_reactivate_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_ebay_settings_by_store_id_put** +> v_beta_connections_marketplaces_ebay_settings_by_store_id_put(store_id, body) + +ebay_account.update_settings + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + +body = ShipEngineApi::DefaultAccountSettingsRequestBody.new # DefaultAccountSettingsRequestBody | + + +begin + #ebay_account.update_settings + api_instance.v_beta_connections_marketplaces_ebay_settings_by_store_id_put(store_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_ebay_settings_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + **body** | [**DefaultAccountSettingsRequestBody**](DefaultAccountSettingsRequestBody.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_ebay_test_by_store_id_get** +> v_beta_connections_marketplaces_ebay_test_by_store_id_get(store_id) + +ebay_account.test + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #ebay_account.test + api_instance.v_beta_connections_marketplaces_ebay_test_by_store_id_get(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_ebay_test_by_store_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_etsy_access_token_post** +> ConnectMarketplaceResponseBody v_beta_connections_marketplaces_etsy_access_token_post(body) + +etsy_account.connect + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +body = ShipEngineApi::EtsyAccessTokenRequestBody.new # EtsyAccessTokenRequestBody | + + +begin + #etsy_account.connect + result = api_instance.v_beta_connections_marketplaces_etsy_access_token_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_etsy_access_token_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**EtsyAccessTokenRequestBody**](EtsyAccessTokenRequestBody.md)| | + +### Return type + +[**ConnectMarketplaceResponseBody**](ConnectMarketplaceResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_etsy_deactivate_by_store_id_put** +> v_beta_connections_marketplaces_etsy_deactivate_by_store_id_put(store_id) + +etsy_account.deactivate + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #etsy_account.deactivate + api_instance.v_beta_connections_marketplaces_etsy_deactivate_by_store_id_put(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_etsy_deactivate_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_etsy_reactivate_by_store_id_put** +> v_beta_connections_marketplaces_etsy_reactivate_by_store_id_put(store_id) + +etsy_account.reactivate + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #etsy_account.reactivate + api_instance.v_beta_connections_marketplaces_etsy_reactivate_by_store_id_put(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_etsy_reactivate_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_etsy_settings_by_store_id_put** +> v_beta_connections_marketplaces_etsy_settings_by_store_id_put(store_id, body) + +etsy_account.update_settings + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + +body = ShipEngineApi::DefaultAccountSettingsRequestBody.new # DefaultAccountSettingsRequestBody | + + +begin + #etsy_account.update_settings + api_instance.v_beta_connections_marketplaces_etsy_settings_by_store_id_put(store_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_etsy_settings_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + **body** | [**DefaultAccountSettingsRequestBody**](DefaultAccountSettingsRequestBody.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_etsy_test_by_store_id_get** +> v_beta_connections_marketplaces_etsy_test_by_store_id_get(store_id) + +etsy_account.test + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #etsy_account.test + api_instance.v_beta_connections_marketplaces_etsy_test_by_store_id_get(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_etsy_test_by_store_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_magento_deactivate_by_store_id_put** +> v_beta_connections_marketplaces_magento_deactivate_by_store_id_put(store_id) + +magento_account.deactivate + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #magento_account.deactivate + api_instance.v_beta_connections_marketplaces_magento_deactivate_by_store_id_put(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_magento_deactivate_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_magento_post** +> ConnectMarketplaceResponseBody v_beta_connections_marketplaces_magento_post(body) + +magento_account.connect + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +body = ShipEngineApi::MagentoAccountInformationRequestBody.new # MagentoAccountInformationRequestBody | + + +begin + #magento_account.connect + result = api_instance.v_beta_connections_marketplaces_magento_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_magento_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**MagentoAccountInformationRequestBody**](MagentoAccountInformationRequestBody.md)| | + +### Return type + +[**ConnectMarketplaceResponseBody**](ConnectMarketplaceResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_magento_reactivate_by_store_id_put** +> v_beta_connections_marketplaces_magento_reactivate_by_store_id_put(store_id) + +magento_account.reactivate + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #magento_account.reactivate + api_instance.v_beta_connections_marketplaces_magento_reactivate_by_store_id_put(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_magento_reactivate_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_magento_settings_by_store_id_put** +> v_beta_connections_marketplaces_magento_settings_by_store_id_put(store_id, body) + +magento_account.update_settings + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + +body = ShipEngineApi::DefaultAccountSettingsRequestBody.new # DefaultAccountSettingsRequestBody | + + +begin + #magento_account.update_settings + api_instance.v_beta_connections_marketplaces_magento_settings_by_store_id_put(store_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_magento_settings_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + **body** | [**DefaultAccountSettingsRequestBody**](DefaultAccountSettingsRequestBody.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_magento_test_by_store_id_get** +> v_beta_connections_marketplaces_magento_test_by_store_id_get(store_id) + +magento_account.test + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #magento_account.test + api_instance.v_beta_connections_marketplaces_magento_test_by_store_id_get(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_magento_test_by_store_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_shopify_access_token_post** +> ConnectMarketplaceResponseBody v_beta_connections_marketplaces_shopify_access_token_post(body) + +shopify_account.connect_access_token + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +body = ShipEngineApi::ShopifyAccessTokenRequestBody.new # ShopifyAccessTokenRequestBody | + + +begin + #shopify_account.connect_access_token + result = api_instance.v_beta_connections_marketplaces_shopify_access_token_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_shopify_access_token_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ShopifyAccessTokenRequestBody**](ShopifyAccessTokenRequestBody.md)| | + +### Return type + +[**ConnectMarketplaceResponseBody**](ConnectMarketplaceResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_shopify_deactivate_by_store_id_put** +> v_beta_connections_marketplaces_shopify_deactivate_by_store_id_put(store_id) + +shopify_account.deactivate + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #shopify_account.deactivate + api_instance.v_beta_connections_marketplaces_shopify_deactivate_by_store_id_put(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_shopify_deactivate_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_shopify_reactivate_by_store_id_put** +> v_beta_connections_marketplaces_shopify_reactivate_by_store_id_put(store_id) + +shopify_account.reactivate + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #shopify_account.reactivate + api_instance.v_beta_connections_marketplaces_shopify_reactivate_by_store_id_put(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_shopify_reactivate_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_shopify_settings_by_store_id_put** +> v_beta_connections_marketplaces_shopify_settings_by_store_id_put(store_id, body) + +shopify_account.update_settings + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + +body = ShipEngineApi::DefaultAccountSettingsRequestBody.new # DefaultAccountSettingsRequestBody | + + +begin + #shopify_account.update_settings + api_instance.v_beta_connections_marketplaces_shopify_settings_by_store_id_put(store_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_shopify_settings_by_store_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + **body** | [**DefaultAccountSettingsRequestBody**](DefaultAccountSettingsRequestBody.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v_beta_connections_marketplaces_shopify_test_by_store_id_get** +> v_beta_connections_marketplaces_shopify_test_by_store_id_get(store_id) + +shopify_account.test + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::MarketplaceAccountsApi.new + +store_id = 'store_id_example' # String | + + +begin + #shopify_account.test + api_instance.v_beta_connections_marketplaces_shopify_test_by_store_id_get(store_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling MarketplaceAccountsApi->v_beta_connections_marketplaces_shopify_test_by_store_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **store_id** | [**String**](.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/ModelNext.md b/docs/ModelNext.md new file mode 100755 index 0000000..15087df --- /dev/null +++ b/docs/ModelNext.md @@ -0,0 +1,8 @@ +# ShipEngineApi::ModelNext + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | | [optional] + + diff --git a/docs/ModifyBatchRequestBody.md b/docs/ModifyBatchRequestBody.md new file mode 100755 index 0000000..73429d0 --- /dev/null +++ b/docs/ModifyBatchRequestBody.md @@ -0,0 +1,9 @@ +# ShipEngineApi::ModifyBatchRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shipment_ids** | **Array<String>** | | [optional] +**rate_ids** | **Array<String>** | | [optional] + + diff --git a/docs/Money.md b/docs/Money.md new file mode 100755 index 0000000..b50542c --- /dev/null +++ b/docs/Money.md @@ -0,0 +1,9 @@ +# ShipEngineApi::Money + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | [**Currency**](Currency.md) | | [optional] +**amount** | **Float** | | [optional] + + diff --git a/docs/NewgisticsAccountInformationRequestBody.md b/docs/NewgisticsAccountInformationRequestBody.md new file mode 100755 index 0000000..4dffe63 --- /dev/null +++ b/docs/NewgisticsAccountInformationRequestBody.md @@ -0,0 +1,11 @@ +# ShipEngineApi::NewgisticsAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**merchant_id** | **Integer** | | [optional] +**mailer_id** | **Integer** | | [optional] +**induction_site** | **String** | | [optional] +**nickname** | **String** | | [optional] + + diff --git a/docs/NewgisticsAccountSettingsRequestBody.md b/docs/NewgisticsAccountSettingsRequestBody.md new file mode 100755 index 0000000..7355aa6 --- /dev/null +++ b/docs/NewgisticsAccountSettingsRequestBody.md @@ -0,0 +1,9 @@ +# ShipEngineApi::NewgisticsAccountSettingsRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**include_barcode_with_order_number** | **BOOLEAN** | | [optional] +**receive_email_on_manifest_processing** | **BOOLEAN** | | [optional] + + diff --git a/docs/NonDelivery.md b/docs/NonDelivery.md new file mode 100755 index 0000000..5ec7f3e --- /dev/null +++ b/docs/NonDelivery.md @@ -0,0 +1,7 @@ +# ShipEngineApi::NonDelivery + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/OntracAccountInformationRequestBody.md b/docs/OntracAccountInformationRequestBody.md new file mode 100755 index 0000000..002d756 --- /dev/null +++ b/docs/OntracAccountInformationRequestBody.md @@ -0,0 +1,10 @@ +# ShipEngineApi::OntracAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**account_number** | **String** | | [optional] +**password** | **String** | | [optional] + + diff --git a/docs/Package.md b/docs/Package.md new file mode 100755 index 0000000..a16a99e --- /dev/null +++ b/docs/Package.md @@ -0,0 +1,12 @@ +# ShipEngineApi::Package + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**package_id** | **String** | A string that uniquely identifies the package id | [optional] +**package_code** | **String** | | [optional] +**name** | **String** | | +**dimensions** | [**Dimensions**](Dimensions.md) | | [optional] +**description** | **String** | | [optional] + + diff --git a/docs/PackageListResponseBody.md b/docs/PackageListResponseBody.md new file mode 100755 index 0000000..b29970f --- /dev/null +++ b/docs/PackageListResponseBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::PackageListResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**packages** | [**Array<Package>**](Package.md) | | [optional] + + diff --git a/docs/PackagesApi.md b/docs/PackagesApi.md new file mode 100755 index 0000000..aa35072 --- /dev/null +++ b/docs/PackagesApi.md @@ -0,0 +1,278 @@ +# ShipEngineApi::PackagesApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v1_packages_by_package_id_delete**](PackagesApi.md#v1_packages_by_package_id_delete) | **DELETE** /v1/packages/{package_id} | packages.delete +[**v1_packages_by_package_id_get**](PackagesApi.md#v1_packages_by_package_id_get) | **GET** /v1/packages/{package_id} | packages.get_by_id +[**v1_packages_by_package_id_put**](PackagesApi.md#v1_packages_by_package_id_put) | **PUT** /v1/packages/{package_id} | packages.update +[**v1_packages_get**](PackagesApi.md#v1_packages_get) | **GET** /v1/packages | packages.find +[**v1_packages_post**](PackagesApi.md#v1_packages_post) | **POST** /v1/packages | packages.create + + +# **v1_packages_by_package_id_delete** +> v1_packages_by_package_id_delete(package_id) + +packages.delete + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::PackagesApi.new + +package_id = 'package_id_example' # String | + + +begin + #packages.delete + api_instance.v1_packages_by_package_id_delete(package_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling PackagesApi->v1_packages_by_package_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **package_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_packages_by_package_id_get** +> Package v1_packages_by_package_id_get(package_id) + +packages.get_by_id + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::PackagesApi.new + +package_id = 'package_id_example' # String | + + +begin + #packages.get_by_id + result = api_instance.v1_packages_by_package_id_get(package_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling PackagesApi->v1_packages_by_package_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **package_id** | **String**| | + +### Return type + +[**Package**](Package.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_packages_by_package_id_put** +> v1_packages_by_package_id_put(package_id, body) + +packages.update + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::PackagesApi.new + +package_id = 'package_id_example' # String | + +body = ShipEngineApi::Package.new # Package | + + +begin + #packages.update + api_instance.v1_packages_by_package_id_put(package_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling PackagesApi->v1_packages_by_package_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **package_id** | **String**| | + **body** | [**Package**](Package.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_packages_get** +> PackageListResponseBody v1_packages_get + +packages.find + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::PackagesApi.new + +begin + #packages.find + result = api_instance.v1_packages_get + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling PackagesApi->v1_packages_get: #{e}" +end +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**PackageListResponseBody**](PackageListResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_packages_post** +> Package v1_packages_post(body) + +packages.create + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::PackagesApi.new + +body = ShipEngineApi::Package.new # Package | + + +begin + #packages.create + result = api_instance.v1_packages_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling PackagesApi->v1_packages_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Package**](Package.md)| | + +### Return type + +[**Package**](Package.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/PagedListResponseBody.md b/docs/PagedListResponseBody.md new file mode 100755 index 0000000..cbe4fa1 --- /dev/null +++ b/docs/PagedListResponseBody.md @@ -0,0 +1,11 @@ +# ShipEngineApi::PagedListResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **Integer** | The total number of items across all pages of results | +**page** | **Integer** | The current page number of results. For example, if there are 80 results, and the page size is 25, then `page` could be 1, 2, 3, or 4. The first three pages would contain 25 items each, and the fourth page would contain the five remaining items. | +**pages** | **Integer** | The total number of pages of results. For example, if there are 80 results, and the page size is 25, then `pages` would be 4. The first three pages would contain 25 items each, and the fourth page would contain the five remaining items. If there are no results, then `pages` will be zero. | +**links** | [**Links**](Links.md) | | + + diff --git a/docs/PaginationLink.md b/docs/PaginationLink.md new file mode 100755 index 0000000..5b9ffa2 --- /dev/null +++ b/docs/PaginationLink.md @@ -0,0 +1,13 @@ +# ShipEngineApi::PaginationLink + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**first** | [**Link**](Link.md) | | [optional] +**last** | [**Link**](Link.md) | | [optional] +**prev** | [**Link**](Link.md) | | [optional] +**_next** | [**Link**](Link.md) | | [optional] +**href** | **String** | | [optional] +**type** | **String** | | [optional] + + diff --git a/docs/Prev.md b/docs/Prev.md new file mode 100755 index 0000000..4ed0318 --- /dev/null +++ b/docs/Prev.md @@ -0,0 +1,8 @@ +# ShipEngineApi::Prev + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **String** | | [optional] + + diff --git a/docs/ProcessBatchRequestBody.md b/docs/ProcessBatchRequestBody.md new file mode 100755 index 0000000..440f349 --- /dev/null +++ b/docs/ProcessBatchRequestBody.md @@ -0,0 +1,10 @@ +# ShipEngineApi::ProcessBatchRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ship_date** | **DateTime** | | [optional] +**label_layout** | **String** | | [optional] +**label_format** | [**LabelFormat**](LabelFormat.md) | | [optional] + + diff --git a/docs/ProviderError.md b/docs/ProviderError.md new file mode 100755 index 0000000..5ec5362 --- /dev/null +++ b/docs/ProviderError.md @@ -0,0 +1,9 @@ +# ShipEngineApi::ProviderError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**carrier_id** | **String** | A string that uniquely identifies the carrier id | [optional] +**message** | **String** | | [optional] + + diff --git a/docs/PurchaseLabelRequestBody.md b/docs/PurchaseLabelRequestBody.md new file mode 100755 index 0000000..cae9166 --- /dev/null +++ b/docs/PurchaseLabelRequestBody.md @@ -0,0 +1,14 @@ +# ShipEngineApi::PurchaseLabelRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shipment** | [**Shipment**](Shipment.md) | | [optional] +**is_return_label** | **BOOLEAN** | | [optional] +**rma_number** | **String** | | [optional] +**test_label** | **BOOLEAN** | | [optional] +**validate_address** | [**ValidateAddress**](ValidateAddress.md) | | [optional] +**label_layout** | **String** | | [optional] +**label_format** | [**LabelFormat**](LabelFormat.md) | | [optional] + + diff --git a/docs/PurchaseLabelWithoutShipmentRequestBody.md b/docs/PurchaseLabelWithoutShipmentRequestBody.md new file mode 100755 index 0000000..f932919 --- /dev/null +++ b/docs/PurchaseLabelWithoutShipmentRequestBody.md @@ -0,0 +1,11 @@ +# ShipEngineApi::PurchaseLabelWithoutShipmentRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**test_label** | **BOOLEAN** | | [optional] +**validate_address** | [**ValidateAddress**](ValidateAddress.md) | | [optional] +**label_layout** | **String** | | [optional] +**label_format** | [**LabelFormat**](LabelFormat.md) | | [optional] + + diff --git a/docs/Rate.md b/docs/Rate.md new file mode 100755 index 0000000..ab518d6 --- /dev/null +++ b/docs/Rate.md @@ -0,0 +1,31 @@ +# ShipEngineApi::Rate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rate_id** | **String** | A string that uniquely identifies the rate id | [optional] +**rate_type** | [**RateType**](RateType.md) | | [optional] +**carrier_id** | **String** | A string that uniquely identifies the carrier id | [optional] +**shipping_amount** | [**Money**](Money.md) | | [optional] +**insurance_amount** | [**Money**](Money.md) | | [optional] +**confirmation_amount** | [**Money**](Money.md) | | [optional] +**other_amount** | [**Money**](Money.md) | | [optional] +**zone** | **Integer** | | [optional] +**package_type** | **String** | | [optional] +**delivery_days** | **Integer** | | [optional] +**guaranteed_service** | **BOOLEAN** | | [optional] +**estimated_delivery_date** | **DateTime** | | [optional] +**carrier_delivery_days** | **String** | | [optional] +**ship_date** | **DateTime** | | [optional] +**negotiated_rate** | **BOOLEAN** | | [optional] +**service_type** | **String** | | [optional] +**service_code** | **String** | | [optional] +**trackable** | **BOOLEAN** | | [optional] +**carrier_code** | **String** | | [optional] +**carrier_nickname** | **String** | | [optional] +**carrier_friendly_name** | **String** | | [optional] +**validation_status** | [**ValidationStatus**](ValidationStatus.md) | | [optional] +**warning_messages** | **Array<String>** | | [optional] +**error_messages** | **Array<String>** | | [optional] + + diff --git a/docs/RateEstimateRequestBody.md b/docs/RateEstimateRequestBody.md new file mode 100755 index 0000000..027a8b7 --- /dev/null +++ b/docs/RateEstimateRequestBody.md @@ -0,0 +1,20 @@ +# ShipEngineApi::RateEstimateRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**carrier_id** | **String** | A string that uniquely identifies the carrier id | [optional] +**carrier_ids** | **Array<String>** | | [optional] +**from_country_code** | **String** | | [optional] +**from_postal_code** | **String** | | [optional] +**to_country_code** | **String** | | [optional] +**to_postal_code** | **String** | | [optional] +**to_city_locality** | **String** | | [optional] +**to_state_province** | **String** | | [optional] +**weight** | [**Weight**](Weight.md) | | [optional] +**dimensions** | [**Dimensions**](Dimensions.md) | | [optional] +**confirmation** | [**Confirmation**](Confirmation.md) | | [optional] +**address_residential_indicator** | [**AddressResidentialIndicator**](AddressResidentialIndicator.md) | | [optional] +**ship_date** | **DateTime** | | [optional] + + diff --git a/docs/RateRequestBody.md b/docs/RateRequestBody.md new file mode 100755 index 0000000..b8c50a0 --- /dev/null +++ b/docs/RateRequestBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::RateRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**carrier_ids** | **Array<String>** | | [optional] + + diff --git a/docs/RateResponseBody.md b/docs/RateResponseBody.md new file mode 100755 index 0000000..88c2103 --- /dev/null +++ b/docs/RateResponseBody.md @@ -0,0 +1,14 @@ +# ShipEngineApi::RateResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rates** | [**Array<Rate>**](Rate.md) | | [optional] +**invalid_rates** | [**Array<Rate>**](Rate.md) | | [optional] +**rate_request_id** | **String** | A string that uniquely identifies the rate request id | [optional] +**shipment_id** | **String** | A string that uniquely identifies the shipment id | [optional] +**created_at** | **DateTime** | | [optional] +**status** | [**RateResponseStatus**](RateResponseStatus.md) | | [optional] +**errors** | [**Array<ProviderError>**](ProviderError.md) | | [optional] + + diff --git a/docs/RateResponseStatus.md b/docs/RateResponseStatus.md new file mode 100755 index 0000000..af187ba --- /dev/null +++ b/docs/RateResponseStatus.md @@ -0,0 +1,7 @@ +# ShipEngineApi::RateResponseStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/RateShipmentRequestBody.md b/docs/RateShipmentRequestBody.md new file mode 100755 index 0000000..22bddf7 --- /dev/null +++ b/docs/RateShipmentRequestBody.md @@ -0,0 +1,10 @@ +# ShipEngineApi::RateShipmentRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shipment_id** | **String** | A string that uniquely identifies the shipment id | [optional] +**shipment** | [**AddressValidatingShipment**](AddressValidatingShipment.md) | | [optional] +**rate_options** | [**RateRequestBody**](RateRequestBody.md) | | [optional] + + diff --git a/docs/RateShipmentResponseBody.md b/docs/RateShipmentResponseBody.md new file mode 100755 index 0000000..25df8d4 --- /dev/null +++ b/docs/RateShipmentResponseBody.md @@ -0,0 +1,27 @@ +# ShipEngineApi::RateShipmentResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rate_response** | [**RateResponseBody**](RateResponseBody.md) | | [optional] +**shipment_id** | **String** | A string that uniquely identifies the shipment id | [optional] +**carrier_id** | **String** | A string that uniquely identifies the carrier id | [optional] +**service_code** | **String** | | [optional] +**external_shipment_id** | **String** | A string that uniquely identifies the external shipment id | [optional] +**ship_date** | **DateTime** | | [optional] +**created_at** | **DateTime** | | [optional] +**modified_at** | **DateTime** | | [optional] +**shipment_status** | [**ShipmentStatus**](ShipmentStatus.md) | | [optional] +**ship_to** | [**Address**](Address.md) | | [optional] +**ship_from** | [**Address**](Address.md) | | [optional] +**warehouse_id** | **String** | A string that uniquely identifies the warehouse id | [optional] +**return_to** | [**Address**](Address.md) | | [optional] +**confirmation** | [**Confirmation**](Confirmation.md) | | [optional] +**customs** | [**InternationalOptions**](InternationalOptions.md) | | [optional] +**advanced_options** | [**AdvancedOptions**](AdvancedOptions.md) | | [optional] +**insurance_provider** | [**InsuranceProvider**](InsuranceProvider.md) | | [optional] +**tags** | [**Array<TagResponseBody>**](TagResponseBody.md) | | [optional] +**packages** | [**Array<ShipmentPackage>**](ShipmentPackage.md) | | [optional] +**total_weight** | [**Weight**](Weight.md) | | [optional] + + diff --git a/docs/RateShipmentsRequestBody.md b/docs/RateShipmentsRequestBody.md new file mode 100755 index 0000000..9c43a8d --- /dev/null +++ b/docs/RateShipmentsRequestBody.md @@ -0,0 +1,10 @@ +# ShipEngineApi::RateShipmentsRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shipment_ids** | **Array<String>** | | [optional] +**rate_options** | [**RateRequestBody**](RateRequestBody.md) | | [optional] +**shipments** | [**Array<AddressValidatingShipment>**](AddressValidatingShipment.md) | | [optional] + + diff --git a/docs/RateType.md b/docs/RateType.md new file mode 100755 index 0000000..955f4b4 --- /dev/null +++ b/docs/RateType.md @@ -0,0 +1,7 @@ +# ShipEngineApi::RateType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/RatesApi.md b/docs/RatesApi.md new file mode 100755 index 0000000..28fc7ef --- /dev/null +++ b/docs/RatesApi.md @@ -0,0 +1,228 @@ +# ShipEngineApi::RatesApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v1_rates_bulk_post**](RatesApi.md#v1_rates_bulk_post) | **POST** /v1/rates/bulk | rates.bulk_rate_shipments +[**v1_rates_by_rate_id_get**](RatesApi.md#v1_rates_by_rate_id_get) | **GET** /v1/rates/{rate_id} | rates.get_by_id +[**v1_rates_estimate_post**](RatesApi.md#v1_rates_estimate_post) | **POST** /v1/rates/estimate | rates.estimate +[**v1_rates_post**](RatesApi.md#v1_rates_post) | **POST** /v1/rates | rates.rate_shipment + + +# **v1_rates_bulk_post** +> Array<BulkRateResponseBody> v1_rates_bulk_post(body) + +rates.bulk_rate_shipments + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::RatesApi.new + +body = ShipEngineApi::RateShipmentsRequestBody.new # RateShipmentsRequestBody | + + +begin + #rates.bulk_rate_shipments + result = api_instance.v1_rates_bulk_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling RatesApi->v1_rates_bulk_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**RateShipmentsRequestBody**](RateShipmentsRequestBody.md)| | + +### Return type + +[**Array<BulkRateResponseBody>**](BulkRateResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_rates_by_rate_id_get** +> Rate v1_rates_by_rate_id_get(rate_id) + +rates.get_by_id + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::RatesApi.new + +rate_id = 'rate_id_example' # String | + + +begin + #rates.get_by_id + result = api_instance.v1_rates_by_rate_id_get(rate_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling RatesApi->v1_rates_by_rate_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **rate_id** | **String**| | + +### Return type + +[**Rate**](Rate.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_rates_estimate_post** +> Array<Rate> v1_rates_estimate_post(body) + +rates.estimate + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::RatesApi.new + +body = ShipEngineApi::RateEstimateRequestBody.new # RateEstimateRequestBody | + + +begin + #rates.estimate + result = api_instance.v1_rates_estimate_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling RatesApi->v1_rates_estimate_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**RateEstimateRequestBody**](RateEstimateRequestBody.md)| | + +### Return type + +[**Array<Rate>**](Rate.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_rates_post** +> RateShipmentResponseBody v1_rates_post(body) + +rates.rate_shipment + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::RatesApi.new + +body = ShipEngineApi::RateShipmentRequestBody.new # RateShipmentRequestBody | + + +begin + #rates.rate_shipment + result = api_instance.v1_rates_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling RatesApi->v1_rates_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**RateShipmentRequestBody**](RateShipmentRequestBody.md)| | + +### Return type + +[**RateShipmentResponseBody**](RateShipmentResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/ResponseMessage.md b/docs/ResponseMessage.md new file mode 100755 index 0000000..deaa470 --- /dev/null +++ b/docs/ResponseMessage.md @@ -0,0 +1,11 @@ +# ShipEngineApi::ResponseMessage + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | [**Code**](Code.md) | | [optional] +**message** | **String** | | [optional] +**type** | [**Type**](Type.md) | | [optional] +**detail_code** | [**DetailCode**](DetailCode.md) | | [optional] + + diff --git a/docs/RoyalMailAccountInformationRequestBody.md b/docs/RoyalMailAccountInformationRequestBody.md new file mode 100755 index 0000000..542e8eb --- /dev/null +++ b/docs/RoyalMailAccountInformationRequestBody.md @@ -0,0 +1,19 @@ +# ShipEngineApi::RoyalMailAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_number** | **String** | | [optional] +**oba_email** | **String** | The oba email address | [optional] +**contact_name** | **String** | | [optional] +**email** | **String** | The email address | [optional] +**company_name** | **String** | | [optional] +**street_line1** | **String** | | [optional] +**street_line2** | **String** | | [optional] +**street_line3** | **String** | | [optional] +**city** | **String** | | [optional] +**postal_code** | **String** | | [optional] +**phone** | **String** | | [optional] +**nickname** | **String** | | [optional] + + diff --git a/docs/RrDonnelleyAccountInformationRequestBody.md b/docs/RrDonnelleyAccountInformationRequestBody.md new file mode 100755 index 0000000..c86fedd --- /dev/null +++ b/docs/RrDonnelleyAccountInformationRequestBody.md @@ -0,0 +1,10 @@ +# ShipEngineApi::RrDonnelleyAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**username** | **String** | | [optional] +**password** | **String** | | [optional] + + diff --git a/docs/Service.md b/docs/Service.md new file mode 100755 index 0000000..2fda20d --- /dev/null +++ b/docs/Service.md @@ -0,0 +1,14 @@ +# ShipEngineApi::Service + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**carrier_id** | **String** | A string that uniquely identifies the carrier id | [optional] +**carrier_code** | **String** | | [optional] +**service_code** | **String** | | [optional] +**name** | **String** | | [optional] +**domestic** | **BOOLEAN** | | [optional] +**international** | **BOOLEAN** | | [optional] +**is_multi_package_supported** | **BOOLEAN** | | [optional] + + diff --git a/docs/Shipment.md b/docs/Shipment.md new file mode 100755 index 0000000..5507c2e --- /dev/null +++ b/docs/Shipment.md @@ -0,0 +1,26 @@ +# ShipEngineApi::Shipment + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shipment_id** | **String** | A string that uniquely identifies the shipment id | [optional] +**carrier_id** | **String** | A string that uniquely identifies the carrier id | [optional] +**service_code** | **String** | | [optional] +**external_shipment_id** | **String** | A string that uniquely identifies the external shipment id | [optional] +**ship_date** | **DateTime** | | [optional] +**created_at** | **DateTime** | | [optional] +**modified_at** | **DateTime** | | [optional] +**shipment_status** | [**ShipmentStatus**](ShipmentStatus.md) | | [optional] +**ship_to** | [**Address**](Address.md) | | [optional] +**ship_from** | [**Address**](Address.md) | | [optional] +**warehouse_id** | **String** | A string that uniquely identifies the warehouse id | [optional] +**return_to** | [**Address**](Address.md) | | [optional] +**confirmation** | [**Confirmation**](Confirmation.md) | | [optional] +**customs** | [**InternationalOptions**](InternationalOptions.md) | | [optional] +**advanced_options** | [**AdvancedOptions**](AdvancedOptions.md) | | [optional] +**insurance_provider** | [**InsuranceProvider**](InsuranceProvider.md) | | [optional] +**tags** | [**Array<TagResponseBody>**](TagResponseBody.md) | | [optional] +**packages** | [**Array<ShipmentPackage>**](ShipmentPackage.md) | | [optional] +**total_weight** | [**Weight**](Weight.md) | | [optional] + + diff --git a/docs/ShipmentAddTagResponseBody.md b/docs/ShipmentAddTagResponseBody.md new file mode 100755 index 0000000..2a8a305 --- /dev/null +++ b/docs/ShipmentAddTagResponseBody.md @@ -0,0 +1,9 @@ +# ShipEngineApi::ShipmentAddTagResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shipment_id** | **String** | A string that uniquely identifies the shipment id | [optional] +**tag** | [**TagResponseBody**](TagResponseBody.md) | | [optional] + + diff --git a/docs/ShipmentErrorsResponseBody.md b/docs/ShipmentErrorsResponseBody.md new file mode 100755 index 0000000..cc9b80a --- /dev/null +++ b/docs/ShipmentErrorsResponseBody.md @@ -0,0 +1,9 @@ +# ShipEngineApi::ShipmentErrorsResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | [**Array<ShipmentResponseError>**](ShipmentResponseError.md) | | [optional] +**links** | [**PaginationLink**](PaginationLink.md) | | [optional] + + diff --git a/docs/ShipmentPackage.md b/docs/ShipmentPackage.md new file mode 100755 index 0000000..baf9df1 --- /dev/null +++ b/docs/ShipmentPackage.md @@ -0,0 +1,12 @@ +# ShipEngineApi::ShipmentPackage + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**package_code** | **String** | | [optional] +**weight** | [**Weight**](Weight.md) | | [optional] +**dimensions** | [**Dimensions**](Dimensions.md) | | [optional] +**insured_value** | [**Money**](Money.md) | | [optional] +**label_messages** | [**LabelMessages**](LabelMessages.md) | | [optional] + + diff --git a/docs/ShipmentResponseError.md b/docs/ShipmentResponseError.md new file mode 100755 index 0000000..949b887 --- /dev/null +++ b/docs/ShipmentResponseError.md @@ -0,0 +1,10 @@ +# ShipEngineApi::ShipmentResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **String** | | [optional] +**shipment_id** | **String** | A string that uniquely identifies the shipment id | [optional] +**external_shipment_id** | **String** | A string that uniquely identifies the external shipment id | [optional] + + diff --git a/docs/ShipmentStatus.md b/docs/ShipmentStatus.md new file mode 100755 index 0000000..e8f69ca --- /dev/null +++ b/docs/ShipmentStatus.md @@ -0,0 +1,7 @@ +# ShipEngineApi::ShipmentStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/ShipmentsApi.md b/docs/ShipmentsApi.md new file mode 100755 index 0000000..a5e3ac1 --- /dev/null +++ b/docs/ShipmentsApi.md @@ -0,0 +1,596 @@ +# ShipEngineApi::ShipmentsApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v1_shipments_by_shipment_id_get**](ShipmentsApi.md#v1_shipments_by_shipment_id_get) | **GET** /v1/shipments/{shipment_id} | shipments.get_by_id +[**v1_shipments_by_shipment_id_put**](ShipmentsApi.md#v1_shipments_by_shipment_id_put) | **PUT** /v1/shipments/{shipment_id} | shipments.update_shipment +[**v1_shipments_cancel_by_shipment_id_put**](ShipmentsApi.md#v1_shipments_cancel_by_shipment_id_put) | **PUT** /v1/shipments/{shipment_id}/cancel | shipments.cancel +[**v1_shipments_errors_by_shipment_id_get**](ShipmentsApi.md#v1_shipments_errors_by_shipment_id_get) | **GET** /v1/shipments/{shipment_id}/errors | shipments.find_errors +[**v1_shipments_external_shipment_id_by_external_shipment_id_get**](ShipmentsApi.md#v1_shipments_external_shipment_id_by_external_shipment_id_get) | **GET** /v1/shipments/external_shipment_id/{external_shipment_id} | shipments.get_by_external_id +[**v1_shipments_get**](ShipmentsApi.md#v1_shipments_get) | **GET** /v1/shipments | shipments.find +[**v1_shipments_post**](ShipmentsApi.md#v1_shipments_post) | **POST** /v1/shipments | shipments.create_shipments +[**v1_shipments_rates_by_shipment_id_get**](ShipmentsApi.md#v1_shipments_rates_by_shipment_id_get) | **GET** /v1/shipments/{shipment_id}/rates | shipments.get_rates_for_shipment +[**v1_shipments_tags_by_shipment_id_and_tag_delete**](ShipmentsApi.md#v1_shipments_tags_by_shipment_id_and_tag_delete) | **DELETE** /v1/shipments/{shipment_id}/tags/{tag} | shipments.remove_tag +[**v1_shipments_tags_by_shipment_id_and_tag_post**](ShipmentsApi.md#v1_shipments_tags_by_shipment_id_and_tag_post) | **POST** /v1/shipments/{shipment_id}/tags/{tag} | shipments.add_tag + + +# **v1_shipments_by_shipment_id_get** +> Shipment v1_shipments_by_shipment_id_get(shipment_id) + +shipments.get_by_id + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::ShipmentsApi.new + +shipment_id = 'shipment_id_example' # String | + + +begin + #shipments.get_by_id + result = api_instance.v1_shipments_by_shipment_id_get(shipment_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling ShipmentsApi->v1_shipments_by_shipment_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **shipment_id** | **String**| | + +### Return type + +[**Shipment**](Shipment.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_shipments_by_shipment_id_put** +> CreateShipmentResponseBody v1_shipments_by_shipment_id_put(shipment_id, body) + +shipments.update_shipment + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::ShipmentsApi.new + +shipment_id = 'shipment_id_example' # String | + +body = ShipEngineApi::AddressValidatingShipment.new # AddressValidatingShipment | + + +begin + #shipments.update_shipment + result = api_instance.v1_shipments_by_shipment_id_put(shipment_id, body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling ShipmentsApi->v1_shipments_by_shipment_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **shipment_id** | **String**| | + **body** | [**AddressValidatingShipment**](AddressValidatingShipment.md)| | + +### Return type + +[**CreateShipmentResponseBody**](CreateShipmentResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_shipments_cancel_by_shipment_id_put** +> v1_shipments_cancel_by_shipment_id_put(shipment_id) + +shipments.cancel + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::ShipmentsApi.new + +shipment_id = 'shipment_id_example' # String | + + +begin + #shipments.cancel + api_instance.v1_shipments_cancel_by_shipment_id_put(shipment_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling ShipmentsApi->v1_shipments_cancel_by_shipment_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **shipment_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_shipments_errors_by_shipment_id_get** +> ShipmentErrorsResponseBody v1_shipments_errors_by_shipment_id_get(shipment_id, opts) + +shipments.find_errors + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::ShipmentsApi.new + +shipment_id = 'shipment_id_example' # String | + +opts = { + page: 56, # Integer | + pagesize: 56 # Integer | +} + +begin + #shipments.find_errors + result = api_instance.v1_shipments_errors_by_shipment_id_get(shipment_id, opts) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling ShipmentsApi->v1_shipments_errors_by_shipment_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **shipment_id** | **String**| | + **page** | **Integer**| | [optional] + **pagesize** | **Integer**| | [optional] + +### Return type + +[**ShipmentErrorsResponseBody**](ShipmentErrorsResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_shipments_external_shipment_id_by_external_shipment_id_get** +> Shipment v1_shipments_external_shipment_id_by_external_shipment_id_get(external_shipment_id) + +shipments.get_by_external_id + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::ShipmentsApi.new + +external_shipment_id = 'external_shipment_id_example' # String | + + +begin + #shipments.get_by_external_id + result = api_instance.v1_shipments_external_shipment_id_by_external_shipment_id_get(external_shipment_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling ShipmentsApi->v1_shipments_external_shipment_id_by_external_shipment_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **external_shipment_id** | **String**| | + +### Return type + +[**Shipment**](Shipment.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_shipments_get** +> ListShipmentResponseBody v1_shipments_get(opts) + +shipments.find + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::ShipmentsApi.new + +opts = { + batch_id: 'batch_id_example', # String | + tag: 'tag_example', # String | + shipment_status: 'shipment_status_example', # String | + modified_at_start: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | + modified_at_end: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | + created_at_start: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | + created_at_end: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | + page: 56, # Integer | + page_size: 56, # Integer | + sort_dir: 'sort_dir_example', # String | + sort_by: 'sort_by_example' # String | +} + +begin + #shipments.find + result = api_instance.v1_shipments_get(opts) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling ShipmentsApi->v1_shipments_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **batch_id** | **String**| | [optional] + **tag** | **String**| | [optional] + **shipment_status** | **String**| | [optional] + **modified_at_start** | **DateTime**| | [optional] + **modified_at_end** | **DateTime**| | [optional] + **created_at_start** | **DateTime**| | [optional] + **created_at_end** | **DateTime**| | [optional] + **page** | **Integer**| | [optional] + **page_size** | **Integer**| | [optional] + **sort_dir** | **String**| | [optional] + **sort_by** | **String**| | [optional] + +### Return type + +[**ListShipmentResponseBody**](ListShipmentResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_shipments_post** +> CreateShipmentsResponseBody v1_shipments_post(body) + +shipments.create_shipments + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::ShipmentsApi.new + +body = ShipEngineApi::CreateShipmentsRequestBody.new # CreateShipmentsRequestBody | + + +begin + #shipments.create_shipments + result = api_instance.v1_shipments_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling ShipmentsApi->v1_shipments_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CreateShipmentsRequestBody**](CreateShipmentsRequestBody.md)| | + +### Return type + +[**CreateShipmentsResponseBody**](CreateShipmentsResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_shipments_rates_by_shipment_id_get** +> RateResponseBody v1_shipments_rates_by_shipment_id_get(shipment_id, opts) + +shipments.get_rates_for_shipment + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::ShipmentsApi.new + +shipment_id = 'shipment_id_example' # String | + +opts = { + created_at_start: DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | +} + +begin + #shipments.get_rates_for_shipment + result = api_instance.v1_shipments_rates_by_shipment_id_get(shipment_id, opts) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling ShipmentsApi->v1_shipments_rates_by_shipment_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **shipment_id** | **String**| | + **created_at_start** | **DateTime**| | [optional] + +### Return type + +[**RateResponseBody**](RateResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_shipments_tags_by_shipment_id_and_tag_delete** +> v1_shipments_tags_by_shipment_id_and_tag_delete(shipment_id, tag) + +shipments.remove_tag + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::ShipmentsApi.new + +shipment_id = 'shipment_id_example' # String | + +tag = 'tag_example' # String | + + +begin + #shipments.remove_tag + api_instance.v1_shipments_tags_by_shipment_id_and_tag_delete(shipment_id, tag) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling ShipmentsApi->v1_shipments_tags_by_shipment_id_and_tag_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **shipment_id** | **String**| | + **tag** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_shipments_tags_by_shipment_id_and_tag_post** +> ShipmentAddTagResponseBody v1_shipments_tags_by_shipment_id_and_tag_post(shipment_id, tag) + +shipments.add_tag + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::ShipmentsApi.new + +shipment_id = 'shipment_id_example' # String | + +tag = 'tag_example' # String | + + +begin + #shipments.add_tag + result = api_instance.v1_shipments_tags_by_shipment_id_and_tag_post(shipment_id, tag) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling ShipmentsApi->v1_shipments_tags_by_shipment_id_and_tag_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **shipment_id** | **String**| | + **tag** | **String**| | + +### Return type + +[**ShipmentAddTagResponseBody**](ShipmentAddTagResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/ShipmentsSortBy.md b/docs/ShipmentsSortBy.md new file mode 100755 index 0000000..fd8be6c --- /dev/null +++ b/docs/ShipmentsSortBy.md @@ -0,0 +1,7 @@ +# ShipEngineApi::ShipmentsSortBy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/ShopifyAccessTokenRequestBody.md b/docs/ShopifyAccessTokenRequestBody.md new file mode 100755 index 0000000..eef792f --- /dev/null +++ b/docs/ShopifyAccessTokenRequestBody.md @@ -0,0 +1,11 @@ +# ShipEngineApi::ShopifyAccessTokenRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**store_name** | **String** | | [optional] +**store_url** | **String** | | [optional] +**access_token** | **String** | | [optional] +**private_application_id** | **String** | A string that uniquely identifies the private application id | [optional] + + diff --git a/docs/SmartPostEndorsement.md b/docs/SmartPostEndorsement.md new file mode 100755 index 0000000..e20c4d9 --- /dev/null +++ b/docs/SmartPostEndorsement.md @@ -0,0 +1,7 @@ +# ShipEngineApi::SmartPostEndorsement + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/SmartPostHub.md b/docs/SmartPostHub.md new file mode 100755 index 0000000..1667d0a --- /dev/null +++ b/docs/SmartPostHub.md @@ -0,0 +1,7 @@ +# ShipEngineApi::SmartPostHub + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/SortBy.md b/docs/SortBy.md new file mode 100755 index 0000000..dcbd716 --- /dev/null +++ b/docs/SortBy.md @@ -0,0 +1,7 @@ +# ShipEngineApi::SortBy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/SortDir.md b/docs/SortDir.md new file mode 100755 index 0000000..cadbf86 --- /dev/null +++ b/docs/SortDir.md @@ -0,0 +1,7 @@ +# ShipEngineApi::SortDir + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/StampsAccountInformationRequestBody.md b/docs/StampsAccountInformationRequestBody.md new file mode 100755 index 0000000..92119fc --- /dev/null +++ b/docs/StampsAccountInformationRequestBody.md @@ -0,0 +1,10 @@ +# ShipEngineApi::StampsAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**username** | **String** | | [optional] +**password** | **String** | | [optional] + + diff --git a/docs/StampsAccountUrlResponseBody.md b/docs/StampsAccountUrlResponseBody.md new file mode 100755 index 0000000..238f02e --- /dev/null +++ b/docs/StampsAccountUrlResponseBody.md @@ -0,0 +1,9 @@ +# ShipEngineApi::StampsAccountUrlResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url_type** | [**UrlType**](UrlType.md) | | [optional] +**url** | **String** | | [optional] + + diff --git a/docs/StampsAccountUrlsRequestBody.md b/docs/StampsAccountUrlsRequestBody.md new file mode 100755 index 0000000..37fd488 --- /dev/null +++ b/docs/StampsAccountUrlsRequestBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::StampsAccountUrlsRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url_types** | [**Array<UrlType>**](UrlType.md) | | [optional] + + diff --git a/docs/StampsAccountUrlsResponseBody.md b/docs/StampsAccountUrlsResponseBody.md new file mode 100755 index 0000000..a7ea649 --- /dev/null +++ b/docs/StampsAccountUrlsResponseBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::StampsAccountUrlsResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**urls** | [**Array<StampsAccountUrlResponseBody>**](StampsAccountUrlResponseBody.md) | | [optional] + + diff --git a/docs/TagResponseBody.md b/docs/TagResponseBody.md new file mode 100755 index 0000000..7bb9261 --- /dev/null +++ b/docs/TagResponseBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::TagResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + diff --git a/docs/TagsApi.md b/docs/TagsApi.md new file mode 100755 index 0000000..391689c --- /dev/null +++ b/docs/TagsApi.md @@ -0,0 +1,224 @@ +# ShipEngineApi::TagsApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v1_tags_by_tag_name_and_new_name_put**](TagsApi.md#v1_tags_by_tag_name_and_new_name_put) | **PUT** /v1/tags/{tag_name}/{new_name} | tags.update_tag +[**v1_tags_by_tag_name_delete**](TagsApi.md#v1_tags_by_tag_name_delete) | **DELETE** /v1/tags/{tag_name} | tags.delete +[**v1_tags_by_tag_name_post**](TagsApi.md#v1_tags_by_tag_name_post) | **POST** /v1/tags/{tag_name} | tags.add_tag +[**v1_tags_get**](TagsApi.md#v1_tags_get) | **GET** /v1/tags | tags.find_tags + + +# **v1_tags_by_tag_name_and_new_name_put** +> v1_tags_by_tag_name_and_new_name_put(tag_name, new_name) + +tags.update_tag + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::TagsApi.new + +tag_name = 'tag_name_example' # String | + +new_name = 'new_name_example' # String | + + +begin + #tags.update_tag + api_instance.v1_tags_by_tag_name_and_new_name_put(tag_name, new_name) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling TagsApi->v1_tags_by_tag_name_and_new_name_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tag_name** | **String**| | + **new_name** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_tags_by_tag_name_delete** +> ListTagResponseBody v1_tags_by_tag_name_delete(tag_name) + +tags.delete + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::TagsApi.new + +tag_name = 'tag_name_example' # String | + + +begin + #tags.delete + result = api_instance.v1_tags_by_tag_name_delete(tag_name) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling TagsApi->v1_tags_by_tag_name_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tag_name** | **String**| | + +### Return type + +[**ListTagResponseBody**](ListTagResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_tags_by_tag_name_post** +> TagResponseBody v1_tags_by_tag_name_post(tag_name) + +tags.add_tag + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::TagsApi.new + +tag_name = 'tag_name_example' # String | + + +begin + #tags.add_tag + result = api_instance.v1_tags_by_tag_name_post(tag_name) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling TagsApi->v1_tags_by_tag_name_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tag_name** | **String**| | + +### Return type + +[**TagResponseBody**](TagResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_tags_get** +> ListTagResponseBody v1_tags_get + +tags.find_tags + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::TagsApi.new + +begin + #tags.find_tags + result = api_instance.v1_tags_get + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling TagsApi->v1_tags_get: #{e}" +end +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ListTagResponseBody**](ListTagResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/TrackEvent.md b/docs/TrackEvent.md new file mode 100755 index 0000000..ee3af78 --- /dev/null +++ b/docs/TrackEvent.md @@ -0,0 +1,15 @@ +# ShipEngineApi::TrackEvent + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**occurred_at** | **DateTime** | | [optional] +**description** | **String** | | [optional] +**city_locality** | **String** | | [optional] +**state_province** | **String** | | [optional] +**postal_code** | **String** | | [optional] +**country_code** | **String** | | [optional] +**company_name** | **String** | | [optional] +**signer** | **String** | | [optional] + + diff --git a/docs/TrackingApi.md b/docs/TrackingApi.md new file mode 100755 index 0000000..2d82397 --- /dev/null +++ b/docs/TrackingApi.md @@ -0,0 +1,180 @@ +# ShipEngineApi::TrackingApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v1_tracking_get**](TrackingApi.md#v1_tracking_get) | **GET** /v1/tracking | tracking.track +[**v1_tracking_start_post**](TrackingApi.md#v1_tracking_start_post) | **POST** /v1/tracking/start | tracking.start_tracking +[**v1_tracking_stop_post**](TrackingApi.md#v1_tracking_stop_post) | **POST** /v1/tracking/stop | tracking.stop_tracking + + +# **v1_tracking_get** +> TrackingInformationResponseBody v1_tracking_get(opts) + +tracking.track + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::TrackingApi.new + +opts = { + carrier_code: 'carrier_code_example', # String | + tracking_number: 'tracking_number_example' # String | +} + +begin + #tracking.track + result = api_instance.v1_tracking_get(opts) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling TrackingApi->v1_tracking_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_code** | **String**| | [optional] + **tracking_number** | **String**| | [optional] + +### Return type + +[**TrackingInformationResponseBody**](TrackingInformationResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_tracking_start_post** +> v1_tracking_start_post(opts) + +tracking.start_tracking + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::TrackingApi.new + +opts = { + carrier_code: 'carrier_code_example', # String | + tracking_number: 'tracking_number_example' # String | +} + +begin + #tracking.start_tracking + api_instance.v1_tracking_start_post(opts) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling TrackingApi->v1_tracking_start_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_code** | **String**| | [optional] + **tracking_number** | **String**| | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_tracking_stop_post** +> v1_tracking_stop_post(opts) + +tracking.stop_tracking + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::TrackingApi.new + +opts = { + carrier_code: 'carrier_code_example', # String | + tracking_number: 'tracking_number_example' # String | +} + +begin + #tracking.stop_tracking + api_instance.v1_tracking_stop_post(opts) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling TrackingApi->v1_tracking_stop_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **carrier_code** | **String**| | [optional] + **tracking_number** | **String**| | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/TrackingInformationResponseBody.md b/docs/TrackingInformationResponseBody.md new file mode 100755 index 0000000..02b9698 --- /dev/null +++ b/docs/TrackingInformationResponseBody.md @@ -0,0 +1,17 @@ +# ShipEngineApi::TrackingInformationResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tracking_number** | **String** | | [optional] +**status_code** | **String** | | [optional] +**status_description** | **String** | | [optional] +**carrier_status_code** | **String** | | [optional] +**carrier_status_description** | **String** | | [optional] +**ship_date** | **DateTime** | | [optional] +**estimated_delivery_date** | **DateTime** | | [optional] +**actual_delivery_date** | **DateTime** | | [optional] +**exception_description** | **String** | | [optional] +**events** | [**Array<TrackEvent>**](TrackEvent.md) | | [optional] + + diff --git a/docs/TrackingStatus.md b/docs/TrackingStatus.md new file mode 100755 index 0000000..bea3d5a --- /dev/null +++ b/docs/TrackingStatus.md @@ -0,0 +1,7 @@ +# ShipEngineApi::TrackingStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/Type.md b/docs/Type.md new file mode 100755 index 0000000..b9de97c --- /dev/null +++ b/docs/Type.md @@ -0,0 +1,7 @@ +# ShipEngineApi::Type + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/UpdateWebhookRequestBody.md b/docs/UpdateWebhookRequestBody.md new file mode 100755 index 0000000..c6dee3d --- /dev/null +++ b/docs/UpdateWebhookRequestBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::UpdateWebhookRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **String** | | [optional] + + diff --git a/docs/UpsAccountInformationRequestBody.md b/docs/UpsAccountInformationRequestBody.md new file mode 100755 index 0000000..ecd446a --- /dev/null +++ b/docs/UpsAccountInformationRequestBody.md @@ -0,0 +1,25 @@ +# ShipEngineApi::UpsAccountInformationRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**account_number** | **String** | | [optional] +**account_country_code** | **String** | | [optional] +**account_postal_code** | **String** | | [optional] +**title** | **String** | | [optional] +**first_name** | **String** | | [optional] +**last_name** | **String** | | [optional] +**company** | **String** | | [optional] +**address1** | **String** | | [optional] +**address2** | **String** | | [optional] +**city** | **String** | | [optional] +**state** | **String** | | [optional] +**postal_code** | **String** | | [optional] +**country_code** | **String** | | [optional] +**email** | **String** | The email address | [optional] +**phone** | **String** | | [optional] +**invoice** | [**UpsInvoice**](UpsInvoice.md) | | [optional] +**agree_to_technology_agreement** | **BOOLEAN** | | [optional] + + diff --git a/docs/UpsAccountSettings.md b/docs/UpsAccountSettings.md new file mode 100755 index 0000000..0a666ee --- /dev/null +++ b/docs/UpsAccountSettings.md @@ -0,0 +1,19 @@ +# ShipEngineApi::UpsAccountSettings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nickname** | **String** | | [optional] +**is_primary_account** | **BOOLEAN** | | [optional] +**pickup_type** | [**UpsPickupType**](UpsPickupType.md) | | [optional] +**use_carbon_neutral_shipping_program** | **BOOLEAN** | | [optional] +**use_ground_freight_pricing** | **BOOLEAN** | | [optional] +**use_consolidation_services** | **BOOLEAN** | | [optional] +**use_order_number_on_mail_innovations_labels** | **BOOLEAN** | | [optional] +**mail_innovations_endorsement** | [**MailInnovationsEndorsement**](MailInnovationsEndorsement.md) | | [optional] +**mail_innovations_cost_center** | **String** | | [optional] +**use_negotiated_rates** | **BOOLEAN** | | [optional] +**account_postal_code** | **String** | | [optional] +**invoice** | [**UpsInvoice**](UpsInvoice.md) | | [optional] + + diff --git a/docs/UpsInvoice.md b/docs/UpsInvoice.md new file mode 100755 index 0000000..d980f3a --- /dev/null +++ b/docs/UpsInvoice.md @@ -0,0 +1,11 @@ +# ShipEngineApi::UpsInvoice + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**invoice_date** | **DateTime** | | [optional] +**invoice_number** | **String** | | [optional] +**control_id** | **String** | A string that uniquely identifies the control id | [optional] +**invoice_amount** | **Float** | | [optional] + + diff --git a/docs/UpsPickupType.md b/docs/UpsPickupType.md new file mode 100755 index 0000000..3222125 --- /dev/null +++ b/docs/UpsPickupType.md @@ -0,0 +1,7 @@ +# ShipEngineApi::UpsPickupType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/UrlType.md b/docs/UrlType.md new file mode 100755 index 0000000..dc82209 --- /dev/null +++ b/docs/UrlType.md @@ -0,0 +1,7 @@ +# ShipEngineApi::UrlType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/V1LabelsResponse.md b/docs/V1LabelsResponse.md new file mode 100755 index 0000000..2c8a9ff --- /dev/null +++ b/docs/V1LabelsResponse.md @@ -0,0 +1,12 @@ +# ShipEngineApi::V1LabelsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **Integer** | The total number of items across all pages of results | +**page** | **Integer** | The current page number of results. For example, if there are 80 results, and the page size is 25, then `page` could be 1, 2, 3, or 4. The first three pages would contain 25 items each, and the fourth page would contain the five remaining items. | +**pages** | **Integer** | The total number of pages of results. For example, if there are 80 results, and the page size is 25, then `pages` would be 4. The first three pages would contain 25 items each, and the fourth page would contain the five remaining items. If there are no results, then `pages` will be zero. | +**links** | [**Links**](Links.md) | | +**labels** | [**Array<Label>**](Label.md) | The labels that matched the query criteria. If no matching labels were found, then this array will be empty; otherwise, it will contain one page of results. The last page of results may have fewer labels than the `page_size`. | + + diff --git a/docs/ValidateAddress.md b/docs/ValidateAddress.md new file mode 100755 index 0000000..4d128f5 --- /dev/null +++ b/docs/ValidateAddress.md @@ -0,0 +1,7 @@ +# ShipEngineApi::ValidateAddress + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/ValidationStatus.md b/docs/ValidationStatus.md new file mode 100755 index 0000000..0d1a9b4 --- /dev/null +++ b/docs/ValidationStatus.md @@ -0,0 +1,7 @@ +# ShipEngineApi::ValidationStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/VoidLabelResponseBody.md b/docs/VoidLabelResponseBody.md new file mode 100755 index 0000000..a3200a4 --- /dev/null +++ b/docs/VoidLabelResponseBody.md @@ -0,0 +1,9 @@ +# ShipEngineApi::VoidLabelResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**approved** | **BOOLEAN** | | [optional] +**message** | **String** | | [optional] + + diff --git a/docs/Warehouse.md b/docs/Warehouse.md new file mode 100755 index 0000000..bce2494 --- /dev/null +++ b/docs/Warehouse.md @@ -0,0 +1,12 @@ +# ShipEngineApi::Warehouse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**warehouse_id** | **String** | A string that uniquely identifies the warehouse id | [optional] +**name** | **String** | | [optional] +**created_at** | **DateTime** | | [optional] +**origin_address** | [**Address**](Address.md) | | [optional] +**return_address** | [**Address**](Address.md) | | [optional] + + diff --git a/docs/WarehouseListResponseBody.md b/docs/WarehouseListResponseBody.md new file mode 100755 index 0000000..07ede9f --- /dev/null +++ b/docs/WarehouseListResponseBody.md @@ -0,0 +1,8 @@ +# ShipEngineApi::WarehouseListResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**warehouses** | [**Array<Warehouse>**](Warehouse.md) | | [optional] + + diff --git a/docs/WarehouseRequestBody.md b/docs/WarehouseRequestBody.md new file mode 100755 index 0000000..11fc5d4 --- /dev/null +++ b/docs/WarehouseRequestBody.md @@ -0,0 +1,11 @@ +# ShipEngineApi::WarehouseRequestBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**warehouse_id** | **String** | A string that uniquely identifies the warehouse id | [optional] +**name** | **String** | | [optional] +**origin_address** | [**Address**](Address.md) | | [optional] +**return_address** | [**Address**](Address.md) | | [optional] + + diff --git a/docs/WarehousesApi.md b/docs/WarehousesApi.md new file mode 100755 index 0000000..99d633b --- /dev/null +++ b/docs/WarehousesApi.md @@ -0,0 +1,278 @@ +# ShipEngineApi::WarehousesApi + +All URIs are relative to *https://api.shipengine.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**v1_warehouses_by_warehouse_id_delete**](WarehousesApi.md#v1_warehouses_by_warehouse_id_delete) | **DELETE** /v1/warehouses/{warehouse_id} | warehouses.delete +[**v1_warehouses_by_warehouse_id_get**](WarehousesApi.md#v1_warehouses_by_warehouse_id_get) | **GET** /v1/warehouses/{warehouse_id} | warehouses.get_by_id +[**v1_warehouses_by_warehouse_id_put**](WarehousesApi.md#v1_warehouses_by_warehouse_id_put) | **PUT** /v1/warehouses/{warehouse_id} | warehouses.update +[**v1_warehouses_get**](WarehousesApi.md#v1_warehouses_get) | **GET** /v1/warehouses | warehouses.find +[**v1_warehouses_post**](WarehousesApi.md#v1_warehouses_post) | **POST** /v1/warehouses | warehouses.create + + +# **v1_warehouses_by_warehouse_id_delete** +> v1_warehouses_by_warehouse_id_delete(warehouse_id) + +warehouses.delete + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::WarehousesApi.new + +warehouse_id = 'warehouse_id_example' # String | + + +begin + #warehouses.delete + api_instance.v1_warehouses_by_warehouse_id_delete(warehouse_id) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling WarehousesApi->v1_warehouses_by_warehouse_id_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **warehouse_id** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_warehouses_by_warehouse_id_get** +> Warehouse v1_warehouses_by_warehouse_id_get(warehouse_id) + +warehouses.get_by_id + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::WarehousesApi.new + +warehouse_id = 'warehouse_id_example' # String | + + +begin + #warehouses.get_by_id + result = api_instance.v1_warehouses_by_warehouse_id_get(warehouse_id) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling WarehousesApi->v1_warehouses_by_warehouse_id_get: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **warehouse_id** | **String**| | + +### Return type + +[**Warehouse**](Warehouse.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_warehouses_by_warehouse_id_put** +> v1_warehouses_by_warehouse_id_put(warehouse_id, body) + +warehouses.update + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::WarehousesApi.new + +warehouse_id = 'warehouse_id_example' # String | + +body = ShipEngineApi::WarehouseRequestBody.new # WarehouseRequestBody | + + +begin + #warehouses.update + api_instance.v1_warehouses_by_warehouse_id_put(warehouse_id, body) +rescue ShipEngineApi::ApiError => e + puts "Exception when calling WarehousesApi->v1_warehouses_by_warehouse_id_put: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **warehouse_id** | **String**| | + **body** | [**WarehouseRequestBody**](WarehouseRequestBody.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_warehouses_get** +> WarehouseListResponseBody v1_warehouses_get + +warehouses.find + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::WarehousesApi.new + +begin + #warehouses.find + result = api_instance.v1_warehouses_get + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling WarehousesApi->v1_warehouses_get: #{e}" +end +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**WarehouseListResponseBody**](WarehouseListResponseBody.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **v1_warehouses_post** +> Warehouse v1_warehouses_post(body) + +warehouses.create + + + +### Example +```ruby +# load the gem +require 'shipengine_api' +# setup authorization +ShipEngineApi.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api-key'] = 'Bearer' +end + +api_instance = ShipEngineApi::WarehousesApi.new + +body = ShipEngineApi::WarehouseRequestBody.new # WarehouseRequestBody | + + +begin + #warehouses.create + result = api_instance.v1_warehouses_post(body) + p result +rescue ShipEngineApi::ApiError => e + puts "Exception when calling WarehousesApi->v1_warehouses_post: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**WarehouseRequestBody**](WarehouseRequestBody.md)| | + +### Return type + +[**Warehouse**](Warehouse.md) + +### Authorization + +[api-key](../README.md#api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/docs/WebhookResponseBody.md b/docs/WebhookResponseBody.md new file mode 100755 index 0000000..986f645 --- /dev/null +++ b/docs/WebhookResponseBody.md @@ -0,0 +1,10 @@ +# ShipEngineApi::WebhookResponseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**webhook_id** | **String** | A string that uniquely identifies the webhook id | [optional] +**url** | **String** | | [optional] +**event** | **String** | | [optional] + + diff --git a/docs/Weight.md b/docs/Weight.md new file mode 100755 index 0000000..545d1f0 --- /dev/null +++ b/docs/Weight.md @@ -0,0 +1,9 @@ +# ShipEngineApi::Weight + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **Float** | | [optional] +**unit** | [**WeightUnit**](WeightUnit.md) | | [optional] + + diff --git a/docs/WeightUnit.md b/docs/WeightUnit.md new file mode 100755 index 0000000..413dea5 --- /dev/null +++ b/docs/WeightUnit.md @@ -0,0 +1,7 @@ +# ShipEngineApi::WeightUnit + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/lib/shipengine_api.rb b/lib/shipengine_api.rb new file mode 100755 index 0000000..080b89d --- /dev/null +++ b/lib/shipengine_api.rb @@ -0,0 +1,203 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +# Common files +require 'shipengine_api/api_client' +require 'shipengine_api/api_error' +require 'shipengine_api/version' +require 'shipengine_api/configuration' + +# Models +require 'shipengine_api/models/access_worldwide_account_information_request_body' +require 'shipengine_api/models/address' +require 'shipengine_api/models/address_residential_indicator' +require 'shipengine_api/models/address_validating_shipment' +require 'shipengine_api/models/address_validation_result' +require 'shipengine_api/models/address_validation_status' +require 'shipengine_api/models/advanced_options' +require 'shipengine_api/models/amazon_account_information_request_body' +require 'shipengine_api/models/amazon_product_identifier' +require 'shipengine_api/models/apc_account_information_request_body' +require 'shipengine_api/models/api_error' +require 'shipengine_api/models/asendia_account_information_request_body' +require 'shipengine_api/models/balance_response_body' +require 'shipengine_api/models/batch' +require 'shipengine_api/models/batch_errors_response_body' +require 'shipengine_api/models/batch_response_error' +require 'shipengine_api/models/batch_status' +require 'shipengine_api/models/batches_sort_by' +require 'shipengine_api/models/bill_to_party' +require 'shipengine_api/models/bulk_rate_response_body' +require 'shipengine_api/models/capture_payment' +require 'shipengine_api/models/carrier' +require 'shipengine_api/models/carrier_advanced_option' +require 'shipengine_api/models/carrier_list_options_response_body' +require 'shipengine_api/models/carrier_list_response_body' +require 'shipengine_api/models/carrier_list_services_response_body' +require 'shipengine_api/models/channel_advisor_account_information_request_body' +require 'shipengine_api/models/channel_advisor_product_identifier' +require 'shipengine_api/models/code' +require 'shipengine_api/models/confirmation' +require 'shipengine_api/models/connect_account_response_body' +require 'shipengine_api/models/connect_marketplace_response_body' +require 'shipengine_api/models/contents' +require 'shipengine_api/models/create_batch_request_body' +require 'shipengine_api/models/create_manifest_request_body' +require 'shipengine_api/models/create_shipment_response_body' +require 'shipengine_api/models/create_shipments_request_body' +require 'shipengine_api/models/create_shipments_response_body' +require 'shipengine_api/models/create_webhook_request_body' +require 'shipengine_api/models/currency' +require 'shipengine_api/models/customs_item' +require 'shipengine_api/models/default_account_settings_request_body' +require 'shipengine_api/models/detail_code' +require 'shipengine_api/models/dhl_ecommerce_account_information_request_body' +require 'shipengine_api/models/dhl_express_account_information_request_body' +require 'shipengine_api/models/dhl_express_account_settings' +require 'shipengine_api/models/dhl_express_uk_account_information_request_body' +require 'shipengine_api/models/dimension_unit' +require 'shipengine_api/models/dimensions' +require 'shipengine_api/models/dpd_account_information_request_body' +require 'shipengine_api/models/ebay_access_token_request_body' +require 'shipengine_api/models/endicia_account_information_request_body' +require 'shipengine_api/models/error_response_body' +require 'shipengine_api/models/etsy_access_token_request_body' +require 'shipengine_api/models/event' +require 'shipengine_api/models/fedex_account_information_request_body' +require 'shipengine_api/models/fedex_account_settings_request_body' +require 'shipengine_api/models/fedex_pickup_type' +require 'shipengine_api/models/fedex_uk_account_information_request_body' +require 'shipengine_api/models/first' +require 'shipengine_api/models/first_mile_account_information_request_body' +require 'shipengine_api/models/globegistics_account_information_request_body' +require 'shipengine_api/models/imex_account_information_request_body' +require 'shipengine_api/models/insurance_provider' +require 'shipengine_api/models/international_options' +require 'shipengine_api/models/label' +require 'shipengine_api/models/label_format' +require 'shipengine_api/models/label_layout' +require 'shipengine_api/models/label_messages' +require 'shipengine_api/models/label_status' +require 'shipengine_api/models/last' +require 'shipengine_api/models/link' +require 'shipengine_api/models/links' +require 'shipengine_api/models/list_batch_response_body' +require 'shipengine_api/models/list_label_response_body' +require 'shipengine_api/models/list_manifests_request_body' +require 'shipengine_api/models/list_manifests_response_body' +require 'shipengine_api/models/list_shipment_response_body' +require 'shipengine_api/models/list_tag_response_body' +require 'shipengine_api/models/magento_account_information_request_body' +require 'shipengine_api/models/magento_account_settings_request_body' +require 'shipengine_api/models/mail_innovations_endorsement' +require 'shipengine_api/models/manifest_response_body' +require 'shipengine_api/models/model_next' +require 'shipengine_api/models/modify_batch_request_body' +require 'shipengine_api/models/money' +require 'shipengine_api/models/newgistics_account_information_request_body' +require 'shipengine_api/models/newgistics_account_settings_request_body' +require 'shipengine_api/models/non_delivery' +require 'shipengine_api/models/ontrac_account_information_request_body' +require 'shipengine_api/models/package' +require 'shipengine_api/models/package_list_response_body' +require 'shipengine_api/models/paged_list_response_body' +require 'shipengine_api/models/pagination_link' +require 'shipengine_api/models/prev' +require 'shipengine_api/models/process_batch_request_body' +require 'shipengine_api/models/provider_error' +require 'shipengine_api/models/purchase_label_request_body' +require 'shipengine_api/models/purchase_label_without_shipment_request_body' +require 'shipengine_api/models/rate' +require 'shipengine_api/models/rate_estimate_request_body' +require 'shipengine_api/models/rate_request_body' +require 'shipengine_api/models/rate_response_body' +require 'shipengine_api/models/rate_response_status' +require 'shipengine_api/models/rate_shipment_request_body' +require 'shipengine_api/models/rate_shipment_response_body' +require 'shipengine_api/models/rate_shipments_request_body' +require 'shipengine_api/models/rate_type' +require 'shipengine_api/models/response_message' +require 'shipengine_api/models/royal_mail_account_information_request_body' +require 'shipengine_api/models/rr_donnelley_account_information_request_body' +require 'shipengine_api/models/service' +require 'shipengine_api/models/shipment' +require 'shipengine_api/models/shipment_add_tag_response_body' +require 'shipengine_api/models/shipment_errors_response_body' +require 'shipengine_api/models/shipment_package' +require 'shipengine_api/models/shipment_response_error' +require 'shipengine_api/models/shipment_status' +require 'shipengine_api/models/shipments_sort_by' +require 'shipengine_api/models/shopify_access_token_request_body' +require 'shipengine_api/models/smart_post_endorsement' +require 'shipengine_api/models/smart_post_hub' +require 'shipengine_api/models/sort_by' +require 'shipengine_api/models/sort_dir' +require 'shipengine_api/models/stamps_account_information_request_body' +require 'shipengine_api/models/stamps_account_url_response_body' +require 'shipengine_api/models/stamps_account_urls_request_body' +require 'shipengine_api/models/stamps_account_urls_response_body' +require 'shipengine_api/models/tag_response_body' +require 'shipengine_api/models/track_event' +require 'shipengine_api/models/tracking_information_response_body' +require 'shipengine_api/models/tracking_status' +require 'shipengine_api/models/type' +require 'shipengine_api/models/update_webhook_request_body' +require 'shipengine_api/models/ups_account_information_request_body' +require 'shipengine_api/models/ups_account_settings' +require 'shipengine_api/models/ups_invoice' +require 'shipengine_api/models/ups_pickup_type' +require 'shipengine_api/models/url_type' +require 'shipengine_api/models/v1_labels_response' +require 'shipengine_api/models/validate_address' +require 'shipengine_api/models/validation_status' +require 'shipengine_api/models/void_label_response_body' +require 'shipengine_api/models/warehouse' +require 'shipengine_api/models/warehouse_list_response_body' +require 'shipengine_api/models/warehouse_request_body' +require 'shipengine_api/models/webhook_response_body' +require 'shipengine_api/models/weight' +require 'shipengine_api/models/weight_unit' + +# APIs +require 'shipengine_api/api/address_validation_api' +require 'shipengine_api/api/batches_api' +require 'shipengine_api/api/carrier_accounts_api' +require 'shipengine_api/api/carriers_api' +require 'shipengine_api/api/environment_api' +require 'shipengine_api/api/insurance_api' +require 'shipengine_api/api/labels_api' +require 'shipengine_api/api/manifests_api' +require 'shipengine_api/api/marketplace_accounts_api' +require 'shipengine_api/api/packages_api' +require 'shipengine_api/api/rates_api' +require 'shipengine_api/api/shipments_api' +require 'shipengine_api/api/tags_api' +require 'shipengine_api/api/tracking_api' +require 'shipengine_api/api/warehouses_api' + +module ShipEngineApi + class << self + # Customize default settings for the SDK using block. + # ShipEngineApi.configure do |config| + # config.username = "xxx" + # config.password = "xxx" + # end + # If no block given, return the default Configuration object. + def configure + if block_given? + yield(Configuration.default) + else + Configuration.default + end + end + end +end diff --git a/lib/shipengine_api/api/address_validation_api.rb b/lib/shipengine_api/api/address_validation_api.rb new file mode 100755 index 0000000..4e746bd --- /dev/null +++ b/lib/shipengine_api/api/address_validation_api.rb @@ -0,0 +1,77 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class AddressValidationApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # addresses.validate_addresses + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array] + def v1_addresses_validate_post(body, opts = {}) + data, _status_code, _headers = v1_addresses_validate_post_with_http_info(body, opts) + data + end + + # addresses.validate_addresses + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + def v1_addresses_validate_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AddressValidationApi.v1_addresses_validate_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AddressValidationApi.v1_addresses_validate_post" + end + # resource path + local_var_path = '/v1/addresses/validate' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Array') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AddressValidationApi#v1_addresses_validate_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api/batches_api.rb b/lib/shipengine_api/api/batches_api.rb new file mode 100755 index 0000000..690ca64 --- /dev/null +++ b/lib/shipengine_api/api/batches_api.rb @@ -0,0 +1,566 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class BatchesApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # batches.add_to_batch + # + # @param batch_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_batches_add_by_batch_id_post(batch_id, body, opts = {}) + v1_batches_add_by_batch_id_post_with_http_info(batch_id, body, opts) + nil + end + + # batches.add_to_batch + # + # @param batch_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_batches_add_by_batch_id_post_with_http_info(batch_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: BatchesApi.v1_batches_add_by_batch_id_post ...' + end + # verify the required parameter 'batch_id' is set + if @api_client.config.client_side_validation && batch_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchesApi.v1_batches_add_by_batch_id_post" + end + if @api_client.config.client_side_validation && batch_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.v1_batches_add_by_batch_id_post, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && batch_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.v1_batches_add_by_batch_id_post, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'batch_id' when calling BatchesApi.v1_batches_add_by_batch_id_post, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling BatchesApi.v1_batches_add_by_batch_id_post" + end + # resource path + local_var_path = '/v1/batches/{batch_id}/add'.sub('{' + 'batch_id' + '}', batch_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: BatchesApi#v1_batches_add_by_batch_id_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # batches.get_by_id + # + # @param batch_id + # @param [Hash] opts the optional parameters + # @return [Batch] + def v1_batches_by_batch_id_get(batch_id, opts = {}) + data, _status_code, _headers = v1_batches_by_batch_id_get_with_http_info(batch_id, opts) + data + end + + # batches.get_by_id + # + # @param batch_id + # @param [Hash] opts the optional parameters + # @return [Array<(Batch, Fixnum, Hash)>] Batch data, response status code and response headers + def v1_batches_by_batch_id_get_with_http_info(batch_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: BatchesApi.v1_batches_by_batch_id_get ...' + end + # verify the required parameter 'batch_id' is set + if @api_client.config.client_side_validation && batch_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchesApi.v1_batches_by_batch_id_get" + end + if @api_client.config.client_side_validation && batch_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.v1_batches_by_batch_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && batch_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.v1_batches_by_batch_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'batch_id' when calling BatchesApi.v1_batches_by_batch_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/batches/{batch_id}'.sub('{' + 'batch_id' + '}', batch_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Batch') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: BatchesApi#v1_batches_by_batch_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # batches.find_errors + # + # @param batch_id + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page + # @option opts [Integer] :pagesize + # @return [BatchErrorsResponseBody] + def v1_batches_errors_by_batch_id_get(batch_id, opts = {}) + data, _status_code, _headers = v1_batches_errors_by_batch_id_get_with_http_info(batch_id, opts) + data + end + + # batches.find_errors + # + # @param batch_id + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page + # @option opts [Integer] :pagesize + # @return [Array<(BatchErrorsResponseBody, Fixnum, Hash)>] BatchErrorsResponseBody data, response status code and response headers + def v1_batches_errors_by_batch_id_get_with_http_info(batch_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: BatchesApi.v1_batches_errors_by_batch_id_get ...' + end + # verify the required parameter 'batch_id' is set + if @api_client.config.client_side_validation && batch_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchesApi.v1_batches_errors_by_batch_id_get" + end + if @api_client.config.client_side_validation && batch_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.v1_batches_errors_by_batch_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && batch_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.v1_batches_errors_by_batch_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'batch_id' when calling BatchesApi.v1_batches_errors_by_batch_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/batches/{batch_id}/errors'.sub('{' + 'batch_id' + '}', batch_id.to_s) + + # query parameters + query_params = {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'pagesize'] = opts[:'pagesize'] if !opts[:'pagesize'].nil? + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'BatchErrorsResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: BatchesApi#v1_batches_errors_by_batch_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # batches.get_by_external_id + # + # @param external_batch_id + # @param [Hash] opts the optional parameters + # @return [Batch] + def v1_batches_external_batch_id_by_external_batch_id_get(external_batch_id, opts = {}) + data, _status_code, _headers = v1_batches_external_batch_id_by_external_batch_id_get_with_http_info(external_batch_id, opts) + data + end + + # batches.get_by_external_id + # + # @param external_batch_id + # @param [Hash] opts the optional parameters + # @return [Array<(Batch, Fixnum, Hash)>] Batch data, response status code and response headers + def v1_batches_external_batch_id_by_external_batch_id_get_with_http_info(external_batch_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: BatchesApi.v1_batches_external_batch_id_by_external_batch_id_get ...' + end + # verify the required parameter 'external_batch_id' is set + if @api_client.config.client_side_validation && external_batch_id.nil? + fail ArgumentError, "Missing the required parameter 'external_batch_id' when calling BatchesApi.v1_batches_external_batch_id_by_external_batch_id_get" + end + if @api_client.config.client_side_validation && external_batch_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "external_batch_id" when calling BatchesApi.v1_batches_external_batch_id_by_external_batch_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && external_batch_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "external_batch_id" when calling BatchesApi.v1_batches_external_batch_id_by_external_batch_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && external_batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'external_batch_id' when calling BatchesApi.v1_batches_external_batch_id_by_external_batch_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/batches/external_batch_id/{external_batch_id}'.sub('{' + 'external_batch_id' + '}', external_batch_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Batch') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: BatchesApi#v1_batches_external_batch_id_by_external_batch_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # batches.find + # + # @param [Hash] opts the optional parameters + # @option opts [String] :status + # @option opts [Integer] :page + # @option opts [Integer] :page_size + # @option opts [String] :sort_dir + # @option opts [String] :sort_by + # @return [ListBatchResponseBody] + def v1_batches_get(opts = {}) + data, _status_code, _headers = v1_batches_get_with_http_info(opts) + data + end + + # batches.find + # + # @param [Hash] opts the optional parameters + # @option opts [String] :status + # @option opts [Integer] :page + # @option opts [Integer] :page_size + # @option opts [String] :sort_dir + # @option opts [String] :sort_by + # @return [Array<(ListBatchResponseBody, Fixnum, Hash)>] ListBatchResponseBody data, response status code and response headers + def v1_batches_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: BatchesApi.v1_batches_get ...' + end + if @api_client.config.client_side_validation && opts[:'status'] && !['open', 'queued', 'processing', 'completed', 'completed_with_errors', 'archived', 'notifying', 'invalid'].include?(opts[:'status']) + fail ArgumentError, 'invalid value for "status", must be one of open, queued, processing, completed, completed_with_errors, archived, notifying, invalid' + end + if @api_client.config.client_side_validation && opts[:'sort_dir'] && !['asc', 'desc'].include?(opts[:'sort_dir']) + fail ArgumentError, 'invalid value for "sort_dir", must be one of asc, desc' + end + if @api_client.config.client_side_validation && opts[:'sort_by'] && !['ship_date', 'processed_at'].include?(opts[:'sort_by']) + fail ArgumentError, 'invalid value for "sort_by", must be one of ship_date, processed_at' + end + # resource path + local_var_path = '/v1/batches' + + # query parameters + query_params = {} + query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'sort_dir'] = opts[:'sort_dir'] if !opts[:'sort_dir'].nil? + query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ListBatchResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: BatchesApi#v1_batches_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # batches.create + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Batch] + def v1_batches_post(body, opts = {}) + data, _status_code, _headers = v1_batches_post_with_http_info(body, opts) + data + end + + # batches.create + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(Batch, Fixnum, Hash)>] Batch data, response status code and response headers + def v1_batches_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: BatchesApi.v1_batches_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling BatchesApi.v1_batches_post" + end + # resource path + local_var_path = '/v1/batches' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Batch') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: BatchesApi#v1_batches_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # batches.process + # + # @param batch_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_batches_process_labels_by_batch_id_post(batch_id, body, opts = {}) + v1_batches_process_labels_by_batch_id_post_with_http_info(batch_id, body, opts) + nil + end + + # batches.process + # + # @param batch_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_batches_process_labels_by_batch_id_post_with_http_info(batch_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: BatchesApi.v1_batches_process_labels_by_batch_id_post ...' + end + # verify the required parameter 'batch_id' is set + if @api_client.config.client_side_validation && batch_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchesApi.v1_batches_process_labels_by_batch_id_post" + end + if @api_client.config.client_side_validation && batch_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.v1_batches_process_labels_by_batch_id_post, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && batch_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.v1_batches_process_labels_by_batch_id_post, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'batch_id' when calling BatchesApi.v1_batches_process_labels_by_batch_id_post, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling BatchesApi.v1_batches_process_labels_by_batch_id_post" + end + # resource path + local_var_path = '/v1/batches/{batch_id}/process/labels'.sub('{' + 'batch_id' + '}', batch_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: BatchesApi#v1_batches_process_labels_by_batch_id_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # batches.remove_from_batch + # + # @param batch_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_batches_remove_by_batch_id_post(batch_id, body, opts = {}) + v1_batches_remove_by_batch_id_post_with_http_info(batch_id, body, opts) + nil + end + + # batches.remove_from_batch + # + # @param batch_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_batches_remove_by_batch_id_post_with_http_info(batch_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: BatchesApi.v1_batches_remove_by_batch_id_post ...' + end + # verify the required parameter 'batch_id' is set + if @api_client.config.client_side_validation && batch_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchesApi.v1_batches_remove_by_batch_id_post" + end + if @api_client.config.client_side_validation && batch_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.v1_batches_remove_by_batch_id_post, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && batch_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.v1_batches_remove_by_batch_id_post, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'batch_id' when calling BatchesApi.v1_batches_remove_by_batch_id_post, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling BatchesApi.v1_batches_remove_by_batch_id_post" + end + # resource path + local_var_path = '/v1/batches/{batch_id}/remove'.sub('{' + 'batch_id' + '}', batch_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: BatchesApi#v1_batches_remove_by_batch_id_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api/carrier_accounts_api.rb b/lib/shipengine_api/api/carrier_accounts_api.rb new file mode 100755 index 0000000..1a8a1b5 --- /dev/null +++ b/lib/shipengine_api/api/carrier_accounts_api.rb @@ -0,0 +1,2838 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class CarrierAccountsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # access_worldwide_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_access_worldwide_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_access_worldwide_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # access_worldwide_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_access_worldwide_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_access_worldwide_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_access_worldwide_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_access_worldwide_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_access_worldwide_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_access_worldwide_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/access_worldwide/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_access_worldwide_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # access_worldwide_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_access_worldwide_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_access_worldwide_post_with_http_info(body, opts) + data + end + + # access_worldwide_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_access_worldwide_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_access_worldwide_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_access_worldwide_post" + end + # resource path + local_var_path = '/v1/connections/carriers/access_worldwide' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_access_worldwide_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # apc_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_apc_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_apc_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # apc_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_apc_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_apc_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_apc_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_apc_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_apc_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_apc_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/apc/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_apc_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # apc_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_apc_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_apc_post_with_http_info(body, opts) + data + end + + # apc_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_apc_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_apc_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_apc_post" + end + # resource path + local_var_path = '/v1/connections/carriers/apc' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_apc_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # asendia_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_asendia_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_asendia_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # asendia_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_asendia_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_asendia_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_asendia_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_asendia_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_asendia_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_asendia_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/asendia/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_asendia_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # asendia_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_asendia_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_asendia_post_with_http_info(body, opts) + data + end + + # asendia_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_asendia_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_asendia_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_asendia_post" + end + # resource path + local_var_path = '/v1/connections/carriers/asendia' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_asendia_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # dhl_ecommerce_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # dhl_ecommerce_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/dhl_ecommerce/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_dhl_ecommerce_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # dhl_ecommerce_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_dhl_ecommerce_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_dhl_ecommerce_post_with_http_info(body, opts) + data + end + + # dhl_ecommerce_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_dhl_ecommerce_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_dhl_ecommerce_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_dhl_ecommerce_post" + end + # resource path + local_var_path = '/v1/connections/carriers/dhl_ecommerce' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_dhl_ecommerce_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # dhl_express_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_dhl_express_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_dhl_express_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # dhl_express_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_dhl_express_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_dhl_express_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/dhl_express/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_dhl_express_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # dhl_express_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_dhl_express_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_dhl_express_post_with_http_info(body, opts) + data + end + + # dhl_express_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_dhl_express_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_dhl_express_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_post" + end + # resource path + local_var_path = '/v1/connections/carriers/dhl_express' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_dhl_express_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # dhl_express_account_carrier.get_settings + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [DhlExpressAccountSettings] + def v1_connections_carriers_dhl_express_settings_by_carrier_id_get(carrier_id, opts = {}) + data, _status_code, _headers = v1_connections_carriers_dhl_express_settings_by_carrier_id_get_with_http_info(carrier_id, opts) + data + end + + # dhl_express_account_carrier.get_settings + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(DhlExpressAccountSettings, Fixnum, Hash)>] DhlExpressAccountSettings data, response status code and response headers + def v1_connections_carriers_dhl_express_settings_by_carrier_id_get_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_dhl_express_settings_by_carrier_id_get ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_settings_by_carrier_id_get" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_settings_by_carrier_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_settings_by_carrier_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_settings_by_carrier_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/dhl_express/{carrier_id}/settings'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'DhlExpressAccountSettings') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_dhl_express_settings_by_carrier_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # dhl_express_account_carrier.update_settings + # + # @param carrier_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_dhl_express_settings_by_carrier_id_put(carrier_id, body, opts = {}) + v1_connections_carriers_dhl_express_settings_by_carrier_id_put_with_http_info(carrier_id, body, opts) + nil + end + + # dhl_express_account_carrier.update_settings + # + # @param carrier_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_dhl_express_settings_by_carrier_id_put_with_http_info(carrier_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_dhl_express_settings_by_carrier_id_put ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_settings_by_carrier_id_put" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_settings_by_carrier_id_put, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_settings_by_carrier_id_put, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_settings_by_carrier_id_put, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_settings_by_carrier_id_put" + end + # resource path + local_var_path = '/v1/connections/carriers/dhl_express/{carrier_id}/settings'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_dhl_express_settings_by_carrier_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # dhl_express_uk_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_dhl_express_uk_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_dhl_express_uk_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # dhl_express_uk_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_dhl_express_uk_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_dhl_express_uk_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_uk_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_uk_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_uk_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_uk_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/dhl_express_uk/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_dhl_express_uk_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # dhl_express_uk_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_dhl_express_uk_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_dhl_express_uk_post_with_http_info(body, opts) + data + end + + # dhl_express_uk_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_dhl_express_uk_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_dhl_express_uk_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_dhl_express_uk_post" + end + # resource path + local_var_path = '/v1/connections/carriers/dhl_express_uk' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_dhl_express_uk_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # dpd_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_dpd_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_dpd_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # dpd_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_dpd_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_dpd_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_dpd_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_dpd_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_dpd_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_dpd_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/dpd/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_dpd_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # dpd_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_dpd_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_dpd_post_with_http_info(body, opts) + data + end + + # dpd_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_dpd_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_dpd_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_dpd_post" + end + # resource path + local_var_path = '/v1/connections/carriers/dpd' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_dpd_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # endicia_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_endicia_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_endicia_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # endicia_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_endicia_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_endicia_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_endicia_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_endicia_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_endicia_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_endicia_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/endicia/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_endicia_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # endicia_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_endicia_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_endicia_post_with_http_info(body, opts) + data + end + + # endicia_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_endicia_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_endicia_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_endicia_post" + end + # resource path + local_var_path = '/v1/connections/carriers/endicia' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_endicia_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # fedex_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_fedex_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_fedex_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # fedex_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_fedex_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_fedex_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_fedex_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_fedex_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_fedex_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_fedex_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/fedex/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_fedex_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # fedex_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_fedex_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_fedex_post_with_http_info(body, opts) + data + end + + # fedex_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_fedex_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_fedex_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_fedex_post" + end + # resource path + local_var_path = '/v1/connections/carriers/fedex' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_fedex_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # fedex_account_carrier.get_settings + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [UpsAccountSettings] + def v1_connections_carriers_fedex_settings_by_carrier_id_get(carrier_id, opts = {}) + data, _status_code, _headers = v1_connections_carriers_fedex_settings_by_carrier_id_get_with_http_info(carrier_id, opts) + data + end + + # fedex_account_carrier.get_settings + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(UpsAccountSettings, Fixnum, Hash)>] UpsAccountSettings data, response status code and response headers + def v1_connections_carriers_fedex_settings_by_carrier_id_get_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_fedex_settings_by_carrier_id_get ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_fedex_settings_by_carrier_id_get" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_fedex_settings_by_carrier_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_fedex_settings_by_carrier_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_fedex_settings_by_carrier_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/fedex/{carrier_id}/settings'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'UpsAccountSettings') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_fedex_settings_by_carrier_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # fedex_account_carrier.update_settings + # + # @param carrier_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_fedex_settings_by_carrier_id_put(carrier_id, body, opts = {}) + v1_connections_carriers_fedex_settings_by_carrier_id_put_with_http_info(carrier_id, body, opts) + nil + end + + # fedex_account_carrier.update_settings + # + # @param carrier_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_fedex_settings_by_carrier_id_put_with_http_info(carrier_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_fedex_settings_by_carrier_id_put ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_fedex_settings_by_carrier_id_put" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_fedex_settings_by_carrier_id_put, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_fedex_settings_by_carrier_id_put, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_fedex_settings_by_carrier_id_put, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_fedex_settings_by_carrier_id_put" + end + # resource path + local_var_path = '/v1/connections/carriers/fedex/{carrier_id}/settings'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_fedex_settings_by_carrier_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # fedex_uk_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_fedex_uk_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_fedex_uk_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # fedex_uk_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_fedex_uk_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_fedex_uk_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_fedex_uk_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_fedex_uk_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_fedex_uk_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_fedex_uk_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/fedex_uk/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_fedex_uk_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # fedex_uk_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_fedex_uk_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_fedex_uk_post_with_http_info(body, opts) + data + end + + # fedex_uk_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_fedex_uk_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_fedex_uk_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_fedex_uk_post" + end + # resource path + local_var_path = '/v1/connections/carriers/fedex_uk' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_fedex_uk_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # first_mile_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_firstmile_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_firstmile_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # first_mile_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_firstmile_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_firstmile_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_firstmile_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_firstmile_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_firstmile_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_firstmile_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/firstmile/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_firstmile_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # first_mile_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_firstmile_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_firstmile_post_with_http_info(body, opts) + data + end + + # first_mile_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_firstmile_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_firstmile_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_firstmile_post" + end + # resource path + local_var_path = '/v1/connections/carriers/firstmile' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_firstmile_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # globegistics_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_globegistics_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_globegistics_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # globegistics_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_globegistics_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_globegistics_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_globegistics_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_globegistics_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_globegistics_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_globegistics_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/globegistics/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_globegistics_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # globegistics_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_globegistics_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_globegistics_post_with_http_info(body, opts) + data + end + + # globegistics_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_globegistics_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_globegistics_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_globegistics_post" + end + # resource path + local_var_path = '/v1/connections/carriers/globegistics' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_globegistics_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # imex_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_imex_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_imex_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # imex_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_imex_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_imex_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_imex_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_imex_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_imex_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_imex_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/imex/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_imex_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # imex_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_imex_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_imex_post_with_http_info(body, opts) + data + end + + # imex_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_imex_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_imex_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_imex_post" + end + # resource path + local_var_path = '/v1/connections/carriers/imex' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_imex_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # newgistics_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_newgistics_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_newgistics_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # newgistics_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_newgistics_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_newgistics_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_newgistics_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_newgistics_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_newgistics_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_newgistics_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/newgistics/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_newgistics_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # newgistics_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_newgistics_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_newgistics_post_with_http_info(body, opts) + data + end + + # newgistics_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_newgistics_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_newgistics_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_newgistics_post" + end + # resource path + local_var_path = '/v1/connections/carriers/newgistics' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_newgistics_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # newgistics_account_carrier.update_settings + # + # @param carrier_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_newgistics_settings_by_carrier_id_put(carrier_id, body, opts = {}) + v1_connections_carriers_newgistics_settings_by_carrier_id_put_with_http_info(carrier_id, body, opts) + nil + end + + # newgistics_account_carrier.update_settings + # + # @param carrier_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_newgistics_settings_by_carrier_id_put_with_http_info(carrier_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_newgistics_settings_by_carrier_id_put ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_newgistics_settings_by_carrier_id_put" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_newgistics_settings_by_carrier_id_put, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_newgistics_settings_by_carrier_id_put, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_newgistics_settings_by_carrier_id_put, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_newgistics_settings_by_carrier_id_put" + end + # resource path + local_var_path = '/v1/connections/carriers/newgistics/{carrier_id}/settings'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_newgistics_settings_by_carrier_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # ontrac_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_ontrac_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_ontrac_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # ontrac_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_ontrac_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_ontrac_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_ontrac_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_ontrac_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_ontrac_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_ontrac_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/ontrac/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_ontrac_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # ontrac_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_ontrac_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_ontrac_post_with_http_info(body, opts) + data + end + + # ontrac_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_ontrac_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_ontrac_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_ontrac_post" + end + # resource path + local_var_path = '/v1/connections/carriers/ontrac' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_ontrac_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # royal_mail_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_royal_mail_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_royal_mail_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # royal_mail_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_royal_mail_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_royal_mail_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_royal_mail_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_royal_mail_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_royal_mail_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_royal_mail_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/royal_mail/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_royal_mail_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # royal_mail_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_royal_mail_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_royal_mail_post_with_http_info(body, opts) + data + end + + # royal_mail_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_royal_mail_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_royal_mail_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_royal_mail_post" + end + # resource path + local_var_path = '/v1/connections/carriers/royal_mail' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_royal_mail_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # rr_donnelley_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_rr_donnelley_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_rr_donnelley_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # rr_donnelley_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_rr_donnelley_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_rr_donnelley_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_rr_donnelley_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_rr_donnelley_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_rr_donnelley_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_rr_donnelley_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/rr_donnelley/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_rr_donnelley_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # rr_donnelley_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_rr_donnelley_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_rr_donnelley_post_with_http_info(body, opts) + data + end + + # rr_donnelley_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_rr_donnelley_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_rr_donnelley_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_rr_donnelley_post" + end + # resource path + local_var_path = '/v1/connections/carriers/rr_donnelley' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_rr_donnelley_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # stamps_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_stamps_com_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_stamps_com_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # stamps_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_stamps_com_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_stamps_com_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_stamps_com_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_stamps_com_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_stamps_com_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_stamps_com_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/stamps_com/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_stamps_com_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # stamps_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_stamps_com_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_stamps_com_post_with_http_info(body, opts) + data + end + + # stamps_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_stamps_com_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_stamps_com_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_stamps_com_post" + end + # resource path + local_var_path = '/v1/connections/carriers/stamps_com' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_stamps_com_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # stamps_account_carrier.get_account_url + # + # @param carrier_id + # @param body + # @param [Hash] opts the optional parameters + # @return [StampsAccountUrlsResponseBody] + def v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put(carrier_id, body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put_with_http_info(carrier_id, body, opts) + data + end + + # stamps_account_carrier.get_account_url + # + # @param carrier_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(StampsAccountUrlsResponseBody, Fixnum, Hash)>] StampsAccountUrlsResponseBody data, response status code and response headers + def v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put_with_http_info(carrier_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put" + end + # resource path + local_var_path = '/v1/connections/carriers/stamps_com/{carrier_id}/request_account_url'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'StampsAccountUrlsResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_stamps_com_request_account_url_by_carrier_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # ups_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_ups_by_carrier_id_delete(carrier_id, opts = {}) + v1_connections_carriers_ups_by_carrier_id_delete_with_http_info(carrier_id, opts) + nil + end + + # ups_account_carrier.disconnect_account + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_ups_by_carrier_id_delete_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_ups_by_carrier_id_delete ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_ups_by_carrier_id_delete" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_ups_by_carrier_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_ups_by_carrier_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_ups_by_carrier_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/ups/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_ups_by_carrier_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # ups_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectAccountResponseBody] + def v1_connections_carriers_ups_post(body, opts = {}) + data, _status_code, _headers = v1_connections_carriers_ups_post_with_http_info(body, opts) + data + end + + # ups_account_carrier.connect_account + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectAccountResponseBody, Fixnum, Hash)>] ConnectAccountResponseBody data, response status code and response headers + def v1_connections_carriers_ups_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_ups_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_ups_post" + end + # resource path + local_var_path = '/v1/connections/carriers/ups' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectAccountResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_ups_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # ups_account_carrier.get_settings + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [UpsAccountSettings] + def v1_connections_carriers_ups_settings_by_carrier_id_get(carrier_id, opts = {}) + data, _status_code, _headers = v1_connections_carriers_ups_settings_by_carrier_id_get_with_http_info(carrier_id, opts) + data + end + + # ups_account_carrier.get_settings + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(UpsAccountSettings, Fixnum, Hash)>] UpsAccountSettings data, response status code and response headers + def v1_connections_carriers_ups_settings_by_carrier_id_get_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_ups_settings_by_carrier_id_get ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_ups_settings_by_carrier_id_get" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_ups_settings_by_carrier_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_ups_settings_by_carrier_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_ups_settings_by_carrier_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/connections/carriers/ups/{carrier_id}/settings'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'UpsAccountSettings') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_ups_settings_by_carrier_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # ups_account_carrier.update_settings + # + # @param carrier_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_connections_carriers_ups_settings_by_carrier_id_put(carrier_id, body, opts = {}) + v1_connections_carriers_ups_settings_by_carrier_id_put_with_http_info(carrier_id, body, opts) + nil + end + + # ups_account_carrier.update_settings + # + # @param carrier_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_connections_carriers_ups_settings_by_carrier_id_put_with_http_info(carrier_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarrierAccountsApi.v1_connections_carriers_ups_settings_by_carrier_id_put ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_ups_settings_by_carrier_id_put" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_ups_settings_by_carrier_id_put, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarrierAccountsApi.v1_connections_carriers_ups_settings_by_carrier_id_put, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarrierAccountsApi.v1_connections_carriers_ups_settings_by_carrier_id_put, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarrierAccountsApi.v1_connections_carriers_ups_settings_by_carrier_id_put" + end + # resource path + local_var_path = '/v1/connections/carriers/ups/{carrier_id}/settings'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarrierAccountsApi#v1_connections_carriers_ups_settings_by_carrier_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api/carriers_api.rb b/lib/shipengine_api/api/carriers_api.rb new file mode 100755 index 0000000..53afe99 --- /dev/null +++ b/lib/shipengine_api/api/carriers_api.rb @@ -0,0 +1,407 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class CarriersApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # carriers.add_funds + # + # @param carrier_id + # @param body + # @param [Hash] opts the optional parameters + # @return [BalanceResponseBody] + def v1_carriers_add_funds_by_carrier_id_put(carrier_id, body, opts = {}) + data, _status_code, _headers = v1_carriers_add_funds_by_carrier_id_put_with_http_info(carrier_id, body, opts) + data + end + + # carriers.add_funds + # + # @param carrier_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(BalanceResponseBody, Fixnum, Hash)>] BalanceResponseBody data, response status code and response headers + def v1_carriers_add_funds_by_carrier_id_put_with_http_info(carrier_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarriersApi.v1_carriers_add_funds_by_carrier_id_put ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarriersApi.v1_carriers_add_funds_by_carrier_id_put" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarriersApi.v1_carriers_add_funds_by_carrier_id_put, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarriersApi.v1_carriers_add_funds_by_carrier_id_put, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarriersApi.v1_carriers_add_funds_by_carrier_id_put, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CarriersApi.v1_carriers_add_funds_by_carrier_id_put" + end + # resource path + local_var_path = '/v1/carriers/{carrier_id}/add_funds'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'BalanceResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarriersApi#v1_carriers_add_funds_by_carrier_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # carriers.get_by_id + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Carrier] + def v1_carriers_by_carrier_id_get(carrier_id, opts = {}) + data, _status_code, _headers = v1_carriers_by_carrier_id_get_with_http_info(carrier_id, opts) + data + end + + # carriers.get_by_id + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(Carrier, Fixnum, Hash)>] Carrier data, response status code and response headers + def v1_carriers_by_carrier_id_get_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarriersApi.v1_carriers_by_carrier_id_get ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarriersApi.v1_carriers_by_carrier_id_get" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarriersApi.v1_carriers_by_carrier_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarriersApi.v1_carriers_by_carrier_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarriersApi.v1_carriers_by_carrier_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/carriers/{carrier_id}'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Carrier') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarriersApi#v1_carriers_by_carrier_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # carriers.find + # + # @param [Hash] opts the optional parameters + # @return [CarrierListResponseBody] + def v1_carriers_get(opts = {}) + data, _status_code, _headers = v1_carriers_get_with_http_info(opts) + data + end + + # carriers.find + # + # @param [Hash] opts the optional parameters + # @return [Array<(CarrierListResponseBody, Fixnum, Hash)>] CarrierListResponseBody data, response status code and response headers + def v1_carriers_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarriersApi.v1_carriers_get ...' + end + # resource path + local_var_path = '/v1/carriers' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'CarrierListResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarriersApi#v1_carriers_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # carriers.get_options + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [CarrierListOptionsResponseBody] + def v1_carriers_options_by_carrier_id_get(carrier_id, opts = {}) + data, _status_code, _headers = v1_carriers_options_by_carrier_id_get_with_http_info(carrier_id, opts) + data + end + + # carriers.get_options + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(CarrierListOptionsResponseBody, Fixnum, Hash)>] CarrierListOptionsResponseBody data, response status code and response headers + def v1_carriers_options_by_carrier_id_get_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarriersApi.v1_carriers_options_by_carrier_id_get ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarriersApi.v1_carriers_options_by_carrier_id_get" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarriersApi.v1_carriers_options_by_carrier_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarriersApi.v1_carriers_options_by_carrier_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarriersApi.v1_carriers_options_by_carrier_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/carriers/{carrier_id}/options'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'CarrierListOptionsResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarriersApi#v1_carriers_options_by_carrier_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # carriers.find_packages + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [PackageListResponseBody] + def v1_carriers_packages_by_carrier_id_get(carrier_id, opts = {}) + data, _status_code, _headers = v1_carriers_packages_by_carrier_id_get_with_http_info(carrier_id, opts) + data + end + + # carriers.find_packages + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(PackageListResponseBody, Fixnum, Hash)>] PackageListResponseBody data, response status code and response headers + def v1_carriers_packages_by_carrier_id_get_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarriersApi.v1_carriers_packages_by_carrier_id_get ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarriersApi.v1_carriers_packages_by_carrier_id_get" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarriersApi.v1_carriers_packages_by_carrier_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarriersApi.v1_carriers_packages_by_carrier_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarriersApi.v1_carriers_packages_by_carrier_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/carriers/{carrier_id}/packages'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'PackageListResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarriersApi#v1_carriers_packages_by_carrier_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # carriers.find_services + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [CarrierListServicesResponseBody] + def v1_carriers_services_by_carrier_id_get(carrier_id, opts = {}) + data, _status_code, _headers = v1_carriers_services_by_carrier_id_get_with_http_info(carrier_id, opts) + data + end + + # carriers.find_services + # + # @param carrier_id + # @param [Hash] opts the optional parameters + # @return [Array<(CarrierListServicesResponseBody, Fixnum, Hash)>] CarrierListServicesResponseBody data, response status code and response headers + def v1_carriers_services_by_carrier_id_get_with_http_info(carrier_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CarriersApi.v1_carriers_services_by_carrier_id_get ...' + end + # verify the required parameter 'carrier_id' is set + if @api_client.config.client_side_validation && carrier_id.nil? + fail ArgumentError, "Missing the required parameter 'carrier_id' when calling CarriersApi.v1_carriers_services_by_carrier_id_get" + end + if @api_client.config.client_side_validation && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarriersApi.v1_carriers_services_by_carrier_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id" when calling CarriersApi.v1_carriers_services_by_carrier_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'carrier_id' when calling CarriersApi.v1_carriers_services_by_carrier_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/carriers/{carrier_id}/services'.sub('{' + 'carrier_id' + '}', carrier_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'CarrierListServicesResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CarriersApi#v1_carriers_services_by_carrier_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api/environment_api.rb b/lib/shipengine_api/api/environment_api.rb new file mode 100755 index 0000000..18dbd80 --- /dev/null +++ b/lib/shipengine_api/api/environment_api.rb @@ -0,0 +1,327 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class EnvironmentApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # environment.delete_webhook + # + # @param webhook_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_environment_webhooks_by_webhook_id_delete(webhook_id, opts = {}) + v1_environment_webhooks_by_webhook_id_delete_with_http_info(webhook_id, opts) + nil + end + + # environment.delete_webhook + # + # @param webhook_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_environment_webhooks_by_webhook_id_delete_with_http_info(webhook_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EnvironmentApi.v1_environment_webhooks_by_webhook_id_delete ...' + end + # verify the required parameter 'webhook_id' is set + if @api_client.config.client_side_validation && webhook_id.nil? + fail ArgumentError, "Missing the required parameter 'webhook_id' when calling EnvironmentApi.v1_environment_webhooks_by_webhook_id_delete" + end + if @api_client.config.client_side_validation && webhook_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "webhook_id" when calling EnvironmentApi.v1_environment_webhooks_by_webhook_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && webhook_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "webhook_id" when calling EnvironmentApi.v1_environment_webhooks_by_webhook_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && webhook_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'webhook_id' when calling EnvironmentApi.v1_environment_webhooks_by_webhook_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/environment/webhooks/{webhook_id}'.sub('{' + 'webhook_id' + '}', webhook_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EnvironmentApi#v1_environment_webhooks_by_webhook_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # environment.get_webhook_by_id + # + # @param webhook_id + # @param [Hash] opts the optional parameters + # @return [WebhookResponseBody] + def v1_environment_webhooks_by_webhook_id_get(webhook_id, opts = {}) + data, _status_code, _headers = v1_environment_webhooks_by_webhook_id_get_with_http_info(webhook_id, opts) + data + end + + # environment.get_webhook_by_id + # + # @param webhook_id + # @param [Hash] opts the optional parameters + # @return [Array<(WebhookResponseBody, Fixnum, Hash)>] WebhookResponseBody data, response status code and response headers + def v1_environment_webhooks_by_webhook_id_get_with_http_info(webhook_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EnvironmentApi.v1_environment_webhooks_by_webhook_id_get ...' + end + # verify the required parameter 'webhook_id' is set + if @api_client.config.client_side_validation && webhook_id.nil? + fail ArgumentError, "Missing the required parameter 'webhook_id' when calling EnvironmentApi.v1_environment_webhooks_by_webhook_id_get" + end + if @api_client.config.client_side_validation && webhook_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "webhook_id" when calling EnvironmentApi.v1_environment_webhooks_by_webhook_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && webhook_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "webhook_id" when calling EnvironmentApi.v1_environment_webhooks_by_webhook_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && webhook_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'webhook_id' when calling EnvironmentApi.v1_environment_webhooks_by_webhook_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/environment/webhooks/{webhook_id}'.sub('{' + 'webhook_id' + '}', webhook_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'WebhookResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EnvironmentApi#v1_environment_webhooks_by_webhook_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # environment.update_webhook + # + # @param webhook_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_environment_webhooks_by_webhook_id_put(webhook_id, body, opts = {}) + v1_environment_webhooks_by_webhook_id_put_with_http_info(webhook_id, body, opts) + nil + end + + # environment.update_webhook + # + # @param webhook_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_environment_webhooks_by_webhook_id_put_with_http_info(webhook_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EnvironmentApi.v1_environment_webhooks_by_webhook_id_put ...' + end + # verify the required parameter 'webhook_id' is set + if @api_client.config.client_side_validation && webhook_id.nil? + fail ArgumentError, "Missing the required parameter 'webhook_id' when calling EnvironmentApi.v1_environment_webhooks_by_webhook_id_put" + end + if @api_client.config.client_side_validation && webhook_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "webhook_id" when calling EnvironmentApi.v1_environment_webhooks_by_webhook_id_put, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && webhook_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "webhook_id" when calling EnvironmentApi.v1_environment_webhooks_by_webhook_id_put, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && webhook_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'webhook_id' when calling EnvironmentApi.v1_environment_webhooks_by_webhook_id_put, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling EnvironmentApi.v1_environment_webhooks_by_webhook_id_put" + end + # resource path + local_var_path = '/v1/environment/webhooks/{webhook_id}'.sub('{' + 'webhook_id' + '}', webhook_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EnvironmentApi#v1_environment_webhooks_by_webhook_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # environment.webhooks + # + # @param [Hash] opts the optional parameters + # @return [Array] + def v1_environment_webhooks_get(opts = {}) + data, _status_code, _headers = v1_environment_webhooks_get_with_http_info(opts) + data + end + + # environment.webhooks + # + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + def v1_environment_webhooks_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EnvironmentApi.v1_environment_webhooks_get ...' + end + # resource path + local_var_path = '/v1/environment/webhooks' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Array') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EnvironmentApi#v1_environment_webhooks_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # environment.create_webhook + # + # @param body + # @param [Hash] opts the optional parameters + # @return [WebhookResponseBody] + def v1_environment_webhooks_post(body, opts = {}) + data, _status_code, _headers = v1_environment_webhooks_post_with_http_info(body, opts) + data + end + + # environment.create_webhook + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(WebhookResponseBody, Fixnum, Hash)>] WebhookResponseBody data, response status code and response headers + def v1_environment_webhooks_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EnvironmentApi.v1_environment_webhooks_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling EnvironmentApi.v1_environment_webhooks_post" + end + # resource path + local_var_path = '/v1/environment/webhooks' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'WebhookResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EnvironmentApi#v1_environment_webhooks_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api/insurance_api.rb b/lib/shipengine_api/api/insurance_api.rb new file mode 100755 index 0000000..00aa3fa --- /dev/null +++ b/lib/shipengine_api/api/insurance_api.rb @@ -0,0 +1,125 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class InsuranceApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # insurance.add_funds + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Money] + def v1_insurance_shipsurance_add_funds_patch(body, opts = {}) + data, _status_code, _headers = v1_insurance_shipsurance_add_funds_patch_with_http_info(body, opts) + data + end + + # insurance.add_funds + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(Money, Fixnum, Hash)>] Money data, response status code and response headers + def v1_insurance_shipsurance_add_funds_patch_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: InsuranceApi.v1_insurance_shipsurance_add_funds_patch ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling InsuranceApi.v1_insurance_shipsurance_add_funds_patch" + end + # resource path + local_var_path = '/v1/insurance/shipsurance/add_funds' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Money') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: InsuranceApi#v1_insurance_shipsurance_add_funds_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # insurance.get_balance + # + # @param [Hash] opts the optional parameters + # @return [Money] + def v1_insurance_shipsurance_balance_get(opts = {}) + data, _status_code, _headers = v1_insurance_shipsurance_balance_get_with_http_info(opts) + data + end + + # insurance.get_balance + # + # @param [Hash] opts the optional parameters + # @return [Array<(Money, Fixnum, Hash)>] Money data, response status code and response headers + def v1_insurance_shipsurance_balance_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: InsuranceApi.v1_insurance_shipsurance_balance_get ...' + end + # resource path + local_var_path = '/v1/insurance/shipsurance/balance' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Money') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: InsuranceApi#v1_insurance_shipsurance_balance_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api/labels_api.rb b/lib/shipengine_api/api/labels_api.rb new file mode 100755 index 0000000..2688263 --- /dev/null +++ b/lib/shipengine_api/api/labels_api.rb @@ -0,0 +1,518 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class LabelsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # labels.get_by_id + # + # @param label_id + # @param [Hash] opts the optional parameters + # @return [Label] + def v1_labels_by_label_id_get(label_id, opts = {}) + data, _status_code, _headers = v1_labels_by_label_id_get_with_http_info(label_id, opts) + data + end + + # labels.get_by_id + # + # @param label_id + # @param [Hash] opts the optional parameters + # @return [Array<(Label, Fixnum, Hash)>] Label data, response status code and response headers + def v1_labels_by_label_id_get_with_http_info(label_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LabelsApi.v1_labels_by_label_id_get ...' + end + # verify the required parameter 'label_id' is set + if @api_client.config.client_side_validation && label_id.nil? + fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelsApi.v1_labels_by_label_id_get" + end + if @api_client.config.client_side_validation && label_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "label_id" when calling LabelsApi.v1_labels_by_label_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && label_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "label_id" when calling LabelsApi.v1_labels_by_label_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && label_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'label_id' when calling LabelsApi.v1_labels_by_label_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/labels/{label_id}'.sub('{' + 'label_id' + '}', label_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Label') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LabelsApi#v1_labels_by_label_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Searchforshippinglabelsyou'vecreated + # This endpoint returns a list of labels that you've [created](https://docs.shipengine.com/docs/quickstart-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` > ###### Warning > Test labels (those created with `test_label: true`) are not included in the results. If you've only ever created test labels, then the results will be empty. + # @param [Hash] opts the optional parameters + # @option opts [String] :label_status Only return labels that are currently in the specified status + # @option opts [String] :carrier_id Only return labels for a specific [carrier account](https://docs.shipengine.com/docs/setup-a-carrier) + # @option opts [String] :service_code Only return labels for a specific [carrier service](https://docs.shipengine.com/docs/use-a-specific-service) + # @option opts [String] :tracking_number Only return labels with a specific tracking number + # @option opts [String] :batch_id Only return labels that were created in a specific [batch](https://docs.shipengine.com/docs/using-batches) + # @option opts [String] :warehouse_id Only return labels that originate from a specific [warehouse](https://docs.shipengine.com/docs/ship-from-a-warehouse) + # @option opts [DateTime] :created_at_start Only return labels that were created on or after a specific date/time + # @option opts [DateTime] :created_at_end Only return labels that were created on or before a specific date/time + # @option opts [Integer] :page Return a specific \"page\" of results. Defaults to the first page. If set to a number that's greater than the number of pages of results, an empty page will be returned. (default to 1) + # @option opts [Integer] :page_size The number of labels to return per response. Defaults to 25. (default to 25) + # @option opts [String] :sort_dir Controls the sort order of the query. Defaults to `desc`. + # @option opts [String] :sort_by Controls which property the query is sorted by. Defaults to `created_at`. (default to created_at) + # @return [V1LabelsResponse] + def v1_labels_get(opts = {}) + data, _status_code, _headers = v1_labels_get_with_http_info(opts) + data + end + + # Searchforshippinglabelsyou'vecreated + # This endpoint returns a list of labels that you've [created](https://docs.shipengine.com/docs/quickstart-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` > ###### Warning > Test labels (those created with `test_label: true`) are not included in the results. If you've only ever created test labels, then the results will be empty. + # @param [Hash] opts the optional parameters + # @option opts [String] :label_status Only return labels that are currently in the specified status + # @option opts [String] :carrier_id Only return labels for a specific [carrier account](https://docs.shipengine.com/docs/setup-a-carrier) + # @option opts [String] :service_code Only return labels for a specific [carrier service](https://docs.shipengine.com/docs/use-a-specific-service) + # @option opts [String] :tracking_number Only return labels with a specific tracking number + # @option opts [String] :batch_id Only return labels that were created in a specific [batch](https://docs.shipengine.com/docs/using-batches) + # @option opts [String] :warehouse_id Only return labels that originate from a specific [warehouse](https://docs.shipengine.com/docs/ship-from-a-warehouse) + # @option opts [DateTime] :created_at_start Only return labels that were created on or after a specific date/time + # @option opts [DateTime] :created_at_end Only return labels that were created on or before a specific date/time + # @option opts [Integer] :page Return a specific \"page\" of results. Defaults to the first page. If set to a number that's greater than the number of pages of results, an empty page will be returned. + # @option opts [Integer] :page_size The number of labels to return per response. Defaults to 25. + # @option opts [String] :sort_dir Controls the sort order of the query. Defaults to `desc`. + # @option opts [String] :sort_by Controls which property the query is sorted by. Defaults to `created_at`. + # @return [Array<(V1LabelsResponse, Fixnum, Hash)>] V1LabelsResponse data, response status code and response headers + def v1_labels_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LabelsApi.v1_labels_get ...' + end + if @api_client.config.client_side_validation && opts[:'label_status'] && !['processing', 'completed', 'error', 'voided'].include?(opts[:'label_status']) + fail ArgumentError, 'invalid value for "label_status", must be one of processing, completed, error, voided' + end + if @api_client.config.client_side_validation && !opts[:'carrier_id'].nil? && opts[:'carrier_id'].to_s.length > 25 + fail ArgumentError, 'invalid value for "opts[:"carrier_id"]" when calling LabelsApi.v1_labels_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && !opts[:'carrier_id'].nil? && opts[:'carrier_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"carrier_id"]" when calling LabelsApi.v1_labels_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'carrier_id'].nil? && opts[:'carrier_id'] !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'opts[:\"carrier_id\"]' when calling LabelsApi.v1_labels_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + if @api_client.config.client_side_validation && !opts[:'service_code'].nil? && opts[:'service_code'].to_s.length > 100 + fail ArgumentError, 'invalid value for "opts[:"service_code"]" when calling LabelsApi.v1_labels_get, the character length must be smaller than or equal to 100.' + end + + if @api_client.config.client_side_validation && !opts[:'service_code'].nil? && opts[:'service_code'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"service_code"]" when calling LabelsApi.v1_labels_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'service_code'].nil? && opts[:'service_code'] !~ Regexp.new(/^[a-z0-9]+([_-][a-z0-9]+)*\\s*$/) + fail ArgumentError, "invalid value for 'opts[:\"service_code\"]' when calling LabelsApi.v1_labels_get, must conform to the pattern /^[a-z0-9]+([_-][a-z0-9]+)*\\s*$/." + end + + if @api_client.config.client_side_validation && !opts[:'tracking_number'].nil? && opts[:'tracking_number'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"tracking_number"]" when calling LabelsApi.v1_labels_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'batch_id'].nil? && opts[:'batch_id'].to_s.length > 25 + fail ArgumentError, 'invalid value for "opts[:"batch_id"]" when calling LabelsApi.v1_labels_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && !opts[:'batch_id'].nil? && opts[:'batch_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"batch_id"]" when calling LabelsApi.v1_labels_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'batch_id'].nil? && opts[:'batch_id'] !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'opts[:\"batch_id\"]' when calling LabelsApi.v1_labels_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + if @api_client.config.client_side_validation && !opts[:'warehouse_id'].nil? && opts[:'warehouse_id'].to_s.length > 25 + fail ArgumentError, 'invalid value for "opts[:"warehouse_id"]" when calling LabelsApi.v1_labels_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && !opts[:'warehouse_id'].nil? && opts[:'warehouse_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"warehouse_id"]" when calling LabelsApi.v1_labels_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'warehouse_id'].nil? && opts[:'warehouse_id'] !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'opts[:\"warehouse_id\"]' when calling LabelsApi.v1_labels_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page"]" when calling LabelsApi.v1_labels_get, must be greater than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling LabelsApi.v1_labels_get, must be greater than or equal to 1.' + end + + if @api_client.config.client_side_validation && opts[:'sort_dir'] && !['processing', 'completed', 'error', 'voided'].include?(opts[:'sort_dir']) + fail ArgumentError, 'invalid value for "sort_dir", must be one of processing, completed, error, voided' + end + if @api_client.config.client_side_validation && opts[:'sort_by'] && !['modified_at', 'created_at'].include?(opts[:'sort_by']) + fail ArgumentError, 'invalid value for "sort_by", must be one of modified_at, created_at' + end + # resource path + local_var_path = '/v1/labels' + + # query parameters + query_params = {} + query_params[:'label_status'] = opts[:'label_status'] if !opts[:'label_status'].nil? + query_params[:'carrier_id'] = opts[:'carrier_id'] if !opts[:'carrier_id'].nil? + query_params[:'service_code'] = opts[:'service_code'] if !opts[:'service_code'].nil? + query_params[:'tracking_number'] = opts[:'tracking_number'] if !opts[:'tracking_number'].nil? + query_params[:'batch_id'] = opts[:'batch_id'] if !opts[:'batch_id'].nil? + query_params[:'warehouse_id'] = opts[:'warehouse_id'] if !opts[:'warehouse_id'].nil? + query_params[:'created_at_start'] = opts[:'created_at_start'] if !opts[:'created_at_start'].nil? + query_params[:'created_at_end'] = opts[:'created_at_end'] if !opts[:'created_at_end'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'sort_dir'] = opts[:'sort_dir'] if !opts[:'sort_dir'].nil? + query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'V1LabelsResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LabelsApi#v1_labels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # labels.purchase_label_with_rate + # + # @param rate_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Label] + def v1_labels_rates_by_rate_id_post(rate_id, body, opts = {}) + data, _status_code, _headers = v1_labels_rates_by_rate_id_post_with_http_info(rate_id, body, opts) + data + end + + # labels.purchase_label_with_rate + # + # @param rate_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(Label, Fixnum, Hash)>] Label data, response status code and response headers + def v1_labels_rates_by_rate_id_post_with_http_info(rate_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LabelsApi.v1_labels_rates_by_rate_id_post ...' + end + # verify the required parameter 'rate_id' is set + if @api_client.config.client_side_validation && rate_id.nil? + fail ArgumentError, "Missing the required parameter 'rate_id' when calling LabelsApi.v1_labels_rates_by_rate_id_post" + end + if @api_client.config.client_side_validation && rate_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "rate_id" when calling LabelsApi.v1_labels_rates_by_rate_id_post, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && rate_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "rate_id" when calling LabelsApi.v1_labels_rates_by_rate_id_post, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && rate_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'rate_id' when calling LabelsApi.v1_labels_rates_by_rate_id_post, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LabelsApi.v1_labels_rates_by_rate_id_post" + end + # resource path + local_var_path = '/v1/labels/rates/{rate_id}'.sub('{' + 'rate_id' + '}', rate_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Label') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LabelsApi#v1_labels_rates_by_rate_id_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # labels.purchase_label_with_shipment + # + # @param shipment_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Label] + def v1_labels_shipment_by_shipment_id_post(shipment_id, body, opts = {}) + data, _status_code, _headers = v1_labels_shipment_by_shipment_id_post_with_http_info(shipment_id, body, opts) + data + end + + # labels.purchase_label_with_shipment + # + # @param shipment_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(Label, Fixnum, Hash)>] Label data, response status code and response headers + def v1_labels_shipment_by_shipment_id_post_with_http_info(shipment_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LabelsApi.v1_labels_shipment_by_shipment_id_post ...' + end + # verify the required parameter 'shipment_id' is set + if @api_client.config.client_side_validation && shipment_id.nil? + fail ArgumentError, "Missing the required parameter 'shipment_id' when calling LabelsApi.v1_labels_shipment_by_shipment_id_post" + end + if @api_client.config.client_side_validation && shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "shipment_id" when calling LabelsApi.v1_labels_shipment_by_shipment_id_post, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "shipment_id" when calling LabelsApi.v1_labels_shipment_by_shipment_id_post, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'shipment_id' when calling LabelsApi.v1_labels_shipment_by_shipment_id_post, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LabelsApi.v1_labels_shipment_by_shipment_id_post" + end + # resource path + local_var_path = '/v1/labels/shipment/{shipment_id}'.sub('{' + 'shipment_id' + '}', shipment_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Label') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LabelsApi#v1_labels_shipment_by_shipment_id_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # labels.track + # + # @param label_id + # @param [Hash] opts the optional parameters + # @return [TrackingInformationResponseBody] + def v1_labels_track_by_label_id_get(label_id, opts = {}) + data, _status_code, _headers = v1_labels_track_by_label_id_get_with_http_info(label_id, opts) + data + end + + # labels.track + # + # @param label_id + # @param [Hash] opts the optional parameters + # @return [Array<(TrackingInformationResponseBody, Fixnum, Hash)>] TrackingInformationResponseBody data, response status code and response headers + def v1_labels_track_by_label_id_get_with_http_info(label_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LabelsApi.v1_labels_track_by_label_id_get ...' + end + # verify the required parameter 'label_id' is set + if @api_client.config.client_side_validation && label_id.nil? + fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelsApi.v1_labels_track_by_label_id_get" + end + if @api_client.config.client_side_validation && label_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "label_id" when calling LabelsApi.v1_labels_track_by_label_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && label_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "label_id" when calling LabelsApi.v1_labels_track_by_label_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && label_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'label_id' when calling LabelsApi.v1_labels_track_by_label_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/labels/{label_id}/track'.sub('{' + 'label_id' + '}', label_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'TrackingInformationResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LabelsApi#v1_labels_track_by_label_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # labels.void_label + # + # @param label_id + # @param [Hash] opts the optional parameters + # @return [VoidLabelResponseBody] + def v1_labels_void_by_label_id_put(label_id, opts = {}) + data, _status_code, _headers = v1_labels_void_by_label_id_put_with_http_info(label_id, opts) + data + end + + # labels.void_label + # + # @param label_id + # @param [Hash] opts the optional parameters + # @return [Array<(VoidLabelResponseBody, Fixnum, Hash)>] VoidLabelResponseBody data, response status code and response headers + def v1_labels_void_by_label_id_put_with_http_info(label_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LabelsApi.v1_labels_void_by_label_id_put ...' + end + # verify the required parameter 'label_id' is set + if @api_client.config.client_side_validation && label_id.nil? + fail ArgumentError, "Missing the required parameter 'label_id' when calling LabelsApi.v1_labels_void_by_label_id_put" + end + if @api_client.config.client_side_validation && label_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "label_id" when calling LabelsApi.v1_labels_void_by_label_id_put, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && label_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "label_id" when calling LabelsApi.v1_labels_void_by_label_id_put, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && label_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'label_id' when calling LabelsApi.v1_labels_void_by_label_id_put, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/labels/{label_id}/void'.sub('{' + 'label_id' + '}', label_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'VoidLabelResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LabelsApi#v1_labels_void_by_label_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api/manifests_api.rb b/lib/shipengine_api/api/manifests_api.rb new file mode 100755 index 0000000..89022ad --- /dev/null +++ b/lib/shipengine_api/api/manifests_api.rb @@ -0,0 +1,239 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class ManifestsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # manifests.get_by_id + # + # @param manifest_id + # @param [Hash] opts the optional parameters + # @return [ManifestResponseBody] + def v1_manifests_by_manifest_id_get(manifest_id, opts = {}) + data, _status_code, _headers = v1_manifests_by_manifest_id_get_with_http_info(manifest_id, opts) + data + end + + # manifests.get_by_id + # + # @param manifest_id + # @param [Hash] opts the optional parameters + # @return [Array<(ManifestResponseBody, Fixnum, Hash)>] ManifestResponseBody data, response status code and response headers + def v1_manifests_by_manifest_id_get_with_http_info(manifest_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ManifestsApi.v1_manifests_by_manifest_id_get ...' + end + # verify the required parameter 'manifest_id' is set + if @api_client.config.client_side_validation && manifest_id.nil? + fail ArgumentError, "Missing the required parameter 'manifest_id' when calling ManifestsApi.v1_manifests_by_manifest_id_get" + end + if @api_client.config.client_side_validation && manifest_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "manifest_id" when calling ManifestsApi.v1_manifests_by_manifest_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && manifest_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "manifest_id" when calling ManifestsApi.v1_manifests_by_manifest_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && manifest_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'manifest_id' when calling ManifestsApi.v1_manifests_by_manifest_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/manifests/{manifest_id}'.sub('{' + 'manifest_id' + '}', manifest_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ManifestResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ManifestsApi#v1_manifests_by_manifest_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # manifests.find + # + # @param [Hash] opts the optional parameters + # @option opts [String] :warehouse_id + # @option opts [DateTime] :ship_date_start + # @option opts [DateTime] :ship_date_end + # @option opts [DateTime] :created_at_start + # @option opts [DateTime] :created_at_end + # @option opts [String] :carrier_id + # @option opts [Integer] :page + # @option opts [Integer] :page_size + # @return [ListManifestsResponseBody] + def v1_manifests_get(opts = {}) + data, _status_code, _headers = v1_manifests_get_with_http_info(opts) + data + end + + # manifests.find + # + # @param [Hash] opts the optional parameters + # @option opts [String] :warehouse_id + # @option opts [DateTime] :ship_date_start + # @option opts [DateTime] :ship_date_end + # @option opts [DateTime] :created_at_start + # @option opts [DateTime] :created_at_end + # @option opts [String] :carrier_id + # @option opts [Integer] :page + # @option opts [Integer] :page_size + # @return [Array<(ListManifestsResponseBody, Fixnum, Hash)>] ListManifestsResponseBody data, response status code and response headers + def v1_manifests_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ManifestsApi.v1_manifests_get ...' + end + if @api_client.config.client_side_validation && !opts[:'warehouse_id'].nil? && opts[:'warehouse_id'].to_s.length > 25 + fail ArgumentError, 'invalid value for "opts[:"warehouse_id"]" when calling ManifestsApi.v1_manifests_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && !opts[:'warehouse_id'].nil? && opts[:'warehouse_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"warehouse_id"]" when calling ManifestsApi.v1_manifests_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'warehouse_id'].nil? && opts[:'warehouse_id'] !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'opts[:\"warehouse_id\"]' when calling ManifestsApi.v1_manifests_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + if @api_client.config.client_side_validation && !opts[:'carrier_id'].nil? && opts[:'carrier_id'].to_s.length > 25 + fail ArgumentError, 'invalid value for "opts[:"carrier_id"]" when calling ManifestsApi.v1_manifests_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && !opts[:'carrier_id'].nil? && opts[:'carrier_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"carrier_id"]" when calling ManifestsApi.v1_manifests_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'carrier_id'].nil? && opts[:'carrier_id'] !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'opts[:\"carrier_id\"]' when calling ManifestsApi.v1_manifests_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/manifests' + + # query parameters + query_params = {} + query_params[:'warehouse_id'] = opts[:'warehouse_id'] if !opts[:'warehouse_id'].nil? + query_params[:'ship_date_start'] = opts[:'ship_date_start'] if !opts[:'ship_date_start'].nil? + query_params[:'ship_date_end'] = opts[:'ship_date_end'] if !opts[:'ship_date_end'].nil? + query_params[:'created_at_start'] = opts[:'created_at_start'] if !opts[:'created_at_start'].nil? + query_params[:'created_at_end'] = opts[:'created_at_end'] if !opts[:'created_at_end'].nil? + query_params[:'carrier_id'] = opts[:'carrier_id'] if !opts[:'carrier_id'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ListManifestsResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ManifestsApi#v1_manifests_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # manifests.create + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ManifestResponseBody] + def v1_manifests_post(body, opts = {}) + data, _status_code, _headers = v1_manifests_post_with_http_info(body, opts) + data + end + + # manifests.create + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ManifestResponseBody, Fixnum, Hash)>] ManifestResponseBody data, response status code and response headers + def v1_manifests_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ManifestsApi.v1_manifests_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ManifestsApi.v1_manifests_post" + end + # resource path + local_var_path = '/v1/manifests' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ManifestResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ManifestsApi#v1_manifests_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api/marketplace_accounts_api.rb b/lib/shipengine_api/api/marketplace_accounts_api.rb new file mode 100755 index 0000000..6b87797 --- /dev/null +++ b/lib/shipengine_api/api/marketplace_accounts_api.rb @@ -0,0 +1,1655 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class MarketplaceAccountsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # amazon_account.deactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_amazon_deactivate_by_store_id_put(store_id, opts = {}) + v_beta_connections_marketplaces_amazon_deactivate_by_store_id_put_with_http_info(store_id, opts) + nil + end + + # amazon_account.deactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_amazon_deactivate_by_store_id_put_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_amazon_deactivate_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_amazon_deactivate_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/amazon/{store_id}/deactivate'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_amazon_deactivate_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # amazon_account.connect + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectMarketplaceResponseBody] + def v_beta_connections_marketplaces_amazon_post(body, opts = {}) + data, _status_code, _headers = v_beta_connections_marketplaces_amazon_post_with_http_info(body, opts) + data + end + + # amazon_account.connect + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectMarketplaceResponseBody, Fixnum, Hash)>] ConnectMarketplaceResponseBody data, response status code and response headers + def v_beta_connections_marketplaces_amazon_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_amazon_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_amazon_post" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/amazon' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectMarketplaceResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_amazon_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # amazon_account.reactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_amazon_reactivate_by_store_id_put(store_id, opts = {}) + v_beta_connections_marketplaces_amazon_reactivate_by_store_id_put_with_http_info(store_id, opts) + nil + end + + # amazon_account.reactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_amazon_reactivate_by_store_id_put_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_amazon_reactivate_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_amazon_reactivate_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/amazon/{store_id}/reactivate'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_amazon_reactivate_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # amazon_account.update_settings + # + # @param store_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_amazon_settings_by_store_id_put(store_id, body, opts = {}) + v_beta_connections_marketplaces_amazon_settings_by_store_id_put_with_http_info(store_id, body, opts) + nil + end + + # amazon_account.update_settings + # + # @param store_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_amazon_settings_by_store_id_put_with_http_info(store_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_amazon_settings_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_amazon_settings_by_store_id_put" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_amazon_settings_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/amazon/{store_id}/settings'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_amazon_settings_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # amazon_account.test + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_amazon_test_by_store_id_get(store_id, opts = {}) + v_beta_connections_marketplaces_amazon_test_by_store_id_get_with_http_info(store_id, opts) + nil + end + + # amazon_account.test + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_amazon_test_by_store_id_get_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_amazon_test_by_store_id_get ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_amazon_test_by_store_id_get" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/amazon/{store_id}/test'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_amazon_test_by_store_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # channel_advisor_account.deactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_channeladvisor_deactivate_by_store_id_put(store_id, opts = {}) + v_beta_connections_marketplaces_channeladvisor_deactivate_by_store_id_put_with_http_info(store_id, opts) + nil + end + + # channel_advisor_account.deactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_channeladvisor_deactivate_by_store_id_put_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_channeladvisor_deactivate_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_channeladvisor_deactivate_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/channeladvisor/{store_id}/deactivate'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_channeladvisor_deactivate_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # channel_advisor_account.connect + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectMarketplaceResponseBody] + def v_beta_connections_marketplaces_channeladvisor_post(body, opts = {}) + data, _status_code, _headers = v_beta_connections_marketplaces_channeladvisor_post_with_http_info(body, opts) + data + end + + # channel_advisor_account.connect + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectMarketplaceResponseBody, Fixnum, Hash)>] ConnectMarketplaceResponseBody data, response status code and response headers + def v_beta_connections_marketplaces_channeladvisor_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_channeladvisor_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_channeladvisor_post" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/channeladvisor' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectMarketplaceResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_channeladvisor_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # channel_advisor_account.reactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_channeladvisor_reactivate_by_store_id_put(store_id, opts = {}) + v_beta_connections_marketplaces_channeladvisor_reactivate_by_store_id_put_with_http_info(store_id, opts) + nil + end + + # channel_advisor_account.reactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_channeladvisor_reactivate_by_store_id_put_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_channeladvisor_reactivate_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_channeladvisor_reactivate_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/channeladvisor/{store_id}/reactivate'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_channeladvisor_reactivate_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # channel_advisor_account.update_settings + # + # @param store_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put(store_id, body, opts = {}) + v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put_with_http_info(store_id, body, opts) + nil + end + + # channel_advisor_account.update_settings + # + # @param store_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put_with_http_info(store_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/channeladvisor/{store_id}/settings'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_channeladvisor_settings_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # channel_advisor_account.test + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_channeladvisor_test_by_store_id_get(store_id, opts = {}) + v_beta_connections_marketplaces_channeladvisor_test_by_store_id_get_with_http_info(store_id, opts) + nil + end + + # channel_advisor_account.test + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_channeladvisor_test_by_store_id_get_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_channeladvisor_test_by_store_id_get ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_channeladvisor_test_by_store_id_get" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/channeladvisor/{store_id}/test'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_channeladvisor_test_by_store_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # ebay_account.connect_access_token + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectMarketplaceResponseBody] + def v_beta_connections_marketplaces_ebay_access_token_post(body, opts = {}) + data, _status_code, _headers = v_beta_connections_marketplaces_ebay_access_token_post_with_http_info(body, opts) + data + end + + # ebay_account.connect_access_token + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectMarketplaceResponseBody, Fixnum, Hash)>] ConnectMarketplaceResponseBody data, response status code and response headers + def v_beta_connections_marketplaces_ebay_access_token_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_ebay_access_token_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_ebay_access_token_post" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/ebay/access_token' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectMarketplaceResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_ebay_access_token_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # ebay_account.deactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_ebay_deactivate_by_store_id_put(store_id, opts = {}) + v_beta_connections_marketplaces_ebay_deactivate_by_store_id_put_with_http_info(store_id, opts) + nil + end + + # ebay_account.deactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_ebay_deactivate_by_store_id_put_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_ebay_deactivate_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_ebay_deactivate_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/ebay/{store_id}/deactivate'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_ebay_deactivate_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # ebay_account.reactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_ebay_reactivate_by_store_id_put(store_id, opts = {}) + v_beta_connections_marketplaces_ebay_reactivate_by_store_id_put_with_http_info(store_id, opts) + nil + end + + # ebay_account.reactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_ebay_reactivate_by_store_id_put_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_ebay_reactivate_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_ebay_reactivate_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/ebay/{store_id}/reactivate'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_ebay_reactivate_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # ebay_account.update_settings + # + # @param store_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_ebay_settings_by_store_id_put(store_id, body, opts = {}) + v_beta_connections_marketplaces_ebay_settings_by_store_id_put_with_http_info(store_id, body, opts) + nil + end + + # ebay_account.update_settings + # + # @param store_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_ebay_settings_by_store_id_put_with_http_info(store_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_ebay_settings_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_ebay_settings_by_store_id_put" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_ebay_settings_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/ebay/{store_id}/settings'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_ebay_settings_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # ebay_account.test + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_ebay_test_by_store_id_get(store_id, opts = {}) + v_beta_connections_marketplaces_ebay_test_by_store_id_get_with_http_info(store_id, opts) + nil + end + + # ebay_account.test + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_ebay_test_by_store_id_get_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_ebay_test_by_store_id_get ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_ebay_test_by_store_id_get" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/ebay/{store_id}/test'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_ebay_test_by_store_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # etsy_account.connect + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectMarketplaceResponseBody] + def v_beta_connections_marketplaces_etsy_access_token_post(body, opts = {}) + data, _status_code, _headers = v_beta_connections_marketplaces_etsy_access_token_post_with_http_info(body, opts) + data + end + + # etsy_account.connect + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectMarketplaceResponseBody, Fixnum, Hash)>] ConnectMarketplaceResponseBody data, response status code and response headers + def v_beta_connections_marketplaces_etsy_access_token_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_etsy_access_token_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_etsy_access_token_post" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/etsy/access_token' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectMarketplaceResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_etsy_access_token_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # etsy_account.deactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_etsy_deactivate_by_store_id_put(store_id, opts = {}) + v_beta_connections_marketplaces_etsy_deactivate_by_store_id_put_with_http_info(store_id, opts) + nil + end + + # etsy_account.deactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_etsy_deactivate_by_store_id_put_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_etsy_deactivate_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_etsy_deactivate_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/etsy/{store_id}/deactivate'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_etsy_deactivate_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # etsy_account.reactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_etsy_reactivate_by_store_id_put(store_id, opts = {}) + v_beta_connections_marketplaces_etsy_reactivate_by_store_id_put_with_http_info(store_id, opts) + nil + end + + # etsy_account.reactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_etsy_reactivate_by_store_id_put_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_etsy_reactivate_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_etsy_reactivate_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/etsy/{store_id}/reactivate'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_etsy_reactivate_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # etsy_account.update_settings + # + # @param store_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_etsy_settings_by_store_id_put(store_id, body, opts = {}) + v_beta_connections_marketplaces_etsy_settings_by_store_id_put_with_http_info(store_id, body, opts) + nil + end + + # etsy_account.update_settings + # + # @param store_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_etsy_settings_by_store_id_put_with_http_info(store_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_etsy_settings_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_etsy_settings_by_store_id_put" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_etsy_settings_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/etsy/{store_id}/settings'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_etsy_settings_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # etsy_account.test + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_etsy_test_by_store_id_get(store_id, opts = {}) + v_beta_connections_marketplaces_etsy_test_by_store_id_get_with_http_info(store_id, opts) + nil + end + + # etsy_account.test + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_etsy_test_by_store_id_get_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_etsy_test_by_store_id_get ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_etsy_test_by_store_id_get" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/etsy/{store_id}/test'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_etsy_test_by_store_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # magento_account.deactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_magento_deactivate_by_store_id_put(store_id, opts = {}) + v_beta_connections_marketplaces_magento_deactivate_by_store_id_put_with_http_info(store_id, opts) + nil + end + + # magento_account.deactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_magento_deactivate_by_store_id_put_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_magento_deactivate_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_magento_deactivate_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/magento/{store_id}/deactivate'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_magento_deactivate_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # magento_account.connect + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectMarketplaceResponseBody] + def v_beta_connections_marketplaces_magento_post(body, opts = {}) + data, _status_code, _headers = v_beta_connections_marketplaces_magento_post_with_http_info(body, opts) + data + end + + # magento_account.connect + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectMarketplaceResponseBody, Fixnum, Hash)>] ConnectMarketplaceResponseBody data, response status code and response headers + def v_beta_connections_marketplaces_magento_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_magento_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_magento_post" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/magento' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectMarketplaceResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_magento_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # magento_account.reactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_magento_reactivate_by_store_id_put(store_id, opts = {}) + v_beta_connections_marketplaces_magento_reactivate_by_store_id_put_with_http_info(store_id, opts) + nil + end + + # magento_account.reactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_magento_reactivate_by_store_id_put_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_magento_reactivate_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_magento_reactivate_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/magento/{store_id}/reactivate'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_magento_reactivate_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # magento_account.update_settings + # + # @param store_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_magento_settings_by_store_id_put(store_id, body, opts = {}) + v_beta_connections_marketplaces_magento_settings_by_store_id_put_with_http_info(store_id, body, opts) + nil + end + + # magento_account.update_settings + # + # @param store_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_magento_settings_by_store_id_put_with_http_info(store_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_magento_settings_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_magento_settings_by_store_id_put" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_magento_settings_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/magento/{store_id}/settings'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_magento_settings_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # magento_account.test + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_magento_test_by_store_id_get(store_id, opts = {}) + v_beta_connections_marketplaces_magento_test_by_store_id_get_with_http_info(store_id, opts) + nil + end + + # magento_account.test + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_magento_test_by_store_id_get_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_magento_test_by_store_id_get ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_magento_test_by_store_id_get" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/magento/{store_id}/test'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_magento_test_by_store_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # shopify_account.connect_access_token + # + # @param body + # @param [Hash] opts the optional parameters + # @return [ConnectMarketplaceResponseBody] + def v_beta_connections_marketplaces_shopify_access_token_post(body, opts = {}) + data, _status_code, _headers = v_beta_connections_marketplaces_shopify_access_token_post_with_http_info(body, opts) + data + end + + # shopify_account.connect_access_token + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(ConnectMarketplaceResponseBody, Fixnum, Hash)>] ConnectMarketplaceResponseBody data, response status code and response headers + def v_beta_connections_marketplaces_shopify_access_token_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_shopify_access_token_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_shopify_access_token_post" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/shopify/access_token' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ConnectMarketplaceResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_shopify_access_token_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # shopify_account.deactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_shopify_deactivate_by_store_id_put(store_id, opts = {}) + v_beta_connections_marketplaces_shopify_deactivate_by_store_id_put_with_http_info(store_id, opts) + nil + end + + # shopify_account.deactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_shopify_deactivate_by_store_id_put_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_shopify_deactivate_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_shopify_deactivate_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/shopify/{store_id}/deactivate'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_shopify_deactivate_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # shopify_account.reactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_shopify_reactivate_by_store_id_put(store_id, opts = {}) + v_beta_connections_marketplaces_shopify_reactivate_by_store_id_put_with_http_info(store_id, opts) + nil + end + + # shopify_account.reactivate + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_shopify_reactivate_by_store_id_put_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_shopify_reactivate_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_shopify_reactivate_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/shopify/{store_id}/reactivate'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_shopify_reactivate_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # shopify_account.update_settings + # + # @param store_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_shopify_settings_by_store_id_put(store_id, body, opts = {}) + v_beta_connections_marketplaces_shopify_settings_by_store_id_put_with_http_info(store_id, body, opts) + nil + end + + # shopify_account.update_settings + # + # @param store_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_shopify_settings_by_store_id_put_with_http_info(store_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_shopify_settings_by_store_id_put ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_shopify_settings_by_store_id_put" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_shopify_settings_by_store_id_put" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/shopify/{store_id}/settings'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_shopify_settings_by_store_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # shopify_account.test + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v_beta_connections_marketplaces_shopify_test_by_store_id_get(store_id, opts = {}) + v_beta_connections_marketplaces_shopify_test_by_store_id_get_with_http_info(store_id, opts) + nil + end + + # shopify_account.test + # + # @param store_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v_beta_connections_marketplaces_shopify_test_by_store_id_get_with_http_info(store_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MarketplaceAccountsApi.v_beta_connections_marketplaces_shopify_test_by_store_id_get ...' + end + # verify the required parameter 'store_id' is set + if @api_client.config.client_side_validation && store_id.nil? + fail ArgumentError, "Missing the required parameter 'store_id' when calling MarketplaceAccountsApi.v_beta_connections_marketplaces_shopify_test_by_store_id_get" + end + # resource path + local_var_path = '/v-beta/connections/marketplaces/shopify/{store_id}/test'.sub('{' + 'store_id' + '}', store_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MarketplaceAccountsApi#v_beta_connections_marketplaces_shopify_test_by_store_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api/packages_api.rb b/lib/shipengine_api/api/packages_api.rb new file mode 100755 index 0000000..f9635fd --- /dev/null +++ b/lib/shipengine_api/api/packages_api.rb @@ -0,0 +1,327 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class PackagesApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # packages.delete + # + # @param package_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_packages_by_package_id_delete(package_id, opts = {}) + v1_packages_by_package_id_delete_with_http_info(package_id, opts) + nil + end + + # packages.delete + # + # @param package_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_packages_by_package_id_delete_with_http_info(package_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PackagesApi.v1_packages_by_package_id_delete ...' + end + # verify the required parameter 'package_id' is set + if @api_client.config.client_side_validation && package_id.nil? + fail ArgumentError, "Missing the required parameter 'package_id' when calling PackagesApi.v1_packages_by_package_id_delete" + end + if @api_client.config.client_side_validation && package_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "package_id" when calling PackagesApi.v1_packages_by_package_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && package_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "package_id" when calling PackagesApi.v1_packages_by_package_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && package_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'package_id' when calling PackagesApi.v1_packages_by_package_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/packages/{package_id}'.sub('{' + 'package_id' + '}', package_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PackagesApi#v1_packages_by_package_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # packages.get_by_id + # + # @param package_id + # @param [Hash] opts the optional parameters + # @return [Package] + def v1_packages_by_package_id_get(package_id, opts = {}) + data, _status_code, _headers = v1_packages_by_package_id_get_with_http_info(package_id, opts) + data + end + + # packages.get_by_id + # + # @param package_id + # @param [Hash] opts the optional parameters + # @return [Array<(Package, Fixnum, Hash)>] Package data, response status code and response headers + def v1_packages_by_package_id_get_with_http_info(package_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PackagesApi.v1_packages_by_package_id_get ...' + end + # verify the required parameter 'package_id' is set + if @api_client.config.client_side_validation && package_id.nil? + fail ArgumentError, "Missing the required parameter 'package_id' when calling PackagesApi.v1_packages_by_package_id_get" + end + if @api_client.config.client_side_validation && package_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "package_id" when calling PackagesApi.v1_packages_by_package_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && package_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "package_id" when calling PackagesApi.v1_packages_by_package_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && package_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'package_id' when calling PackagesApi.v1_packages_by_package_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/packages/{package_id}'.sub('{' + 'package_id' + '}', package_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Package') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PackagesApi#v1_packages_by_package_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # packages.update + # + # @param package_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_packages_by_package_id_put(package_id, body, opts = {}) + v1_packages_by_package_id_put_with_http_info(package_id, body, opts) + nil + end + + # packages.update + # + # @param package_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_packages_by_package_id_put_with_http_info(package_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PackagesApi.v1_packages_by_package_id_put ...' + end + # verify the required parameter 'package_id' is set + if @api_client.config.client_side_validation && package_id.nil? + fail ArgumentError, "Missing the required parameter 'package_id' when calling PackagesApi.v1_packages_by_package_id_put" + end + if @api_client.config.client_side_validation && package_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "package_id" when calling PackagesApi.v1_packages_by_package_id_put, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && package_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "package_id" when calling PackagesApi.v1_packages_by_package_id_put, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && package_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'package_id' when calling PackagesApi.v1_packages_by_package_id_put, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling PackagesApi.v1_packages_by_package_id_put" + end + # resource path + local_var_path = '/v1/packages/{package_id}'.sub('{' + 'package_id' + '}', package_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PackagesApi#v1_packages_by_package_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # packages.find + # + # @param [Hash] opts the optional parameters + # @return [PackageListResponseBody] + def v1_packages_get(opts = {}) + data, _status_code, _headers = v1_packages_get_with_http_info(opts) + data + end + + # packages.find + # + # @param [Hash] opts the optional parameters + # @return [Array<(PackageListResponseBody, Fixnum, Hash)>] PackageListResponseBody data, response status code and response headers + def v1_packages_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PackagesApi.v1_packages_get ...' + end + # resource path + local_var_path = '/v1/packages' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'PackageListResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PackagesApi#v1_packages_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # packages.create + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Package] + def v1_packages_post(body, opts = {}) + data, _status_code, _headers = v1_packages_post_with_http_info(body, opts) + data + end + + # packages.create + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(Package, Fixnum, Hash)>] Package data, response status code and response headers + def v1_packages_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PackagesApi.v1_packages_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling PackagesApi.v1_packages_post" + end + # resource path + local_var_path = '/v1/packages' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Package') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PackagesApi#v1_packages_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api/rates_api.rb b/lib/shipengine_api/api/rates_api.rb new file mode 100755 index 0000000..191feed --- /dev/null +++ b/lib/shipengine_api/api/rates_api.rb @@ -0,0 +1,251 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class RatesApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # rates.bulk_rate_shipments + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array] + def v1_rates_bulk_post(body, opts = {}) + data, _status_code, _headers = v1_rates_bulk_post_with_http_info(body, opts) + data + end + + # rates.bulk_rate_shipments + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + def v1_rates_bulk_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RatesApi.v1_rates_bulk_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling RatesApi.v1_rates_bulk_post" + end + # resource path + local_var_path = '/v1/rates/bulk' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Array') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RatesApi#v1_rates_bulk_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # rates.get_by_id + # + # @param rate_id + # @param [Hash] opts the optional parameters + # @return [Rate] + def v1_rates_by_rate_id_get(rate_id, opts = {}) + data, _status_code, _headers = v1_rates_by_rate_id_get_with_http_info(rate_id, opts) + data + end + + # rates.get_by_id + # + # @param rate_id + # @param [Hash] opts the optional parameters + # @return [Array<(Rate, Fixnum, Hash)>] Rate data, response status code and response headers + def v1_rates_by_rate_id_get_with_http_info(rate_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RatesApi.v1_rates_by_rate_id_get ...' + end + # verify the required parameter 'rate_id' is set + if @api_client.config.client_side_validation && rate_id.nil? + fail ArgumentError, "Missing the required parameter 'rate_id' when calling RatesApi.v1_rates_by_rate_id_get" + end + if @api_client.config.client_side_validation && rate_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "rate_id" when calling RatesApi.v1_rates_by_rate_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && rate_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "rate_id" when calling RatesApi.v1_rates_by_rate_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && rate_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'rate_id' when calling RatesApi.v1_rates_by_rate_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/rates/{rate_id}'.sub('{' + 'rate_id' + '}', rate_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Rate') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RatesApi#v1_rates_by_rate_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # rates.estimate + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array] + def v1_rates_estimate_post(body, opts = {}) + data, _status_code, _headers = v1_rates_estimate_post_with_http_info(body, opts) + data + end + + # rates.estimate + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + def v1_rates_estimate_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RatesApi.v1_rates_estimate_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling RatesApi.v1_rates_estimate_post" + end + # resource path + local_var_path = '/v1/rates/estimate' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Array') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RatesApi#v1_rates_estimate_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # rates.rate_shipment + # + # @param body + # @param [Hash] opts the optional parameters + # @return [RateShipmentResponseBody] + def v1_rates_post(body, opts = {}) + data, _status_code, _headers = v1_rates_post_with_http_info(body, opts) + data + end + + # rates.rate_shipment + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(RateShipmentResponseBody, Fixnum, Hash)>] RateShipmentResponseBody data, response status code and response headers + def v1_rates_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RatesApi.v1_rates_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling RatesApi.v1_rates_post" + end + # resource path + local_var_path = '/v1/rates' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'RateShipmentResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RatesApi#v1_rates_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api/shipments_api.rb b/lib/shipengine_api/api/shipments_api.rb new file mode 100755 index 0000000..b2371c4 --- /dev/null +++ b/lib/shipengine_api/api/shipments_api.rb @@ -0,0 +1,732 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class ShipmentsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # shipments.get_by_id + # + # @param shipment_id + # @param [Hash] opts the optional parameters + # @return [Shipment] + def v1_shipments_by_shipment_id_get(shipment_id, opts = {}) + data, _status_code, _headers = v1_shipments_by_shipment_id_get_with_http_info(shipment_id, opts) + data + end + + # shipments.get_by_id + # + # @param shipment_id + # @param [Hash] opts the optional parameters + # @return [Array<(Shipment, Fixnum, Hash)>] Shipment data, response status code and response headers + def v1_shipments_by_shipment_id_get_with_http_info(shipment_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ShipmentsApi.v1_shipments_by_shipment_id_get ...' + end + # verify the required parameter 'shipment_id' is set + if @api_client.config.client_side_validation && shipment_id.nil? + fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.v1_shipments_by_shipment_id_get" + end + if @api_client.config.client_side_validation && shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "shipment_id" when calling ShipmentsApi.v1_shipments_by_shipment_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "shipment_id" when calling ShipmentsApi.v1_shipments_by_shipment_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'shipment_id' when calling ShipmentsApi.v1_shipments_by_shipment_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/shipments/{shipment_id}'.sub('{' + 'shipment_id' + '}', shipment_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Shipment') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ShipmentsApi#v1_shipments_by_shipment_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # shipments.update_shipment + # + # @param shipment_id + # @param body + # @param [Hash] opts the optional parameters + # @return [CreateShipmentResponseBody] + def v1_shipments_by_shipment_id_put(shipment_id, body, opts = {}) + data, _status_code, _headers = v1_shipments_by_shipment_id_put_with_http_info(shipment_id, body, opts) + data + end + + # shipments.update_shipment + # + # @param shipment_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(CreateShipmentResponseBody, Fixnum, Hash)>] CreateShipmentResponseBody data, response status code and response headers + def v1_shipments_by_shipment_id_put_with_http_info(shipment_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ShipmentsApi.v1_shipments_by_shipment_id_put ...' + end + # verify the required parameter 'shipment_id' is set + if @api_client.config.client_side_validation && shipment_id.nil? + fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.v1_shipments_by_shipment_id_put" + end + if @api_client.config.client_side_validation && shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "shipment_id" when calling ShipmentsApi.v1_shipments_by_shipment_id_put, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "shipment_id" when calling ShipmentsApi.v1_shipments_by_shipment_id_put, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'shipment_id' when calling ShipmentsApi.v1_shipments_by_shipment_id_put, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ShipmentsApi.v1_shipments_by_shipment_id_put" + end + # resource path + local_var_path = '/v1/shipments/{shipment_id}'.sub('{' + 'shipment_id' + '}', shipment_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'CreateShipmentResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ShipmentsApi#v1_shipments_by_shipment_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # shipments.cancel + # + # @param shipment_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_shipments_cancel_by_shipment_id_put(shipment_id, opts = {}) + v1_shipments_cancel_by_shipment_id_put_with_http_info(shipment_id, opts) + nil + end + + # shipments.cancel + # + # @param shipment_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_shipments_cancel_by_shipment_id_put_with_http_info(shipment_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ShipmentsApi.v1_shipments_cancel_by_shipment_id_put ...' + end + # verify the required parameter 'shipment_id' is set + if @api_client.config.client_side_validation && shipment_id.nil? + fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.v1_shipments_cancel_by_shipment_id_put" + end + if @api_client.config.client_side_validation && shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "shipment_id" when calling ShipmentsApi.v1_shipments_cancel_by_shipment_id_put, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "shipment_id" when calling ShipmentsApi.v1_shipments_cancel_by_shipment_id_put, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'shipment_id' when calling ShipmentsApi.v1_shipments_cancel_by_shipment_id_put, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/shipments/{shipment_id}/cancel'.sub('{' + 'shipment_id' + '}', shipment_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ShipmentsApi#v1_shipments_cancel_by_shipment_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # shipments.find_errors + # + # @param shipment_id + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page + # @option opts [Integer] :pagesize + # @return [ShipmentErrorsResponseBody] + def v1_shipments_errors_by_shipment_id_get(shipment_id, opts = {}) + data, _status_code, _headers = v1_shipments_errors_by_shipment_id_get_with_http_info(shipment_id, opts) + data + end + + # shipments.find_errors + # + # @param shipment_id + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page + # @option opts [Integer] :pagesize + # @return [Array<(ShipmentErrorsResponseBody, Fixnum, Hash)>] ShipmentErrorsResponseBody data, response status code and response headers + def v1_shipments_errors_by_shipment_id_get_with_http_info(shipment_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ShipmentsApi.v1_shipments_errors_by_shipment_id_get ...' + end + # verify the required parameter 'shipment_id' is set + if @api_client.config.client_side_validation && shipment_id.nil? + fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.v1_shipments_errors_by_shipment_id_get" + end + if @api_client.config.client_side_validation && shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "shipment_id" when calling ShipmentsApi.v1_shipments_errors_by_shipment_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "shipment_id" when calling ShipmentsApi.v1_shipments_errors_by_shipment_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'shipment_id' when calling ShipmentsApi.v1_shipments_errors_by_shipment_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/shipments/{shipment_id}/errors'.sub('{' + 'shipment_id' + '}', shipment_id.to_s) + + # query parameters + query_params = {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'pagesize'] = opts[:'pagesize'] if !opts[:'pagesize'].nil? + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ShipmentErrorsResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ShipmentsApi#v1_shipments_errors_by_shipment_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # shipments.get_by_external_id + # + # @param external_shipment_id + # @param [Hash] opts the optional parameters + # @return [Shipment] + def v1_shipments_external_shipment_id_by_external_shipment_id_get(external_shipment_id, opts = {}) + data, _status_code, _headers = v1_shipments_external_shipment_id_by_external_shipment_id_get_with_http_info(external_shipment_id, opts) + data + end + + # shipments.get_by_external_id + # + # @param external_shipment_id + # @param [Hash] opts the optional parameters + # @return [Array<(Shipment, Fixnum, Hash)>] Shipment data, response status code and response headers + def v1_shipments_external_shipment_id_by_external_shipment_id_get_with_http_info(external_shipment_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ShipmentsApi.v1_shipments_external_shipment_id_by_external_shipment_id_get ...' + end + # verify the required parameter 'external_shipment_id' is set + if @api_client.config.client_side_validation && external_shipment_id.nil? + fail ArgumentError, "Missing the required parameter 'external_shipment_id' when calling ShipmentsApi.v1_shipments_external_shipment_id_by_external_shipment_id_get" + end + if @api_client.config.client_side_validation && external_shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "external_shipment_id" when calling ShipmentsApi.v1_shipments_external_shipment_id_by_external_shipment_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && external_shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "external_shipment_id" when calling ShipmentsApi.v1_shipments_external_shipment_id_by_external_shipment_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && external_shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'external_shipment_id' when calling ShipmentsApi.v1_shipments_external_shipment_id_by_external_shipment_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/shipments/external_shipment_id/{external_shipment_id}'.sub('{' + 'external_shipment_id' + '}', external_shipment_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Shipment') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ShipmentsApi#v1_shipments_external_shipment_id_by_external_shipment_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # shipments.find + # + # @param [Hash] opts the optional parameters + # @option opts [String] :batch_id + # @option opts [String] :tag + # @option opts [String] :shipment_status + # @option opts [DateTime] :modified_at_start + # @option opts [DateTime] :modified_at_end + # @option opts [DateTime] :created_at_start + # @option opts [DateTime] :created_at_end + # @option opts [Integer] :page + # @option opts [Integer] :page_size + # @option opts [String] :sort_dir + # @option opts [String] :sort_by + # @return [ListShipmentResponseBody] + def v1_shipments_get(opts = {}) + data, _status_code, _headers = v1_shipments_get_with_http_info(opts) + data + end + + # shipments.find + # + # @param [Hash] opts the optional parameters + # @option opts [String] :batch_id + # @option opts [String] :tag + # @option opts [String] :shipment_status + # @option opts [DateTime] :modified_at_start + # @option opts [DateTime] :modified_at_end + # @option opts [DateTime] :created_at_start + # @option opts [DateTime] :created_at_end + # @option opts [Integer] :page + # @option opts [Integer] :page_size + # @option opts [String] :sort_dir + # @option opts [String] :sort_by + # @return [Array<(ListShipmentResponseBody, Fixnum, Hash)>] ListShipmentResponseBody data, response status code and response headers + def v1_shipments_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ShipmentsApi.v1_shipments_get ...' + end + if @api_client.config.client_side_validation && !opts[:'batch_id'].nil? && opts[:'batch_id'].to_s.length > 25 + fail ArgumentError, 'invalid value for "opts[:"batch_id"]" when calling ShipmentsApi.v1_shipments_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && !opts[:'batch_id'].nil? && opts[:'batch_id'].to_s.length < 1 + fail ArgumentError, 'invalid value for "opts[:"batch_id"]" when calling ShipmentsApi.v1_shipments_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'batch_id'].nil? && opts[:'batch_id'] !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'opts[:\"batch_id\"]' when calling ShipmentsApi.v1_shipments_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + if @api_client.config.client_side_validation && opts[:'shipment_status'] && !['pending', 'processing', 'label_purchased', 'cancelled'].include?(opts[:'shipment_status']) + fail ArgumentError, 'invalid value for "shipment_status", must be one of pending, processing, label_purchased, cancelled' + end + if @api_client.config.client_side_validation && opts[:'sort_dir'] && !['asc', 'desc'].include?(opts[:'sort_dir']) + fail ArgumentError, 'invalid value for "sort_dir", must be one of asc, desc' + end + if @api_client.config.client_side_validation && opts[:'sort_by'] && !['modified_at', 'created_at'].include?(opts[:'sort_by']) + fail ArgumentError, 'invalid value for "sort_by", must be one of modified_at, created_at' + end + # resource path + local_var_path = '/v1/shipments' + + # query parameters + query_params = {} + query_params[:'batch_id'] = opts[:'batch_id'] if !opts[:'batch_id'].nil? + query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? + query_params[:'shipment_status'] = opts[:'shipment_status'] if !opts[:'shipment_status'].nil? + query_params[:'modified_at_start'] = opts[:'modified_at_start'] if !opts[:'modified_at_start'].nil? + query_params[:'modified_at_end'] = opts[:'modified_at_end'] if !opts[:'modified_at_end'].nil? + query_params[:'created_at_start'] = opts[:'created_at_start'] if !opts[:'created_at_start'].nil? + query_params[:'created_at_end'] = opts[:'created_at_end'] if !opts[:'created_at_end'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'sort_dir'] = opts[:'sort_dir'] if !opts[:'sort_dir'].nil? + query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ListShipmentResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ShipmentsApi#v1_shipments_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # shipments.create_shipments + # + # @param body + # @param [Hash] opts the optional parameters + # @return [CreateShipmentsResponseBody] + def v1_shipments_post(body, opts = {}) + data, _status_code, _headers = v1_shipments_post_with_http_info(body, opts) + data + end + + # shipments.create_shipments + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(CreateShipmentsResponseBody, Fixnum, Hash)>] CreateShipmentsResponseBody data, response status code and response headers + def v1_shipments_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ShipmentsApi.v1_shipments_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ShipmentsApi.v1_shipments_post" + end + # resource path + local_var_path = '/v1/shipments' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'CreateShipmentsResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ShipmentsApi#v1_shipments_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # shipments.get_rates_for_shipment + # + # @param shipment_id + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :created_at_start + # @return [RateResponseBody] + def v1_shipments_rates_by_shipment_id_get(shipment_id, opts = {}) + data, _status_code, _headers = v1_shipments_rates_by_shipment_id_get_with_http_info(shipment_id, opts) + data + end + + # shipments.get_rates_for_shipment + # + # @param shipment_id + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :created_at_start + # @return [Array<(RateResponseBody, Fixnum, Hash)>] RateResponseBody data, response status code and response headers + def v1_shipments_rates_by_shipment_id_get_with_http_info(shipment_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ShipmentsApi.v1_shipments_rates_by_shipment_id_get ...' + end + # verify the required parameter 'shipment_id' is set + if @api_client.config.client_side_validation && shipment_id.nil? + fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.v1_shipments_rates_by_shipment_id_get" + end + if @api_client.config.client_side_validation && shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "shipment_id" when calling ShipmentsApi.v1_shipments_rates_by_shipment_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "shipment_id" when calling ShipmentsApi.v1_shipments_rates_by_shipment_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'shipment_id' when calling ShipmentsApi.v1_shipments_rates_by_shipment_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/shipments/{shipment_id}/rates'.sub('{' + 'shipment_id' + '}', shipment_id.to_s) + + # query parameters + query_params = {} + query_params[:'created_at_start'] = opts[:'created_at_start'] if !opts[:'created_at_start'].nil? + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'RateResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ShipmentsApi#v1_shipments_rates_by_shipment_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # shipments.remove_tag + # + # @param shipment_id + # @param tag + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_shipments_tags_by_shipment_id_and_tag_delete(shipment_id, tag, opts = {}) + v1_shipments_tags_by_shipment_id_and_tag_delete_with_http_info(shipment_id, tag, opts) + nil + end + + # shipments.remove_tag + # + # @param shipment_id + # @param tag + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_shipments_tags_by_shipment_id_and_tag_delete_with_http_info(shipment_id, tag, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ShipmentsApi.v1_shipments_tags_by_shipment_id_and_tag_delete ...' + end + # verify the required parameter 'shipment_id' is set + if @api_client.config.client_side_validation && shipment_id.nil? + fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.v1_shipments_tags_by_shipment_id_and_tag_delete" + end + if @api_client.config.client_side_validation && shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "shipment_id" when calling ShipmentsApi.v1_shipments_tags_by_shipment_id_and_tag_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "shipment_id" when calling ShipmentsApi.v1_shipments_tags_by_shipment_id_and_tag_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'shipment_id' when calling ShipmentsApi.v1_shipments_tags_by_shipment_id_and_tag_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'tag' is set + if @api_client.config.client_side_validation && tag.nil? + fail ArgumentError, "Missing the required parameter 'tag' when calling ShipmentsApi.v1_shipments_tags_by_shipment_id_and_tag_delete" + end + # resource path + local_var_path = '/v1/shipments/{shipment_id}/tags/{tag}'.sub('{' + 'shipment_id' + '}', shipment_id.to_s).sub('{' + 'tag' + '}', tag.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ShipmentsApi#v1_shipments_tags_by_shipment_id_and_tag_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # shipments.add_tag + # + # @param shipment_id + # @param tag + # @param [Hash] opts the optional parameters + # @return [ShipmentAddTagResponseBody] + def v1_shipments_tags_by_shipment_id_and_tag_post(shipment_id, tag, opts = {}) + data, _status_code, _headers = v1_shipments_tags_by_shipment_id_and_tag_post_with_http_info(shipment_id, tag, opts) + data + end + + # shipments.add_tag + # + # @param shipment_id + # @param tag + # @param [Hash] opts the optional parameters + # @return [Array<(ShipmentAddTagResponseBody, Fixnum, Hash)>] ShipmentAddTagResponseBody data, response status code and response headers + def v1_shipments_tags_by_shipment_id_and_tag_post_with_http_info(shipment_id, tag, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ShipmentsApi.v1_shipments_tags_by_shipment_id_and_tag_post ...' + end + # verify the required parameter 'shipment_id' is set + if @api_client.config.client_side_validation && shipment_id.nil? + fail ArgumentError, "Missing the required parameter 'shipment_id' when calling ShipmentsApi.v1_shipments_tags_by_shipment_id_and_tag_post" + end + if @api_client.config.client_side_validation && shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "shipment_id" when calling ShipmentsApi.v1_shipments_tags_by_shipment_id_and_tag_post, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "shipment_id" when calling ShipmentsApi.v1_shipments_tags_by_shipment_id_and_tag_post, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'shipment_id' when calling ShipmentsApi.v1_shipments_tags_by_shipment_id_and_tag_post, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'tag' is set + if @api_client.config.client_side_validation && tag.nil? + fail ArgumentError, "Missing the required parameter 'tag' when calling ShipmentsApi.v1_shipments_tags_by_shipment_id_and_tag_post" + end + # resource path + local_var_path = '/v1/shipments/{shipment_id}/tags/{tag}'.sub('{' + 'shipment_id' + '}', shipment_id.to_s).sub('{' + 'tag' + '}', tag.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ShipmentAddTagResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ShipmentsApi#v1_shipments_tags_by_shipment_id_and_tag_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api/tags_api.rb b/lib/shipengine_api/api/tags_api.rb new file mode 100755 index 0000000..be93b73 --- /dev/null +++ b/lib/shipengine_api/api/tags_api.rb @@ -0,0 +1,238 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class TagsApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # tags.update_tag + # + # @param tag_name + # @param new_name + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_tags_by_tag_name_and_new_name_put(tag_name, new_name, opts = {}) + v1_tags_by_tag_name_and_new_name_put_with_http_info(tag_name, new_name, opts) + nil + end + + # tags.update_tag + # + # @param tag_name + # @param new_name + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_tags_by_tag_name_and_new_name_put_with_http_info(tag_name, new_name, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TagsApi.v1_tags_by_tag_name_and_new_name_put ...' + end + # verify the required parameter 'tag_name' is set + if @api_client.config.client_side_validation && tag_name.nil? + fail ArgumentError, "Missing the required parameter 'tag_name' when calling TagsApi.v1_tags_by_tag_name_and_new_name_put" + end + # verify the required parameter 'new_name' is set + if @api_client.config.client_side_validation && new_name.nil? + fail ArgumentError, "Missing the required parameter 'new_name' when calling TagsApi.v1_tags_by_tag_name_and_new_name_put" + end + # resource path + local_var_path = '/v1/tags/{tag_name}/{new_name}'.sub('{' + 'tag_name' + '}', tag_name.to_s).sub('{' + 'new_name' + '}', new_name.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TagsApi#v1_tags_by_tag_name_and_new_name_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # tags.delete + # + # @param tag_name + # @param [Hash] opts the optional parameters + # @return [ListTagResponseBody] + def v1_tags_by_tag_name_delete(tag_name, opts = {}) + data, _status_code, _headers = v1_tags_by_tag_name_delete_with_http_info(tag_name, opts) + data + end + + # tags.delete + # + # @param tag_name + # @param [Hash] opts the optional parameters + # @return [Array<(ListTagResponseBody, Fixnum, Hash)>] ListTagResponseBody data, response status code and response headers + def v1_tags_by_tag_name_delete_with_http_info(tag_name, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TagsApi.v1_tags_by_tag_name_delete ...' + end + # verify the required parameter 'tag_name' is set + if @api_client.config.client_side_validation && tag_name.nil? + fail ArgumentError, "Missing the required parameter 'tag_name' when calling TagsApi.v1_tags_by_tag_name_delete" + end + # resource path + local_var_path = '/v1/tags/{tag_name}'.sub('{' + 'tag_name' + '}', tag_name.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ListTagResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TagsApi#v1_tags_by_tag_name_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # tags.add_tag + # + # @param tag_name + # @param [Hash] opts the optional parameters + # @return [TagResponseBody] + def v1_tags_by_tag_name_post(tag_name, opts = {}) + data, _status_code, _headers = v1_tags_by_tag_name_post_with_http_info(tag_name, opts) + data + end + + # tags.add_tag + # + # @param tag_name + # @param [Hash] opts the optional parameters + # @return [Array<(TagResponseBody, Fixnum, Hash)>] TagResponseBody data, response status code and response headers + def v1_tags_by_tag_name_post_with_http_info(tag_name, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TagsApi.v1_tags_by_tag_name_post ...' + end + # verify the required parameter 'tag_name' is set + if @api_client.config.client_side_validation && tag_name.nil? + fail ArgumentError, "Missing the required parameter 'tag_name' when calling TagsApi.v1_tags_by_tag_name_post" + end + # resource path + local_var_path = '/v1/tags/{tag_name}'.sub('{' + 'tag_name' + '}', tag_name.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'TagResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TagsApi#v1_tags_by_tag_name_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # tags.find_tags + # + # @param [Hash] opts the optional parameters + # @return [ListTagResponseBody] + def v1_tags_get(opts = {}) + data, _status_code, _headers = v1_tags_get_with_http_info(opts) + data + end + + # tags.find_tags + # + # @param [Hash] opts the optional parameters + # @return [Array<(ListTagResponseBody, Fixnum, Hash)>] ListTagResponseBody data, response status code and response headers + def v1_tags_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TagsApi.v1_tags_get ...' + end + # resource path + local_var_path = '/v1/tags' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ListTagResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TagsApi#v1_tags_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api/tracking_api.rb b/lib/shipengine_api/api/tracking_api.rb new file mode 100755 index 0000000..57580b6 --- /dev/null +++ b/lib/shipengine_api/api/tracking_api.rb @@ -0,0 +1,183 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class TrackingApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # tracking.track + # + # @param [Hash] opts the optional parameters + # @option opts [String] :carrier_code + # @option opts [String] :tracking_number + # @return [TrackingInformationResponseBody] + def v1_tracking_get(opts = {}) + data, _status_code, _headers = v1_tracking_get_with_http_info(opts) + data + end + + # tracking.track + # + # @param [Hash] opts the optional parameters + # @option opts [String] :carrier_code + # @option opts [String] :tracking_number + # @return [Array<(TrackingInformationResponseBody, Fixnum, Hash)>] TrackingInformationResponseBody data, response status code and response headers + def v1_tracking_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TrackingApi.v1_tracking_get ...' + end + # resource path + local_var_path = '/v1/tracking' + + # query parameters + query_params = {} + query_params[:'carrier_code'] = opts[:'carrier_code'] if !opts[:'carrier_code'].nil? + query_params[:'tracking_number'] = opts[:'tracking_number'] if !opts[:'tracking_number'].nil? + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'TrackingInformationResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TrackingApi#v1_tracking_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # tracking.start_tracking + # + # @param [Hash] opts the optional parameters + # @option opts [String] :carrier_code + # @option opts [String] :tracking_number + # @return [nil] + def v1_tracking_start_post(opts = {}) + v1_tracking_start_post_with_http_info(opts) + nil + end + + # tracking.start_tracking + # + # @param [Hash] opts the optional parameters + # @option opts [String] :carrier_code + # @option opts [String] :tracking_number + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_tracking_start_post_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TrackingApi.v1_tracking_start_post ...' + end + # resource path + local_var_path = '/v1/tracking/start' + + # query parameters + query_params = {} + query_params[:'carrier_code'] = opts[:'carrier_code'] if !opts[:'carrier_code'].nil? + query_params[:'tracking_number'] = opts[:'tracking_number'] if !opts[:'tracking_number'].nil? + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TrackingApi#v1_tracking_start_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # tracking.stop_tracking + # + # @param [Hash] opts the optional parameters + # @option opts [String] :carrier_code + # @option opts [String] :tracking_number + # @return [nil] + def v1_tracking_stop_post(opts = {}) + v1_tracking_stop_post_with_http_info(opts) + nil + end + + # tracking.stop_tracking + # + # @param [Hash] opts the optional parameters + # @option opts [String] :carrier_code + # @option opts [String] :tracking_number + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_tracking_stop_post_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TrackingApi.v1_tracking_stop_post ...' + end + # resource path + local_var_path = '/v1/tracking/stop' + + # query parameters + query_params = {} + query_params[:'carrier_code'] = opts[:'carrier_code'] if !opts[:'carrier_code'].nil? + query_params[:'tracking_number'] = opts[:'tracking_number'] if !opts[:'tracking_number'].nil? + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TrackingApi#v1_tracking_stop_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api/warehouses_api.rb b/lib/shipengine_api/api/warehouses_api.rb new file mode 100755 index 0000000..b08febd --- /dev/null +++ b/lib/shipengine_api/api/warehouses_api.rb @@ -0,0 +1,327 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class WarehousesApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # warehouses.delete + # + # @param warehouse_id + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_warehouses_by_warehouse_id_delete(warehouse_id, opts = {}) + v1_warehouses_by_warehouse_id_delete_with_http_info(warehouse_id, opts) + nil + end + + # warehouses.delete + # + # @param warehouse_id + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_warehouses_by_warehouse_id_delete_with_http_info(warehouse_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WarehousesApi.v1_warehouses_by_warehouse_id_delete ...' + end + # verify the required parameter 'warehouse_id' is set + if @api_client.config.client_side_validation && warehouse_id.nil? + fail ArgumentError, "Missing the required parameter 'warehouse_id' when calling WarehousesApi.v1_warehouses_by_warehouse_id_delete" + end + if @api_client.config.client_side_validation && warehouse_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "warehouse_id" when calling WarehousesApi.v1_warehouses_by_warehouse_id_delete, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && warehouse_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "warehouse_id" when calling WarehousesApi.v1_warehouses_by_warehouse_id_delete, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && warehouse_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'warehouse_id' when calling WarehousesApi.v1_warehouses_by_warehouse_id_delete, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/warehouses/{warehouse_id}'.sub('{' + 'warehouse_id' + '}', warehouse_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WarehousesApi#v1_warehouses_by_warehouse_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # warehouses.get_by_id + # + # @param warehouse_id + # @param [Hash] opts the optional parameters + # @return [Warehouse] + def v1_warehouses_by_warehouse_id_get(warehouse_id, opts = {}) + data, _status_code, _headers = v1_warehouses_by_warehouse_id_get_with_http_info(warehouse_id, opts) + data + end + + # warehouses.get_by_id + # + # @param warehouse_id + # @param [Hash] opts the optional parameters + # @return [Array<(Warehouse, Fixnum, Hash)>] Warehouse data, response status code and response headers + def v1_warehouses_by_warehouse_id_get_with_http_info(warehouse_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WarehousesApi.v1_warehouses_by_warehouse_id_get ...' + end + # verify the required parameter 'warehouse_id' is set + if @api_client.config.client_side_validation && warehouse_id.nil? + fail ArgumentError, "Missing the required parameter 'warehouse_id' when calling WarehousesApi.v1_warehouses_by_warehouse_id_get" + end + if @api_client.config.client_side_validation && warehouse_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "warehouse_id" when calling WarehousesApi.v1_warehouses_by_warehouse_id_get, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && warehouse_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "warehouse_id" when calling WarehousesApi.v1_warehouses_by_warehouse_id_get, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && warehouse_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'warehouse_id' when calling WarehousesApi.v1_warehouses_by_warehouse_id_get, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # resource path + local_var_path = '/v1/warehouses/{warehouse_id}'.sub('{' + 'warehouse_id' + '}', warehouse_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Warehouse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WarehousesApi#v1_warehouses_by_warehouse_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # warehouses.update + # + # @param warehouse_id + # @param body + # @param [Hash] opts the optional parameters + # @return [nil] + def v1_warehouses_by_warehouse_id_put(warehouse_id, body, opts = {}) + v1_warehouses_by_warehouse_id_put_with_http_info(warehouse_id, body, opts) + nil + end + + # warehouses.update + # + # @param warehouse_id + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def v1_warehouses_by_warehouse_id_put_with_http_info(warehouse_id, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WarehousesApi.v1_warehouses_by_warehouse_id_put ...' + end + # verify the required parameter 'warehouse_id' is set + if @api_client.config.client_side_validation && warehouse_id.nil? + fail ArgumentError, "Missing the required parameter 'warehouse_id' when calling WarehousesApi.v1_warehouses_by_warehouse_id_put" + end + if @api_client.config.client_side_validation && warehouse_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "warehouse_id" when calling WarehousesApi.v1_warehouses_by_warehouse_id_put, the character length must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && warehouse_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "warehouse_id" when calling WarehousesApi.v1_warehouses_by_warehouse_id_put, the character length must be great than or equal to 1.' + end + + if @api_client.config.client_side_validation && warehouse_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, "invalid value for 'warehouse_id' when calling WarehousesApi.v1_warehouses_by_warehouse_id_put, must conform to the pattern /^se(-[a-z0-9]+)+$/." + end + + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling WarehousesApi.v1_warehouses_by_warehouse_id_put" + end + # resource path + local_var_path = '/v1/warehouses/{warehouse_id}'.sub('{' + 'warehouse_id' + '}', warehouse_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WarehousesApi#v1_warehouses_by_warehouse_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # warehouses.find + # + # @param [Hash] opts the optional parameters + # @return [WarehouseListResponseBody] + def v1_warehouses_get(opts = {}) + data, _status_code, _headers = v1_warehouses_get_with_http_info(opts) + data + end + + # warehouses.find + # + # @param [Hash] opts the optional parameters + # @return [Array<(WarehouseListResponseBody, Fixnum, Hash)>] WarehouseListResponseBody data, response status code and response headers + def v1_warehouses_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WarehousesApi.v1_warehouses_get ...' + end + # resource path + local_var_path = '/v1/warehouses' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'WarehouseListResponseBody') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WarehousesApi#v1_warehouses_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # warehouses.create + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Warehouse] + def v1_warehouses_post(body, opts = {}) + data, _status_code, _headers = v1_warehouses_post_with_http_info(body, opts) + data + end + + # warehouses.create + # + # @param body + # @param [Hash] opts the optional parameters + # @return [Array<(Warehouse, Fixnum, Hash)>] Warehouse data, response status code and response headers + def v1_warehouses_post_with_http_info(body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WarehousesApi.v1_warehouses_post ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling WarehousesApi.v1_warehouses_post" + end + # resource path + local_var_path = '/v1/warehouses' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(body) + auth_names = ['api-key'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Warehouse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WarehousesApi#v1_warehouses_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/shipengine_api/api_client.rb b/lib/shipengine_api/api_client.rb new file mode 100755 index 0000000..fdf9c91 --- /dev/null +++ b/lib/shipengine_api/api_client.rb @@ -0,0 +1,389 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' +require 'json' +require 'logger' +require 'tempfile' +require 'typhoeus' +require 'uri' + +module ShipEngineApi + class ApiClient + # The Configuration object holding settings to be used in the API client. + attr_accessor :config + + # Defines the headers to be used in HTTP requests of all API calls by default. + # + # @return [Hash] + attr_accessor :default_headers + + # Initializes the ApiClient + # @option config [Configuration] Configuration for initializing the object, default to Configuration.default + def initialize(config = Configuration.default) + @config = config + @user_agent = "Swagger-Codegen/#{VERSION}/ruby" + @default_headers = { + 'Content-Type' => 'application/json', + 'User-Agent' => @user_agent + } + end + + def self.default + @@default ||= ApiClient.new + end + + # Call an API with given options. + # + # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements: + # the data deserialized from response body (could be nil), response status code and response headers. + def call_api(http_method, path, opts = {}) + request = build_request(http_method, path, opts) + response = request.run + + if @config.debugging + @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + end + + unless response.success? + if response.timed_out? + fail ApiError.new('Connection timed out') + elsif response.code == 0 + # Errors from libcurl will be made visible here + fail ApiError.new(:code => 0, + :message => response.return_message) + else + fail ApiError.new(:code => response.code, + :response_headers => response.headers, + :response_body => response.body), + response.status_message + end + end + + if opts[:return_type] + data = deserialize(response, opts[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Builds the HTTP request + # + # @param [String] http_method HTTP method/verb (e.g. POST) + # @param [String] path URL path (e.g. /account/new) + # @option opts [Hash] :header_params Header parameters + # @option opts [Hash] :query_params Query parameters + # @option opts [Hash] :form_params Query parameters + # @option opts [Object] :body HTTP body (JSON/XML) + # @return [Typhoeus::Request] A Typhoeus Request + def build_request(http_method, path, opts = {}) + url = build_request_url(path) + http_method = http_method.to_sym.downcase + + header_params = @default_headers.merge(opts[:header_params] || {}) + query_params = opts[:query_params] || {} + form_params = opts[:form_params] || {} + + update_params_for_auth! header_params, query_params, opts[:auth_names] + + # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) + _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 + + req_opts = { + :method => http_method, + :headers => header_params, + :params => query_params, + :params_encoding => @config.params_encoding, + :timeout => @config.timeout, + :ssl_verifypeer => @config.verify_ssl, + :ssl_verifyhost => _verify_ssl_host, + :sslcert => @config.cert_file, + :sslkey => @config.key_file, + :verbose => @config.debugging + } + + # set custom cert, if provided + req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert + + if [:post, :patch, :put, :delete].include?(http_method) + req_body = build_request_body(header_params, form_params, opts[:body]) + req_opts.update :body => req_body + if @config.debugging + @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" + end + end + + request = Typhoeus::Request.new(url, req_opts) + download_file(request) if opts[:return_type] == 'File' + request + end + + # Check if the given MIME is a JSON MIME. + # JSON MIME examples: + # application/json + # application/json; charset=UTF8 + # APPLICATION/JSON + # */* + # @param [String] mime MIME + # @return [Boolean] True if the MIME is application/json + def json_mime?(mime) + (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + end + + # Deserialize the response to the given return type. + # + # @param [Response] response HTTP response + # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]" + def deserialize(response, return_type) + body = response.body + + # handle file downloading - return the File instance processed in request callbacks + # note that response body is empty when the file is written in chunks in request on_body callback + return @tempfile if return_type == 'File' + + return nil if body.nil? || body.empty? + + # return response body directly for String return type + return body if return_type == 'String' + + # ensuring a default content type + content_type = response.headers['Content-Type'] || 'application/json' + + fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) + + begin + data = JSON.parse("[#{body}]", :symbolize_names => true)[0] + rescue JSON::ParserError => e + if %w(String Date DateTime).include?(return_type) + data = body + else + raise e + end + end + + convert_to_type data, return_type + end + + # Convert data to the given return type. + # @param [Object] data Data to be converted + # @param [String] return_type Return type + # @return [Mixed] Data in a particular type + def convert_to_type(data, return_type) + return nil if data.nil? + case return_type + when 'String' + data.to_s + when 'Integer' + data.to_i + when 'Float' + data.to_f + when 'BOOLEAN' + data == true + when 'DateTime' + # parse date time (expecting ISO 8601 format) + DateTime.parse data + when 'Date' + # parse date time (expecting ISO 8601 format) + Date.parse data + when 'Object' + # generic object (usually a Hash), return directly + data + when /\AArray<(.+)>\z/ + # e.g. Array + sub_type = $1 + data.map { |item| convert_to_type(item, sub_type) } + when /\AHash\\z/ + # e.g. Hash + sub_type = $1 + {}.tap do |hash| + data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } + end + else + # models, e.g. Pet + ShipEngineApi.const_get(return_type).new.tap do |model| + model.build_from_hash data + end + end + end + + # Save response body into a file in (the defined) temporary folder, using the filename + # from the "Content-Disposition" header if provided, otherwise a random filename. + # The response body is written to the file in chunks in order to handle files which + # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby + # process can use. + # + # @see Configuration#temp_folder_path + def download_file(request) + tempfile = nil + encoding = nil + request.on_headers do |response| + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) + else + prefix = 'download-' + end + prefix = prefix + '-' unless prefix.end_with?('-') + encoding = response.body.encoding + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + @tempfile = tempfile + end + request.on_body do |chunk| + chunk.force_encoding(encoding) + tempfile.write(chunk) + end + request.on_complete do |response| + tempfile.close + @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + end + end + + # Sanitize filename by removing path. + # e.g. ../../sun.gif becomes sun.gif + # + # @param [String] filename the filename to be sanitized + # @return [String] the sanitized filename + def sanitize_filename(filename) + filename.gsub(/.*[\/\\]/, '') + end + + def build_request_url(path) + # Add leading and trailing slashes to path + path = "/#{path}".gsub(/\/+/, '/') + URI.encode(@config.base_url + path) + end + + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || + header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Array, nil + # let typhoeus handle File, Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + + # Update hearder and query params based on authentication settings. + # + # @param [Hash] header_params Header parameters + # @param [Hash] query_params Query parameters + # @param [String] auth_names Authentication scheme name + def update_params_for_auth!(header_params, query_params, auth_names) + Array(auth_names).each do |auth_name| + auth_setting = @config.auth_settings[auth_name] + next unless auth_setting + case auth_setting[:in] + when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] + when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] + else fail ArgumentError, 'Authentication token must be in `query` of `header`' + end + end + end + + # Sets user agent in HTTP header + # + # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) + def user_agent=(user_agent) + @user_agent = user_agent + @default_headers['User-Agent'] = @user_agent + end + + # Return Accept header based on an array of accepts provided. + # @param [Array] accepts array for Accept + # @return [String] the Accept header (e.g. application/json) + def select_header_accept(accepts) + return nil if accepts.nil? || accepts.empty? + # use JSON when present, otherwise use all of the provided + json_accept = accepts.find { |s| json_mime?(s) } + json_accept || accepts.join(',') + end + + # Return Content-Type header based on an array of content types provided. + # @param [Array] content_types array for Content-Type + # @return [String] the Content-Type header (e.g. application/json) + def select_header_content_type(content_types) + # use application/json by default + return 'application/json' if content_types.nil? || content_types.empty? + # use JSON when present, otherwise use the first one + json_content_type = content_types.find { |s| json_mime?(s) } + json_content_type || content_types.first + end + + # Convert object (array, hash, object, etc) to JSON string. + # @param [Object] model object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_http_body(model) + return model if model.nil? || model.is_a?(String) + local_body = nil + if model.is_a?(Array) + local_body = model.map { |m| object_to_hash(m) } + else + local_body = object_to_hash(model) + end + local_body.to_json + end + + # Convert object(non-array) to hash. + # @param [Object] obj object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_hash(obj) + if obj.respond_to?(:to_hash) + obj.to_hash + else + obj + end + end + + # Build parameter value according to the given collection format. + # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi + def build_collection_param(param, collection_format) + case collection_format + when :csv + param.join(',') + when :ssv + param.join(' ') + when :tsv + param.join("\t") + when :pipes + param.join('|') + when :multi + # return the array directly as typhoeus will handle it as expected + param + else + fail "unknown collection format: #{collection_format.inspect}" + end + end + end +end diff --git a/lib/shipengine_api/api_error.rb b/lib/shipengine_api/api_error.rb new file mode 100755 index 0000000..a12eb6e --- /dev/null +++ b/lib/shipengine_api/api_error.rb @@ -0,0 +1,38 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +module ShipEngineApi + class ApiError < StandardError + attr_reader :code, :response_headers, :response_body + + # Usage examples: + # ApiError.new + # ApiError.new("message") + # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") + # ApiError.new(:code => 404, :message => "Not Found") + def initialize(arg = nil) + if arg.is_a? Hash + if arg.key?(:message) || arg.key?('message') + super(arg[:message] || arg['message']) + else + super arg + end + + arg.each do |k, v| + instance_variable_set "@#{k}", v + end + else + super arg + end + end + end +end diff --git a/lib/shipengine_api/configuration.rb b/lib/shipengine_api/configuration.rb new file mode 100755 index 0000000..78ab073 --- /dev/null +++ b/lib/shipengine_api/configuration.rb @@ -0,0 +1,209 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'uri' + +module ShipEngineApi + class Configuration + # Defines url scheme + attr_accessor :scheme + + # Defines url host + attr_accessor :host + + # Defines url base path + attr_accessor :base_path + + # Defines API keys used with API Key authentications. + # + # @return [Hash] key: parameter name, value: parameter value (API key) + # + # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) + # config.api_key['api_key'] = 'xxx' + attr_accessor :api_key + + # Defines API key prefixes used with API Key authentications. + # + # @return [Hash] key: parameter name, value: API key prefix + # + # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) + # config.api_key_prefix['api_key'] = 'Token' + attr_accessor :api_key_prefix + + # Defines the username used with HTTP basic authentication. + # + # @return [String] + attr_accessor :username + + # Defines the password used with HTTP basic authentication. + # + # @return [String] + attr_accessor :password + + # Defines the access token (Bearer) used with OAuth2. + attr_accessor :access_token + + # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response + # details will be logged with `logger.debug` (see the `logger` attribute). + # Default to false. + # + # @return [true, false] + attr_accessor :debugging + + # Defines the logger used for debugging. + # Default to `Rails.logger` (when in Rails) or logging to STDOUT. + # + # @return [#debug] + attr_accessor :logger + + # Defines the temporary folder to store downloaded files + # (for API endpoints that have file response). + # Default to use `Tempfile`. + # + # @return [String] + attr_accessor :temp_folder_path + + # The time limit for HTTP request in seconds. + # Default to 0 (never times out). + attr_accessor :timeout + + # Set this to false to skip client side validation in the operation. + # Default to true. + # @return [true, false] + attr_accessor :client_side_validation + + ### TLS/SSL setting + # Set this to false to skip verifying SSL certificate when calling API from https server. + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :verify_ssl + + ### TLS/SSL setting + # Set this to false to skip verifying SSL host name + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :verify_ssl_host + + ### TLS/SSL setting + # Set this to customize the certificate file to verify the peer. + # + # @return [String] the path to the certificate file + # + # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: + # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 + attr_accessor :ssl_ca_cert + + ### TLS/SSL setting + # Client certificate file (for client certificate) + attr_accessor :cert_file + + ### TLS/SSL setting + # Client private key file (for client certificate) + attr_accessor :key_file + + # Set this to customize parameters encoding of array parameter with multi collectionFormat. + # Default to nil. + # + # @see The params_encoding option of Ethon. Related source code: + # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 + attr_accessor :params_encoding + + attr_accessor :inject_format + + attr_accessor :force_ending_format + + def initialize + @scheme = 'https' + @host = 'api.shipengine.com' + @base_path = '/' + @api_key = {} + @api_key_prefix = {} + @timeout = 0 + @client_side_validation = true + @verify_ssl = true + @verify_ssl_host = true + @params_encoding = nil + @cert_file = nil + @key_file = nil + @debugging = false + @inject_format = false + @force_ending_format = false + @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) + + yield(self) if block_given? + end + + # The default Configuration object. + def self.default + @@default ||= Configuration.new + end + + def configure + yield(self) if block_given? + end + + def scheme=(scheme) + # remove :// from scheme + @scheme = scheme.sub(/:\/\//, '') + end + + def host=(host) + # remove http(s):// and anything after a slash + @host = host.sub(/https?:\/\//, '').split('/').first + end + + def base_path=(base_path) + # Add leading and trailing slashes to base_path + @base_path = "/#{base_path}".gsub(/\/+/, '/') + @base_path = '' if @base_path == '/' + end + + def base_url + url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') + URI.encode(url) + end + + # Gets API key (with prefix if set). + # @param [String] param_name the parameter name of API key auth + def api_key_with_prefix(param_name) + if @api_key_prefix[param_name] + "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" + else + @api_key[param_name] + end + end + + # Gets Basic Auth token string + def basic_auth_token + 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") + end + + # Returns Auth Settings hash for api client. + def auth_settings + { + 'api-key' => + { + type: 'api_key', + in: 'header', + key: 'api-key', + value: api_key_with_prefix('api-key') + }, + } + end + end +end diff --git a/lib/shipengine_api/models/access_worldwide_account_information_request_body.rb b/lib/shipengine_api/models/access_worldwide_account_information_request_body.rb new file mode 100755 index 0000000..c06bb94 --- /dev/null +++ b/lib/shipengine_api/models/access_worldwide_account_information_request_body.rb @@ -0,0 +1,201 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class AccessWorldwideAccountInformationRequestBody + attr_accessor :nickname + + attr_accessor :username + + attr_accessor :password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nickname' => :'nickname', + :'username' => :'username', + :'password' => :'password' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'nickname' => :'String', + :'username' => :'String', + :'password' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + + if attributes.has_key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.has_key?(:'password') + self.password = attributes[:'password'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nickname == o.nickname && + username == o.username && + password == o.password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [nickname, username, password].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/address.rb b/lib/shipengine_api/models/address.rb new file mode 100755 index 0000000..27bf98d --- /dev/null +++ b/lib/shipengine_api/models/address.rb @@ -0,0 +1,273 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class Address + attr_accessor :name + + attr_accessor :phone + + attr_accessor :company_name + + attr_accessor :address_line1 + + attr_accessor :address_line2 + + attr_accessor :address_line3 + + attr_accessor :city_locality + + attr_accessor :state_province + + attr_accessor :postal_code + + attr_accessor :country_code + + attr_accessor :address_residential_indicator + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'phone' => :'phone', + :'company_name' => :'company_name', + :'address_line1' => :'address_line1', + :'address_line2' => :'address_line2', + :'address_line3' => :'address_line3', + :'city_locality' => :'city_locality', + :'state_province' => :'state_province', + :'postal_code' => :'postal_code', + :'country_code' => :'country_code', + :'address_residential_indicator' => :'address_residential_indicator' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'name' => :'String', + :'phone' => :'String', + :'company_name' => :'String', + :'address_line1' => :'String', + :'address_line2' => :'String', + :'address_line3' => :'String', + :'city_locality' => :'String', + :'state_province' => :'String', + :'postal_code' => :'String', + :'country_code' => :'String', + :'address_residential_indicator' => :'AddressResidentialIndicator' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.has_key?(:'phone') + self.phone = attributes[:'phone'] + end + + if attributes.has_key?(:'company_name') + self.company_name = attributes[:'company_name'] + end + + if attributes.has_key?(:'address_line1') + self.address_line1 = attributes[:'address_line1'] + end + + if attributes.has_key?(:'address_line2') + self.address_line2 = attributes[:'address_line2'] + end + + if attributes.has_key?(:'address_line3') + self.address_line3 = attributes[:'address_line3'] + end + + if attributes.has_key?(:'city_locality') + self.city_locality = attributes[:'city_locality'] + end + + if attributes.has_key?(:'state_province') + self.state_province = attributes[:'state_province'] + end + + if attributes.has_key?(:'postal_code') + self.postal_code = attributes[:'postal_code'] + end + + if attributes.has_key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.has_key?(:'address_residential_indicator') + self.address_residential_indicator = attributes[:'address_residential_indicator'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + phone == o.phone && + company_name == o.company_name && + address_line1 == o.address_line1 && + address_line2 == o.address_line2 && + address_line3 == o.address_line3 && + city_locality == o.city_locality && + state_province == o.state_province && + postal_code == o.postal_code && + country_code == o.country_code && + address_residential_indicator == o.address_residential_indicator + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [name, phone, company_name, address_line1, address_line2, address_line3, city_locality, state_province, postal_code, country_code, address_residential_indicator].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/address_residential_indicator.rb b/lib/shipengine_api/models/address_residential_indicator.rb new file mode 100755 index 0000000..797556f --- /dev/null +++ b/lib/shipengine_api/models/address_residential_indicator.rb @@ -0,0 +1,31 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class AddressResidentialIndicator + + UNKNOWN = 'unknown'.freeze + YES = 'yes'.freeze + NO = 'no'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = AddressResidentialIndicator.constants.select { |c| AddressResidentialIndicator::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #AddressResidentialIndicator" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/address_validating_shipment.rb b/lib/shipengine_api/models/address_validating_shipment.rb new file mode 100755 index 0000000..687de34 --- /dev/null +++ b/lib/shipengine_api/models/address_validating_shipment.rb @@ -0,0 +1,494 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class AddressValidatingShipment + attr_accessor :validate_address + + # A string that uniquely identifies the shipment id + attr_accessor :shipment_id + + # A string that uniquely identifies the carrier id + attr_accessor :carrier_id + + attr_accessor :service_code + + # A string that uniquely identifies the external shipment id + attr_accessor :external_shipment_id + + attr_accessor :ship_date + + attr_accessor :created_at + + attr_accessor :modified_at + + attr_accessor :shipment_status + + attr_accessor :ship_to + + attr_accessor :ship_from + + # A string that uniquely identifies the warehouse id + attr_accessor :warehouse_id + + attr_accessor :return_to + + attr_accessor :confirmation + + attr_accessor :customs + + attr_accessor :advanced_options + + attr_accessor :insurance_provider + + attr_accessor :tags + + attr_accessor :packages + + attr_accessor :total_weight + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'validate_address' => :'validate_address', + :'shipment_id' => :'shipment_id', + :'carrier_id' => :'carrier_id', + :'service_code' => :'service_code', + :'external_shipment_id' => :'external_shipment_id', + :'ship_date' => :'ship_date', + :'created_at' => :'created_at', + :'modified_at' => :'modified_at', + :'shipment_status' => :'shipment_status', + :'ship_to' => :'ship_to', + :'ship_from' => :'ship_from', + :'warehouse_id' => :'warehouse_id', + :'return_to' => :'return_to', + :'confirmation' => :'confirmation', + :'customs' => :'customs', + :'advanced_options' => :'advanced_options', + :'insurance_provider' => :'insurance_provider', + :'tags' => :'tags', + :'packages' => :'packages', + :'total_weight' => :'total_weight' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'validate_address' => :'ValidateAddress', + :'shipment_id' => :'String', + :'carrier_id' => :'String', + :'service_code' => :'String', + :'external_shipment_id' => :'String', + :'ship_date' => :'DateTime', + :'created_at' => :'DateTime', + :'modified_at' => :'DateTime', + :'shipment_status' => :'ShipmentStatus', + :'ship_to' => :'Address', + :'ship_from' => :'Address', + :'warehouse_id' => :'String', + :'return_to' => :'Address', + :'confirmation' => :'Confirmation', + :'customs' => :'InternationalOptions', + :'advanced_options' => :'AdvancedOptions', + :'insurance_provider' => :'InsuranceProvider', + :'tags' => :'Array', + :'packages' => :'Array', + :'total_weight' => :'Weight' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'validate_address') + self.validate_address = attributes[:'validate_address'] + end + + if attributes.has_key?(:'shipment_id') + self.shipment_id = attributes[:'shipment_id'] + end + + if attributes.has_key?(:'carrier_id') + self.carrier_id = attributes[:'carrier_id'] + end + + if attributes.has_key?(:'service_code') + self.service_code = attributes[:'service_code'] + end + + if attributes.has_key?(:'external_shipment_id') + self.external_shipment_id = attributes[:'external_shipment_id'] + end + + if attributes.has_key?(:'ship_date') + self.ship_date = attributes[:'ship_date'] + end + + if attributes.has_key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.has_key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.has_key?(:'shipment_status') + self.shipment_status = attributes[:'shipment_status'] + end + + if attributes.has_key?(:'ship_to') + self.ship_to = attributes[:'ship_to'] + end + + if attributes.has_key?(:'ship_from') + self.ship_from = attributes[:'ship_from'] + end + + if attributes.has_key?(:'warehouse_id') + self.warehouse_id = attributes[:'warehouse_id'] + end + + if attributes.has_key?(:'return_to') + self.return_to = attributes[:'return_to'] + end + + if attributes.has_key?(:'confirmation') + self.confirmation = attributes[:'confirmation'] + end + + if attributes.has_key?(:'customs') + self.customs = attributes[:'customs'] + end + + if attributes.has_key?(:'advanced_options') + self.advanced_options = attributes[:'advanced_options'] + end + + if attributes.has_key?(:'insurance_provider') + self.insurance_provider = attributes[:'insurance_provider'] + end + + if attributes.has_key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.has_key?(:'packages') + if (value = attributes[:'packages']).is_a?(Array) + self.packages = value + end + end + + if attributes.has_key?(:'total_weight') + self.total_weight = attributes[:'total_weight'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@shipment_id.nil? && @shipment_id.to_s.length > 25 + invalid_properties.push('invalid value for "shipment_id", the character length must be smaller than or equal to 25.') + end + + if !@shipment_id.nil? && @shipment_id.to_s.length < 1 + invalid_properties.push('invalid value for "shipment_id", the character length must be great than or equal to 1.') + end + + if !@shipment_id.nil? && @shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "shipment_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + if !@carrier_id.nil? && @carrier_id.to_s.length > 25 + invalid_properties.push('invalid value for "carrier_id", the character length must be smaller than or equal to 25.') + end + + if !@carrier_id.nil? && @carrier_id.to_s.length < 1 + invalid_properties.push('invalid value for "carrier_id", the character length must be great than or equal to 1.') + end + + if !@carrier_id.nil? && @carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "carrier_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + if !@external_shipment_id.nil? && @external_shipment_id.to_s.length > 25 + invalid_properties.push('invalid value for "external_shipment_id", the character length must be smaller than or equal to 25.') + end + + if !@external_shipment_id.nil? && @external_shipment_id.to_s.length < 1 + invalid_properties.push('invalid value for "external_shipment_id", the character length must be great than or equal to 1.') + end + + if !@external_shipment_id.nil? && @external_shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "external_shipment_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + if !@warehouse_id.nil? && @warehouse_id.to_s.length > 25 + invalid_properties.push('invalid value for "warehouse_id", the character length must be smaller than or equal to 25.') + end + + if !@warehouse_id.nil? && @warehouse_id.to_s.length < 1 + invalid_properties.push('invalid value for "warehouse_id", the character length must be great than or equal to 1.') + end + + if !@warehouse_id.nil? && @warehouse_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "warehouse_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@shipment_id.nil? && @shipment_id.to_s.length > 25 + return false if !@shipment_id.nil? && @shipment_id.to_s.length < 1 + return false if !@shipment_id.nil? && @shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + return false if !@carrier_id.nil? && @carrier_id.to_s.length > 25 + return false if !@carrier_id.nil? && @carrier_id.to_s.length < 1 + return false if !@carrier_id.nil? && @carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + return false if !@external_shipment_id.nil? && @external_shipment_id.to_s.length > 25 + return false if !@external_shipment_id.nil? && @external_shipment_id.to_s.length < 1 + return false if !@external_shipment_id.nil? && @external_shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + return false if !@warehouse_id.nil? && @warehouse_id.to_s.length > 25 + return false if !@warehouse_id.nil? && @warehouse_id.to_s.length < 1 + return false if !@warehouse_id.nil? && @warehouse_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] shipment_id Value to be assigned + def shipment_id=(shipment_id) + if !shipment_id.nil? && shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "shipment_id", the character length must be smaller than or equal to 25.' + end + + if !shipment_id.nil? && shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "shipment_id", the character length must be great than or equal to 1.' + end + + if !shipment_id.nil? && shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "shipment_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @shipment_id = shipment_id + end + + # Custom attribute writer method with validation + # @param [Object] carrier_id Value to be assigned + def carrier_id=(carrier_id) + if !carrier_id.nil? && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id", the character length must be smaller than or equal to 25.' + end + + if !carrier_id.nil? && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id", the character length must be great than or equal to 1.' + end + + if !carrier_id.nil? && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "carrier_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @carrier_id = carrier_id + end + + # Custom attribute writer method with validation + # @param [Object] external_shipment_id Value to be assigned + def external_shipment_id=(external_shipment_id) + if !external_shipment_id.nil? && external_shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "external_shipment_id", the character length must be smaller than or equal to 25.' + end + + if !external_shipment_id.nil? && external_shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "external_shipment_id", the character length must be great than or equal to 1.' + end + + if !external_shipment_id.nil? && external_shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "external_shipment_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @external_shipment_id = external_shipment_id + end + + # Custom attribute writer method with validation + # @param [Object] warehouse_id Value to be assigned + def warehouse_id=(warehouse_id) + if !warehouse_id.nil? && warehouse_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "warehouse_id", the character length must be smaller than or equal to 25.' + end + + if !warehouse_id.nil? && warehouse_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "warehouse_id", the character length must be great than or equal to 1.' + end + + if !warehouse_id.nil? && warehouse_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "warehouse_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @warehouse_id = warehouse_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + validate_address == o.validate_address && + shipment_id == o.shipment_id && + carrier_id == o.carrier_id && + service_code == o.service_code && + external_shipment_id == o.external_shipment_id && + ship_date == o.ship_date && + created_at == o.created_at && + modified_at == o.modified_at && + shipment_status == o.shipment_status && + ship_to == o.ship_to && + ship_from == o.ship_from && + warehouse_id == o.warehouse_id && + return_to == o.return_to && + confirmation == o.confirmation && + customs == o.customs && + advanced_options == o.advanced_options && + insurance_provider == o.insurance_provider && + tags == o.tags && + packages == o.packages && + total_weight == o.total_weight + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [validate_address, shipment_id, carrier_id, service_code, external_shipment_id, ship_date, created_at, modified_at, shipment_status, ship_to, ship_from, warehouse_id, return_to, confirmation, customs, advanced_options, insurance_provider, tags, packages, total_weight].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/address_validation_result.rb b/lib/shipengine_api/models/address_validation_result.rb new file mode 100755 index 0000000..afeb996 --- /dev/null +++ b/lib/shipengine_api/models/address_validation_result.rb @@ -0,0 +1,212 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class AddressValidationResult + attr_accessor :status + + attr_accessor :original_address + + attr_accessor :matched_address + + attr_accessor :messages + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'status' => :'status', + :'original_address' => :'original_address', + :'matched_address' => :'matched_address', + :'messages' => :'messages' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'status' => :'AddressValidationStatus', + :'original_address' => :'Address', + :'matched_address' => :'Address', + :'messages' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.has_key?(:'original_address') + self.original_address = attributes[:'original_address'] + end + + if attributes.has_key?(:'matched_address') + self.matched_address = attributes[:'matched_address'] + end + + if attributes.has_key?(:'messages') + if (value = attributes[:'messages']).is_a?(Array) + self.messages = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + status == o.status && + original_address == o.original_address && + matched_address == o.matched_address && + messages == o.messages + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [status, original_address, matched_address, messages].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/address_validation_status.rb b/lib/shipengine_api/models/address_validation_status.rb new file mode 100755 index 0000000..2d148a1 --- /dev/null +++ b/lib/shipengine_api/models/address_validation_status.rb @@ -0,0 +1,32 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class AddressValidationStatus + + UNVERIFIED = 'unverified'.freeze + VERIFIED = 'verified'.freeze + WARNING = 'warning'.freeze + ERROR = 'error'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = AddressValidationStatus.constants.select { |c| AddressValidationStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #AddressValidationStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/advanced_options.rb b/lib/shipengine_api/models/advanced_options.rb new file mode 100755 index 0000000..b480a42 --- /dev/null +++ b/lib/shipengine_api/models/advanced_options.rb @@ -0,0 +1,291 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class AdvancedOptions + attr_accessor :bill_to_account + + attr_accessor :bill_to_country_code + + attr_accessor :bill_to_party + + attr_accessor :bill_to_postal_code + + attr_accessor :contains_alcohol + + attr_accessor :delivered_duty_paid + + attr_accessor :non_machinable + + attr_accessor :saturday_delivery + + attr_accessor :use_ups_ground_freight_pricing + + attr_accessor :freight_class + + attr_accessor :custom_field1 + + attr_accessor :custom_field2 + + attr_accessor :custom_field3 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'bill_to_account' => :'bill_to_account', + :'bill_to_country_code' => :'bill_to_country_code', + :'bill_to_party' => :'bill_to_party', + :'bill_to_postal_code' => :'bill_to_postal_code', + :'contains_alcohol' => :'contains_alcohol', + :'delivered_duty_paid' => :'delivered_duty_paid', + :'non_machinable' => :'non_machinable', + :'saturday_delivery' => :'saturday_delivery', + :'use_ups_ground_freight_pricing' => :'use_ups_ground_freight_pricing', + :'freight_class' => :'freight_class', + :'custom_field1' => :'custom_field1', + :'custom_field2' => :'custom_field2', + :'custom_field3' => :'custom_field3' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'bill_to_account' => :'String', + :'bill_to_country_code' => :'String', + :'bill_to_party' => :'BillToParty', + :'bill_to_postal_code' => :'String', + :'contains_alcohol' => :'BOOLEAN', + :'delivered_duty_paid' => :'BOOLEAN', + :'non_machinable' => :'BOOLEAN', + :'saturday_delivery' => :'BOOLEAN', + :'use_ups_ground_freight_pricing' => :'BOOLEAN', + :'freight_class' => :'String', + :'custom_field1' => :'String', + :'custom_field2' => :'String', + :'custom_field3' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'bill_to_account') + self.bill_to_account = attributes[:'bill_to_account'] + end + + if attributes.has_key?(:'bill_to_country_code') + self.bill_to_country_code = attributes[:'bill_to_country_code'] + end + + if attributes.has_key?(:'bill_to_party') + self.bill_to_party = attributes[:'bill_to_party'] + end + + if attributes.has_key?(:'bill_to_postal_code') + self.bill_to_postal_code = attributes[:'bill_to_postal_code'] + end + + if attributes.has_key?(:'contains_alcohol') + self.contains_alcohol = attributes[:'contains_alcohol'] + end + + if attributes.has_key?(:'delivered_duty_paid') + self.delivered_duty_paid = attributes[:'delivered_duty_paid'] + end + + if attributes.has_key?(:'non_machinable') + self.non_machinable = attributes[:'non_machinable'] + end + + if attributes.has_key?(:'saturday_delivery') + self.saturday_delivery = attributes[:'saturday_delivery'] + end + + if attributes.has_key?(:'use_ups_ground_freight_pricing') + self.use_ups_ground_freight_pricing = attributes[:'use_ups_ground_freight_pricing'] + end + + if attributes.has_key?(:'freight_class') + self.freight_class = attributes[:'freight_class'] + end + + if attributes.has_key?(:'custom_field1') + self.custom_field1 = attributes[:'custom_field1'] + end + + if attributes.has_key?(:'custom_field2') + self.custom_field2 = attributes[:'custom_field2'] + end + + if attributes.has_key?(:'custom_field3') + self.custom_field3 = attributes[:'custom_field3'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + bill_to_account == o.bill_to_account && + bill_to_country_code == o.bill_to_country_code && + bill_to_party == o.bill_to_party && + bill_to_postal_code == o.bill_to_postal_code && + contains_alcohol == o.contains_alcohol && + delivered_duty_paid == o.delivered_duty_paid && + non_machinable == o.non_machinable && + saturday_delivery == o.saturday_delivery && + use_ups_ground_freight_pricing == o.use_ups_ground_freight_pricing && + freight_class == o.freight_class && + custom_field1 == o.custom_field1 && + custom_field2 == o.custom_field2 && + custom_field3 == o.custom_field3 + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [bill_to_account, bill_to_country_code, bill_to_party, bill_to_postal_code, contains_alcohol, delivered_duty_paid, non_machinable, saturday_delivery, use_ups_ground_freight_pricing, freight_class, custom_field1, custom_field2, custom_field3].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/amazon_account_information_request_body.rb b/lib/shipengine_api/models/amazon_account_information_request_body.rb new file mode 100755 index 0000000..ae1070d --- /dev/null +++ b/lib/shipengine_api/models/amazon_account_information_request_body.rb @@ -0,0 +1,244 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class AmazonAccountInformationRequestBody + attr_accessor :store_name + + # A string that uniquely identifies the merchant seller id + attr_accessor :merchant_seller_id + + attr_accessor :product_identifier + + attr_accessor :mws_auth_token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'store_name' => :'store_name', + :'merchant_seller_id' => :'merchant_seller_id', + :'product_identifier' => :'product_identifier', + :'mws_auth_token' => :'mws_auth_token' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'store_name' => :'String', + :'merchant_seller_id' => :'String', + :'product_identifier' => :'AmazonProductIdentifier', + :'mws_auth_token' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'store_name') + self.store_name = attributes[:'store_name'] + end + + if attributes.has_key?(:'merchant_seller_id') + self.merchant_seller_id = attributes[:'merchant_seller_id'] + end + + if attributes.has_key?(:'product_identifier') + self.product_identifier = attributes[:'product_identifier'] + end + + if attributes.has_key?(:'mws_auth_token') + self.mws_auth_token = attributes[:'mws_auth_token'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@merchant_seller_id.nil? && @merchant_seller_id.to_s.length > 25 + invalid_properties.push('invalid value for "merchant_seller_id", the character length must be smaller than or equal to 25.') + end + + if !@merchant_seller_id.nil? && @merchant_seller_id.to_s.length < 1 + invalid_properties.push('invalid value for "merchant_seller_id", the character length must be great than or equal to 1.') + end + + if !@merchant_seller_id.nil? && @merchant_seller_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "merchant_seller_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@merchant_seller_id.nil? && @merchant_seller_id.to_s.length > 25 + return false if !@merchant_seller_id.nil? && @merchant_seller_id.to_s.length < 1 + return false if !@merchant_seller_id.nil? && @merchant_seller_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] merchant_seller_id Value to be assigned + def merchant_seller_id=(merchant_seller_id) + if !merchant_seller_id.nil? && merchant_seller_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "merchant_seller_id", the character length must be smaller than or equal to 25.' + end + + if !merchant_seller_id.nil? && merchant_seller_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "merchant_seller_id", the character length must be great than or equal to 1.' + end + + if !merchant_seller_id.nil? && merchant_seller_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "merchant_seller_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @merchant_seller_id = merchant_seller_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + store_name == o.store_name && + merchant_seller_id == o.merchant_seller_id && + product_identifier == o.product_identifier && + mws_auth_token == o.mws_auth_token + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [store_name, merchant_seller_id, product_identifier, mws_auth_token].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/amazon_product_identifier.rb b/lib/shipengine_api/models/amazon_product_identifier.rb new file mode 100755 index 0000000..26e958b --- /dev/null +++ b/lib/shipengine_api/models/amazon_product_identifier.rb @@ -0,0 +1,30 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class AmazonProductIdentifier + + SKU = 'sku'.freeze + ASIN = 'asin'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = AmazonProductIdentifier.constants.select { |c| AmazonProductIdentifier::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #AmazonProductIdentifier" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/apc_account_information_request_body.rb b/lib/shipengine_api/models/apc_account_information_request_body.rb new file mode 100755 index 0000000..ae5d928 --- /dev/null +++ b/lib/shipengine_api/models/apc_account_information_request_body.rb @@ -0,0 +1,201 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class ApcAccountInformationRequestBody + attr_accessor :nickname + + attr_accessor :username + + attr_accessor :password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nickname' => :'nickname', + :'username' => :'username', + :'password' => :'password' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'nickname' => :'String', + :'username' => :'String', + :'password' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + + if attributes.has_key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.has_key?(:'password') + self.password = attributes[:'password'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nickname == o.nickname && + username == o.username && + password == o.password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [nickname, username, password].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/api_error.rb b/lib/shipengine_api/models/api_error.rb new file mode 100755 index 0000000..27a26ba --- /dev/null +++ b/lib/shipengine_api/models/api_error.rb @@ -0,0 +1,192 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class ApiError + attr_accessor :error_code + + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'error_code' => :'error_code', + :'message' => :'message' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'error_code' => :'String', + :'message' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'error_code') + self.error_code = attributes[:'error_code'] + end + + if attributes.has_key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error_code == o.error_code && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [error_code, message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/asendia_account_information_request_body.rb b/lib/shipengine_api/models/asendia_account_information_request_body.rb new file mode 100755 index 0000000..61886b9 --- /dev/null +++ b/lib/shipengine_api/models/asendia_account_information_request_body.rb @@ -0,0 +1,210 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class AsendiaAccountInformationRequestBody + attr_accessor :nickname + + attr_accessor :account_number + + attr_accessor :ftp_username + + attr_accessor :ftp_password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nickname' => :'nickname', + :'account_number' => :'account_number', + :'ftp_username' => :'ftp_username', + :'ftp_password' => :'ftp_password' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'nickname' => :'String', + :'account_number' => :'String', + :'ftp_username' => :'String', + :'ftp_password' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + + if attributes.has_key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.has_key?(:'ftp_username') + self.ftp_username = attributes[:'ftp_username'] + end + + if attributes.has_key?(:'ftp_password') + self.ftp_password = attributes[:'ftp_password'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nickname == o.nickname && + account_number == o.account_number && + ftp_username == o.ftp_username && + ftp_password == o.ftp_password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [nickname, account_number, ftp_username, ftp_password].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/balance_response_body.rb b/lib/shipengine_api/models/balance_response_body.rb new file mode 100755 index 0000000..d8835e6 --- /dev/null +++ b/lib/shipengine_api/models/balance_response_body.rb @@ -0,0 +1,183 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class BalanceResponseBody + attr_accessor :balance + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'balance' => :'balance' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'balance' => :'Money' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'balance') + self.balance = attributes[:'balance'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + balance == o.balance + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [balance].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/batch.rb b/lib/shipengine_api/models/batch.rb new file mode 100755 index 0000000..e106884 --- /dev/null +++ b/lib/shipengine_api/models/batch.rb @@ -0,0 +1,404 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class Batch + attr_accessor :label_layout + + attr_accessor :label_format + + # A string that uniquely identifies the batch id + attr_accessor :batch_id + + # A string that uniquely identifies the external batch id + attr_accessor :external_batch_id + + attr_accessor :batch_notes + + attr_accessor :created_at + + attr_accessor :processed_at + + attr_accessor :errors + + attr_accessor :warnings + + attr_accessor :completed + + attr_accessor :forms + + attr_accessor :count + + attr_accessor :batch_shipments_url + + attr_accessor :batch_labels_url + + attr_accessor :batch_errors_url + + attr_accessor :label_download + + attr_accessor :form_download + + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'label_layout' => :'label_layout', + :'label_format' => :'label_format', + :'batch_id' => :'batch_id', + :'external_batch_id' => :'external_batch_id', + :'batch_notes' => :'batch_notes', + :'created_at' => :'created_at', + :'processed_at' => :'processed_at', + :'errors' => :'errors', + :'warnings' => :'warnings', + :'completed' => :'completed', + :'forms' => :'forms', + :'count' => :'count', + :'batch_shipments_url' => :'batch_shipments_url', + :'batch_labels_url' => :'batch_labels_url', + :'batch_errors_url' => :'batch_errors_url', + :'label_download' => :'label_download', + :'form_download' => :'form_download', + :'status' => :'status' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'label_layout' => :'String', + :'label_format' => :'LabelFormat', + :'batch_id' => :'String', + :'external_batch_id' => :'String', + :'batch_notes' => :'String', + :'created_at' => :'DateTime', + :'processed_at' => :'DateTime', + :'errors' => :'Integer', + :'warnings' => :'Integer', + :'completed' => :'Integer', + :'forms' => :'Integer', + :'count' => :'Integer', + :'batch_shipments_url' => :'Link', + :'batch_labels_url' => :'Link', + :'batch_errors_url' => :'Link', + :'label_download' => :'Link', + :'form_download' => :'Link', + :'status' => :'BatchStatus' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'label_layout') + self.label_layout = attributes[:'label_layout'] + end + + if attributes.has_key?(:'label_format') + self.label_format = attributes[:'label_format'] + end + + if attributes.has_key?(:'batch_id') + self.batch_id = attributes[:'batch_id'] + end + + if attributes.has_key?(:'external_batch_id') + self.external_batch_id = attributes[:'external_batch_id'] + end + + if attributes.has_key?(:'batch_notes') + self.batch_notes = attributes[:'batch_notes'] + end + + if attributes.has_key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.has_key?(:'processed_at') + self.processed_at = attributes[:'processed_at'] + end + + if attributes.has_key?(:'errors') + self.errors = attributes[:'errors'] + end + + if attributes.has_key?(:'warnings') + self.warnings = attributes[:'warnings'] + end + + if attributes.has_key?(:'completed') + self.completed = attributes[:'completed'] + end + + if attributes.has_key?(:'forms') + self.forms = attributes[:'forms'] + end + + if attributes.has_key?(:'count') + self.count = attributes[:'count'] + end + + if attributes.has_key?(:'batch_shipments_url') + self.batch_shipments_url = attributes[:'batch_shipments_url'] + end + + if attributes.has_key?(:'batch_labels_url') + self.batch_labels_url = attributes[:'batch_labels_url'] + end + + if attributes.has_key?(:'batch_errors_url') + self.batch_errors_url = attributes[:'batch_errors_url'] + end + + if attributes.has_key?(:'label_download') + self.label_download = attributes[:'label_download'] + end + + if attributes.has_key?(:'form_download') + self.form_download = attributes[:'form_download'] + end + + if attributes.has_key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@batch_id.nil? && @batch_id.to_s.length > 25 + invalid_properties.push('invalid value for "batch_id", the character length must be smaller than or equal to 25.') + end + + if !@batch_id.nil? && @batch_id.to_s.length < 1 + invalid_properties.push('invalid value for "batch_id", the character length must be great than or equal to 1.') + end + + if !@batch_id.nil? && @batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "batch_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + if !@external_batch_id.nil? && @external_batch_id.to_s.length > 25 + invalid_properties.push('invalid value for "external_batch_id", the character length must be smaller than or equal to 25.') + end + + if !@external_batch_id.nil? && @external_batch_id.to_s.length < 1 + invalid_properties.push('invalid value for "external_batch_id", the character length must be great than or equal to 1.') + end + + if !@external_batch_id.nil? && @external_batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "external_batch_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@batch_id.nil? && @batch_id.to_s.length > 25 + return false if !@batch_id.nil? && @batch_id.to_s.length < 1 + return false if !@batch_id.nil? && @batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + return false if !@external_batch_id.nil? && @external_batch_id.to_s.length > 25 + return false if !@external_batch_id.nil? && @external_batch_id.to_s.length < 1 + return false if !@external_batch_id.nil? && @external_batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] batch_id Value to be assigned + def batch_id=(batch_id) + if !batch_id.nil? && batch_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "batch_id", the character length must be smaller than or equal to 25.' + end + + if !batch_id.nil? && batch_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "batch_id", the character length must be great than or equal to 1.' + end + + if !batch_id.nil? && batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "batch_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @batch_id = batch_id + end + + # Custom attribute writer method with validation + # @param [Object] external_batch_id Value to be assigned + def external_batch_id=(external_batch_id) + if !external_batch_id.nil? && external_batch_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "external_batch_id", the character length must be smaller than or equal to 25.' + end + + if !external_batch_id.nil? && external_batch_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "external_batch_id", the character length must be great than or equal to 1.' + end + + if !external_batch_id.nil? && external_batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "external_batch_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @external_batch_id = external_batch_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + label_layout == o.label_layout && + label_format == o.label_format && + batch_id == o.batch_id && + external_batch_id == o.external_batch_id && + batch_notes == o.batch_notes && + created_at == o.created_at && + processed_at == o.processed_at && + errors == o.errors && + warnings == o.warnings && + completed == o.completed && + forms == o.forms && + count == o.count && + batch_shipments_url == o.batch_shipments_url && + batch_labels_url == o.batch_labels_url && + batch_errors_url == o.batch_errors_url && + label_download == o.label_download && + form_download == o.form_download && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [label_layout, label_format, batch_id, external_batch_id, batch_notes, created_at, processed_at, errors, warnings, completed, forms, count, batch_shipments_url, batch_labels_url, batch_errors_url, label_download, form_download, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/batch_errors_response_body.rb b/lib/shipengine_api/models/batch_errors_response_body.rb new file mode 100755 index 0000000..dec82ae --- /dev/null +++ b/lib/shipengine_api/models/batch_errors_response_body.rb @@ -0,0 +1,194 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class BatchErrorsResponseBody + attr_accessor :errors + + attr_accessor :links + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'errors' => :'errors', + :'links' => :'links' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'errors' => :'Array', + :'links' => :'PaginationLink' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + end + + if attributes.has_key?(:'links') + self.links = attributes[:'links'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + errors == o.errors && + links == o.links + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [errors, links].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/batch_response_error.rb b/lib/shipengine_api/models/batch_response_error.rb new file mode 100755 index 0000000..800b008 --- /dev/null +++ b/lib/shipengine_api/models/batch_response_error.rb @@ -0,0 +1,226 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class BatchResponseError + attr_accessor :error + + # A string that uniquely identifies the shipment id + attr_accessor :shipment_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'error' => :'error', + :'shipment_id' => :'shipment_id' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'error' => :'String', + :'shipment_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'error') + self.error = attributes[:'error'] + end + + if attributes.has_key?(:'shipment_id') + self.shipment_id = attributes[:'shipment_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@shipment_id.nil? && @shipment_id.to_s.length > 25 + invalid_properties.push('invalid value for "shipment_id", the character length must be smaller than or equal to 25.') + end + + if !@shipment_id.nil? && @shipment_id.to_s.length < 1 + invalid_properties.push('invalid value for "shipment_id", the character length must be great than or equal to 1.') + end + + if !@shipment_id.nil? && @shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "shipment_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@shipment_id.nil? && @shipment_id.to_s.length > 25 + return false if !@shipment_id.nil? && @shipment_id.to_s.length < 1 + return false if !@shipment_id.nil? && @shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] shipment_id Value to be assigned + def shipment_id=(shipment_id) + if !shipment_id.nil? && shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "shipment_id", the character length must be smaller than or equal to 25.' + end + + if !shipment_id.nil? && shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "shipment_id", the character length must be great than or equal to 1.' + end + + if !shipment_id.nil? && shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "shipment_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @shipment_id = shipment_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error == o.error && + shipment_id == o.shipment_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [error, shipment_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/batch_status.rb b/lib/shipengine_api/models/batch_status.rb new file mode 100755 index 0000000..279c1e6 --- /dev/null +++ b/lib/shipengine_api/models/batch_status.rb @@ -0,0 +1,36 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class BatchStatus + + OPEN = 'open'.freeze + QUEUED = 'queued'.freeze + PROCESSING = 'processing'.freeze + COMPLETED = 'completed'.freeze + COMPLETED_WITH_ERRORS = 'completed_with_errors'.freeze + ARCHIVED = 'archived'.freeze + NOTIFYING = 'notifying'.freeze + INVALID = 'invalid'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = BatchStatus.constants.select { |c| BatchStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #BatchStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/batches_sort_by.rb b/lib/shipengine_api/models/batches_sort_by.rb new file mode 100755 index 0000000..e51672e --- /dev/null +++ b/lib/shipengine_api/models/batches_sort_by.rb @@ -0,0 +1,30 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class BatchesSortBy + + SHIP_DATE = 'ship_date'.freeze + PROCESSED_AT = 'processed_at'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = BatchesSortBy.constants.select { |c| BatchesSortBy::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #BatchesSortBy" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/bill_to_party.rb b/lib/shipengine_api/models/bill_to_party.rb new file mode 100755 index 0000000..b52059e --- /dev/null +++ b/lib/shipengine_api/models/bill_to_party.rb @@ -0,0 +1,30 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class BillToParty + + RECIPIENT = 'recipient'.freeze + THIRD_PARTY = 'third_party'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = BillToParty.constants.select { |c| BillToParty::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #BillToParty" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/bulk_rate_response_body.rb b/lib/shipengine_api/models/bulk_rate_response_body.rb new file mode 100755 index 0000000..b8ad3f1 --- /dev/null +++ b/lib/shipengine_api/models/bulk_rate_response_body.rb @@ -0,0 +1,289 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class BulkRateResponseBody + # A string that uniquely identifies the rate request id + attr_accessor :rate_request_id + + # A string that uniquely identifies the shipment id + attr_accessor :shipment_id + + attr_accessor :created_at + + attr_accessor :status + + attr_accessor :errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'rate_request_id' => :'rate_request_id', + :'shipment_id' => :'shipment_id', + :'created_at' => :'created_at', + :'status' => :'status', + :'errors' => :'errors' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'rate_request_id' => :'String', + :'shipment_id' => :'String', + :'created_at' => :'DateTime', + :'status' => :'RateResponseStatus', + :'errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'rate_request_id') + self.rate_request_id = attributes[:'rate_request_id'] + end + + if attributes.has_key?(:'shipment_id') + self.shipment_id = attributes[:'shipment_id'] + end + + if attributes.has_key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.has_key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.has_key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@rate_request_id.nil? && @rate_request_id.to_s.length > 25 + invalid_properties.push('invalid value for "rate_request_id", the character length must be smaller than or equal to 25.') + end + + if !@rate_request_id.nil? && @rate_request_id.to_s.length < 1 + invalid_properties.push('invalid value for "rate_request_id", the character length must be great than or equal to 1.') + end + + if !@rate_request_id.nil? && @rate_request_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "rate_request_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + if !@shipment_id.nil? && @shipment_id.to_s.length > 25 + invalid_properties.push('invalid value for "shipment_id", the character length must be smaller than or equal to 25.') + end + + if !@shipment_id.nil? && @shipment_id.to_s.length < 1 + invalid_properties.push('invalid value for "shipment_id", the character length must be great than or equal to 1.') + end + + if !@shipment_id.nil? && @shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "shipment_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@rate_request_id.nil? && @rate_request_id.to_s.length > 25 + return false if !@rate_request_id.nil? && @rate_request_id.to_s.length < 1 + return false if !@rate_request_id.nil? && @rate_request_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + return false if !@shipment_id.nil? && @shipment_id.to_s.length > 25 + return false if !@shipment_id.nil? && @shipment_id.to_s.length < 1 + return false if !@shipment_id.nil? && @shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] rate_request_id Value to be assigned + def rate_request_id=(rate_request_id) + if !rate_request_id.nil? && rate_request_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "rate_request_id", the character length must be smaller than or equal to 25.' + end + + if !rate_request_id.nil? && rate_request_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "rate_request_id", the character length must be great than or equal to 1.' + end + + if !rate_request_id.nil? && rate_request_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "rate_request_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @rate_request_id = rate_request_id + end + + # Custom attribute writer method with validation + # @param [Object] shipment_id Value to be assigned + def shipment_id=(shipment_id) + if !shipment_id.nil? && shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "shipment_id", the character length must be smaller than or equal to 25.' + end + + if !shipment_id.nil? && shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "shipment_id", the character length must be great than or equal to 1.' + end + + if !shipment_id.nil? && shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "shipment_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @shipment_id = shipment_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + rate_request_id == o.rate_request_id && + shipment_id == o.shipment_id && + created_at == o.created_at && + status == o.status && + errors == o.errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [rate_request_id, shipment_id, created_at, status, errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/capture_payment.rb b/lib/shipengine_api/models/capture_payment.rb new file mode 100755 index 0000000..33036a1 --- /dev/null +++ b/lib/shipengine_api/models/capture_payment.rb @@ -0,0 +1,30 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class CapturePayment + + SHIPPED = 'when_order_is_shipped'.freeze + PLACED = 'when_order_is_placed'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = CapturePayment.constants.select { |c| CapturePayment::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #CapturePayment" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/carrier.rb b/lib/shipengine_api/models/carrier.rb new file mode 100755 index 0000000..354e7e2 --- /dev/null +++ b/lib/shipengine_api/models/carrier.rb @@ -0,0 +1,331 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class Carrier + # A string that uniquely identifies the carrier id + attr_accessor :carrier_id + + attr_accessor :carrier_code + + attr_accessor :account_number + + attr_accessor :requires_funded_amount + + attr_accessor :balance + + attr_accessor :nickname + + attr_accessor :friendly_name + + attr_accessor :primary + + attr_accessor :has_multi_package_supporting_services + + attr_accessor :supports_label_messages + + attr_accessor :services + + attr_accessor :packages + + attr_accessor :options + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'carrier_id' => :'carrier_id', + :'carrier_code' => :'carrier_code', + :'account_number' => :'account_number', + :'requires_funded_amount' => :'requires_funded_amount', + :'balance' => :'balance', + :'nickname' => :'nickname', + :'friendly_name' => :'friendly_name', + :'primary' => :'primary', + :'has_multi_package_supporting_services' => :'has_multi_package_supporting_services', + :'supports_label_messages' => :'supports_label_messages', + :'services' => :'services', + :'packages' => :'packages', + :'options' => :'options' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'carrier_id' => :'String', + :'carrier_code' => :'String', + :'account_number' => :'String', + :'requires_funded_amount' => :'BOOLEAN', + :'balance' => :'Float', + :'nickname' => :'String', + :'friendly_name' => :'String', + :'primary' => :'BOOLEAN', + :'has_multi_package_supporting_services' => :'BOOLEAN', + :'supports_label_messages' => :'BOOLEAN', + :'services' => :'Array', + :'packages' => :'Array', + :'options' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'carrier_id') + self.carrier_id = attributes[:'carrier_id'] + end + + if attributes.has_key?(:'carrier_code') + self.carrier_code = attributes[:'carrier_code'] + end + + if attributes.has_key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.has_key?(:'requires_funded_amount') + self.requires_funded_amount = attributes[:'requires_funded_amount'] + end + + if attributes.has_key?(:'balance') + self.balance = attributes[:'balance'] + end + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + + if attributes.has_key?(:'friendly_name') + self.friendly_name = attributes[:'friendly_name'] + end + + if attributes.has_key?(:'primary') + self.primary = attributes[:'primary'] + end + + if attributes.has_key?(:'has_multi_package_supporting_services') + self.has_multi_package_supporting_services = attributes[:'has_multi_package_supporting_services'] + end + + if attributes.has_key?(:'supports_label_messages') + self.supports_label_messages = attributes[:'supports_label_messages'] + end + + if attributes.has_key?(:'services') + if (value = attributes[:'services']).is_a?(Array) + self.services = value + end + end + + if attributes.has_key?(:'packages') + if (value = attributes[:'packages']).is_a?(Array) + self.packages = value + end + end + + if attributes.has_key?(:'options') + if (value = attributes[:'options']).is_a?(Array) + self.options = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@carrier_id.nil? && @carrier_id.to_s.length > 25 + invalid_properties.push('invalid value for "carrier_id", the character length must be smaller than or equal to 25.') + end + + if !@carrier_id.nil? && @carrier_id.to_s.length < 1 + invalid_properties.push('invalid value for "carrier_id", the character length must be great than or equal to 1.') + end + + if !@carrier_id.nil? && @carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "carrier_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@carrier_id.nil? && @carrier_id.to_s.length > 25 + return false if !@carrier_id.nil? && @carrier_id.to_s.length < 1 + return false if !@carrier_id.nil? && @carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] carrier_id Value to be assigned + def carrier_id=(carrier_id) + if !carrier_id.nil? && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id", the character length must be smaller than or equal to 25.' + end + + if !carrier_id.nil? && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id", the character length must be great than or equal to 1.' + end + + if !carrier_id.nil? && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "carrier_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @carrier_id = carrier_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + carrier_id == o.carrier_id && + carrier_code == o.carrier_code && + account_number == o.account_number && + requires_funded_amount == o.requires_funded_amount && + balance == o.balance && + nickname == o.nickname && + friendly_name == o.friendly_name && + primary == o.primary && + has_multi_package_supporting_services == o.has_multi_package_supporting_services && + supports_label_messages == o.supports_label_messages && + services == o.services && + packages == o.packages && + options == o.options + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [carrier_id, carrier_code, account_number, requires_funded_amount, balance, nickname, friendly_name, primary, has_multi_package_supporting_services, supports_label_messages, services, packages, options].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/carrier_advanced_option.rb b/lib/shipengine_api/models/carrier_advanced_option.rb new file mode 100755 index 0000000..b4e051c --- /dev/null +++ b/lib/shipengine_api/models/carrier_advanced_option.rb @@ -0,0 +1,201 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class CarrierAdvancedOption + attr_accessor :name + + attr_accessor :default_value + + attr_accessor :description + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'default_value' => :'default_value', + :'description' => :'description' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'name' => :'String', + :'default_value' => :'String', + :'description' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.has_key?(:'default_value') + self.default_value = attributes[:'default_value'] + end + + if attributes.has_key?(:'description') + self.description = attributes[:'description'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + default_value == o.default_value && + description == o.description + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [name, default_value, description].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/carrier_list_options_response_body.rb b/lib/shipengine_api/models/carrier_list_options_response_body.rb new file mode 100755 index 0000000..5104b01 --- /dev/null +++ b/lib/shipengine_api/models/carrier_list_options_response_body.rb @@ -0,0 +1,185 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class CarrierListOptionsResponseBody + attr_accessor :options + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'options' => :'options' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'options' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'options') + if (value = attributes[:'options']).is_a?(Array) + self.options = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + options == o.options + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [options].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/carrier_list_response_body.rb b/lib/shipengine_api/models/carrier_list_response_body.rb new file mode 100755 index 0000000..3b428b4 --- /dev/null +++ b/lib/shipengine_api/models/carrier_list_response_body.rb @@ -0,0 +1,185 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class CarrierListResponseBody + attr_accessor :carriers + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'carriers' => :'carriers' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'carriers' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'carriers') + if (value = attributes[:'carriers']).is_a?(Array) + self.carriers = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + carriers == o.carriers + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [carriers].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/carrier_list_services_response_body.rb b/lib/shipengine_api/models/carrier_list_services_response_body.rb new file mode 100755 index 0000000..f0089e7 --- /dev/null +++ b/lib/shipengine_api/models/carrier_list_services_response_body.rb @@ -0,0 +1,185 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class CarrierListServicesResponseBody + attr_accessor :services + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'services' => :'services' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'services' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'services') + if (value = attributes[:'services']).is_a?(Array) + self.services = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + services == o.services + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [services].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/channel_advisor_account_information_request_body.rb b/lib/shipengine_api/models/channel_advisor_account_information_request_body.rb new file mode 100755 index 0000000..eab0592 --- /dev/null +++ b/lib/shipengine_api/models/channel_advisor_account_information_request_body.rb @@ -0,0 +1,201 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class ChannelAdvisorAccountInformationRequestBody + attr_accessor :store_name + + attr_accessor :profile_id + + attr_accessor :product_identifier + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'store_name' => :'store_name', + :'profile_id' => :'profile_id', + :'product_identifier' => :'product_identifier' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'store_name' => :'String', + :'profile_id' => :'Integer', + :'product_identifier' => :'ChannelAdvisorProductIdentifier' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'store_name') + self.store_name = attributes[:'store_name'] + end + + if attributes.has_key?(:'profile_id') + self.profile_id = attributes[:'profile_id'] + end + + if attributes.has_key?(:'product_identifier') + self.product_identifier = attributes[:'product_identifier'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + store_name == o.store_name && + profile_id == o.profile_id && + product_identifier == o.product_identifier + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [store_name, profile_id, product_identifier].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/channel_advisor_product_identifier.rb b/lib/shipengine_api/models/channel_advisor_product_identifier.rb new file mode 100755 index 0000000..91361e4 --- /dev/null +++ b/lib/shipengine_api/models/channel_advisor_product_identifier.rb @@ -0,0 +1,30 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class ChannelAdvisorProductIdentifier + + CLIENT_ORDER_NUMBER = 'client_order_number'.freeze + CHANNEL_ADVISOR_ORDER_NUMBER = 'channel_advisor_order_number'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = ChannelAdvisorProductIdentifier.constants.select { |c| ChannelAdvisorProductIdentifier::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #ChannelAdvisorProductIdentifier" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/code.rb b/lib/shipengine_api/models/code.rb new file mode 100755 index 0000000..a6f0be5 --- /dev/null +++ b/lib/shipengine_api/models/code.rb @@ -0,0 +1,41 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class Code + + A1000 = 'a1000'.freeze + A1001 = 'a1001'.freeze + A1002 = 'a1002'.freeze + A1003 = 'a1003'.freeze + A1004 = 'a1004'.freeze + A1005 = 'a1005'.freeze + A1006 = 'a1006'.freeze + A1007 = 'a1007'.freeze + A1008 = 'a1008'.freeze + R1000 = 'r1000'.freeze + R1001 = 'r1001'.freeze + R1002 = 'r1002'.freeze + R1003 = 'r1003'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = Code.constants.select { |c| Code::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #Code" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/confirmation.rb b/lib/shipengine_api/models/confirmation.rb new file mode 100755 index 0000000..4f51945 --- /dev/null +++ b/lib/shipengine_api/models/confirmation.rb @@ -0,0 +1,33 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class Confirmation + + NONE = 'none'.freeze + DELIVERY = 'delivery'.freeze + SIGNATURE = 'signature'.freeze + ADULT_SIGNATURE = 'adult_signature'.freeze + DIRECT_SIGNATURE = 'direct_signature'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = Confirmation.constants.select { |c| Confirmation::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #Confirmation" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/connect_account_response_body.rb b/lib/shipengine_api/models/connect_account_response_body.rb new file mode 100755 index 0000000..7b1f9fd --- /dev/null +++ b/lib/shipengine_api/models/connect_account_response_body.rb @@ -0,0 +1,217 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class ConnectAccountResponseBody + # A string that uniquely identifies the carrier id + attr_accessor :carrier_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'carrier_id' => :'carrier_id' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'carrier_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'carrier_id') + self.carrier_id = attributes[:'carrier_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@carrier_id.nil? && @carrier_id.to_s.length > 25 + invalid_properties.push('invalid value for "carrier_id", the character length must be smaller than or equal to 25.') + end + + if !@carrier_id.nil? && @carrier_id.to_s.length < 1 + invalid_properties.push('invalid value for "carrier_id", the character length must be great than or equal to 1.') + end + + if !@carrier_id.nil? && @carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "carrier_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@carrier_id.nil? && @carrier_id.to_s.length > 25 + return false if !@carrier_id.nil? && @carrier_id.to_s.length < 1 + return false if !@carrier_id.nil? && @carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] carrier_id Value to be assigned + def carrier_id=(carrier_id) + if !carrier_id.nil? && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id", the character length must be smaller than or equal to 25.' + end + + if !carrier_id.nil? && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id", the character length must be great than or equal to 1.' + end + + if !carrier_id.nil? && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "carrier_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @carrier_id = carrier_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + carrier_id == o.carrier_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [carrier_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/connect_marketplace_response_body.rb b/lib/shipengine_api/models/connect_marketplace_response_body.rb new file mode 100755 index 0000000..6a4de35 --- /dev/null +++ b/lib/shipengine_api/models/connect_marketplace_response_body.rb @@ -0,0 +1,184 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class ConnectMarketplaceResponseBody + # A UUID that uniquely identifies the store id + attr_accessor :store_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'store_id' => :'store_id' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'store_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'store_id') + self.store_id = attributes[:'store_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + store_id == o.store_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [store_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/contents.rb b/lib/shipengine_api/models/contents.rb new file mode 100755 index 0000000..87c7e31 --- /dev/null +++ b/lib/shipengine_api/models/contents.rb @@ -0,0 +1,33 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class Contents + + MERCHANDISE = 'merchandise'.freeze + DOCUMENTS = 'documents'.freeze + GIFT = 'gift'.freeze + RETURNED_GOODS = 'returned_goods'.freeze + SAMPLE = 'sample'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = Contents.constants.select { |c| Contents::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #Contents" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/create_batch_request_body.rb b/lib/shipengine_api/models/create_batch_request_body.rb new file mode 100755 index 0000000..e6e6b72 --- /dev/null +++ b/lib/shipengine_api/models/create_batch_request_body.rb @@ -0,0 +1,248 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class CreateBatchRequestBody + # A string that uniquely identifies the external batch id + attr_accessor :external_batch_id + + attr_accessor :batch_notes + + attr_accessor :shipment_ids + + attr_accessor :rate_ids + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'external_batch_id' => :'external_batch_id', + :'batch_notes' => :'batch_notes', + :'shipment_ids' => :'shipment_ids', + :'rate_ids' => :'rate_ids' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'external_batch_id' => :'String', + :'batch_notes' => :'String', + :'shipment_ids' => :'Array', + :'rate_ids' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'external_batch_id') + self.external_batch_id = attributes[:'external_batch_id'] + end + + if attributes.has_key?(:'batch_notes') + self.batch_notes = attributes[:'batch_notes'] + end + + if attributes.has_key?(:'shipment_ids') + if (value = attributes[:'shipment_ids']).is_a?(Array) + self.shipment_ids = value + end + end + + if attributes.has_key?(:'rate_ids') + if (value = attributes[:'rate_ids']).is_a?(Array) + self.rate_ids = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@external_batch_id.nil? && @external_batch_id.to_s.length > 25 + invalid_properties.push('invalid value for "external_batch_id", the character length must be smaller than or equal to 25.') + end + + if !@external_batch_id.nil? && @external_batch_id.to_s.length < 1 + invalid_properties.push('invalid value for "external_batch_id", the character length must be great than or equal to 1.') + end + + if !@external_batch_id.nil? && @external_batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "external_batch_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@external_batch_id.nil? && @external_batch_id.to_s.length > 25 + return false if !@external_batch_id.nil? && @external_batch_id.to_s.length < 1 + return false if !@external_batch_id.nil? && @external_batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] external_batch_id Value to be assigned + def external_batch_id=(external_batch_id) + if !external_batch_id.nil? && external_batch_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "external_batch_id", the character length must be smaller than or equal to 25.' + end + + if !external_batch_id.nil? && external_batch_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "external_batch_id", the character length must be great than or equal to 1.' + end + + if !external_batch_id.nil? && external_batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "external_batch_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @external_batch_id = external_batch_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + external_batch_id == o.external_batch_id && + batch_notes == o.batch_notes && + shipment_ids == o.shipment_ids && + rate_ids == o.rate_ids + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [external_batch_id, batch_notes, shipment_ids, rate_ids].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/create_manifest_request_body.rb b/lib/shipengine_api/models/create_manifest_request_body.rb new file mode 100755 index 0000000..78755a5 --- /dev/null +++ b/lib/shipengine_api/models/create_manifest_request_body.rb @@ -0,0 +1,280 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class CreateManifestRequestBody + # A string that uniquely identifies the carrier id + attr_accessor :carrier_id + + attr_accessor :excluded_label_ids + + # A string that uniquely identifies the warehouse id + attr_accessor :warehouse_id + + attr_accessor :ship_date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'carrier_id' => :'carrier_id', + :'excluded_label_ids' => :'excluded_label_ids', + :'warehouse_id' => :'warehouse_id', + :'ship_date' => :'ship_date' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'carrier_id' => :'String', + :'excluded_label_ids' => :'Array', + :'warehouse_id' => :'String', + :'ship_date' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'carrier_id') + self.carrier_id = attributes[:'carrier_id'] + end + + if attributes.has_key?(:'excluded_label_ids') + if (value = attributes[:'excluded_label_ids']).is_a?(Array) + self.excluded_label_ids = value + end + end + + if attributes.has_key?(:'warehouse_id') + self.warehouse_id = attributes[:'warehouse_id'] + end + + if attributes.has_key?(:'ship_date') + self.ship_date = attributes[:'ship_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@carrier_id.nil? && @carrier_id.to_s.length > 25 + invalid_properties.push('invalid value for "carrier_id", the character length must be smaller than or equal to 25.') + end + + if !@carrier_id.nil? && @carrier_id.to_s.length < 1 + invalid_properties.push('invalid value for "carrier_id", the character length must be great than or equal to 1.') + end + + if !@carrier_id.nil? && @carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "carrier_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + if !@warehouse_id.nil? && @warehouse_id.to_s.length > 25 + invalid_properties.push('invalid value for "warehouse_id", the character length must be smaller than or equal to 25.') + end + + if !@warehouse_id.nil? && @warehouse_id.to_s.length < 1 + invalid_properties.push('invalid value for "warehouse_id", the character length must be great than or equal to 1.') + end + + if !@warehouse_id.nil? && @warehouse_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "warehouse_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@carrier_id.nil? && @carrier_id.to_s.length > 25 + return false if !@carrier_id.nil? && @carrier_id.to_s.length < 1 + return false if !@carrier_id.nil? && @carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + return false if !@warehouse_id.nil? && @warehouse_id.to_s.length > 25 + return false if !@warehouse_id.nil? && @warehouse_id.to_s.length < 1 + return false if !@warehouse_id.nil? && @warehouse_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] carrier_id Value to be assigned + def carrier_id=(carrier_id) + if !carrier_id.nil? && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id", the character length must be smaller than or equal to 25.' + end + + if !carrier_id.nil? && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id", the character length must be great than or equal to 1.' + end + + if !carrier_id.nil? && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "carrier_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @carrier_id = carrier_id + end + + # Custom attribute writer method with validation + # @param [Object] warehouse_id Value to be assigned + def warehouse_id=(warehouse_id) + if !warehouse_id.nil? && warehouse_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "warehouse_id", the character length must be smaller than or equal to 25.' + end + + if !warehouse_id.nil? && warehouse_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "warehouse_id", the character length must be great than or equal to 1.' + end + + if !warehouse_id.nil? && warehouse_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "warehouse_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @warehouse_id = warehouse_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + carrier_id == o.carrier_id && + excluded_label_ids == o.excluded_label_ids && + warehouse_id == o.warehouse_id && + ship_date == o.ship_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [carrier_id, excluded_label_ids, warehouse_id, ship_date].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/create_shipment_response_body.rb b/lib/shipengine_api/models/create_shipment_response_body.rb new file mode 100755 index 0000000..6c6f10d --- /dev/null +++ b/lib/shipengine_api/models/create_shipment_response_body.rb @@ -0,0 +1,505 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class CreateShipmentResponseBody + attr_accessor :errors + + attr_accessor :address_validation + + # A string that uniquely identifies the shipment id + attr_accessor :shipment_id + + # A string that uniquely identifies the carrier id + attr_accessor :carrier_id + + attr_accessor :service_code + + # A string that uniquely identifies the external shipment id + attr_accessor :external_shipment_id + + attr_accessor :ship_date + + attr_accessor :created_at + + attr_accessor :modified_at + + attr_accessor :shipment_status + + attr_accessor :ship_to + + attr_accessor :ship_from + + # A string that uniquely identifies the warehouse id + attr_accessor :warehouse_id + + attr_accessor :return_to + + attr_accessor :confirmation + + attr_accessor :customs + + attr_accessor :advanced_options + + attr_accessor :insurance_provider + + attr_accessor :tags + + attr_accessor :packages + + attr_accessor :total_weight + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'errors' => :'errors', + :'address_validation' => :'address_validation', + :'shipment_id' => :'shipment_id', + :'carrier_id' => :'carrier_id', + :'service_code' => :'service_code', + :'external_shipment_id' => :'external_shipment_id', + :'ship_date' => :'ship_date', + :'created_at' => :'created_at', + :'modified_at' => :'modified_at', + :'shipment_status' => :'shipment_status', + :'ship_to' => :'ship_to', + :'ship_from' => :'ship_from', + :'warehouse_id' => :'warehouse_id', + :'return_to' => :'return_to', + :'confirmation' => :'confirmation', + :'customs' => :'customs', + :'advanced_options' => :'advanced_options', + :'insurance_provider' => :'insurance_provider', + :'tags' => :'tags', + :'packages' => :'packages', + :'total_weight' => :'total_weight' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'errors' => :'Array', + :'address_validation' => :'AddressValidationResult', + :'shipment_id' => :'String', + :'carrier_id' => :'String', + :'service_code' => :'String', + :'external_shipment_id' => :'String', + :'ship_date' => :'DateTime', + :'created_at' => :'DateTime', + :'modified_at' => :'DateTime', + :'shipment_status' => :'ShipmentStatus', + :'ship_to' => :'Address', + :'ship_from' => :'Address', + :'warehouse_id' => :'String', + :'return_to' => :'Address', + :'confirmation' => :'Confirmation', + :'customs' => :'InternationalOptions', + :'advanced_options' => :'AdvancedOptions', + :'insurance_provider' => :'InsuranceProvider', + :'tags' => :'Array', + :'packages' => :'Array', + :'total_weight' => :'Weight' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + end + + if attributes.has_key?(:'address_validation') + self.address_validation = attributes[:'address_validation'] + end + + if attributes.has_key?(:'shipment_id') + self.shipment_id = attributes[:'shipment_id'] + end + + if attributes.has_key?(:'carrier_id') + self.carrier_id = attributes[:'carrier_id'] + end + + if attributes.has_key?(:'service_code') + self.service_code = attributes[:'service_code'] + end + + if attributes.has_key?(:'external_shipment_id') + self.external_shipment_id = attributes[:'external_shipment_id'] + end + + if attributes.has_key?(:'ship_date') + self.ship_date = attributes[:'ship_date'] + end + + if attributes.has_key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.has_key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.has_key?(:'shipment_status') + self.shipment_status = attributes[:'shipment_status'] + end + + if attributes.has_key?(:'ship_to') + self.ship_to = attributes[:'ship_to'] + end + + if attributes.has_key?(:'ship_from') + self.ship_from = attributes[:'ship_from'] + end + + if attributes.has_key?(:'warehouse_id') + self.warehouse_id = attributes[:'warehouse_id'] + end + + if attributes.has_key?(:'return_to') + self.return_to = attributes[:'return_to'] + end + + if attributes.has_key?(:'confirmation') + self.confirmation = attributes[:'confirmation'] + end + + if attributes.has_key?(:'customs') + self.customs = attributes[:'customs'] + end + + if attributes.has_key?(:'advanced_options') + self.advanced_options = attributes[:'advanced_options'] + end + + if attributes.has_key?(:'insurance_provider') + self.insurance_provider = attributes[:'insurance_provider'] + end + + if attributes.has_key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.has_key?(:'packages') + if (value = attributes[:'packages']).is_a?(Array) + self.packages = value + end + end + + if attributes.has_key?(:'total_weight') + self.total_weight = attributes[:'total_weight'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@shipment_id.nil? && @shipment_id.to_s.length > 25 + invalid_properties.push('invalid value for "shipment_id", the character length must be smaller than or equal to 25.') + end + + if !@shipment_id.nil? && @shipment_id.to_s.length < 1 + invalid_properties.push('invalid value for "shipment_id", the character length must be great than or equal to 1.') + end + + if !@shipment_id.nil? && @shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "shipment_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + if !@carrier_id.nil? && @carrier_id.to_s.length > 25 + invalid_properties.push('invalid value for "carrier_id", the character length must be smaller than or equal to 25.') + end + + if !@carrier_id.nil? && @carrier_id.to_s.length < 1 + invalid_properties.push('invalid value for "carrier_id", the character length must be great than or equal to 1.') + end + + if !@carrier_id.nil? && @carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "carrier_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + if !@external_shipment_id.nil? && @external_shipment_id.to_s.length > 25 + invalid_properties.push('invalid value for "external_shipment_id", the character length must be smaller than or equal to 25.') + end + + if !@external_shipment_id.nil? && @external_shipment_id.to_s.length < 1 + invalid_properties.push('invalid value for "external_shipment_id", the character length must be great than or equal to 1.') + end + + if !@external_shipment_id.nil? && @external_shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "external_shipment_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + if !@warehouse_id.nil? && @warehouse_id.to_s.length > 25 + invalid_properties.push('invalid value for "warehouse_id", the character length must be smaller than or equal to 25.') + end + + if !@warehouse_id.nil? && @warehouse_id.to_s.length < 1 + invalid_properties.push('invalid value for "warehouse_id", the character length must be great than or equal to 1.') + end + + if !@warehouse_id.nil? && @warehouse_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "warehouse_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@shipment_id.nil? && @shipment_id.to_s.length > 25 + return false if !@shipment_id.nil? && @shipment_id.to_s.length < 1 + return false if !@shipment_id.nil? && @shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + return false if !@carrier_id.nil? && @carrier_id.to_s.length > 25 + return false if !@carrier_id.nil? && @carrier_id.to_s.length < 1 + return false if !@carrier_id.nil? && @carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + return false if !@external_shipment_id.nil? && @external_shipment_id.to_s.length > 25 + return false if !@external_shipment_id.nil? && @external_shipment_id.to_s.length < 1 + return false if !@external_shipment_id.nil? && @external_shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + return false if !@warehouse_id.nil? && @warehouse_id.to_s.length > 25 + return false if !@warehouse_id.nil? && @warehouse_id.to_s.length < 1 + return false if !@warehouse_id.nil? && @warehouse_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] shipment_id Value to be assigned + def shipment_id=(shipment_id) + if !shipment_id.nil? && shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "shipment_id", the character length must be smaller than or equal to 25.' + end + + if !shipment_id.nil? && shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "shipment_id", the character length must be great than or equal to 1.' + end + + if !shipment_id.nil? && shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "shipment_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @shipment_id = shipment_id + end + + # Custom attribute writer method with validation + # @param [Object] carrier_id Value to be assigned + def carrier_id=(carrier_id) + if !carrier_id.nil? && carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id", the character length must be smaller than or equal to 25.' + end + + if !carrier_id.nil? && carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id", the character length must be great than or equal to 1.' + end + + if !carrier_id.nil? && carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "carrier_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @carrier_id = carrier_id + end + + # Custom attribute writer method with validation + # @param [Object] external_shipment_id Value to be assigned + def external_shipment_id=(external_shipment_id) + if !external_shipment_id.nil? && external_shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "external_shipment_id", the character length must be smaller than or equal to 25.' + end + + if !external_shipment_id.nil? && external_shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "external_shipment_id", the character length must be great than or equal to 1.' + end + + if !external_shipment_id.nil? && external_shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "external_shipment_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @external_shipment_id = external_shipment_id + end + + # Custom attribute writer method with validation + # @param [Object] warehouse_id Value to be assigned + def warehouse_id=(warehouse_id) + if !warehouse_id.nil? && warehouse_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "warehouse_id", the character length must be smaller than or equal to 25.' + end + + if !warehouse_id.nil? && warehouse_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "warehouse_id", the character length must be great than or equal to 1.' + end + + if !warehouse_id.nil? && warehouse_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "warehouse_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @warehouse_id = warehouse_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + errors == o.errors && + address_validation == o.address_validation && + shipment_id == o.shipment_id && + carrier_id == o.carrier_id && + service_code == o.service_code && + external_shipment_id == o.external_shipment_id && + ship_date == o.ship_date && + created_at == o.created_at && + modified_at == o.modified_at && + shipment_status == o.shipment_status && + ship_to == o.ship_to && + ship_from == o.ship_from && + warehouse_id == o.warehouse_id && + return_to == o.return_to && + confirmation == o.confirmation && + customs == o.customs && + advanced_options == o.advanced_options && + insurance_provider == o.insurance_provider && + tags == o.tags && + packages == o.packages && + total_weight == o.total_weight + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [errors, address_validation, shipment_id, carrier_id, service_code, external_shipment_id, ship_date, created_at, modified_at, shipment_status, ship_to, ship_from, warehouse_id, return_to, confirmation, customs, advanced_options, insurance_provider, tags, packages, total_weight].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/create_shipments_request_body.rb b/lib/shipengine_api/models/create_shipments_request_body.rb new file mode 100755 index 0000000..154a5bb --- /dev/null +++ b/lib/shipengine_api/models/create_shipments_request_body.rb @@ -0,0 +1,185 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class CreateShipmentsRequestBody + attr_accessor :shipments + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'shipments' => :'shipments' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'shipments' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'shipments') + if (value = attributes[:'shipments']).is_a?(Array) + self.shipments = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + shipments == o.shipments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [shipments].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/create_shipments_response_body.rb b/lib/shipengine_api/models/create_shipments_response_body.rb new file mode 100755 index 0000000..b6e0efb --- /dev/null +++ b/lib/shipengine_api/models/create_shipments_response_body.rb @@ -0,0 +1,194 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class CreateShipmentsResponseBody + attr_accessor :has_errors + + attr_accessor :shipments + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'has_errors' => :'has_errors', + :'shipments' => :'shipments' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'has_errors' => :'BOOLEAN', + :'shipments' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'has_errors') + self.has_errors = attributes[:'has_errors'] + end + + if attributes.has_key?(:'shipments') + if (value = attributes[:'shipments']).is_a?(Array) + self.shipments = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + has_errors == o.has_errors && + shipments == o.shipments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [has_errors, shipments].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/create_webhook_request_body.rb b/lib/shipengine_api/models/create_webhook_request_body.rb new file mode 100755 index 0000000..c661064 --- /dev/null +++ b/lib/shipengine_api/models/create_webhook_request_body.rb @@ -0,0 +1,192 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class CreateWebhookRequestBody + attr_accessor :event + + attr_accessor :url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'event' => :'event', + :'url' => :'url' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'event' => :'Event', + :'url' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'event') + self.event = attributes[:'event'] + end + + if attributes.has_key?(:'url') + self.url = attributes[:'url'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event == o.event && + url == o.url + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [event, url].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/currency.rb b/lib/shipengine_api/models/currency.rb new file mode 100755 index 0000000..4b51bb9 --- /dev/null +++ b/lib/shipengine_api/models/currency.rb @@ -0,0 +1,33 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class Currency + + USD = 'usd'.freeze + CAD = 'cad'.freeze + AUD = 'aud'.freeze + GBP = 'gbp'.freeze + EUR = 'eur'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = Currency.constants.select { |c| Currency::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #Currency" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/customs_item.rb b/lib/shipengine_api/models/customs_item.rb new file mode 100755 index 0000000..05d438f --- /dev/null +++ b/lib/shipengine_api/models/customs_item.rb @@ -0,0 +1,262 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class CustomsItem + # A string that uniquely identifies the customs item id + attr_accessor :customs_item_id + + attr_accessor :description + + attr_accessor :quantity + + attr_accessor :value + + attr_accessor :harmonized_tariff_code + + attr_accessor :country_of_origin + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'customs_item_id' => :'customs_item_id', + :'description' => :'description', + :'quantity' => :'quantity', + :'value' => :'value', + :'harmonized_tariff_code' => :'harmonized_tariff_code', + :'country_of_origin' => :'country_of_origin' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'customs_item_id' => :'String', + :'description' => :'String', + :'quantity' => :'Integer', + :'value' => :'Float', + :'harmonized_tariff_code' => :'String', + :'country_of_origin' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'customs_item_id') + self.customs_item_id = attributes[:'customs_item_id'] + end + + if attributes.has_key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.has_key?(:'quantity') + self.quantity = attributes[:'quantity'] + end + + if attributes.has_key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.has_key?(:'harmonized_tariff_code') + self.harmonized_tariff_code = attributes[:'harmonized_tariff_code'] + end + + if attributes.has_key?(:'country_of_origin') + self.country_of_origin = attributes[:'country_of_origin'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@customs_item_id.nil? && @customs_item_id.to_s.length > 25 + invalid_properties.push('invalid value for "customs_item_id", the character length must be smaller than or equal to 25.') + end + + if !@customs_item_id.nil? && @customs_item_id.to_s.length < 1 + invalid_properties.push('invalid value for "customs_item_id", the character length must be great than or equal to 1.') + end + + if !@customs_item_id.nil? && @customs_item_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "customs_item_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@customs_item_id.nil? && @customs_item_id.to_s.length > 25 + return false if !@customs_item_id.nil? && @customs_item_id.to_s.length < 1 + return false if !@customs_item_id.nil? && @customs_item_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] customs_item_id Value to be assigned + def customs_item_id=(customs_item_id) + if !customs_item_id.nil? && customs_item_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "customs_item_id", the character length must be smaller than or equal to 25.' + end + + if !customs_item_id.nil? && customs_item_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "customs_item_id", the character length must be great than or equal to 1.' + end + + if !customs_item_id.nil? && customs_item_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "customs_item_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @customs_item_id = customs_item_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + customs_item_id == o.customs_item_id && + description == o.description && + quantity == o.quantity && + value == o.value && + harmonized_tariff_code == o.harmonized_tariff_code && + country_of_origin == o.country_of_origin + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [customs_item_id, description, quantity, value, harmonized_tariff_code, country_of_origin].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/default_account_settings_request_body.rb b/lib/shipengine_api/models/default_account_settings_request_body.rb new file mode 100755 index 0000000..2fff302 --- /dev/null +++ b/lib/shipengine_api/models/default_account_settings_request_body.rb @@ -0,0 +1,183 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class DefaultAccountSettingsRequestBody + attr_accessor :automatically_import_sales_orders + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'automatically_import_sales_orders' => :'automatically_import_sales_orders' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'automatically_import_sales_orders' => :'BOOLEAN' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'automatically_import_sales_orders') + self.automatically_import_sales_orders = attributes[:'automatically_import_sales_orders'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + automatically_import_sales_orders == o.automatically_import_sales_orders + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [automatically_import_sales_orders].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/detail_code.rb b/lib/shipengine_api/models/detail_code.rb new file mode 100755 index 0000000..53c515b --- /dev/null +++ b/lib/shipengine_api/models/detail_code.rb @@ -0,0 +1,72 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class DetailCode + + NON_SUPPORTED_COUNTRY = 'non_supported_country'.freeze + MINIMUM_POSTAL_CODE_VERIFICATION_FAILED = 'minimum_postal_code_verification_failed'.freeze + STREET_DOES_NOT_MATCH_UNIQUE_STREET_NAME = 'street_does_not_match_unique_street_name'.freeze + MULTIPLE_DIRECTIONALS = 'multiple_directionals'.freeze + MULTIPLE_MATCHES = 'multiple_matches'.freeze + SUITE_NOT_VALID = 'suite_not_valid'.freeze + SUITE_MISSING = 'suite_missing'.freeze + INVALID_HOUSE_NUMBER = 'invalid_house_number'.freeze + MISSING_HOUSE_NUMBER = 'missing_house_number'.freeze + INVALID_BOX_NUMBER = 'invalid_box_number'.freeze + MISSING_BOX_NUMBER = 'missing_box_number'.freeze + MISSING_CMRA_OR_PRIVATE_MAIL_BOX_NUMBER = 'missing_cmra_or_private_mail_box_number'.freeze + SUITE_HAS_NO_SECONDARIES = 'suite_has_no_secondaries'.freeze + POSTAL_CODE_CHANGED_OR_ADDED = 'postal_code_changed_or_added'.freeze + STATE_PROVINCE_CHANGED_OR_ADDED = 'state_province_changed_or_added'.freeze + CITY_LOCALITY_CHANGED_OR_ADDED = 'city_locality_changed_or_added'.freeze + URBANIZATION_CHANGED = 'urbanization_changed'.freeze + STREET_NAME_SPELLING_CHANGED_OR_ADDED = 'street_name_spelling_changed_or_added'.freeze + STREET_NAME_TYPE_CHANGED_OR_ADDED = 'street_name_type_changed_or_added'.freeze + STREET_DIRECTION_CHANGED_OR_ADDED = 'street_direction_changed_or_added'.freeze + SUITE_TYPE_CHANGED_OR_ADDED = 'suite_type_changed_or_added'.freeze + SUITE_UNIT_NUMBER_CHANGED_OR_ADDED = 'suite_unit_number_changed_or_added'.freeze + DOUBLE_DEPENDENT_LOCALITY_CHANGED_OR_ADDED = 'double_dependent_locality_changed_or_added'.freeze + SUBADMINISTRATIVE_AREA_CHANGED_OR_ADDED = 'subadministrative_area_changed_or_added'.freeze + SUBNATIONAL_AREA_CHANGED_OR_ADDED = 'subnational_area_changed_or_added'.freeze + P_O_BOX_CHANGED_OR_ADDED = 'p_o_box_changed_or_added'.freeze + PREMISE_TYPE_CHANGED_OR_ADDED = 'premise_type_changed_or_added'.freeze + HOUSE_NUMBER_CHANGED = 'house_number_changed'.freeze + ORGANIZATION_CHANGED_OR_ADDED = 'organization_changed_or_added'.freeze + PARTIALLY_VERIFIED_TO_STATE_LEVEL = 'partially_verified_to_state_level'.freeze + PARTIALLY_VERIFIED_TO_CITY_LEVEL = 'partially_verified_to_city_level'.freeze + PARTIALLY_VERIFIED_TO_STREET_LEVEL = 'partially_verified_to_street_level'.freeze + PARTIALLY_VERIFIED_TO_PREMISE_LEVEL = 'partially_verified_to_premise_level'.freeze + VERIFIED_TO_STATE_LEVEL = 'verified_to_state_level'.freeze + VERIFIED_TO_CITY_LEVEL = 'verified_to_city_level'.freeze + VERIFIED_TO_STREET_LEVEL = 'verified_to_street_level'.freeze + VERIFIED_TO_PREMISE_LEVEL = 'verified_to_premise_level'.freeze + VERIFIED_TO_SUITE_LEVEL = 'verified_to_suite_level'.freeze + CODED_TO_STREET_LAVEL = 'coded_to_street_lavel'.freeze + CODED_TO_NEIGHBORHOOD_LEVEL = 'coded_to_neighborhood_level'.freeze + CODED_TO_COMMUNITY_LEVEL = 'coded_to_community_level'.freeze + CODED_TO_STATE_LEVEL = 'coded_to_state_level'.freeze + CODED_TO_ROOFTOP_LEVEL = 'coded_to_rooftop_level'.freeze + CODED_TO_ROOFTOP_INTERPOLATION_LEVEL = 'coded_to_rooftop_interpolation_level'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = DetailCode.constants.select { |c| DetailCode::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #DetailCode" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/dhl_ecommerce_account_information_request_body.rb b/lib/shipengine_api/models/dhl_ecommerce_account_information_request_body.rb new file mode 100755 index 0000000..a12c215 --- /dev/null +++ b/lib/shipengine_api/models/dhl_ecommerce_account_information_request_body.rb @@ -0,0 +1,219 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class DhlEcommerceAccountInformationRequestBody + attr_accessor :nickname + + attr_accessor :account_number + + attr_accessor :pickup_number + + attr_accessor :ftp_username + + attr_accessor :ftp_password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nickname' => :'nickname', + :'account_number' => :'account_number', + :'pickup_number' => :'pickup_number', + :'ftp_username' => :'ftp_username', + :'ftp_password' => :'ftp_password' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'nickname' => :'String', + :'account_number' => :'String', + :'pickup_number' => :'String', + :'ftp_username' => :'String', + :'ftp_password' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + + if attributes.has_key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.has_key?(:'pickup_number') + self.pickup_number = attributes[:'pickup_number'] + end + + if attributes.has_key?(:'ftp_username') + self.ftp_username = attributes[:'ftp_username'] + end + + if attributes.has_key?(:'ftp_password') + self.ftp_password = attributes[:'ftp_password'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nickname == o.nickname && + account_number == o.account_number && + pickup_number == o.pickup_number && + ftp_username == o.ftp_username && + ftp_password == o.ftp_password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [nickname, account_number, pickup_number, ftp_username, ftp_password].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/dhl_express_account_information_request_body.rb b/lib/shipengine_api/models/dhl_express_account_information_request_body.rb new file mode 100755 index 0000000..ba40b5b --- /dev/null +++ b/lib/shipengine_api/models/dhl_express_account_information_request_body.rb @@ -0,0 +1,192 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class DhlExpressAccountInformationRequestBody + attr_accessor :nickname + + attr_accessor :account_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nickname' => :'nickname', + :'account_number' => :'account_number' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'nickname' => :'String', + :'account_number' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + + if attributes.has_key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nickname == o.nickname && + account_number == o.account_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [nickname, account_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/dhl_express_account_settings.rb b/lib/shipengine_api/models/dhl_express_account_settings.rb new file mode 100755 index 0000000..1bd7002 --- /dev/null +++ b/lib/shipengine_api/models/dhl_express_account_settings.rb @@ -0,0 +1,201 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class DhlExpressAccountSettings + attr_accessor :nickname + + attr_accessor :should_hide_account_number_on_archive_doc + + attr_accessor :is_primary_account + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nickname' => :'nickname', + :'should_hide_account_number_on_archive_doc' => :'should_hide_account_number_on_archive_doc', + :'is_primary_account' => :'is_primary_account' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'nickname' => :'String', + :'should_hide_account_number_on_archive_doc' => :'BOOLEAN', + :'is_primary_account' => :'BOOLEAN' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + + if attributes.has_key?(:'should_hide_account_number_on_archive_doc') + self.should_hide_account_number_on_archive_doc = attributes[:'should_hide_account_number_on_archive_doc'] + end + + if attributes.has_key?(:'is_primary_account') + self.is_primary_account = attributes[:'is_primary_account'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nickname == o.nickname && + should_hide_account_number_on_archive_doc == o.should_hide_account_number_on_archive_doc && + is_primary_account == o.is_primary_account + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [nickname, should_hide_account_number_on_archive_doc, is_primary_account].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/dhl_express_uk_account_information_request_body.rb b/lib/shipengine_api/models/dhl_express_uk_account_information_request_body.rb new file mode 100755 index 0000000..06c292f --- /dev/null +++ b/lib/shipengine_api/models/dhl_express_uk_account_information_request_body.rb @@ -0,0 +1,244 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class DhlExpressUkAccountInformationRequestBody + attr_accessor :account_number + + # A string that uniquely identifies the site id + attr_accessor :site_id + + attr_accessor :password + + attr_accessor :nickname + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'account_number' => :'account_number', + :'site_id' => :'site_id', + :'password' => :'password', + :'nickname' => :'nickname' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'account_number' => :'String', + :'site_id' => :'String', + :'password' => :'String', + :'nickname' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.has_key?(:'site_id') + self.site_id = attributes[:'site_id'] + end + + if attributes.has_key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@site_id.nil? && @site_id.to_s.length > 25 + invalid_properties.push('invalid value for "site_id", the character length must be smaller than or equal to 25.') + end + + if !@site_id.nil? && @site_id.to_s.length < 1 + invalid_properties.push('invalid value for "site_id", the character length must be great than or equal to 1.') + end + + if !@site_id.nil? && @site_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "site_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@site_id.nil? && @site_id.to_s.length > 25 + return false if !@site_id.nil? && @site_id.to_s.length < 1 + return false if !@site_id.nil? && @site_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] site_id Value to be assigned + def site_id=(site_id) + if !site_id.nil? && site_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "site_id", the character length must be smaller than or equal to 25.' + end + + if !site_id.nil? && site_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "site_id", the character length must be great than or equal to 1.' + end + + if !site_id.nil? && site_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "site_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @site_id = site_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_number == o.account_number && + site_id == o.site_id && + password == o.password && + nickname == o.nickname + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [account_number, site_id, password, nickname].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/dimension_unit.rb b/lib/shipengine_api/models/dimension_unit.rb new file mode 100755 index 0000000..19cc398 --- /dev/null +++ b/lib/shipengine_api/models/dimension_unit.rb @@ -0,0 +1,30 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class DimensionUnit + + INCH = 'inch'.freeze + CENTIMETER = 'centimeter'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = DimensionUnit.constants.select { |c| DimensionUnit::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #DimensionUnit" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/dimensions.rb b/lib/shipengine_api/models/dimensions.rb new file mode 100755 index 0000000..dc43f61 --- /dev/null +++ b/lib/shipengine_api/models/dimensions.rb @@ -0,0 +1,210 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class Dimensions + attr_accessor :unit + + attr_accessor :length + + attr_accessor :width + + attr_accessor :height + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'unit' => :'unit', + :'length' => :'length', + :'width' => :'width', + :'height' => :'height' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'unit' => :'DimensionUnit', + :'length' => :'Float', + :'width' => :'Float', + :'height' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'unit') + self.unit = attributes[:'unit'] + end + + if attributes.has_key?(:'length') + self.length = attributes[:'length'] + end + + if attributes.has_key?(:'width') + self.width = attributes[:'width'] + end + + if attributes.has_key?(:'height') + self.height = attributes[:'height'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + unit == o.unit && + length == o.length && + width == o.width && + height == o.height + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [unit, length, width, height].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/dpd_account_information_request_body.rb b/lib/shipengine_api/models/dpd_account_information_request_body.rb new file mode 100755 index 0000000..a45b7c1 --- /dev/null +++ b/lib/shipengine_api/models/dpd_account_information_request_body.rb @@ -0,0 +1,201 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class DpdAccountInformationRequestBody + attr_accessor :account_number + + attr_accessor :password + + attr_accessor :nickname + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'account_number' => :'account_number', + :'password' => :'password', + :'nickname' => :'nickname' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'account_number' => :'String', + :'password' => :'String', + :'nickname' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.has_key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_number == o.account_number && + password == o.password && + nickname == o.nickname + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [account_number, password, nickname].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/ebay_access_token_request_body.rb b/lib/shipengine_api/models/ebay_access_token_request_body.rb new file mode 100755 index 0000000..96f3133 --- /dev/null +++ b/lib/shipengine_api/models/ebay_access_token_request_body.rb @@ -0,0 +1,244 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class EbayAccessTokenRequestBody + attr_accessor :username + + attr_accessor :store_name + + attr_accessor :access_token + + # A string that uniquely identifies the private application id + attr_accessor :private_application_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'username' => :'username', + :'store_name' => :'store_name', + :'access_token' => :'access_token', + :'private_application_id' => :'private_application_id' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'username' => :'String', + :'store_name' => :'String', + :'access_token' => :'String', + :'private_application_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.has_key?(:'store_name') + self.store_name = attributes[:'store_name'] + end + + if attributes.has_key?(:'access_token') + self.access_token = attributes[:'access_token'] + end + + if attributes.has_key?(:'private_application_id') + self.private_application_id = attributes[:'private_application_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@private_application_id.nil? && @private_application_id.to_s.length > 25 + invalid_properties.push('invalid value for "private_application_id", the character length must be smaller than or equal to 25.') + end + + if !@private_application_id.nil? && @private_application_id.to_s.length < 1 + invalid_properties.push('invalid value for "private_application_id", the character length must be great than or equal to 1.') + end + + if !@private_application_id.nil? && @private_application_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "private_application_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@private_application_id.nil? && @private_application_id.to_s.length > 25 + return false if !@private_application_id.nil? && @private_application_id.to_s.length < 1 + return false if !@private_application_id.nil? && @private_application_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] private_application_id Value to be assigned + def private_application_id=(private_application_id) + if !private_application_id.nil? && private_application_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "private_application_id", the character length must be smaller than or equal to 25.' + end + + if !private_application_id.nil? && private_application_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "private_application_id", the character length must be great than or equal to 1.' + end + + if !private_application_id.nil? && private_application_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "private_application_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @private_application_id = private_application_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + username == o.username && + store_name == o.store_name && + access_token == o.access_token && + private_application_id == o.private_application_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [username, store_name, access_token, private_application_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/endicia_account_information_request_body.rb b/lib/shipengine_api/models/endicia_account_information_request_body.rb new file mode 100755 index 0000000..b6b64a2 --- /dev/null +++ b/lib/shipengine_api/models/endicia_account_information_request_body.rb @@ -0,0 +1,201 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class EndiciaAccountInformationRequestBody + attr_accessor :nickname + + attr_accessor :account + + attr_accessor :passphrase + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nickname' => :'nickname', + :'account' => :'account', + :'passphrase' => :'passphrase' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'nickname' => :'String', + :'account' => :'String', + :'passphrase' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + + if attributes.has_key?(:'account') + self.account = attributes[:'account'] + end + + if attributes.has_key?(:'passphrase') + self.passphrase = attributes[:'passphrase'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nickname == o.nickname && + account == o.account && + passphrase == o.passphrase + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [nickname, account, passphrase].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/error_response_body.rb b/lib/shipengine_api/models/error_response_body.rb new file mode 100755 index 0000000..3699e6d --- /dev/null +++ b/lib/shipengine_api/models/error_response_body.rb @@ -0,0 +1,195 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class ErrorResponseBody + # A UUID that uniquely identifies the request id + attr_accessor :request_id + + attr_accessor :errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_id' => :'request_id', + :'errors' => :'errors' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'request_id' => :'String', + :'errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'request_id') + self.request_id = attributes[:'request_id'] + end + + if attributes.has_key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_id == o.request_id && + errors == o.errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [request_id, errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/etsy_access_token_request_body.rb b/lib/shipengine_api/models/etsy_access_token_request_body.rb new file mode 100755 index 0000000..fe9a9c2 --- /dev/null +++ b/lib/shipengine_api/models/etsy_access_token_request_body.rb @@ -0,0 +1,253 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class EtsyAccessTokenRequestBody + attr_accessor :store_name + + attr_accessor :access_token + + attr_accessor :access_token_secret + + attr_accessor :shop_id + + # A string that uniquely identifies the private application id + attr_accessor :private_application_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'store_name' => :'store_name', + :'access_token' => :'access_token', + :'access_token_secret' => :'access_token_secret', + :'shop_id' => :'shop_id', + :'private_application_id' => :'private_application_id' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'store_name' => :'String', + :'access_token' => :'String', + :'access_token_secret' => :'String', + :'shop_id' => :'Integer', + :'private_application_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'store_name') + self.store_name = attributes[:'store_name'] + end + + if attributes.has_key?(:'access_token') + self.access_token = attributes[:'access_token'] + end + + if attributes.has_key?(:'access_token_secret') + self.access_token_secret = attributes[:'access_token_secret'] + end + + if attributes.has_key?(:'shop_id') + self.shop_id = attributes[:'shop_id'] + end + + if attributes.has_key?(:'private_application_id') + self.private_application_id = attributes[:'private_application_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@private_application_id.nil? && @private_application_id.to_s.length > 25 + invalid_properties.push('invalid value for "private_application_id", the character length must be smaller than or equal to 25.') + end + + if !@private_application_id.nil? && @private_application_id.to_s.length < 1 + invalid_properties.push('invalid value for "private_application_id", the character length must be great than or equal to 1.') + end + + if !@private_application_id.nil? && @private_application_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "private_application_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@private_application_id.nil? && @private_application_id.to_s.length > 25 + return false if !@private_application_id.nil? && @private_application_id.to_s.length < 1 + return false if !@private_application_id.nil? && @private_application_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] private_application_id Value to be assigned + def private_application_id=(private_application_id) + if !private_application_id.nil? && private_application_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "private_application_id", the character length must be smaller than or equal to 25.' + end + + if !private_application_id.nil? && private_application_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "private_application_id", the character length must be great than or equal to 1.' + end + + if !private_application_id.nil? && private_application_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "private_application_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @private_application_id = private_application_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + store_name == o.store_name && + access_token == o.access_token && + access_token_secret == o.access_token_secret && + shop_id == o.shop_id && + private_application_id == o.private_application_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [store_name, access_token, access_token_secret, shop_id, private_application_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/event.rb b/lib/shipengine_api/models/event.rb new file mode 100755 index 0000000..a70a521 --- /dev/null +++ b/lib/shipengine_api/models/event.rb @@ -0,0 +1,34 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class Event + + RATE = 'rate'.freeze + TRACK = 'track'.freeze + BATCH = 'batch'.freeze + STORE_REFRESH_COMPLETE = 'store_refresh_complete'.freeze + SALES_ORDERS_IMPORTED = 'sales_orders_imported'.freeze + CARRIER_CONNECTED = 'carrier_connected'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = Event.constants.select { |c| Event::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #Event" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/fedex_account_information_request_body.rb b/lib/shipengine_api/models/fedex_account_information_request_body.rb new file mode 100755 index 0000000..6981838 --- /dev/null +++ b/lib/shipengine_api/models/fedex_account_information_request_body.rb @@ -0,0 +1,325 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class FedexAccountInformationRequestBody + attr_accessor :account_number + + attr_accessor :address1 + + attr_accessor :address2 + + attr_accessor :city + + attr_accessor :company + + attr_accessor :country_code + + # The email address + attr_accessor :email + + attr_accessor :first_name + + attr_accessor :last_name + + attr_accessor :phone + + attr_accessor :postal_code + + attr_accessor :state + + attr_accessor :nickname + + attr_accessor :agree_to_eula + + attr_accessor :meter_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'account_number' => :'account_number', + :'address1' => :'address1', + :'address2' => :'address2', + :'city' => :'city', + :'company' => :'company', + :'country_code' => :'country_code', + :'email' => :'email', + :'first_name' => :'first_name', + :'last_name' => :'last_name', + :'phone' => :'phone', + :'postal_code' => :'postal_code', + :'state' => :'state', + :'nickname' => :'nickname', + :'agree_to_eula' => :'agree_to_eula', + :'meter_number' => :'meter_number' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'account_number' => :'String', + :'address1' => :'String', + :'address2' => :'String', + :'city' => :'String', + :'company' => :'String', + :'country_code' => :'String', + :'email' => :'String', + :'first_name' => :'String', + :'last_name' => :'String', + :'phone' => :'String', + :'postal_code' => :'String', + :'state' => :'String', + :'nickname' => :'String', + :'agree_to_eula' => :'BOOLEAN', + :'meter_number' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.has_key?(:'address1') + self.address1 = attributes[:'address1'] + end + + if attributes.has_key?(:'address2') + self.address2 = attributes[:'address2'] + end + + if attributes.has_key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.has_key?(:'company') + self.company = attributes[:'company'] + end + + if attributes.has_key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.has_key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.has_key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.has_key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.has_key?(:'phone') + self.phone = attributes[:'phone'] + end + + if attributes.has_key?(:'postal_code') + self.postal_code = attributes[:'postal_code'] + end + + if attributes.has_key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + + if attributes.has_key?(:'agree_to_eula') + self.agree_to_eula = attributes[:'agree_to_eula'] + end + + if attributes.has_key?(:'meter_number') + self.meter_number = attributes[:'meter_number'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@email.nil? && @email.to_s.length < 1 + invalid_properties.push('invalid value for "email", the character length must be great than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@email.nil? && @email.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param [Object] email Value to be assigned + def email=(email) + if !email.nil? && email.to_s.length < 1 + fail ArgumentError, 'invalid value for "email", the character length must be great than or equal to 1.' + end + + @email = email + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_number == o.account_number && + address1 == o.address1 && + address2 == o.address2 && + city == o.city && + company == o.company && + country_code == o.country_code && + email == o.email && + first_name == o.first_name && + last_name == o.last_name && + phone == o.phone && + postal_code == o.postal_code && + state == o.state && + nickname == o.nickname && + agree_to_eula == o.agree_to_eula && + meter_number == o.meter_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [account_number, address1, address2, city, company, country_code, email, first_name, last_name, phone, postal_code, state, nickname, agree_to_eula, meter_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/fedex_account_settings_request_body.rb b/lib/shipengine_api/models/fedex_account_settings_request_body.rb new file mode 100755 index 0000000..0a3c654 --- /dev/null +++ b/lib/shipengine_api/models/fedex_account_settings_request_body.rb @@ -0,0 +1,219 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class FedexAccountSettingsRequestBody + attr_accessor :nickname + + attr_accessor :pickup_type + + attr_accessor :smart_post_hub + + attr_accessor :smart_post_endorsement + + attr_accessor :is_primary_account + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nickname' => :'nickname', + :'pickup_type' => :'pickup_type', + :'smart_post_hub' => :'smart_post_hub', + :'smart_post_endorsement' => :'smart_post_endorsement', + :'is_primary_account' => :'is_primary_account' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'nickname' => :'String', + :'pickup_type' => :'FedexPickupType', + :'smart_post_hub' => :'SmartPostHub', + :'smart_post_endorsement' => :'SmartPostEndorsement', + :'is_primary_account' => :'BOOLEAN' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + + if attributes.has_key?(:'pickup_type') + self.pickup_type = attributes[:'pickup_type'] + end + + if attributes.has_key?(:'smart_post_hub') + self.smart_post_hub = attributes[:'smart_post_hub'] + end + + if attributes.has_key?(:'smart_post_endorsement') + self.smart_post_endorsement = attributes[:'smart_post_endorsement'] + end + + if attributes.has_key?(:'is_primary_account') + self.is_primary_account = attributes[:'is_primary_account'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nickname == o.nickname && + pickup_type == o.pickup_type && + smart_post_hub == o.smart_post_hub && + smart_post_endorsement == o.smart_post_endorsement && + is_primary_account == o.is_primary_account + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [nickname, pickup_type, smart_post_hub, smart_post_endorsement, is_primary_account].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/fedex_pickup_type.rb b/lib/shipengine_api/models/fedex_pickup_type.rb new file mode 100755 index 0000000..923e04f --- /dev/null +++ b/lib/shipengine_api/models/fedex_pickup_type.rb @@ -0,0 +1,34 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class FedexPickupType + + NONE = 'none'.freeze + REGULAR_PICKUP = 'regular_pickup'.freeze + REQUEST_COURIER = 'request_courier'.freeze + DROP_BOX = 'drop_box'.freeze + BUSINESS_SERVICE_CENTER = 'business_service_center'.freeze + STATION = 'station'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FedexPickupType.constants.select { |c| FedexPickupType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FedexPickupType" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/fedex_uk_account_information_request_body.rb b/lib/shipengine_api/models/fedex_uk_account_information_request_body.rb new file mode 100755 index 0000000..1c60b29 --- /dev/null +++ b/lib/shipengine_api/models/fedex_uk_account_information_request_body.rb @@ -0,0 +1,325 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class FedexUkAccountInformationRequestBody + attr_accessor :account_number + + attr_accessor :address1 + + attr_accessor :address2 + + attr_accessor :city + + attr_accessor :company + + attr_accessor :country_code + + # The email address + attr_accessor :email + + attr_accessor :first_name + + attr_accessor :last_name + + attr_accessor :phone + + attr_accessor :postal_code + + attr_accessor :state_province + + attr_accessor :nickname + + attr_accessor :agree_to_eula + + attr_accessor :meter_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'account_number' => :'account_number', + :'address1' => :'address1', + :'address2' => :'address2', + :'city' => :'city', + :'company' => :'company', + :'country_code' => :'country_code', + :'email' => :'email', + :'first_name' => :'first_name', + :'last_name' => :'last_name', + :'phone' => :'phone', + :'postal_code' => :'postal_code', + :'state_province' => :'state_province', + :'nickname' => :'nickname', + :'agree_to_eula' => :'agree_to_eula', + :'meter_number' => :'meter_number' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'account_number' => :'String', + :'address1' => :'String', + :'address2' => :'String', + :'city' => :'String', + :'company' => :'String', + :'country_code' => :'String', + :'email' => :'String', + :'first_name' => :'String', + :'last_name' => :'String', + :'phone' => :'String', + :'postal_code' => :'String', + :'state_province' => :'String', + :'nickname' => :'String', + :'agree_to_eula' => :'BOOLEAN', + :'meter_number' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.has_key?(:'address1') + self.address1 = attributes[:'address1'] + end + + if attributes.has_key?(:'address2') + self.address2 = attributes[:'address2'] + end + + if attributes.has_key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.has_key?(:'company') + self.company = attributes[:'company'] + end + + if attributes.has_key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.has_key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.has_key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.has_key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.has_key?(:'phone') + self.phone = attributes[:'phone'] + end + + if attributes.has_key?(:'postal_code') + self.postal_code = attributes[:'postal_code'] + end + + if attributes.has_key?(:'state_province') + self.state_province = attributes[:'state_province'] + end + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + + if attributes.has_key?(:'agree_to_eula') + self.agree_to_eula = attributes[:'agree_to_eula'] + end + + if attributes.has_key?(:'meter_number') + self.meter_number = attributes[:'meter_number'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@email.nil? && @email.to_s.length < 1 + invalid_properties.push('invalid value for "email", the character length must be great than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@email.nil? && @email.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param [Object] email Value to be assigned + def email=(email) + if !email.nil? && email.to_s.length < 1 + fail ArgumentError, 'invalid value for "email", the character length must be great than or equal to 1.' + end + + @email = email + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_number == o.account_number && + address1 == o.address1 && + address2 == o.address2 && + city == o.city && + company == o.company && + country_code == o.country_code && + email == o.email && + first_name == o.first_name && + last_name == o.last_name && + phone == o.phone && + postal_code == o.postal_code && + state_province == o.state_province && + nickname == o.nickname && + agree_to_eula == o.agree_to_eula && + meter_number == o.meter_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [account_number, address1, address2, city, company, country_code, email, first_name, last_name, phone, postal_code, state_province, nickname, agree_to_eula, meter_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/first.rb b/lib/shipengine_api/models/first.rb new file mode 100755 index 0000000..2236dda --- /dev/null +++ b/lib/shipengine_api/models/first.rb @@ -0,0 +1,208 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + # The link to the first page of results. This object will _always_ have an `href` property. If there are no results, then the first page will contain an empty array of items. + class First + attr_accessor :href + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'href' => :'href' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'href' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'href') + self.href = attributes[:'href'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @href.nil? + invalid_properties.push('invalid value for "href", href cannot be nil.') + end + + if @href.to_s.length < 1 + invalid_properties.push('invalid value for "href", the character length must be great than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @href.nil? + return false if @href.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param [Object] href Value to be assigned + def href=(href) + if href.nil? + fail ArgumentError, 'href cannot be nil' + end + + if href.to_s.length < 1 + fail ArgumentError, 'invalid value for "href", the character length must be great than or equal to 1.' + end + + @href = href + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + href == o.href + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [href].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/first_mile_account_information_request_body.rb b/lib/shipengine_api/models/first_mile_account_information_request_body.rb new file mode 100755 index 0000000..c4424a6 --- /dev/null +++ b/lib/shipengine_api/models/first_mile_account_information_request_body.rb @@ -0,0 +1,244 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class FirstMileAccountInformationRequestBody + attr_accessor :nickname + + # A string that uniquely identifies the mailer id + attr_accessor :mailer_id + + attr_accessor :profile_name + + attr_accessor :password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nickname' => :'nickname', + :'mailer_id' => :'mailer_id', + :'profile_name' => :'profile_name', + :'password' => :'password' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'nickname' => :'String', + :'mailer_id' => :'String', + :'profile_name' => :'String', + :'password' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + + if attributes.has_key?(:'mailer_id') + self.mailer_id = attributes[:'mailer_id'] + end + + if attributes.has_key?(:'profile_name') + self.profile_name = attributes[:'profile_name'] + end + + if attributes.has_key?(:'password') + self.password = attributes[:'password'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@mailer_id.nil? && @mailer_id.to_s.length > 25 + invalid_properties.push('invalid value for "mailer_id", the character length must be smaller than or equal to 25.') + end + + if !@mailer_id.nil? && @mailer_id.to_s.length < 1 + invalid_properties.push('invalid value for "mailer_id", the character length must be great than or equal to 1.') + end + + if !@mailer_id.nil? && @mailer_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "mailer_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@mailer_id.nil? && @mailer_id.to_s.length > 25 + return false if !@mailer_id.nil? && @mailer_id.to_s.length < 1 + return false if !@mailer_id.nil? && @mailer_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] mailer_id Value to be assigned + def mailer_id=(mailer_id) + if !mailer_id.nil? && mailer_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "mailer_id", the character length must be smaller than or equal to 25.' + end + + if !mailer_id.nil? && mailer_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "mailer_id", the character length must be great than or equal to 1.' + end + + if !mailer_id.nil? && mailer_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "mailer_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @mailer_id = mailer_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nickname == o.nickname && + mailer_id == o.mailer_id && + profile_name == o.profile_name && + password == o.password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [nickname, mailer_id, profile_name, password].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/globegistics_account_information_request_body.rb b/lib/shipengine_api/models/globegistics_account_information_request_body.rb new file mode 100755 index 0000000..5cdb615 --- /dev/null +++ b/lib/shipengine_api/models/globegistics_account_information_request_body.rb @@ -0,0 +1,201 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class GlobegisticsAccountInformationRequestBody + attr_accessor :nickname + + attr_accessor :username + + attr_accessor :password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nickname' => :'nickname', + :'username' => :'username', + :'password' => :'password' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'nickname' => :'String', + :'username' => :'String', + :'password' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + + if attributes.has_key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.has_key?(:'password') + self.password = attributes[:'password'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nickname == o.nickname && + username == o.username && + password == o.password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [nickname, username, password].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/imex_account_information_request_body.rb b/lib/shipengine_api/models/imex_account_information_request_body.rb new file mode 100755 index 0000000..300705e --- /dev/null +++ b/lib/shipengine_api/models/imex_account_information_request_body.rb @@ -0,0 +1,201 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class ImexAccountInformationRequestBody + attr_accessor :nickname + + attr_accessor :username + + attr_accessor :password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nickname' => :'nickname', + :'username' => :'username', + :'password' => :'password' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'nickname' => :'String', + :'username' => :'String', + :'password' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'nickname') + self.nickname = attributes[:'nickname'] + end + + if attributes.has_key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.has_key?(:'password') + self.password = attributes[:'password'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nickname == o.nickname && + username == o.username && + password == o.password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [nickname, username, password].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/insurance_provider.rb b/lib/shipengine_api/models/insurance_provider.rb new file mode 100755 index 0000000..5a9ede5 --- /dev/null +++ b/lib/shipengine_api/models/insurance_provider.rb @@ -0,0 +1,31 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class InsuranceProvider + + NONE = 'none'.freeze + SHIPSURANCE = 'shipsurance'.freeze + CARRIER = 'carrier'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = InsuranceProvider.constants.select { |c| InsuranceProvider::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #InsuranceProvider" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/international_options.rb b/lib/shipengine_api/models/international_options.rb new file mode 100755 index 0000000..2fea311 --- /dev/null +++ b/lib/shipengine_api/models/international_options.rb @@ -0,0 +1,203 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class InternationalOptions + attr_accessor :contents + + attr_accessor :customs_items + + attr_accessor :non_delivery + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'contents' => :'contents', + :'customs_items' => :'customs_items', + :'non_delivery' => :'non_delivery' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'contents' => :'Contents', + :'customs_items' => :'Array', + :'non_delivery' => :'NonDelivery' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'contents') + self.contents = attributes[:'contents'] + end + + if attributes.has_key?(:'customs_items') + if (value = attributes[:'customs_items']).is_a?(Array) + self.customs_items = value + end + end + + if attributes.has_key?(:'non_delivery') + self.non_delivery = attributes[:'non_delivery'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + contents == o.contents && + customs_items == o.customs_items && + non_delivery == o.non_delivery + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [contents, customs_items, non_delivery].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/label.rb b/lib/shipengine_api/models/label.rb new file mode 100755 index 0000000..2307bc9 --- /dev/null +++ b/lib/shipengine_api/models/label.rb @@ -0,0 +1,661 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + # A label represents the physical sticker that you affix to a package to ship it. ShipEngine makes it easy for you to [create labels](https://docs.shipengine.com/docs/quickstart-create-a-label) and then download them in PDF, PNG, or ZPL format so you can print them. + class Label + # A string that uniquely identifies the label. This ID is generated by ShipEngine when the label is created. + attr_accessor :label_id + + attr_accessor :status + + # The shipment that this label is for. ShipEngine can create a shipment for you automatically when you [create a label](https://docs.shipengine.com/docs/quickstart-create-a-label), or you can [create your own shipment](https://docs.shipengine.com/docs/create-a-shipment) and then [use it to print a label](https://docs.shipengine.com/docs/use-a-shipment-to-print-a-label) + attr_accessor :shipment_id + + # The date that the package was (or will be) shippped. ShipEngine will take the day of week into consideration when setting this. For example, if a carrier does not operate on Sundays, then a package that would have shipped on Sunday will ship on Monday instead. + attr_accessor :ship_date + + # The date and time that the label was created in ShipEngine. + attr_accessor :created_at + + # The tracking number for the package. Tracking number formats vary across carriers. + attr_accessor :tracking_number + + # Indicates whether this is a return label. You may also want to set the `rma_number` so you know what is being returned. + attr_accessor :is_return_label + + # An optional Return Merchandise Authorization number. This field is useful for return labels. You can set it to any string value. + attr_accessor :rma_number + + # Indicates whether this is an international shipment. That is, the originating country and destination country are different. + attr_accessor :is_international + + # If this label was created as part of a [batch](https://docs.shipengine.com/docs/using-batches), then this is the unique ID of that batch. + attr_accessor :batch_id + + # The unique ID of the [carrier account](https://docs.shipengine.com/docs/setup-a-carrier) that was used to create this label + attr_accessor :carrier_id + + # The [carrier service](https://docs.shipengine.com/docs/use-a-specific-service) that will be used to ship the package, such as `fedex_ground`, `usps_first_class_mail`, `flat_rate_envelope`, etc. + attr_accessor :service_code + + # Indicates whether the label has been [voided](https://docs.shipengine.com/docs/void-a-label) + attr_accessor :voided + + # The date and time that the label was [voided](https://docs.shipengine.com/docs/void-a-label), or `null` if the label has not been voided + attr_accessor :voided_at + + attr_accessor :label_format + + attr_accessor :label_layout + + # Indicates whether the shipment is trackable, in which case the `tracking_status` field will reflect the current status and each package will have a `tracking_number`. + attr_accessor :trackable + + # The [shipping carrier](https://docs.shipengine.com/docs/setup-a-carrier) who will ship the package, such as `fedex`, `dhl_express`, `stamps_com`, etc. + attr_accessor :carrier_code + + attr_accessor :tracking_status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'label_id' => :'label_id', + :'status' => :'status', + :'shipment_id' => :'shipment_id', + :'ship_date' => :'ship_date', + :'created_at' => :'created_at', + :'tracking_number' => :'tracking_number', + :'is_return_label' => :'is_return_label', + :'rma_number' => :'rma_number', + :'is_international' => :'is_international', + :'batch_id' => :'batch_id', + :'carrier_id' => :'carrier_id', + :'service_code' => :'service_code', + :'voided' => :'voided', + :'voided_at' => :'voided_at', + :'label_format' => :'label_format', + :'label_layout' => :'label_layout', + :'trackable' => :'trackable', + :'carrier_code' => :'carrier_code', + :'tracking_status' => :'tracking_status' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'label_id' => :'String', + :'status' => :'LabelStatus', + :'shipment_id' => :'String', + :'ship_date' => :'DateTime', + :'created_at' => :'DateTime', + :'tracking_number' => :'String', + :'is_return_label' => :'BOOLEAN', + :'rma_number' => :'String', + :'is_international' => :'BOOLEAN', + :'batch_id' => :'String', + :'carrier_id' => :'String', + :'service_code' => :'String', + :'voided' => :'BOOLEAN', + :'voided_at' => :'DateTime', + :'label_format' => :'LabelFormat', + :'label_layout' => :'LabelLayout', + :'trackable' => :'BOOLEAN', + :'carrier_code' => :'String', + :'tracking_status' => :'TrackingStatus' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'label_id') + self.label_id = attributes[:'label_id'] + end + + if attributes.has_key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.has_key?(:'shipment_id') + self.shipment_id = attributes[:'shipment_id'] + end + + if attributes.has_key?(:'ship_date') + self.ship_date = attributes[:'ship_date'] + end + + if attributes.has_key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.has_key?(:'tracking_number') + self.tracking_number = attributes[:'tracking_number'] + end + + if attributes.has_key?(:'is_return_label') + self.is_return_label = attributes[:'is_return_label'] + end + + if attributes.has_key?(:'rma_number') + self.rma_number = attributes[:'rma_number'] + end + + if attributes.has_key?(:'is_international') + self.is_international = attributes[:'is_international'] + end + + if attributes.has_key?(:'batch_id') + self.batch_id = attributes[:'batch_id'] + end + + if attributes.has_key?(:'carrier_id') + self.carrier_id = attributes[:'carrier_id'] + end + + if attributes.has_key?(:'service_code') + self.service_code = attributes[:'service_code'] + end + + if attributes.has_key?(:'voided') + self.voided = attributes[:'voided'] + end + + if attributes.has_key?(:'voided_at') + self.voided_at = attributes[:'voided_at'] + end + + if attributes.has_key?(:'label_format') + self.label_format = attributes[:'label_format'] + end + + if attributes.has_key?(:'label_layout') + self.label_layout = attributes[:'label_layout'] + end + + if attributes.has_key?(:'trackable') + self.trackable = attributes[:'trackable'] + end + + if attributes.has_key?(:'carrier_code') + self.carrier_code = attributes[:'carrier_code'] + end + + if attributes.has_key?(:'tracking_status') + self.tracking_status = attributes[:'tracking_status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @label_id.nil? + invalid_properties.push('invalid value for "label_id", label_id cannot be nil.') + end + + if @label_id.to_s.length > 25 + invalid_properties.push('invalid value for "label_id", the character length must be smaller than or equal to 25.') + end + + if @label_id.to_s.length < 1 + invalid_properties.push('invalid value for "label_id", the character length must be great than or equal to 1.') + end + + if @label_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "label_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @shipment_id.nil? + invalid_properties.push('invalid value for "shipment_id", shipment_id cannot be nil.') + end + + if @shipment_id.to_s.length > 25 + invalid_properties.push('invalid value for "shipment_id", the character length must be smaller than or equal to 25.') + end + + if @shipment_id.to_s.length < 1 + invalid_properties.push('invalid value for "shipment_id", the character length must be great than or equal to 1.') + end + + if @shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "shipment_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + if @ship_date.nil? + invalid_properties.push('invalid value for "ship_date", ship_date cannot be nil.') + end + + if @created_at.nil? + invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') + end + + if @tracking_number.nil? + invalid_properties.push('invalid value for "tracking_number", tracking_number cannot be nil.') + end + + if @tracking_number.to_s.length < 1 + invalid_properties.push('invalid value for "tracking_number", the character length must be great than or equal to 1.') + end + + if @is_return_label.nil? + invalid_properties.push('invalid value for "is_return_label", is_return_label cannot be nil.') + end + + if @rma_number.nil? + invalid_properties.push('invalid value for "rma_number", rma_number cannot be nil.') + end + + if @is_international.nil? + invalid_properties.push('invalid value for "is_international", is_international cannot be nil.') + end + + if @batch_id.nil? + invalid_properties.push('invalid value for "batch_id", batch_id cannot be nil.') + end + + if @batch_id.to_s.length > 25 + invalid_properties.push('invalid value for "batch_id", the character length must be smaller than or equal to 25.') + end + + if @batch_id.to_s.length < 1 + invalid_properties.push('invalid value for "batch_id", the character length must be great than or equal to 1.') + end + + if @batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "batch_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + if @carrier_id.nil? + invalid_properties.push('invalid value for "carrier_id", carrier_id cannot be nil.') + end + + if @carrier_id.to_s.length > 25 + invalid_properties.push('invalid value for "carrier_id", the character length must be smaller than or equal to 25.') + end + + if @carrier_id.to_s.length < 1 + invalid_properties.push('invalid value for "carrier_id", the character length must be great than or equal to 1.') + end + + if @carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + invalid_properties.push('invalid value for "carrier_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.') + end + + if @service_code.nil? + invalid_properties.push('invalid value for "service_code", service_code cannot be nil.') + end + + if @service_code !~ Regexp.new(/^[a-z0-9]+(_[a-z0-9-]+)* ?$/) + invalid_properties.push('invalid value for "service_code", must conform to the pattern /^[a-z0-9]+(_[a-z0-9-]+)* ?$/.') + end + + if @voided.nil? + invalid_properties.push('invalid value for "voided", voided cannot be nil.') + end + + if @voided_at.nil? + invalid_properties.push('invalid value for "voided_at", voided_at cannot be nil.') + end + + if @label_format.nil? + invalid_properties.push('invalid value for "label_format", label_format cannot be nil.') + end + + if @label_layout.nil? + invalid_properties.push('invalid value for "label_layout", label_layout cannot be nil.') + end + + if @trackable.nil? + invalid_properties.push('invalid value for "trackable", trackable cannot be nil.') + end + + if @carrier_code.nil? + invalid_properties.push('invalid value for "carrier_code", carrier_code cannot be nil.') + end + + if @carrier_code !~ Regexp.new(/^[a-z0-9]+(_[a-z0-9]+)*$/) + invalid_properties.push('invalid value for "carrier_code", must conform to the pattern /^[a-z0-9]+(_[a-z0-9]+)*$/.') + end + + if @tracking_status.nil? + invalid_properties.push('invalid value for "tracking_status", tracking_status cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @label_id.nil? + return false if @label_id.to_s.length > 25 + return false if @label_id.to_s.length < 1 + return false if @label_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + return false if @status.nil? + return false if @shipment_id.nil? + return false if @shipment_id.to_s.length > 25 + return false if @shipment_id.to_s.length < 1 + return false if @shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + return false if @ship_date.nil? + return false if @created_at.nil? + return false if @tracking_number.nil? + return false if @tracking_number.to_s.length < 1 + return false if @is_return_label.nil? + return false if @rma_number.nil? + return false if @is_international.nil? + return false if @batch_id.nil? + return false if @batch_id.to_s.length > 25 + return false if @batch_id.to_s.length < 1 + return false if @batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + return false if @carrier_id.nil? + return false if @carrier_id.to_s.length > 25 + return false if @carrier_id.to_s.length < 1 + return false if @carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + return false if @service_code.nil? + return false if @service_code !~ Regexp.new(/^[a-z0-9]+(_[a-z0-9-]+)* ?$/) + return false if @voided.nil? + return false if @voided_at.nil? + return false if @label_format.nil? + return false if @label_layout.nil? + return false if @trackable.nil? + return false if @carrier_code.nil? + return false if @carrier_code !~ Regexp.new(/^[a-z0-9]+(_[a-z0-9]+)*$/) + return false if @tracking_status.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] label_id Value to be assigned + def label_id=(label_id) + if label_id.nil? + fail ArgumentError, 'label_id cannot be nil' + end + + if label_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "label_id", the character length must be smaller than or equal to 25.' + end + + if label_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "label_id", the character length must be great than or equal to 1.' + end + + if label_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "label_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @label_id = label_id + end + + # Custom attribute writer method with validation + # @param [Object] shipment_id Value to be assigned + def shipment_id=(shipment_id) + if shipment_id.nil? + fail ArgumentError, 'shipment_id cannot be nil' + end + + if shipment_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "shipment_id", the character length must be smaller than or equal to 25.' + end + + if shipment_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "shipment_id", the character length must be great than or equal to 1.' + end + + if shipment_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "shipment_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @shipment_id = shipment_id + end + + # Custom attribute writer method with validation + # @param [Object] tracking_number Value to be assigned + def tracking_number=(tracking_number) + if tracking_number.nil? + fail ArgumentError, 'tracking_number cannot be nil' + end + + if tracking_number.to_s.length < 1 + fail ArgumentError, 'invalid value for "tracking_number", the character length must be great than or equal to 1.' + end + + @tracking_number = tracking_number + end + + # Custom attribute writer method with validation + # @param [Object] batch_id Value to be assigned + def batch_id=(batch_id) + if batch_id.nil? + fail ArgumentError, 'batch_id cannot be nil' + end + + if batch_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "batch_id", the character length must be smaller than or equal to 25.' + end + + if batch_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "batch_id", the character length must be great than or equal to 1.' + end + + if batch_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "batch_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @batch_id = batch_id + end + + # Custom attribute writer method with validation + # @param [Object] carrier_id Value to be assigned + def carrier_id=(carrier_id) + if carrier_id.nil? + fail ArgumentError, 'carrier_id cannot be nil' + end + + if carrier_id.to_s.length > 25 + fail ArgumentError, 'invalid value for "carrier_id", the character length must be smaller than or equal to 25.' + end + + if carrier_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "carrier_id", the character length must be great than or equal to 1.' + end + + if carrier_id !~ Regexp.new(/^se(-[a-z0-9]+)+$/) + fail ArgumentError, 'invalid value for "carrier_id", must conform to the pattern /^se(-[a-z0-9]+)+$/.' + end + + @carrier_id = carrier_id + end + + # Custom attribute writer method with validation + # @param [Object] service_code Value to be assigned + def service_code=(service_code) + if service_code.nil? + fail ArgumentError, 'service_code cannot be nil' + end + + if service_code !~ Regexp.new(/^[a-z0-9]+(_[a-z0-9-]+)* ?$/) + fail ArgumentError, 'invalid value for "service_code", must conform to the pattern /^[a-z0-9]+(_[a-z0-9-]+)* ?$/.' + end + + @service_code = service_code + end + + # Custom attribute writer method with validation + # @param [Object] carrier_code Value to be assigned + def carrier_code=(carrier_code) + if carrier_code.nil? + fail ArgumentError, 'carrier_code cannot be nil' + end + + if carrier_code !~ Regexp.new(/^[a-z0-9]+(_[a-z0-9]+)*$/) + fail ArgumentError, 'invalid value for "carrier_code", must conform to the pattern /^[a-z0-9]+(_[a-z0-9]+)*$/.' + end + + @carrier_code = carrier_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + label_id == o.label_id && + status == o.status && + shipment_id == o.shipment_id && + ship_date == o.ship_date && + created_at == o.created_at && + tracking_number == o.tracking_number && + is_return_label == o.is_return_label && + rma_number == o.rma_number && + is_international == o.is_international && + batch_id == o.batch_id && + carrier_id == o.carrier_id && + service_code == o.service_code && + voided == o.voided && + voided_at == o.voided_at && + label_format == o.label_format && + label_layout == o.label_layout && + trackable == o.trackable && + carrier_code == o.carrier_code && + tracking_status == o.tracking_status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [label_id, status, shipment_id, ship_date, created_at, tracking_number, is_return_label, rma_number, is_international, batch_id, carrier_id, service_code, voided, voided_at, label_format, label_layout, trackable, carrier_code, tracking_status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/label_format.rb b/lib/shipengine_api/models/label_format.rb new file mode 100755 index 0000000..6a25a01 --- /dev/null +++ b/lib/shipengine_api/models/label_format.rb @@ -0,0 +1,31 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class LabelFormat + + PDF = 'pdf'.freeze + PNG = 'png'.freeze + ZPL = 'zpl'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = LabelFormat.constants.select { |c| LabelFormat::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #LabelFormat" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/label_layout.rb b/lib/shipengine_api/models/label_layout.rb new file mode 100755 index 0000000..6db9199 --- /dev/null +++ b/lib/shipengine_api/models/label_layout.rb @@ -0,0 +1,30 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class LabelLayout + + N4X6 = '4x6'.freeze + LETTER = 'letter'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = LabelLayout.constants.select { |c| LabelLayout::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #LabelLayout" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/label_messages.rb b/lib/shipengine_api/models/label_messages.rb new file mode 100755 index 0000000..d1098fb --- /dev/null +++ b/lib/shipengine_api/models/label_messages.rb @@ -0,0 +1,201 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class LabelMessages + attr_accessor :reference1 + + attr_accessor :reference2 + + attr_accessor :reference3 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'reference1' => :'reference1', + :'reference2' => :'reference2', + :'reference3' => :'reference3' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'reference1' => :'String', + :'reference2' => :'String', + :'reference3' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'reference1') + self.reference1 = attributes[:'reference1'] + end + + if attributes.has_key?(:'reference2') + self.reference2 = attributes[:'reference2'] + end + + if attributes.has_key?(:'reference3') + self.reference3 = attributes[:'reference3'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + reference1 == o.reference1 && + reference2 == o.reference2 && + reference3 == o.reference3 + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [reference1, reference2, reference3].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/label_status.rb b/lib/shipengine_api/models/label_status.rb new file mode 100755 index 0000000..4cff033 --- /dev/null +++ b/lib/shipengine_api/models/label_status.rb @@ -0,0 +1,32 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class LabelStatus + + PROCESSING = 'processing'.freeze + COMPLETED = 'completed'.freeze + ERROR = 'error'.freeze + VOIDED = 'voided'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = LabelStatus.constants.select { |c| LabelStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #LabelStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/shipengine_api/models/last.rb b/lib/shipengine_api/models/last.rb new file mode 100755 index 0000000..99d17ff --- /dev/null +++ b/lib/shipengine_api/models/last.rb @@ -0,0 +1,208 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + # The link to the final page of results. This object will _always_ have an `href` property. If there are no results, then the final page will contain an empty array of items. + class Last + attr_accessor :href + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'href' => :'href' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'href' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'href') + self.href = attributes[:'href'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @href.nil? + invalid_properties.push('invalid value for "href", href cannot be nil.') + end + + if @href.to_s.length < 1 + invalid_properties.push('invalid value for "href", the character length must be great than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @href.nil? + return false if @href.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param [Object] href Value to be assigned + def href=(href) + if href.nil? + fail ArgumentError, 'href cannot be nil' + end + + if href.to_s.length < 1 + fail ArgumentError, 'invalid value for "href", the character length must be great than or equal to 1.' + end + + @href = href + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + href == o.href + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [href].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/link.rb b/lib/shipengine_api/models/link.rb new file mode 100755 index 0000000..c172839 --- /dev/null +++ b/lib/shipengine_api/models/link.rb @@ -0,0 +1,192 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class Link + attr_accessor :href + + attr_accessor :type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'href' => :'href', + :'type' => :'type' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'href' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'href') + self.href = attributes[:'href'] + end + + if attributes.has_key?(:'type') + self.type = attributes[:'type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + href == o.href && + type == o.type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [href, type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/links.rb b/lib/shipengine_api/models/links.rb new file mode 100755 index 0000000..dffc1ae --- /dev/null +++ b/lib/shipengine_api/models/links.rb @@ -0,0 +1,231 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + # Helpful links to other pages of results + class Links + attr_accessor :first + + attr_accessor :last + + attr_accessor :prev + + attr_accessor :_next + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'first' => :'first', + :'last' => :'last', + :'prev' => :'prev', + :'_next' => :'next' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'first' => :'First', + :'last' => :'Last', + :'prev' => :'Prev', + :'_next' => :'ModelNext' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'first') + self.first = attributes[:'first'] + end + + if attributes.has_key?(:'last') + self.last = attributes[:'last'] + end + + if attributes.has_key?(:'prev') + self.prev = attributes[:'prev'] + end + + if attributes.has_key?(:'next') + self._next = attributes[:'next'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @first.nil? + invalid_properties.push('invalid value for "first", first cannot be nil.') + end + + if @last.nil? + invalid_properties.push('invalid value for "last", last cannot be nil.') + end + + if @prev.nil? + invalid_properties.push('invalid value for "prev", prev cannot be nil.') + end + + if @_next.nil? + invalid_properties.push('invalid value for "_next", _next cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @first.nil? + return false if @last.nil? + return false if @prev.nil? + return false if @_next.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + first == o.first && + last == o.last && + prev == o.prev && + _next == o._next + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [first, last, prev, _next].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/list_batch_response_body.rb b/lib/shipengine_api/models/list_batch_response_body.rb new file mode 100755 index 0000000..d2071be --- /dev/null +++ b/lib/shipengine_api/models/list_batch_response_body.rb @@ -0,0 +1,221 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class ListBatchResponseBody + attr_accessor :batches + + attr_accessor :total + + attr_accessor :page + + attr_accessor :pages + + attr_accessor :links + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'batches' => :'batches', + :'total' => :'total', + :'page' => :'page', + :'pages' => :'pages', + :'links' => :'links' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'batches' => :'Array', + :'total' => :'Integer', + :'page' => :'Integer', + :'pages' => :'Integer', + :'links' => :'PaginationLink' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'batches') + if (value = attributes[:'batches']).is_a?(Array) + self.batches = value + end + end + + if attributes.has_key?(:'total') + self.total = attributes[:'total'] + end + + if attributes.has_key?(:'page') + self.page = attributes[:'page'] + end + + if attributes.has_key?(:'pages') + self.pages = attributes[:'pages'] + end + + if attributes.has_key?(:'links') + self.links = attributes[:'links'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + batches == o.batches && + total == o.total && + page == o.page && + pages == o.pages && + links == o.links + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [batches, total, page, pages, links].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = ShipEngineApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/shipengine_api/models/list_label_response_body.rb b/lib/shipengine_api/models/list_label_response_body.rb new file mode 100755 index 0000000..58ff910 --- /dev/null +++ b/lib/shipengine_api/models/list_label_response_body.rb @@ -0,0 +1,221 @@ +=begin +#ShipEngine API + +#ShipEngine™ is the world's best multi-carrier shipping API, with more than 20 supported shipping carriers. You can easily get and compare shipping rates, print labels, track your shipments, and validate addresses anywhere in the world. ### Worldwide Major Carrier Support Access the top global carriers in minutes—instead of weeks. Simply [connect your existing carrier accounts](https://docs.shipengine.com/docs/setup-a-carrier) in the API dashboard, and then [begin creating labels](https://docs.shipengine.com/docs/use-a-specific-service). ### Real-Time Tracking [Track packages](https://docs.shipengine.com/docs/track-a-package) across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS. ### Get Rates Across Carriers Make sure you ship as cost-effectively as possible by [quickly comparing rates](https://docs.shipengine.com/docs/get-shipping-rates) using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services. ### Global Address Validation No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. [Learn how to leverage our address validation services here.](https://docs.shipengine.com/docs/address-validation) ShipEngine supports address validation for over 180 countries, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and more. + +OpenAPI spec version: 1.0.0 +Contact: sales@shipengine.com +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.0-SNAPSHOT + +=end + +require 'date' + +module ShipEngineApi + class ListLabelResponseBody + attr_accessor :labels + + attr_accessor :total + + attr_accessor :page + + attr_accessor :pages + + attr_accessor :links + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'labels' => :'labels', + :'total' => :'total', + :'page' => :'page', + :'pages' => :'pages', + :'links' => :'links' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'labels' => :'Array